be performed at the same time. The Propeller allows
objects or programs designed to perform a specific task to
be run in parallel, each occupying its own cog. I will be
implementing the first task: R/C servo control.
Rarely a month goes by without an article in SERVO
Magazine describing the communications needed to control
an analog R/C servo, so I will keep the review short. There
are no official standards on R/C servos, so many aspects of
their operation vary from manufacturer to manufacturer,
or even for different product lines from the same
manufacturer. R/C servos have three lines: power, ground,
and signal. Most servos will run between 4. 8 and 6 volts,
but it is best to check the specifications before powering
an R/C servo; some have a more limited voltage range.
R/C servos are controlled by pulses read by the signal line.
If the voltage on the line is greater than half of the voltage
that is powering the servo, the signal is considered to be
a logic high; otherwise, it is a logic low. To control an R/C
servo, the signal line starts low, is held to a logic high
for one to two milliseconds (ms), and then it is returned
low. This process is repeated 40 to 50 times per second.
The duration of the pulse determines the position that
the servo will try to hold. Generally, a 1 ms pulse moves
it to a 90-degree clockwise position, a 1.5 ms pulse
centers it, and a 2 ms pulse moves it to 90 degrees
What is more interesting though, is how an R/C servo
works. When an R/C servo receives a pulse, it compares
the position of its output shaft to the position the pulse
indicates. If the shaft is not at the position it should be, it
is rotated toward it. The further the shaft needs to rotate,
the faster it moves. The position sensor physically limits the
range the output shaft can rotate; usually to a total of
180 degrees. By removing an R/C servo’s feedback system
and hard-wiring it to think it is always centered, it can also
be modified for continuous rotation. By
sending a center pulse, the modified servo
will think it is where it needs to be, and it
will not move. When the pulse deviates
from center, the servo will try to follow, but
without a feedback system, it will never
know it moved; it will just keep spinning.
The further off-center the pulse indicates,
the further away the servo will think it is,
and the faster it will go. The direction the
modified servo moves will also follow the
direction indicated by the servo pulse.
Because R/C analog servos only move
when they receive a pulse, they will not
move when pulses are not being sent.
Without a stream of pulses, they are
effectively disabled. There are also digital
servos that have internal microcontrollers
that process the incoming pulses and
directly control the motor. Digital servos
have more output power than analog ones,
because analog servos do not power the
motor between pulses. Because they do not
rely on the stream of pulses, digital servos
cannot as easily be disabled.
My employer (Parallax, Inc.), has been selling a servo
controller: the Parallax Servo Controller or PSC. I could have
written an article about how to use it, published the
schematic (even though it is freely distributed in the
documentation on the Parallax website) and a through-hole
version of the circuit board layout, then sold the processor
— preprogrammed with a proprietary servo controller
program — at three times the retail price. This has been
done before, but it is a practice I find rather irritating. I did
not know programmable microcontrollers existed until — as
a student in junior high school — I was building a project
described in a magazine to try and teach myself electronics.
My parents were nice enough to drive me to all of the local
electronics stores to pick up the components, but there was
one chip I could not find. The owner of the local surplus
electronics store kindly explained to me that the author had
custom programmed a microcontroller and I would have to
order it. Several years later, I learned how to program
them myself, and I eventually built my career around
programming microcontrollers, but I think there is a better
way to introduce others to these devices.
Instead of advertising a preprogrammed chip, I would
like to use this article to propose an open-source project
based on the Propeller Multi-Controller board that Chris
Savage introduced last month. The design will be more
powerful than any off-the-shelf servo controllers I have
seen, but it will be easy to use and hobbyists will be able to
build it themselves at a low cost. I will post the source code
and documentation online, and for the remainder of this
article I’ll discuss the features that will make it unique.
Parallax hosts a website called the Propeller Object
Exchange where people can post code they have written
and have it freely distributed under the MIT License. Like
0 sec. 5 sec.
FIGURE 2. The simplest control method
—moving oneservo at atime —is
slower and may place the robotic arm
in positions that it should not be in.
FIGURE 3. Moving more than
one servo at a time is not only
quicker, it also creates a more
SERVO 10.2008 41