•

•

•

•

- Point Turn
- Swing Turn
- Gradual Turn

There are a couple of ways you could determine how many rotations of the wheel is needed:

**View Mode**The NXT Brick supports a "View Mode" which lets you move (push) the robot and the rotations would be shown on the LCD screen.**Trial and Error**You could enter different values for the motor to turn until you found the value that makes the robot do what you wanted it to do.**Simple Algebra/Geometry**You can find out the circumference of the circle of that the wheels make (see the drawing). This circumference is equal to PI (3.14159) times the distance between the two drive wheels on the robot. Now divide this product by the circumference of the wheel. The circumference of the wheel is equal to PI (3.14159) times the diameter of the wheel. The diameter of each wheel is printed on the side of the wheel.**Algebra/Geometry with help from some Programming**This method takes advantage of the power of computer programs to simplify your tasks. In this method, a small program (subroutine, MyBlock, function) would convert a desired degree of rotation for the robot into specific rotations of the motors.

Let's take a look at a working example. If the distance between the two wheels on your robot is 117 millimeters, we can then multiply that number by PI (3.14159) to get the number of millimeters the tires will travel on the ground to get the robot to make a complete circle: 368 millimeters. If each tire itself has a diameter of 56 millimeters, then we know that each tire will travel (56 x 3.14) 176 millimeters when the tire makes one complete rotation on its axle. Therefore, it will take (368/176) 2.1 rotations of each axle to make the robot make 1 complete turn.

If we only want the robot to turn 90 degrees (1/4th of a complete turn), we would need to rotate each wheel only 1/4th of 2.1 which is 0.52 rotations. We can then tell the robot to turn each wheel 0.52 rotations (in opposite directions) to get the robot to make a 90 degree turn.

Using the **Move** block in this way to make a point turn is very simple and is often used by students who are just learning about robotics. If you are competing in FLL tournaments and wish to show your skills in programming, you may want to try using **MyBlocks** to allow you to more quickly develop programs and harness the power of the programming language.

In this example, the MyBlock created has two input values: power level and degrees. The degrees entered here would be the degrees that you want the robot to turn. The MyBlock will multiple the input degrees by a "constant" (in this example the constant is 4.1) to determine how many degrees to rotate each wheel axle. Notice how the arrow on the B-Motor block is point down while the arrow on the C-Motor block is point up. This means that the two motors will move in opposite directions.

void TurnRight(int turnDegrees, int power, bool KeepGoing) { float targetDegrees = (2 * centerOfWheelToCenterOfRobotMM * PI) / wheelCircumference * gearRatio * turnDegrees; targetDegrees = targetDegrees + nMotorEncoder[motorB]; nSyncedMotors = synchBC; //motor B is the master, motor C is the slave if(KeepGoing) { bFloatDuringInactiveMotorPWM = true; // coast or float } else { bFloatDuringInactiveMotorPWM = false; // brake nMotorEncoderTarget[motorB] = targetDegrees; // sets a target } nSyncedTurnRatio = -100; //motors move in opposite directions of one another motor[motorB] = power; //turns the motor on at specified power while(nMotorRunState[motorB] != runStateIdle && nMotorRunState[motorB] != runStateHoldPosition && nMotorEncoder[motorB] <= targetDegrees) { //continue to power motorB until the motor nMotorEncoderTarget position is reached } if(!KeepGoing) motor[motorB] = 0; // turn the motor off. bFloatDuringInactiveMotorPWM = false; // brake }In RobotC you can synchronize the two wheels even if you want them to move in opposite directions. Just set the Turn Ratio value to -100 as in:

In the above example, the distance of each wheel to the center of the robot is stored in a single variable. You need to multiply this by 2 to get the diameter of the large circle that the wheels will make.