WORKING WITH
SERVO MOTORS
DC and stepper motors are inherently open feedback systems—you provide electricity and they spin. How much they spin is not always known, not even for a stepper motor, which turns by finite degrees based on the number of pulses it gets. Should something impede the rotation of the motor it may not turn at all, but there’s no easy, built-in way that the control electronics would know that.
Servo motors, on the other hand, are designed for closed feedback systems. The output
of the motor is coupled to a control circuit; as the motor turns, its speed and/or position
are relayed to the control circuit. If the rotation of the motor is impeded for whatever reason,
the feedback mechanism senses that the output of the motor is not yet in the desired
location. The control circuit continues to correct the error until the motor finally reaches its
proper point.
Servo motors come in various shapes and sizes. Some are smaller than a walnut, while
others are large enough to take up their own seat in your car. They’re used for everything
from controlling computer-operated lathes to copy machines to model airplanes and cars.
It’s the last application that is of most interest to hobby robot builders: the same servo
motors used with model airplanes and cars can readily be used with your robot.
These servo motors are designed to be operated via a radio-controlled link and so are
commonly referred to as radio-controlled (or R/C) servos. But in fact the servo motor itself
is not what is radio-controlled; it is merely connected to a radio receiver on the plane or car.
The servo takes its signals from the receiver. This means you don’t have to control your
robot via radio signals just to use an R/C servo—unless you want to, of course. You can control a servo with your PC, a microcontroller such as the BASIC Stamp, or even a simple circuit designed around the familiar 555 timer integrated circuit.
In this chapter R/C servos will be presented along with how they can be put to use in a
robot. While there are other types of servo motors, it is the R/C type that is commonly
available and reasonably affordable. For simplicity’s sake, when you see the term servo in
the text that follows understand that it specifically means an R/C servo motor, even though
there are other types.
Fig. 22-1 shows a typical standard-sized R/C servo motor, which is used with flyable model
airplanes and model racing cars. The size and mounting of a standard servo is the same
regardless of the manufacturer, which means that you have your pick of a variety of makers.
Along with the standard-sized servor, there are other common sizes of servo motors
also available, which will be discussed later in the chapter.
Inside the servo is a motor, a series of gears to reduce the speed of the motor, a control
board, and a potentiometer (see Fig. 22-2). The motor and potentiometer are connected to
the control board, all three of which form a closed feedback loop. Both control board and
motor are powered by a constant DC voltage (usually between 4.8 and 6.0 V, although
many will work with power inputs up to 7.2 V).
To turn the motor, a digital signal is sent to the control board. This activates the motor, which, through a series of gears, is connected to the potentiometer. The position of the potentiometer’s shaft indicates the position of the output shaft of the servo. When the potentiometer has reached the desired position, the control board shuts down the motor.
As you can surmise, servo motors are designed for limited rotation rather than for continuous
rotation like a DC or stepper motor. While it is possible to modify an R/C servo to
rotate continuously (as discussed later in this chapter), the primary use of the R/C servo is
to achieve accurate rotational positioning over a range of 90° or 180°. While this may not
sound like much, in actuality such control can be used to steer a robot, move legs up and
down, rotate a sensor to scan the room, and more. The precise angular rotation of a servo
in response to a specific digital signal has enormous uses in all fields of robotics.
22.2 Servos and Pulse Width Modulation
The motor shaft of an R/C servo is positioned by using pulse width modulation (PWM). In
this system, the servo responds to the duration of a steady stream of digital pulses (Fig. 22-3).
Specifically, the control board responds to a digital signal whose pulses vary from about
1 ms (one-thousandth of a second) to about 2 ms. These pulses are sent some 50 times
per second. The exact length of the pulse, in fractions of a millisecond, determines the
position of the servo. Some servos are very tolerant of varying PWM periods, while others
will not work properly or “jitter” if the pulses come at anything other than 50 times per
second. To be on the safe side, always try to maintain 20 ms between the start servo control
pulses.
At a duration of 1 ms, the servo is commanded to turn all the way in one direction (for example counterclockwise). At 2 ms, the servo is commanded to turn all the way in the
other direction. Therefore, at 1.5 ms, the servo is commanded to turn to its center (or neutral)
position. As mentioned earlier, the angular position of the servo is determined by the
width (more precisely, the duration) of the pulse. This technique has gone by many names
over the years. One you may have heard of is digital proportional—the movement of the
servo is proportional to the digital signal being fed into it.
The power delivered to the motor inside the servo is also proportional to the difference
between where the output shaft is and where it’s supposed to be. If the servo has only a little
way to move to its new location, then the motor is driven at a fairly low speed. This
ensures that the motor doesn’t overshoot its intended position. But if the servo has a long
way to move to its new location, then it’s driven at full speed in order to get there as fast as
possible. As the output of the servo approaches its desired new position, the motor slows
down. What seems like a complicated process actually happens in a very short period of
time—the average servo can rotate a full 60° in a quarter to half second.
22.3 The Role of the Potentiometer
The potentiometer of the servo plays a key role in determining when the motor has set the
output shaft to the correct position. The potentiometer is physically attached to the output
shaft (and in some servo models, the potentiometer is the output shaft). In this way, the
position of the potentiometer very accurately reflects the position of the output shaft of the
servo. When used in a servo, a potentiometer is wired as a voltage divider and provides a
varying voltage to the control circuit when the servo output changes, as shown in Fig. 22-4.
The control circuit in the servo correlates this voltage with the timing of the incoming
digital pulses and generates an error signal if the voltage is wrong. This error signal is proportional to the difference between the position of the potentiometer and the timing of the
incoming signal. To compensate, the control board applies the error signal to turn the
motor. When the voltage from the potentiometer and the timing of the digital pulses match,
the error signal is removed, and the motor stops.
Servos also vary by the amount of rotation they will perform for the 1 to 2 ms signal they
are provided. Most standard servos are designed to rotate back and forth by 90° to 180°,
given the full range of timing pulses. You’ll find the majority of servos will be able to turn a
full 180°, or very nearly so. Should you attempt to command a servo beyond its mechanical
limits, the output shaft of the motor will hit an internal stop. This causes the gears of the
servo to grind or chatter. If left this way for more than a few seconds, the gears of the motor
or the motor itself and its drivers may be permanently damaged. Therefore, when experimenting
with servo motors exercise care to avoid pushing them beyond their natural limits.
The actual length of the pulses is fairly constant at 1 to 2 ms for most manufacturers’
products, but it should be noted that the Futaba brand and servos that are compatible have
a 1 to 1.5 ms pulse width. There can be a problem with passing a 2 ms pulse to a Futaba
servo if the pulse causes the servo to push against its stop (potentially damaging the servo).
Rather than experimenting on an unknown servo with 1 to 2 ms pulses, you should start
with 1 to 1.5 ms pulses and raise the pulse width to 2 ms if the servo only turns 45 degrees.
22.5 Special-Purpose Servo Types and Sizes
While the standard-sized servo is the one most commonly used in both robotics and radio-controlled
models, other R/C servo types, styles, and sizes exist as well.
- Quarter-scale (or large-scale) servos are about twice the size of standard servos and are
significantly more powerful. Quarter-scale servos are designed to be used in large model
airplanes, but they also make perfect power motors for a robot.
- Mini-micro servos are about half the size (and smaller!) of standard servos and are
designed to be used in tight spaces in a model airplane or car. They aren’t as strong as
standard servos, however.
- Sail winch servos are designed with maximum strength in mind, and are primarily
intended to move the jib and mainsail sheets on a model sailboat.
- Landing-gear retraction servos are made to retract the landing gear of medium- and
large-sized model airplanes. The design of the landing gear often requires the servo to
guarantee at least 170° rotation, if not more (i.e., up to and exceeding 360° of motion).
It is not uncommon for retraction servos to have a slimmer profile than the standard variety
because of the limited space on model airplanes.
22.6 Gear Trains and Power Drives
The motor inside an R/C servo turns at several thousand r/min. This is too fast to be used
directly on model airplanes and cars, or on robots. All servos employ a gear train that
reduces the output of the motor to the equivalent of about 50 to 100 r/min. Servo gears
can be made of plastic, nylon, or metal (usually brass or aluminum).
Metal gears last the longest, but they significantly raise the cost of the servo. Replacement
gear sets are available for many servos, particularly the medium- to higher-priced ones
($20+). Should one or more gears fail, the servo can be disassembled and the gears
replaced. In some cases, you can upgrade the plastic gears in a less expensive servo to
higher-quality metal ones.
Besides the drive gears, the output shaft of the servo receives the most wear and tear.
On the least expensive servos this shaft is supported by a plastic bearing, which obviously
can wear out very quickly if the servo is used heavily. Actually, this piece is not a bearing at
all but a bushing, a sleeve or collar that supports the shaft against the casing of the servo.
Metal bushings, typically made from lubricant-impregnated brass, last longer but add to the
cost of the servo. The best (and most expensive) servos come equipped with ball bearings,
which provide longest life. Ball bearing upgrades are available for some servo models.
R/C servo motors enjoy some standardization. This sameness applies primarily to standard-sized
servos, which measure approximately 1.6 by 0.8 by 1.4 in. For other servo types the
size varies somewhat between makers, as these are designed for specialized tasks.
Table 22.1 outlines typical specifications for several types of servos, including dimensions,
weight, torque, and transit time. Of course, except for the size of standard servos,
these specifications can vary between brand and model. A few of the terms used in the specs require extra discussion. As explained in Chapter 19, “Choosing the Right Motor,”
the torque of the motor is the amount of force it exerts. The standard torque unit of measure
for R/C servos is expressed in ounce-inches—or the number of ounces the servo can
lift when the weight is extended 1 in from the shaft of the motor. Servos exhibit very high
torque thanks to their speed reduction gear trains.
TABLE 22-1 Typical Servo Specifications
The transit time (also called slew rate) is the approximate time it takes for the servo to
rotate the shaft X° (usually specified as 60°). Small servos turn at about a quarter of a second
per 60°, while larger servos tend to be a bit slower. The faster the transit time, the
faster acting the servo will be.
You can calculate equivalent r/min by multiplying the 60° transit time by 6 (to get full
360° rotation), then dividing the result into 60. For example, if a servo motor has a 60°
transit time of 0.20 s, that’s one revolution in 1.2 s (0.2 × 6 = 1.2), or 50 r/min (60 /
1.2 = 50).
Bear in mind that there are variations on the standard themes for all R/C servo classes.
For example, standard servos are available in more expensive high-speed and high-torque
versions. Servo manufacturers list the specifications for each model, so you can compare
and make the best choice based on your particular needs.
Many R/C servos are designed for use in special applications, and these applications can
be adapted to robots. For example, a servo engineered to be used with a model sailboat will
be water resistant and therefore useful on a robot that works in or around water.
22.8 Connector Styles and Wiring
While many aspects of servos are standardized, there is much variety between manufacturers
in the shape and electrical contacts of the connectors used to attach the servo to a
receiver. Despite this diversity, you will find that you can usually connect servos to three standard 0.100" connector posts either soldered into a PCB or pressed into a breadboard.
You may decide the connector issue isn't worth the hassle, and just cut it off from the servo,
hardwiring it to your electronics. This is an acceptable alternative, but hardwiring makes it
more difficult to replace the servo should it ever fail.
There are three primary connector types found on R/C servos:
- “J” or Futaba style
- “A” or Airtronics style
- “S” or Hitec/JR style
Servos made by the principle servo manufacturers—Futaba, Airtronics, Hitec, and JR—employ the connector style popularized by that manufacturer. In addition, servos made by competing manufacturers are usually available in a variety of connector styles, and connector adapters are available.
22.8.2 PINOUT AND COLOR CODING
The physical shape of the connector is just one consideration. The wiring of the connectors
(called the pinout) is also critical. Fortunately, all but the “old-style” Airtronics servos (and
the occasional oddball four-wire servo) use the same pinout, as shown in Fig. 22-5. With
very few exceptions, R/C servo connectors use three wires, providing DC power, ground,
and signal (or control). Fig. 22-2 lists the pinouts for several popular brands of servos.
TABLE 22-2 Connector Pinouts of Popular Servo Brands
Most servos use color coding to indicate the function of each connection wire, but the
actual colors used for the wires vary between servo makers. Table Fig. 22-3 lists the most common
colors used in several popular brands, but chances are you will be right if you assume
that red is positive voltage, black is negative, and the third wire is the signal.
TABLE 22-3 Color Coding of Popular Servo Brands
22.9 Circuits for Controlling a Servo
Unlike a DC motor, which runs if you simply attach battery power to its leads, a servo motor
requires proper interface electronics in order to rotate its output shaft. While the need for
interface electronics may complicate to some degree your use of servos, the electronics are
actually rather simple. And if you plan on operating your servos with a PC or microcontroller
(such as the BASIC Stamp), all you need for the job is a few lines of software.
A DC motor typically needs power transistors, MOSFETs, or relays if it is interfaced to a computer. A servo on the other hand can be directly coupled to a PC or microcontroller with no additional electronics. All of the power-handling needs are taken care of by the control
board in the servo, saving you the hassle. This is one of the key benefits of using servos
with computer-controlled robots.
22.9.1 CONTROLLING A SERVO VIA A 556 TIMER CHIP
You don’t need a computer to control a servo. You can use the venerable 555 timer IC circuit
that is doubled in the 556 chip to provide the required pulses to a servo. This circuit
uses one of the 555 timers built into the chip to provide the 20 ms pulse period and the second
timer to provide the 1 to 2 ms pulse. Fig. 22-6 shows the circuit that can be used to
control a servo, and Table. 22-4 lists the parts that you will need.
TABLE 22-4 Parts Needed to Build the 556 Servo Control Circuit |
IC1 |
556 timer chip |
Pot |
100k single turn potentiometer |
R2, R3 |
100k resistor |
R1 |
2.7M resistor |
C1–C4 |
0.01 μF capacitors (any type) |
Bat |
4× AA battery clip |
Misc. |
Circuit breadboard, wiring, servo connector header |
|
22.9.2 CONTROLLING A SERVO VIA A BASIC STAMP
With a little bit of thought to the software, a BASIC Stamp 2 can be used to control one or
more servos as well as have enough time left over to poll inputs and determine what is the
appropriate next action. Fig. 22-7 shows the hookup diagram for connecting a standard
servo to the BS2. It is very important to note that the power to the servo does not come
from the BS2, or any prototyping board it is on. Servos require more current than the
power supply on the Stamp can provide. A pack of four AA batteries is sufficient to power the servo. For proper operation ensure that the grounds are connected between the Stamp and the battery pack. Use a 33 to 47 μF capacitor between the +V and ground of the AA
pack to help kill any noise that may be induced into the electronics when the servo turns on
and off.
The following application sends the appropriate pulses to a servo for 1s and then polls
the user (using the DEBUG and DEBUGIN console interface statements) to enter in a value
that is passed to the servo. The reason why the application is called calibrate is due to its
use as a method to find the correct stop pulse length for a servo modified for continuous
rotation (described in the following).
'Calibrate – Find the Center/Not Moving Point for Servo
'{$STAMP BS2}
'{$PBASIC 2.50}
22.9.3 USING A DEDICATED CONTROLLER
R/C receivers are designed with a maximum of eight servos in mind. The receiver gets a
digital pulse train from the transmitter, beginning with a long sync pulse, followed by as
many as eight servo pulses. Each pulse is meant for a given servo attached to the receiver:
pulse 1 goes to servo 1, pulse 2 goes to servo 2, and so on. The eight pulses plus the sync
pulse take about 20 ms. This means the pulse train can be repeated 50 times each second,
which is its refresh rate. As the refresh rate gets slower the servos aren’t updated as quickly
and can throb or lose position as a result.
Depending on your electronics and programming ability, you may find it very difficult to
simultaneously supply pulses to multiple servos at one time (a quick Google search on the
Internet will find applications that control up to four servos simultaneously using a single
BS2 and more using a Microchip PIC MCU). Rather than invest the time and effort developing
this capability, you can buy inexpensive servo controllers from a number of sources
(see Appendix B, “Sources,” for addresses and web sites) that can control five, eight, or
even more servos autonomously, which reduces the program overhead of the microcontroller
or computer you are using.
The main benefit of dedicated servo controllers is that a great number of servos can be
commanded simultaneously, even if your computer, microcontroller, or other circuitry is not
multitasking. For example, suppose your robot requires 24 servos. Say it’s an eight-legged
spider, and each leg has three servos; each servo controls a different “degree of freedom”
of the leg. One approach would be to divide the work among three servo controllers, each
capable of handling eight servos. Each controller would be responsible for a given degree of
freedom. One might handle the rotation of all eight legs; another might handle the flexion
of the legs; and the third might be for the rotation of the bottom leg segment.
Dedicated servo controllers must be used with a computer or microcontroller, as they
need to be provided with real-time data in order to operate (commonly sent in a serial data
format). A sequence of bytes sent from the computer or microcontroller is decoded by the servo controller, with each byte corresponding to a servo attached to it. Servo controllers
typically come with application notes and sample programs for popular computers and
microcontrollers, but to make sure things work it’s very helpful to have a knowledge of programming
and serial communications.
22.9.4 SERVO VOLTAGE MARGINS
Servos are designed to be used with rechargeable model R/C battery packs, which normally
put out 4.8 V or four AA alkaline battery packs (which put out approximately 6 V). As the
batteries drain the voltage will drop, and you will notice your servos won’t be as fast as they
used to be. Somewhere below about 4.5 V the servos stop being responsive. Similarly, while
servos may work with power supplies greater than 6 V, you cannot count on it and you will
find that at some point you will burn out their control electronics or even their motors.
Ideally, your servo power supply should be monitored to ensure that the voltage stays
within the range of 4.5 and 6 V. This may mean that the servos in a particular robot will
require their own power supply or battery pack, but by ensuring the correct voltage is
applied to them, they can be assumed to work properly for their full lives.
22.9.5 WORKING WITH AND AVOIDING THE DEAD BAND
References to the Grateful Dead notwithstanding, all servos exhibit what’s known as a dead band. The dead band of a servo is the maximum time differential between the incoming
control signal and the internal reference signal produced by the position of the potentiometer.
If the time difference equates to less than the dead band—say, 5 or 6 ms—the
servo will not bother trying to nudge the motor to correct for the error.
Without the dead band, the servo would constantly hunt back and forth to find the exact
match between the incoming signal and its own internal reference signal. The dead band
allows the servo to minimize this hunting so it will settle down to a position close to, though
maybe not exactly, where it’s supposed to be.
The dead band varies between servos and is often listed as part of the servo’s specifications.
A typical dead band is 5 μs. If the servo has a full travel of 180° over a 1000 μs (1 to
2 ms) range, then the 5 μs dead band equates to 1 part in 200. You probably won’t even
notice the effects of dead band if your control circuitry has a resolution lower than the dead
band.
However, if your control circuitry has a resolution higher than the dead band (which is
the case with a microcontroller such as the BASIC Stamp 2 or the Motorola MC68HC11)
then small changes in the pulse width values may not produce any effect. For instance, if
the controller has a resolution of 2 μs and if the servo has a dead band of 5 μs, then a
change of just one or even two values—equal to a change of 2 or 4 μs in the pulse width—may not have an effect on the servo.
The bottom line: choose a servo that has a narrow dead band if you need accuracy and
if your control circuitry or programming environment has sufficient resolution. Otherwise,
ignore the dead band since it probably won’t matter one way or another. The trade-off here
is that with a narrow dead band the servo will be more prone to hunt to its position and may
even buzz after it has found it.
22.9.6 GOING BEYOND THE 1 TO 2 MILLISECOND PULSE RANGE
You’ve already read that the typical servo responds to signals from 1 to 2 ms. While this is
true in theory, in actual practice many servos can be fed higher and lower pulse values in
order to maximize their rotational limits. The 1 to 2 ms range may indeed turn a servo one
direction or another, but it may not turn it all the way in both directions. However, you
won’t know the absolute minimums and maximums for a given servo until you experiment
with it. Take fair warning: performing this experiment can be risky because operating a
servo to its extreme can cause the mechanism to hit its internal stops. As noted earlier in
this chapter, if left in this state for any period of time, the gears and electronics of the servo
can become damaged.
If you just must have maximum rotation from your servo, connect it to your choice of
control circuitry. Start by varying the pulse width in small increments below 1 ms (1000 μs),
say in 10 μs chunks. After each additional increment, have your control program swing the
servo back to its center or neutral position. When during your testing you hear the servo
hit its internal stop (the servo will chatter as the gears slip), you’ve found the absolute
lower-bound value for that servo. Repeat the process for the upper bound. It’s not unusual
for some servos to have a lower bound of perhaps 250 μs and an upper bound of over
2200 μs. Yet other servos may be so restricted that they cannot even operate over the normal
1 to 2 ms range.
Keep a notebook of the upper and lower operating bounds for each servo in your robot
or parts storehouse. Since there can be mechanical differences between servos of the same
brand and model, number your servos so you can tell them apart. When it comes time to
program them, you can refer to your notes for the lower and upper bounds for that particular
servo.
22.10 Modifying a Servo for Continuous Rotation
Many brands and models of R/C servos can be readily modified to allow them to rotate continuously,
like a regular DC motor. Such modified servos can be used as drive motors for
your robot. Many modern servos also come with the ability to turn continuously with just
the flick of a switch. Servos that can turn continuously can be easier to use than regular DC
motors since they already have the power drive electronics built in, they come already
geared down, and they are easy to mount on your robot.
22.10.1 BASIC MODIFICATION INSTRUCTIONS
Servo modification varies somewhat between makes and models, but the basic steps are the same:
1. Remove the case of the servo to expose the gear train, motor, and potentiometer. This
is accomplished by removing the four screws on the back of the servo case and separating the top and bottom.
2. File or cut off the nub on the underside of the output gear that prevents full rotation. This typically means removing one or more gears, so you should be careful not to misplace any parts. If necessary, make a drawing of the gear layout so you can replace things in their proper location!
3. Remove the potentiometer and replace it with two 2.7K-Ω 1 percent tolerance (precision)
resistors, wired as shown in
Fig. 22-8 This voltage divider circuit “fools” the
servo’s control circuitry into thinking it’s always in the center position and will respond
by turning the motor any time the incoming PWM is outside the center position (which
is found using the calibrate program previously listed). Another approach is to relocate
the potentiometer to the outside of the servo case, so that you can make fine-tune
adjustments to the center position. If you do this, it is suggested that a multi-turn trimmer
potentiometer is used.
4. Reassemble the case.
22.10.2 APPLYING NEW GREASE
The gears in a servo are lubricated with a white or clear grease. As you remove and replace
the gears during your modification surgery, it’s inevitable that some of the grease will come
off on your fingers. If you feel too much of the grease has come off, you’ll want to apply
more. Most any viscous synthetic grease suitable for electronics equipment will work,
though you can also splurge and buy a small tube of grease especially made for servo gears
and other mechanical parts in model cars and airplanes.
When applying grease be sure to spread it around so that it gets onto all the mechanical
parts of the servo that mesh or rub. However, avoid getting any of it inside the motor or on
the electrical parts. Wipe off any excess.
While it may be tempting, don’t apply petroleum-based oil to the gears, such as three-in-one
oil or a spray lubricant like WD-40. Some oils may not be compatible with the plastics
used in the servo, and spray lubricants aren’t permanent enough.
22.10.3 TESTING THE MODIFIED SERVO
After reassembly but before connecting the servo to a control circuit, you’ll want to test your
handiwork to make sure the output shaft of the servo rotates smoothly. Do this by attaching a control disc or control horn to the output shaft of the servo. Slowly and carefully rotate
the disc or horn and note any snags. Don’t spin too quickly, as this will put undo stress on
the gears. If you notice any binding while you’re turning the disc or horn, it could mean you
didn’t remove enough of the mechanical stop on the output gear. Disassemble the servo just
enough to gain access to the output gear and clip or file off some more.
Once you are comfortable with the servo’s ability to turn, you can see how it works using the 556 or BS2 circuits (and software) presented earlier in the chapter.
22.10.4 A CAUTION ON MODIFYING SERVOS
Modifying a servo typically entails removing or gutting the potentiometer and clipping off
any mechanical stops or nubs on the output gear. For all practical purposes, this renders the
servo unusable for its intended use, that is, to precisely control the angular position of its
output shaft. So, before modifying a servo, be sure it’s what you want to do. It’ll be difficult
to reverse the process, and in any case you are voiding its warranty.
22.10.5 SOFTWARE FOR RUNNING MODIFIED SERVOS
Even though a servo has been modified for continuous rotation, the same digital pulses are
used to control the motor. Keep the following points in mind when running modified servos:
- If you’ve used fixed resistors in place of the original potentiometer inside the servo, sending
a pulse of about 1.5 ms will stop the motor. Decreasing the pulse width will turn the
motor in one direction; increasing the pulse width will turn the motor in the other direction.
You will need to experiment (using the calibrate program) with the exact pulse width
to find the value that will cause the motor to stop.
- If you’ve used a replacement 5K potentiometer instead of the original that was inside the
servo, you have the ability to set the precise center point that will cause the motor to
stop. In your software, you can send a precise 1.5 ms pulse, then adjust the potentiometer
until the servo stops. As with fixed resistors, values higher or lower than 1.5 ms
will cause the motor to turn one way or another.
22.10.6 LIMITATIONS OF MODIFIED SERVOS
Modifying a servo for continual rotation carries with it a few limitations, exceptions, and
“gotchas” that you’ll want to keep in mind:
- The average servo is not engineered for lots and lots of continual use. The mechanics of
the servo are likely to wear out after perhaps as little as 25 hours (that’s elapsed time),
depending on the amount of load on the servo. Models with metal gears and/or brass
bushing or ball bearings will last longer.
- The control electronics of a servo are made for intermittent duty. Servos used to power
a robot across the floor may be used minutes or even hours at a time, and they tend to
be under additional mechanical stress because of the weight of the robot. Though this is
not exactly common, it is possible to burn out the control circuitry in the servo by overdriving
it.
- Standard-sized servos are not particularly strong in comparison to many other DC
motors with gear heads. Don't expect a servo to move a 5- or 10-lb robot. If your robot
is heavy, consider using either larger, higher-output servos (such as ¼-scale or sail winch),
or DC motors with built-in gear heads.
- Last and certainly not least, remember that modifying a servo voids its warranty. You’ll
want to test the servo before you modify it to ensure that it works.
22.10.7 MODIFYING BY REMOVING THE SERVO CONTROL BOARD
Another way to modify a servo for continuous rotation is to follow the steps outlined previously
and also remove the control circuit board. Your robot then connects directly to the
servo motor. You’d use this approach if you don’t want to bother with the pulse width
schema. You get a nice, compact DC motor with gearbox attached.
However, since you’ve removed the control board, you will also need to provide adequate
power output circuitry to drive the motor. The circuitry built onto the servo PCB was
designed for the motor; ideally, you might want to do a bit of probing on the servo PCB to
try and figure out what are the components and circuit used in the motor driver so that you
can replicate it rather than having to come up with your own circuit.
22.11 Attaching Mechanical Linkages to Servos
One of the benefits of using R/C servos with robots is the variety of ways it offers you to
connect stuff to the servos. In model airplane and car applications, servos are typically connected
to a push/pull linkage of some type. For example, in a plane, a servo for controlling
the rudder would connect to a push/pull linkage directly attached to the rudder. As the servo
rotates, the linkage draws back and forth, as shown in Fig. 22-9 The rudder is attached to
the body of the plane using a hinge, so when the linkage moves, the rudder flaps back and
forth.
You can use the exact same hardware designed for model cars and airplanes with your
servo-equipped robots. Visit the neighborhood hobby store and scout for possible parts you
can use. Collect and read through web sites and catalogs of companies that manufacture
and sell servo linkages and other mechanics. Appendix B, “Sources,” lists several such
companies.
22.12 Attaching Wheels to Servos
Servos reengineered for full rotation are most often used for robot locomotion and are outfitted
with wheels. Since servos are best suited for small- to medium-sized robots (under
about 3 lb), the wheels for the robot should ideally be between 2 and 5 in diameter. Larger-diameter
wheels make the robot travel faster, but they can weigh more. You won’t want to
put extra large 7- or 10-in wheels on your robot if each wheel weighs 1.5 lb. There’s your
3-lb practical limit right there.
The general approach for attaching wheels to servos is to use the round control disc that
comes with the servo (see Fig. 22-10). The underside of the disc fits snugly over the output
shaft of the servo. You can glue or screw the wheel to the front of the disc. Here are some
ideas:
- Large LEGO balloon tires have a recessed hub that exactly fits the control disc included
with Hitec and many other servos. You can simply glue the disc into the rim of the tire.
- Lightweight foam tires, popular with model airplanes, can be glued or screwed to the
control disc. The tires are available in a variety of diameters. If you wish, you can grind
down the hub of the tire so it fits smoothly against the control disc.
- A gear glued or screwed into the control disc can be used as an ersatz wheel or as a gear
that drives a wheel mounted on another shaft.
In all these cases, it’s important to maintain access to the screw used to secure the control
disc to the servo. When you are attaching a wheel or tire be sure not to block the screw
hole. If necessary, insert the screw into the control disc first, then glue or otherwise attach
the tire. Make sure the hub of the wheel is large enough to accept the diameter of your
screwdriver, so you can tighten the screw over the output shaft of the servo.
22.13 Mounting Servos on the Body of the Robot
Servos should be securely mounted to the robot so the motors don’t fall off while the robot is in motion. The following methods do not work well, though they are commonly used:
- Duct tape or electrical tape. The “goo” on the tape is elastic, and eventually the servo works itself loose. The tape can also leave a sticky residue.
- Hook-and-loop, otherwise known as Velcro. Accurate alignment of the hook-and-loop
halves can be tricky, meaning that every time you remove and replace the servos the
wheels are at a slightly different angle with respect to the body of the robot. This makes
it harder to program repeatable actions.
- Tie-wraps. You must cinch the tie-wrap tightly in order to adequately hold the servo in
place. Unless your robot is made of metal or strong plastic, you’re bound to distort whatever
part of the robot you’ve cinched the wrap against.
Experience shows that hard mounting—gluing, screwing, or bolting—the servos onto the
robot body is the best overall solution, and it greatly reduces the frustration level of hobby
robotics.
22.13.1 ATTACHING SERVOS WITH GLUE
Gluing is a quick and easy way to mount servos on most any robot body material, including
heavy cardboard and plastic. Use only a strong glue, such as two-part epoxy or hot-melt
glue. When gluing it is important that all surfaces be clean. Rough up the surfaces with a file
or heavy-duty sandpaper for better adhesion. If you’re gluing servos to LEGO parts, apply
a generous amount so the extra adequately fills between the nubs. LEGO plastic is hard and
smooth, so be sure to rough it up first.
22.13.2 ATTACHING SERVOS WITH SCREWS OR BOLTS
A disadvantage of mounting servos with glue is that it’s more or less permanent (and,
according to Murphy’s Law, more permanent than you’d like if you want to remove the
servo, less permanent if you want the servo to stay in place!). For the greatest measure of flexibility, use screws or bolts to mount your servos to your robot body. All servos have mounting holes in their cases; it’s simply a matter of finding or drilling matching holes in the
body of your robot.
Servo mounts are included in many R/C radio transmitters and separately available
servo sets. You can also buy them separately from the better-stocked hobby stores. The
servo mount has space for one, two, or three servos. The mount has additional mounting
holes that you can use to secure it to the side or bottom of your robot. Most servo mounts
are made of plastic, so if you need to make additional mounting holes they are easy to drill.
You can also construct your own servo mounting brackets using
-in-thick aluminum or
plastic. A template is shown in Fig. 22-11. (Note: the template is not to scale, so don't trace
it to make your mount. Use the dimensions to fashion your mount to the proper size.)
The first step in constructing your own servo mounting brackets is to cut and drill the aluminum
or plastic, as shown in Fig. 22-12. Use a small hobby file to smooth off the edges
and corners. The mounting hole centers provided in the template are designed to line up
with the holes in LEGO Technic beams. This allows you to directly attach the servo mounts
to LEGO pieces. Use
or
nuts and bolts, or
self-tapping screws, to attach the servo
mount to the LEGO beam.
Fig. 22-12 shows a servo mounted on a bracket and attached to a LEGO beam. If necessary,
the servos can be easily removed for repair or replacement.
To learn more about . . . |
|
Read |
Using batteries to power your robot |
|
Chapter 17, "Batteries and Robot Power Supplies" |
Fundamentals of robot locomotion |
|
Chapter 18, "Principles of Robot Locomotion" |
Choosing the best motor for your robot |
|
Chapter 19, "Choosing the Right Motor" |
Ways to implement computers and microcontrollers in your robots |
|
Chapter 12, "An Overview of Robot ‘Brains’" |
Interfacing servos and other motors to control circuitry |
|
Chapter 14, "Computer Peripherals" |