Brandon's test motor control code