Page 191 - Making things move_ DIY mechanisms for inventors, hobbyists, and artists
P. 191
Chapter 6 Options for Creating and Controlling Motion 169
top of your existing Arduino, attach the motor wires in the right spots, download the
library, and copy a few lines of code. The kits come unassembled, and you need to do
a fair amount of soldering to get started. However, there are excellent tutorials linked
right from the site.
Hobby Servo Control
All hobby servo motors have circuits inside them that respond to pulses. Each servo
has three wires: power, signal, and ground. You need to plug one wire into ground
(usually the black one), one wire into a power source in the motor’s working range
(usually the red one), and one wire into something that can give it pulses (usually the
8
yellow one). This signal is known as pulse-proportional modulation (PPM) (also known
as pulse-position modulation) and is similar to PWM. This is what the Control System
and Required Pulse lines at the top of the hobby servo motor specifications shown
earlier in Figure 6-10 tell us.
The smarts inside a servo motor expect a pulse every 20 milliseconds (ms), or 50 times
a second. Different servos vary, but most servos use a pulse width between 0.5 ms
and 2.5 ms out of this 20 ms to send a signal to the servo motor (see Figure 6-32).
This signal, or pulse, is similar to repeatedly turning the light on for 0.5 to 2.5 ms,
then turning it off until a total on/off time of 20 ms passes, and then repeating the
cycle (see Figure 6-32). As with a PWM signal, you can create this pulse in hardware or
with software.
NOTE There are 1,000 microseconds (μs) in 1 ms. Because the letter u looks
like the Greek letter μ but is easier to type, you will often see servo data
sheets that state the servo range as 500 to 2,500 usec.
Standard Hobby Servo Control
Standard hobby servos are controlled by pulses that tell them which direction to point.
The specs shown earlier in Figure 6-10 indicate that the servo’s range is 600 to 2,400 μs,
with 1,500 μs neutral. The circuit inside the servo knows that a 600 μs pulse width
out of 20 ms means point to one extreme (0°), and a 2,400 μs pulse width means
point to the other extreme (180°). Any pulse width between 600 and 2,400 μs moves