Does anyone know how to make an exact 16 degree turn with a LEGO robot?
This is actually a surprisingly difficult task. If you search for similar questions over on the Robotics stack exchange, you will find very smart people who can't even get it right with thousand-dollar localization solutions and graduate-level control theory.
If you have a Gyro sensor like Michael suggested, you're on the right track. You can probably get close to 16 degrees with that.
If you don't have a Gyro sensor, you can use the motors' built-in rotation sensors. If you drive the motors in opposite directions, the robot rotates around the point halfway between the wheels, and the formula is:
- r_wheel is the radius of your robot's wheels
- theta_wheel is the angle the wheel has to move
- r_robot is the radius of the robot (half of the distance between the two wheels)
- theta_robot is the angle you want the entire robot to turn, in this case 16 degrees.
So measure the radius of the wheel and the robot, plug in 16 degrees for theta_robot, and solve for theta_wheel. Then drive one motor forward theta_wheel degrees, and one motor backward theta_wheel degrees (simultaneously).
Bonus points if you make a MyBlock to have the EV3 do the calculation itself, for any desired theta_robot.
Actually even if you do have the gyro I would recommend trying both to see which gives better results for your specific situation.
Do you have a gyro sensor on your robot? I'm assuming you're using an EV3 set, and the Mindstorms programming environment.
If so, reset your gyro sensor, and then insert a loop block attached to the gyro sensor. Set the loop settings to >= 16 degrees, and insert a tank move block into the loop. The motor should be set to 'on', with wheels going in opposite directions; the speeds should be relatively low to more accurately stop at your chosen degree setting. After the loop, be sure to insert a stop, or the robot will keep rotating.