Hackaday Dictionary: Servo Motors

How do you make things move? You add in a motor that converts electrical energy into motion. That’s a simple idea, but how do you know where the motor is? That’s where the servo motor comes in. By adding a sensor and a controller to the mechanism, these motors can figure out how far they have rotated and maintain that setting without any need for external control.

A disassembled servo motor showing the controller, motor, rotary encoder and gears. By oomlout - SERV-05-ST_TEARDOWN_03, CC BY-SA 2.0
A disassembled servo motor showing the controller, motor, rotary encoder and gears. By oomlout, CC BY-SA 2.0

What is a Servo Motor?

These neat devices can be large or small, but they all share the same basic characteristics: a motor connected to a gearing mechanism and an encoder that detects the movement and speed of the motor. This combination means that the controlling device doesn’t need to know anything about the motor itself: the controller on the servo motor handles the process of feeding the appropriate power to the motor until it reaches the requested position. This makes it much easier to build things with servomotors, as the designer has already done all the hard work for you.

The first place that most people encounter a servo motor is in the small hobby servos that are used in remote control vehicles. Manufactured by companies like Hitec and Futaba, these drive a gear or arm that transfers the rotation of the motor to perform tasks like turning a wheel to steer a car, moving a control surface on an RC plane, or any task that requires a small range of motion at high precision. The gearing in the servomotor offers more torque than connecting the shaft directly to the motor. Most hobby servos of this type are restricted to a certain range of motion (usually 180 degrees) because the position encoder is a simple potentiometer connected to the output shaft.

A selection of different sized servo motors. By Osamu Iwasaki
A selection of different sized servo motors. By Osamu Iwasaki

Servomotors usually have three connection wires: a power line, a ground line and a signal line. The signal line is fed a pulse width modulation (PWM) signal that determines the angle that the servomotor moves to. As the name suggests, the length of the pulse (or the width, if you look at it on an oscilloscope) is the thing that controls the angle that the servo moves to: a short pulse (1 millisecond) sets it to the zero angle, while a long pulse of 2 milliseconds sets it to the maximum angle. A pulse length between these two limits signals the servomotor to move to the corresponding angle: 1.5 ms would set it to 90 degrees.

It is important to note that servomotors and stepper motors are not the same thing. Both are used for positioning, but steppers usually run without feedback. Instead, steppers turn (as the name suggest) in discrete steps. To figure out where a stepper motor is requires a limit switch, then driving the stepper until this is triggered. Then if you keep count out the number of steps that it’s traveled, you know where it is. That’s why devices like inkjet or 3D printers will move to their limits when they start up, so the controller can detect the far limit of the mechanism being driven, and calculate the current position from that.

How Do You Use A Servomotor?

Because the designers of servomotors have done most of the hard work for you, servomotors are very easy to use. To drive them, you just need to feed them power (usually 5V) and feed the PWM signal to the servomotor. You can drive them directly from an Arduino or similar microcontroller using a library that converts an angle into a PWM signal on one of the output pins.

Each servomotor requires a dedicated output pin if they are being driven this way, though, so if you are driving a lot of servomotors, a dedicated controller makes more sense. Devices such as the Adafruit Servo Shield and the Pololu Maestro allow you to control multiple servos from a single output pin on the microcontroller: the microcontroller sends a signal to the device addressing each servo in turn, and the device converts this into the PWM signals for each. If you need to drive a lot of servos, the SD84 can control up to 84 servos at once from a single USB port.

(Headline image bots: µBob and Hexapod4.)

The Voice Recognition Typewriter

Typewriters with voice recognition have existed for over one hundred years; they were called secretaries. Robots are taking all the jobs now, and finally dictation and typing is a job that can be handled by a computer. [Zip Zaps] used an old Smith Corona typewriter to automate the process of turning dictation into print. Like a secretary hunched over an anachronistic IBM Selectric in the first season of Mad Men, this robot will take dictation and accept the overt sexism of a 1960s Manhattan ad agency.

Instead of the machinations of a few biological actuators, this typewriter is controlled with an array of servos driven by Pololu Maestro servo controller. There are twelve servos that move a small actuator down onto the keys, and another twelve servos that move the others above the correct row of the keyboard. The carriage return lever is actuated by a stepper motor, linear rail, and giant plastic lever.

While a robot that can use a typewriter is impressive, the real trick is getting it to take dictation. [Zip Zaps] used the built-in voice recognition found in Windows for this, streaming characters over a serial port to the Arduino-based electronics.

Does it work? Yes, surprisingly it does. Is it useful? Well, typewriters naturally have a cleaner, more analog tone about them, and you can’t replicate the typing experience of an old Smith Corona typewriter with a digital format. This build is just the natural extension of what digital electronics are capable of these days, and we look forward to seeing someone with this amazing device in our local Starbucks.

Continue reading “The Voice Recognition Typewriter”

Brushed DC Servo Drive

Brushless DC motors, and their associated drive electronics, tend to be expensive and complicated. [Ottoragam] was looking for a cheaper alternative and built this Brushed DC motor servo controller and the results look pretty promising. Check out the video after the break.

He needed a low cost, closed loop drive for his home-brew CNC. The servo drive is able to supply a brushed DC motor with up to 7 A continuous current at up to 36 V which works out to about 250 W or 1/3 HP. It does closed loop control with feedback from a quadrature encoder. The drive accepts simple STEP and DIRECTION signals making it easy to interface with micro controllers and use it as a replacement for stepper motors in positioning applications. All of the control is handled by an ATmega328P. It takes the input signals and encoder data, does PID control, and drives the motor via the DRV8701 full bridge MOSFET driver. There’s also some error detection for motor over-current and driver under-voltage. Four IRFH7545 MOSFETs in H-bridge configuration form the output power stage.

This is still work in progress, and [Ottoragam] has a few features pending in his wish list. The important ones include adding a serial interface to make it easy to adjust the PID parameters and creating a GUI to make the adjustment easier. The project is Open Source and all source files available at his Github repository. The board is mostly surface mount, but the passives are all 0805, so it ought to be easy to assemble. The QFN footprint for the micro controller could be the only tricky one. [Ottoragam] would love to have some beta testers for his boards, and maybe some helpful comments to improve his design.

Continue reading “Brushed DC Servo Drive”

Adorable Quadruped Robot Hops and Walks

The ESP8266 is finding its way into all sorts of projects these days. It’s a capable little device, to be sure, but we’d have to say that finding it running a quadruped robot that can hop and run was a little unexpected. And to have it show up in such an adorable design was pretty cool too.

From the looks of [Javier Isabel]’s build log, he put a lot of thought into [Kame]. All the body parts and linkages are 3D printed from PLA, with the nice touch of adding a contrasting color. The legs are powered by eight high-speed Turnigy servos, and good quality bearings are used in the linkages. A NodeMCU runs the show with custom oscillator algorithms that control the various gaits, including the hopping motion. The BOM even lists “Adhesive 12mm diameter eyes” – perhaps that’s some sort of slang for the more technically correct “googly eyes.”

Built primarily as a test platform for studying different gaits, there doesn’t seem to be much in the way of sensors in [Kame]’s current incarnation. But with an ESP8266 under the hood, the possibilities for autonomous operation are good. We look forward to seeing where this project goes next. And we kid about the cuteness factor, but never doubt the power of an attractive design to get the creative juices flowing.

We’ve covered a lot of quadruped robots before, and a lot of them seem to trend toward the cute end of the spectrum. Check out this baby-quad that’s learning to walk or this quad that thinks it’s a puppy.

Continue reading “Adorable Quadruped Robot Hops and Walks”

Old School Gauges Let You Know Which Way the Wind Blows

When your passion is a sport that depends on Mother Nature’s cooperation, you need to keep a close eye on weather conditions. With this in mind, and not one to let work distract him from an opportunity to play, [mechanicalsquid] decided to build a wind-monitoring gauge with an old-school look to let him know when the wind is right for kitesurfing.

old-school-meter-for-windBeing an aficionado of big engineering helped [mechanicalsquid] come up with a style for his gauge – big old dials and meters. We hesitate to apply the “steampunk” label to every project that retasks old technology, but it sure looks like a couple of the gauges he used could have been for steam, so the moniker probably fits here. Weather data for favorite kitesurfing and windsurfing locales is scraped from the web and applied to the gauges to indicates wind speed and direction. [mechanicalsquid] made a valiant effort to drive the voltmeter coil directly from the Raspberry Pi, but it was not to be. Servos proved inaccurate, so steppers do the job of moving the needles on both gauges. Check out the nicely detailed build log for this one, too.

For more weather station fun be sure to check out this meter-based weather station with a slightly more modern look. And for another build in the steampunk style, this vintage meter and Nixie power display is sure to impress.

Video Gives you the Basics of DIY Rotary Encoders

Is it really possible to build a rotary encoder out of a flattened tin can and a couple of photodetectors? Sure it’s possible, but what kind of resolution are you going to get from such a contraption? Is there any way that you’d be able to put them to work in a DIY project like a CNC router? If you pay attention to the basics then the answer is yes, and [HomoFaciens] wants to prove that to you with this detailed video on homebrew encoder design.

Faithful Hackaday readers will no doubt recognize [HomoFaciens] from a number of prior appearances on these pages, including this recent hardware store CNC router build. When we first ran across his builds, we admit a snicker or two was had at the homemade encoders, but if you watch the results he manages to get out of his builds, you quickly realize how much you can accomplish with very little. The video is a primer on encoder design, walking you through the basics of sensing rotation with phototransistors, and how a pair of detectors is needed to determine the direction of rotation. He also discusses the relative merits of the number of teeth in the chopper; turns out more isn’t necessarily better. And in the end he manages to turn a car wiper motor into a high-torque servo, which could be a handy trick to have filed away.

Continue reading “Video Gives you the Basics of DIY Rotary Encoders”

A Tiny Servo Motor Controller

If you’re building a moving thing with a microcontroller, you’ll probably want to throw a servo controller in the mix. Driving a servo or two with a microcontroller takes away valuable cycles that just babysit the servo, making sure all the PWM signals are in sync. The thing is, most servo controllers are a massive overkill, and you don’t need that much to control a few servos over a UART. The proof of this is an attiny13 servo controller over on hackaday.io.

[arief] developed his tiny servo controller around one of the tiniest microcontrollers – the ATtiny13. This chip has just 1kB of Flash and 64 Bytes of RAM, but that’s enough to keep a few servos going and listen in to a UART for commands to drive the servo.

The construction of this servo controller board is simple enough – just a single sided board, microcontroller, and a few headers, caps, and resistors. Commands are sent to the ATtiny through a half duplex UART we covered before, with servos responding to simple serial commands.

If you’re building a robot army, this is the board to make. You’re going to need a high-powered controller to take over the world, but there’s no need to bog down that controller by babysitting a few servos.