CHAPTER 27 ■ ENCORE
Out of the box, servos are wonderful for positioning arms and legs or for aiming sensors. By opening the
cover and cutting away a couple of plastic notches, you can make a servo to rotate continuously, much like a
gearhead motor.
A servo’s built-in electronics handle motor power, eliminating the need for motor-driver transistors
on the robot’s main circuit board. Unfortunately, the command signals to a servo are timed pulses. Thus, a
special module or microcontroller is required to control a servo.
Encoders—Determining Wheel Speed
Many robots could benefit from knowing the speed at which that their wheels are rotating. For example,
Sandwich could improve turning by sensing when the “off ” wheel slips forward, to which it would correct
the pivot point by rolling the wheel back by the same amount. Another use of rotation information is that
when a wheel spins faster than the loaded robot’s mass should allow, the wheel is probably slipping or
perhaps even off the ground.
By multiplying the number of rotations by the wheel size, a robot could determine the distance
traveled. In fact, a line-following robot could store the course distances and turns made on the first lap,
and then speed up in the straight-aways on subsequent laps. Or, a roving robot could find its way home by
backtracking along the turns and distances it had traveled.
An encoder disc (see Figure 27-22) is placed on a shaft or wheel. By aiming photoresistors or
phototransistors at the disc, the robot can tell how much the wheels or shaft are turning. All the robot needs
to do is watch and count the number of transitions from black (high resistance) to white (low resistance).
The greater the number of transitions per second, the faster the wheel is turning.
Figure 27-21. Servo (left) and exposed servo showing gears and circuit board (right)