Servomotors and Managing Current

CS 480: Robotics & 3D Printing Lecture, Dr. Lawlor

Interfacing with R/C Servos

Radio controlled servo, showing white, red, and black
      wires.
An R/C servo is an inexpensive (about $10) device that includes a DC motor, geartrain to increase the motor's effective torque, and a position sensor that allows you to command the position of the output shaft.  They're frequently used for small robot arm and gripper tasks.

In class, we demonstrated a clone of the MG995, a heavier duty servo with metal gears.  Like all common servos, it takes a 1-2 millisecond command pulse on the white wire to specify the desired angle of the output shaft, from 0-180 degrees.

#include <Servo.h>

Servo s;

void setup() {
Serial.begin(9600);
Serial.println("Enter angle in degrees");
s.attach(8);
}

void loop() {
if (Serial.available()) {
int i=Serial.parseInt();
if (i>0) {
Serial.print("Seeking to position ");
Serial.println(i);
s.write(i);
}
}
}

Servo Size

There doesn't seem to be any truly standard sizes for servos, although they all have similar proportions, and the midrange 40.5mm x 20mm profile is nearly standard.  There's a searchable database of servos on the market today.

Style
Length / overall
Thickness
Height / overall
Diameter of output shaft
Mass
Rated torque/speed
Speed to track 60 degrees
Voltage
"Giant" (Hitec HS-805BB)
65.8
30
57.4
10mm
153g
20 / 25 kg-cm
0.19 / 0.14
4.8 / 6.0 volts
"Standard"
(MG995 or MG946)
40.5 / 54 mm
20mm
28.5 / 43.5 mm
5.9mm
50g
10 / 15 kg-cm
0.18 / 0.16 seconds
4.8 / 6.0 volts
"Mini"
28.8 / 40.44 mm
13.5mm
22 / 36.5 mm
5.7mm
20g
5 / 6 kg-cm
0.20 / 0.16 seconds
4.8 / 6.0 volts
"Ultra micro" (HK-5320)
13.5 / 20 mm
6.3mm
10.5 / 18.9 mm
2.9mm
3g
0.05 / 0.075 kg-cm
0.07/0.05 seconds
2.8/4.2 volts


Current Distribution

One recurring issue in robotics is reliably supplying enough current to drive your motors--big DC motors are some of the most current-hungry and electrically noisy devices available today.  In class, we showed how an Arduino can reliably command an MG995 servo for short distances, but long-distance rapid moves cause enough electrical disturbance to reboot the Arduino when the servo is drawing its power through the Arduino's 5V regulator.

The solution is to add a current supply capable of sourcing more amps, such as a Lithium-Polymer (lipo) battery.  If you pull out one cell (3.5-4.2 volts), for example via the battery balance pins, you can wire this directly to the servo's red +5V input, as long as you have a shared ground connection. 

More generally, for large robots supplying and distributing sufficient electrical current can be challenging, requiring thick wires or even solid conductor bus bars.  For our robot mining robot, we run solid aluminum channel from the battery bus to supply the motor controllers, which stall at 40 amps per motor!