Figure 4.
each other from a ring. It’s a lot of fun and a great way to
learn about good engineering and programming. Not only
do the robots need to be built well and geared for torque,
they need to have a program to keep them inside the ring
at all times. Figure 4 shows approximately what a Sumo
robot should do.
1) Move forward until black line.
2) Reverse and turn (either direction).
3) Move forward until black line.
4) Repeat.
Figure 5 shows the program for our Sumo bot. Its steps
are very similar to the logic we saw in Figure 4:
• Motors C and B go backwards (robot goes forwards)
indefinitely.
• Wait for reflected light on port 1 under threshold.
Figure 5.
Figure 6.
• Motors C and B go
forwards (robot goes
backwards) and turns
slightly for two seconds.
• Loop to first step.
Single Light
Sensor Following
Now that we’ve gotten a
couple programs under our
belt, let’s try to make a robot
that follows a line, continuing
to use our single light sensor
attachment. Figure 6 shows
the path our robot will follow:
1) Move forward until black
line.
2) Turn left until light.
3) Turn right until black
line.
x) Loop Steps 2 and 3.
Figure 7 shows our single light sensor line follower.
Challenge
Now that you’ve experimented with a single light
sensor, try to make a program that uses the double light
sensor attachment to follow the line more accurately. Share
your program with friends and compete for the fastest time
trial on a lengthy course. If you have trouble, come back
next time where we’ll be covering programs using multiple
sensors.
If you’ve enjoyed The NXT Big Thing so far and want to
see more articles featuring the MINDSTORMS NXT, please
take a second to let SERVO know via editor@servo
magazine.com. Thanks for reading! See you next time! SV
Figure 7.
56 SERVO 10.2010