the GNU General Public License that is used to distribute
Linux, the MIT License is an open-source license, but the
MIT License does not place any restrictions on when or
how software is used, as long as the license is included
A New Design
The most basic servo controllers do no more than
generate the pulses that control the servos; they have no
memory of where a servo has been or where it is going.
There are more advanced servo controllers that can move
servos from one position to another at a specified speed,
or over a specified time, but many advanced movements —
especially when servos start and stop while others are
moving — are still difficult.
The servo controller design I am proposing allows
commands to be queued, so that servos can be
commanded to begin movement either immediately, after
a set pause, or after a specific servo has arrived at its
destination. This way, some servos can switch directions
while other servos are still moving.
For example, let’s consider a robotic arm. The simplest
method to control it is to move one servo, poll the servo
controller until the movement is completed, then move
another servo, as shown in Figure 2. While simple, this
method is slow, and it can place the robotic arm in
positions that it should not be in. A better method is to
move multiple servos simultaneously (shown in Figure 3).
This produces smoother-looking movements and the arm
will get to its destination sooner.
In industrial manufacturing, equipment time can be
very expensive so many companies have process engineers
that try to create programs to get their products through
the manufacturing line as quickly as possible. When a
Servo 0 (waist)
-90° 0 sec.
90° Servo 1 (shoulder)
-90° 0 sec.
90° Servo 2 (elbow)
90° Servo 3 (wrist)
-90° 0 sec.
42 SERVO 10.2008
robotic arm is in use, the most efficient program can
involve different axes (controlled by large-scale servomotors)
traveling at different speeds and switching directions at
different times. Although hobbyists generally build their
robotic arms for entertainment instead of manufacturing,
these complex movements create more entertaining
In order to create these more advanced servo
movements but still be easy to control, the servo controller
can process the following commands:
• Move a servo to a position and arrive at a specified time.
• Move a servo to a position and travel at a specified speed.
• Delay for a specified amount of time.
• Wait for a specified servo to arrive at its destination.
The first two commands are essentially the same; if a
‘move’ command is specified, the program will always use
the arrival time. If the speed is given, it will be internally
converted to the arrival time.
A series of commands begins with a start byte,
contains a series of one or more commands with their
respective data, and then ends with a stop byte. To keep
the servos in sync, the servo controller will wait until it
receives a stop byte, a wait command, or a delay command
before it begins moving the servos. The delay command will
delay all remaining commands until a specified period of
time after the first servo has begun moving. The wait command will delay all remaining commands until a specified
servo has reached its destination. There are also commands
to enable and disable servos, trim servo positions, read
back servo positions, and perform other minor functions.
So for our example, we want to have the robotic arm
perform a dance by rotating from one side to another while
moving up and down and rotating its wrist back and forth.
To create a more interesting look, the wrist and the arm will
not switch directions at the same time. The servos will start
in the following positions:
• Waist (servo 0): -90°
• Shoulder (servo 1): - 67. 5°
• Elbow (servo 2): - 22. 5°
• Wrist (servo 3): 0°
To create the movements as graphed out in Figure 4,
the following commands must be sent to the servo controller:
• Move servo 0 to +90° over six seconds
• Move servo 1 to - 67. 5° over two seconds
• Move servo 2 to - 22. 5° over two seconds
• Move servo 3 to -90° over one second
If we stopped here, the waist would start rotating,
the arm would lift up, and the wrist would turn to one
side. But after one second, the wrist would stop rotating,
then a second later, the arm would stop lifting, but it
would be another four seconds until the waist finished
rotating. To keep the wrist rotating, we need to issue
FIGURE 4. Complex servo sequences can be
performed with a single set of commands.