Fixed motor control code for gripper