CHAPTER 25 ■ LAUNCHING THE LINE-FOLLOWER
- With the line-following switch in the center (off ) position, place the powered-on
(yet motionless) robot on the floor, centered on the dark line.
You can tell when the robot is truly centered by observing the left and right brightness indicator LEDs.
Either they’ll both light up or they’ll alternate with the slightest nudge in either direction.
- Toggle the line-following switch to the dark-line position and watch the robot go!
Sandwich takes between 12 and 15 seconds to complete a straight 4-meter course. The time varies based
on battery voltage. The speed decreases about a quarter of a percent per trial due to battery-voltage decline.
Correcting Common Problems
There are a couple of common problems that you might encounter during trial runs of the robot on a
straight course.
Line-Following Switch Toggled to Incorrect Position
If the robot doesn’t center on the line, but sort of hugs the outside or inside of it, the line-following switch is
probably toggled in the wrong direction. It’s an odd effect (and worth trying purposely for fun).
If the line-following switch is set to follow a light line but the robot is actually placed on a light surface
with a dark line, then the robot sees the light surface as a massively wide light line. The robot moves into
the light area until the light is balanced under both sensors. The robot believes it is now centered over the
white “line.”
But, no matter how balanced the trimpot adjustment may seem, at some point one set of sensors is still
a little less resistive than the other set and one motor has a bit more spunk than the other. So, the robot drifts
until it hits the side of the dark line. Because it wants to center over the nonexistent white “line,” it turns away
from the dark line because the white “line” is no longer centered under the robot.
As long as the robot’s default drifting side turns toward the dark line, the robot will hug the outside of
the dark line, basically following it. Then again, if the robot’s default drifting side turns away from the dark
line, the robot will either wander away aimlessly, centering over this massive light “line,” or the robot will
spin in a circle because it has nothing to follow.
The correction is simple; just toggle the line-following switch the other way.
Sensors Placed Too High or Too Low
The headlights must be high enough off the floor to have enough distance for the emitted light to illuminate
the floor and bounce into the sensors (see Figure 25-4).