M31_servoOpener

Servomotors do the heavy lifting in countless robotic, animatronic, and other projects, and because they’re so visible, it’s easy to overlook the role played behind the scenes by their controllers. Your choice of servos for any given project will boil down to the mechanical force you require and the physical size you have room for, and you can buy servos that range from very small to large and powerful. But with servo controllers, the selection criteria are more complex, and include the following questions:

  • How many servo motors will you need to control?
  • Will activation be triggered manually or by an external signal?
  • What’s the nature of the triggering signal (continuous, momentary, etc.)?
  • Do you need programmable on-board memory?

Meanwhile, you can also program a general-purpose microcontroller to control servos. For example, Arduino’s built-in servo library lets you control 2 servos from your code by connecting their signal wires to I/O pins 9 and 10. This is good for some projects and a nice way to experiment, but for other uses, dedicated servo controllers offer a simpler, smaller, and more elegant solution.

Project Steps

How Servomotors Work

Tod E. Kurt’s primer on servomotors in MAKE Volume 19 (page 140) provides a good introduction to how these versatile and inexpensive gearmotors work. To review, you use a 3-wire interface — power, signal, and ground — to make a servo rotate to any position along a 180° radius. Inside the servo, a potentiometer on the motor’s driveshaft connects to control electronics that read the driveshaft’s current position and move it to where the signal wire tells it to go.

The signal wire conveys its desired position using pulse-width modulation (PWM). Specifically, HIGH pulses are sent every 20 milliseconds (ms), where a 1ms pulse means rotate fully counter-clockwise, 1.5ms means point straight ahead, and 2ms means rotate fully clockwise. If this signal stops, for example if the power is cut off, the motor will de-energize but will typically stay in its last position.

Manual Controllers

Let’s begin with the simplest controller: with a single-driver manual controller, you control servo actuation manually by rotating a potentiometer knob, and the servo follows the knob’s rotation. This driver is useful for simple automation where you can see the mechanism involved and need to control the servo’s direction and speed by hand.

M31_SklBld_06

A typical example would be a servo mounted in the cab of a model steam shovel and configured so that the shovel moves up and down as you turn the knob (above). A single-driver manual controller can also serve as a quick and easy way to test whether a servo is functioning properly.

FigB

You can easily build this basic type of controller out of a 555 timer chip; The Manual Servo Driver Circuit schematic shows a typical example, and you can find many variants online. You can do all the wiring in a couple of minutes on a solderless breadboard, or solder it onto a bit of perf board for something smaller and more permanent. Hansen Hobbies sells a kit that’s quite similar, based on a 556 dual timer chip (below).

M31_SklBld_servo-02

FigD

You can use a single manual driver to activate more than one servo by switching its signal line. The Single Driver Circuit schematic (above) shows this circuit configuration with 2 servos, but you can control as many as you want, based on the number of switch positions you have. The main limitation with this arrangement is that you can only activate one servo at a time.

M31_SklBld_servo-01

Staying with the manual style of activation, dual-driver controllers like the Robotzone 902MSD from ServoCity (above) control 2 independent servo drivers simultaneously from one board. Obviously this lets you manually operate 2 servos at a time, but you can also configure the 2 outputs to control a single servomotor in ways that aren’t possible with a single-output driver. For example, you can set driver 1 for servo position A and driver 2 for servo position B, then switch the servo signal lead between them. This moves a servo from A to B in a way that mimics the action of a solenoid, but is smoother, more controllable, and more realistic when used in props.

FigF

The servo signal lead can be switched manually or by relay, which opens up as many control possibilities as there are devices that can operate a relay. The schematic above, for example, diagrams a circuit that moves a servo between 2 preset positions based on input from either a sensor (such as an IR photodetector) or a toggle switch.

If you want 2 servomotors to simultane-ously make the exact same movements, you can connect their signal inputs to share the same driver output. The signal will still work if you split it; you don’t need a dedicated driver for each motor. The photo below shows a typical application of this: a model railroad transfer table on which 2 motors move a length of track (with a train on it) back and forth from one set of tracks to another.

M31_SklBld_TRNXFRTBL05

Programmable Controllers

At the next level of servo driver complexity, programmable controllers store a single servo action (defined by a start position, end position, and speed), and then trigger that action automatically. A switch on the board lets you set the trigger mode to respond to either momentary or continuous-on input.

With momentary, which is more frequently used with pushbutton or sensor input, the servo automatically returns to its start position after moving. A magnetic reed relay sensor detecting a train car passing by is a typical example, or input from an IR detector or inductive current sensor. With continuous triggering, like from a flipped toggle or slider switch, the servo remains in its end position until the input turns off.

To program the servo’s start, end, and speed settings, you follow a programming sequence using small buttons onboard the driver. The specific sequence you need to follow depends on the driver board you’re programming, but it’s generally a simple process.

M31_SklBld_servo-04

FigI

The Singlet controller from Tam Valley Depot (above) is a basic programmable single-driver controller with a small footprint (1-1/4″×1-1/4″) that makes it easy to hide. The schematic shows how to configure it to support an automatic culvert unloader triggered by a long-lever micro switch mounted sticking up alongside a model train track. When a train car backs up to the ramp, its body closes the switch. This initiates the servo to tilt the ramp upward and unload the cargo into the car (below).

M31_SklBld_08

M31_SklBld_08a

For more complex projects, we move up to a programmable 4-channel controller like the Quad-Pic from Tam Valley Depot (below). Measuring 3″×2.75″, this unit provides 4 servomotor drivers that you can program independently, and by configuring them to trigger each other, you can make them perform coordinated routines.

M31_SklBld_04

FigL

The schematic above shows a circuit that uses this controller for a model-loading platform in which a series of servo-operated paddles push barrels up a ramp. The ends of the servo horns opposite the paddles click 3 micro switches (SW1, SW2, SW3) in sequence, in each case actuating the next servo in line until all 4 servos have moved to their maximum clockwise position. The fourth servo then closes the last micro switch, sending power to the auto-reset relay. This causes the cycle to repeat, after a short delay determined by the value of the supercapacitor. Thus, a full load of barrels is conveyed one-by-one up the ramp (below).

M31_SklBld_TRNBRLDR021

Computer-Programmable Controllers

For the greatest flexibility and complexity, computer-programmable multichannel controllers like the Maestro USB series let you write control scripts that define any sequence of actions that you want each servo to perform. The 6-driver, postage-stamp-sized Micro Maestro (below) could control a barrel-loading sequence like the one above without needing any switches. Just trigger it, and the Maestro follows through with its sequence of commands for all the servos. Larger Mini Maestro controllers can handle 12, 18, or 24 individual drivers.

M31_SklBld_servo-03

The Maestro drivers make servo control invisible, which is cleaner but possibly less fun to watch, so it depends on what you want. You program the sequences on a PC using the Maestro software, then connect your computer to the Maestro board to upload your control scripts — the same basic procedure as with an Arduino. But these special-purpose servo driver boards let you control more servos from smaller hardware than an Arduino, and use a simple, servo-specific scripting language. I built my original barrel loader using a Micro Maestro, but then decided to go old school with the switches and Quad-Pic because many model train enthusiasts prefer it that way.

Your choice of servo controller is just as important as your choice of servomotor. You have to consider the nature of the signals that you want to initiate the servo actions, and how many servos you need to control. There aren’t as many servo controllers to choose from as there are servos, but even with the relatively limited number, there will still be at least one that’s right for your project.