Radio-controlled cars, boats, airplanes, etc use servos to control steering and other functions. The interface is well defined and the servos are quite affordable, so they are also used for robotics and other clever purposes. The servo positions itself based on the width of positive pulses fed to it. The rate at which pulses are sent to the servo is relatively unimportant(40 per second seems pretty typical).A servo motor has an output shaft that can be positioned by an encoded control signal. The motor drives the angular position of the controlled device.
Servo motors have three wires:
The control signal is used to control the angular position of the output shaft. This signal is encoded using PWM. The pulse duration determines the position of the shaft and as long as the code is present on the signal, the shaft position is maintained. The motor rotates the shaft in the shortest direction to the position indicated by the encoded signal then stops shaft rotation. Servo motor control signals typically have a 20 msec period. The duty cycle (Pulse width modulation (PWM for analog output applications)) of the pulse within the period encodes the shaft position:
-45° rotation is achieved with a 1 msec pulse; a duty cycle of 5%
0° rotation (the neutral position) is achieved with a 1.5 msec pulse; a duty cycle of 7.5%
+45° rotation is achieved with a 2 msec pulse; a duty cycle of 10%
This is also known as PCM (Pulse Coded Modulation). With servo motor control, the width of the pulse is a code representing a desired shaft position.
The pulse width is typically 1 to 2 milliseconds long for 90° motion, but most servos can do more. The midpoint is usually at 1.5 ms. Short pulses turn the horn clockwise (at least on the servos I've tested.) The pulses are sent every 20 milliseconds or so. RC servos don't seem to be too picky about the space between pulses. This can be seen in the picture below:
Servos are constructed from three basic pieces, a motor, a feedback device, and a control board. In R/C servos the feedback device is typically a potentiometer (variable resistor). The motor, through a series of gears, turns the output shaft and the potentiometer simultaneously. The potentiometer is fed into the servo control circuit and when the control circuit detects that the position is correct, it stops the motor.