Servos are extremely useful components and have a wide range of uses in robotics. Essentially they are motors which can be sent angle commands, to which the servo will try to turn its output shaft. They can provide very high amounts of torque for their small size/weight, and so are useful in applications such as robotic arms.
How They Work
A servo has a few main parts:
- Potentiometer (variable resistor) with rotating knob
- Control Circuitry
A servo tries to turn its output to the angle specified by the signal in. It does this using control circuitry, which compares the current position to the command position. If there is an error, the circuit will power the motor so that the output shaft moves towards the correct angle.
To measure the angle, the output shaft is connected to a potentiometer inside the servo. This will output a voltage proportional to the output angle, which is then read by the control circuitry. Precise control of the output shaft is made possible by the gearbox used. This has a high ratio, so a large number of rotations of the internal motor results in a small change in angle of the output shaft. This also gives great torque capabilities.
How to Use a Servo
Servo commands are sent using Pulse Width Modulation (or PWM). This means simply that servos know what angle to turn the output shaft to by measuring the width of the last pulse received; the information is encoded into the size of the pulses. Here's how to convert between pulse width and angle:
|Pulse Width (ms)||Angle (deg)|
Pulses are short intervals where the servo signal is set to 5 volts; the rest of the time the signal will be 0V. They should be sent at a rate of around 50Hz for best performance.