We will build a 3-wheeled robot vehicle with two motorized wheels, and an extra wheel that can pivot, called
a "caster". It is possible to build a robot with 4 or 6 wheels, or with treads, like a tank, but the 3-wheeled
robot is the easiest to program, so that's what we'll use. A robot with a caster generally runs best on very
smooth, flat surfaces, so that the caster can glide easily. For rougher surfaces, 4 wheels or treads may work
better. Follow the steps below to build the robot vehicle.
Step 6 - The Wiring: Use two medium length (35 cm) wires to connect the motors to ports B and C on the NXT. Make
sure that the motor on each side is connected to the port on that side.
Block.
There are several differences between the two blocks, but the biggest is that the Move block can control one,
two, or three motors at one time, while the Motor block can only control one motor at a time. The Motor
block allows you to control the motor in more detail, but for driving, you usually want to have at least two
motors running two wheels at the same time. This is why we'll stick with the Move block to drive our robot.
The Move Block
Look at the settings for the move block. Let's figure out what each one does:
Port: This tells the Move block which of the A, B and C ports are connected to motors to control
Direction: This determines whether the wheels turn forwards or backwards.
Steering: Depending on where the slider is, this gives more power to one motor or the other (you
specify which of the two motors to use).
Power: This specifies how much power overall to send to the motors. More power makes the motors
turn faster, less power turns them slower
Duration: This determines how many turns the motors make, or how long in seconds they run for. The
duration can be specified in rotations, degrees, seconds or unlimited (run forever).
Next Action: Brake means the motor will stop after it is finished. Coast means it will keep turning,
though without any additional power. We will almost always use Brake.
Q: What happens to the vehicle if the motor on the left side runs faster than the motor on the right side
6
(assume both motors are turning forwards)? A:_______________________________________________
Use this program to answer some of the questions below. You may need a calculator:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
What is the circumference (distance around) of a tire on your robot (in inches)? _____________ inches
How far do you think the car will go (in inches) when the wheel turns one time? ______________ inches
Try it. How far did it go? _____________ inches
How far do you think the car will go (in inches) when the wheel turns 5 times? _____________ inches
Try it 3 times and compare your results: How far did it go?
______________ inches _______________ inches ______________ inches
How accurate do you think the Move block is? __________________________
If you want the robot to travel 20 inches, how many turns should the wheel make? __________ turns.
Try it. Did it work? ________________
How many degrees correspond to one rotation of the wheel? ____________ degrees
How far will the car go if the wheels turn 720 degrees? _______________ inches
Try it. How far did the car go for at 720 degree rotation? _______________ inches
Turning:
The robot will always turn when its wheels spin at different rates. In most cases, it's hard to predict where it
will go when both wheels are turning at different rates, so we'll focus on two kinds of turns that we can
predict: Pivoting in Place, and Turning with One Motor. You can control which kind of turn you make with the
steering setting. The following steering values give you the following different kinds of turns:
Steering Value
100
50
0
-50
-100
Steering Results
Pivot in place to the right
Turn to the right using one motor
Go straight
Turn to the left using one motor
Pivot in place to the left
Pivoting in Place
If you turn both motorized wheels in opposite directions at the same power (speed),
the vehicle will pivot around a point halfway between the two powered wheels, as
7
shown in the picture below. The wheels travel around a circle whose diameter is the length of the axle.
The tricky part is to figure out how many rotations the wheels need to complete a single turn. Let's do the
calculation, and then compare it to real life by programming our vehicle. You will probably need a calculator:
1. What is the distance across the circle the car makes when it turns? ____________________ inches
2. The circumference (distance around) the turning circle is about 3.14 x diameter =_______ ___________ inches
3. How many rotations does the tire have to make to travel the circumference of the circle? The formula for the
answer is: (Circumference of turning circle) (circumference of tire) = ________________________rotations
Let's program our Move Block to test our answer. Slide the Steering slider all the way to the right to specify a
right turn about the center of the vehicle. Put the number of rotations from answer 3 above into the Duration
setting to specify how far around the vehicle will turn.
Download and run your program. Did it work? Check with your instructor if you're not sure of the answer.
If you give power to only one motorized wheel, while holding the other one still,
the vehicle will pivot around the unpowered wheel. Let's do a calculation like we
did above. Remember, in this case, the diameter of the circle the car makes is
two times the length of the axle.
4. What is the diameter (distance across) the circle the car makes when it turns? ____________________ inches
5. The circumference (distance around) the turning circle is about 3.14 x diameter =_______ ___________ inches
6. How many rotations does the tire have to make to travel the circumference of the circle? The formula for the
answer is: (Circumference of Circle) (Circumference of Tire) = ___________________________ rotations
Let's program our Move Block to test our answer. Slide the Steering slider to value 50 to specify a turn to the
right using one motor. Put the number of rotations from answer 6 above into the Duration setting to specify
how far around the vehicle will turn.
Download and run your program. Did it work? Check with your instructor if you're not sure of the answer.