The Background
Hobby servos and other devices — such as the linear
actuators from Firgelli — require a specific signal to position
them exactly where you want. Frequently, this signal is
generated by a program in a microprocessor, and
determining the parameters for the program to achieve a
desired position can be a challenge. This is compounded by
variations between servos.
In the past, I solved this by trial-and-error coding until I
had the correct parameters. When I recently had to replace
a broken servo and discovered that the original parameters
wouldn’t work for the replacement, I decided to build
something that would reduce — if not totally eliminate —
the trial and error needed to install the new servo.
Those of you who have designed systems with servos
will recall that the ideal servo uses a control signal with a
period of 20 milliseconds (ms). The typical servo has a
control arm that can move either 45 degrees or 90 degrees
left and right from a center position. A high signal of 1.5
ms every 20 ms centers the control arm of the servo. A
high signal of 1 ms positions it to one extreme; for
example, left or counter-clockwise. A high signal of 2 ms
will position it to the opposite extreme. Take a look at
Figure 1 for an illustration of this.
Rarely does real life match the ideal, which is why RC
transmitters have trim tabs to account for construction and
servo variations. I’ve discovered that many servos advertised
as having a 90 degree range of motion can move much
farther when the parameters are set outside of the “ideal”
range. For example, one 90 degree labeled servo I have
moves 45 degrees left and right from center for control
signals of 1 ms and 2 ms as expected. However, it swings
left from center almost 90 degrees when I send a 0.6 ms
control signal, and swings right from center almost 90
degrees when I send a 2. 4 ms control signal.
I’ve seen servo testers advertised in hobbyist
magazines, and a search on the Internet will reveal circuit
diagrams and instructions for making one. These are great
for testing the servo and checking on the range of motion.
Unfortunately, I haven’t seen one that will tell me the actual
width or duration of the control signal I need to program
into my processor. It’s time to clear some space on the
workbench and make something!
Component Selection and
Hardware Design
After leaning back and contemplating the pattern of
my textured ceiling for a while, I settled on the following
design goals for what I’m calling the Deluxe Servo Tester.
These include:
1. Multiple buttons or inputs for controlling the servo
position.
2. Display of the current timing parameter.
3. Battery power.
4. Convenient for bench and field use.
As I was laying out this project and collecting
components to build the breadboard version, I kept adding
switches and changing the information I wanted to display.
From past experience, I also knew that once I had it built
and was using it, I would undoubtedly want to make more
changes to the inputs and display. This would result in
rewiring, drilling additional holes in my enclosure, and
possibly running out of pins on the selected processor.
To avoid this, I decided to use one of the intelligent
touch screen displays from 4D Systems. This would get me
a lot of design flexibility and a professional look. These
displays have been described in past articles in Nuts & Volts
(for example, in Thomas Kibalo’s article in the April 2012
issue) and also here in SERVO in previous Mr. Roboto
columns.
While these intelligent displays may cost more than a
handful of switches and LCD display screens, they can save
a lot of time — especially when you (or your customer)
haven’t settled on a design for the user interface. The
intelligent display only requires a serial port (two pins) from
the processor, and adding a button is only a software
change. No new wiring is needed for it, nor do you have to
drill any extra holes in your enclosure.
The display and servos I would be testing require five
SERVO 12.2015 31
Figure 1.
Servo
signal.
Post comments on this section and find any associated files and/or downloads at
www.servomagazine.com/index.php/magazine/article/december2015_Schmidt.
Take the Trial and Error Out
of Determining Servo Settings