Servo motors
A servo motor is a motor with a built-in control system. The servo’s output shaft has a geared wheel, to which various arms and wheels can be attached. The control system knows the position of the shaft, and uses feedback to control the motor and correct it’s position. This allows servo motors to work more precisely, and in a different way, than conventional DC motors, and for example, to position an arm to a precise angle from 0-180°.
Instead of directly controlling the motor in a servo, they are controlled by specifying a desired outcome to the servo electronics. The electronics measure the angular position of the output shaft, and compares the actual angle with the desired one. If they don’t match up, it uses the motor to turn the shaft in the right direction until the correct angle has been reached. After that, the engine stops and the servo rests.
The comparison of actual and desired angle (feedback) is done constantly – if some external force should move the shaft, the servo senses it and corrects the error straight away. A servo can thus resist movement or hold up a weight by constantly correcting the faults introduced from outside.
The automation of servo motors makes it easy to build robots and machines that can do more specific things than regular rotating motors. Some examples are opening and closing hatches, drawing pictures, positioning a camera, etc. By using different types of arms and gears, one can easily make lots of different movements possible, and with multiple servos, objects can be moved and positioned in multiple dimensions.
Servomotors are often simply called servos or hobby servos/RC servos.
The control signal
{class=right}
The control signal for standard servos consists of a digital PWM signal (Pulse Width Modulation), where the duration of the high pulse corresponds to the angle to which you want the servo arm to be rotated.
The total pulse period is usually 20ms (50Hz), and the high-pulse portion is between 1–2ms long. A 1ms high pulse usually corresponds to an angle of -90°, whilst 2ms corresponds to +90°. 1.5ms is the neutral position (0°).
Pulse lengths are often written in microseconds, e.g. 1500 µs for the centre position.
There are also servos with angle ranges other than 180°, e.g. 120°. The control scheme, however, remains the same.
The electronics in the servo
The motor in the servo is a standard DC motor, which operates at fairly high speeds. The motor is connected to a gearbox, which reduces the rotational speed to achieve greater precision and higher torque. On the other side of the gearbox is the output shaft – the one to which we can attach arms, wheels and other components. A potentiometer is coupled to this, which produces a varying voltage when its ‘knob’ is turned by the output shaft. The voltage corresponds to the servo’s position.
The electronics compare the shaft’s actual position with the desired position. If these do not match, the electronics drive the motor in the required direction until the shaft (and the potentiometer) is in the correct position. Once the shaft is in the correct position, the motor stops rotating.
There are two different types of electronics, known as analogue or digital – read more about them below.
Servo connectors
Servo motors need three things to work: a supply voltage, ground, and the control signal. These are connected using a standardised servo connector, which is a regular female connector with a 2.54mm pitch. The connector can be easily connected to breadboards for experiments, special servo connectors on controllers, or extended using special servo extension cables.
To ensure the connector is connected the right way round, the wires are colour-coded. The colours are usually brown, red and orange. Another combination is black, red and white. Brown (or black) is ground, red is power supply, and orange/white is the control signal.
There are also other connectors for servos. One is called Futaba J, and is similar to the standard ones with a 2.54mm pitch, but it has a protruding part to prevent incorrect connection. Some large, advanced servos have circular connectors with many pins.
Servo specifications and types
Power supply
Servos are always powered by direct current (DC). The power supply is usually specified as a range. Certain voltages have been standardised, meaning that almost all servos are compatible, at least in terms of power supply.
Regardless of a servo’s specified voltage range, it is generally the case that servos have significantly more torque when powered by higher voltages. Many servos will operate at voltages lower than the specified range, but with significantly reduced power and speed.
The most common supply voltage for servos is the 4.8 to 6V range. Both 4.8 and 6V are ‘logical’ choices when using NiMH batteries, and are available with four and five cells in series respectively. NiMH batteries and servos are often used together in radio-controlled cars, aeroplanes and similar models.
Another common voltage range is 4 to 8.4V.
Power consumption
The power consumption of a servo depends on how hard the motor is working. Three different consumption values are often specified: one where the servo is not working (idle current), one where the motor is running without load (running current) and one when the motor is running at full power and is completely stopped (stall current). The idle current consists of the power consumption of the control electronics.
Many servos can draw several amps when working hard, which means that proper power supplies and decoupling are required.
Torque
One of the more important specifications for servos is torque. A higher torque means that a servo is stronger. Torque is normally specified as the force required to stop the servo, known as holding force or stall torque. Two values are usually given, usually for two voltages, e.g. 4.8 and 6V. The unit is kg/cm, and indicates how many kilograms a servo can lift with a 1 cm radius (e.g. with a string attached to an arm 1 cm out from the centre of the shaft).
If you double the length in cm, you get half the weight instead, and so on. A servo with 10 kg/cm can therefore lift 1 kg with an arm that is 10 cm long, and so on. Knowing exactly what you need may require a bit of maths, but it is not really that complicated. When it comes to torque, more is always better.
Speed
Speed is specified as the time it takes for a servo to rotate the shaft 60° without a load. Small servos with lower gear ratios (and lower torque) are often faster. Typical speeds range from approximately 0.1 to 0.25 seconds.
Digital and analogue servos
Servos are sometimes divided into analogue and digital types. This has nothing to do with serial protocols (more on that below) – both types of servo can be controlled using the same PWM signal. The principle is the same: the servos look identical, come in the same sizes and have the same shaft. The difference lies in how the electronics process the control signal and the feedback from the potentiometer.
Analogue servos control the motor using a PWM signal with pulse frequencies around 50Hz (20ms pulse period). The relatively low speed means that the servo electronics have low ‘resolution’ in terms of time. The result is that analogue servos cannot react as quickly to a changed signal or to external forces acting on the shaft. 20 ms is not a long time for us, but for a servo that needs to correct movements, it is a relatively long time. Analogue electronics result in slower reaction times, reduced precision and a lower ability to counteract external forces, simply because the servos react more slowly.
Digital servos operate much faster internally. A common frequency is 300Hz, but higher frequencies up to 500Hz are also available. The electronics work in the same way, just faster. The result is a shorter reaction time, a better ability to make small adjustments – higher precision – and much better holding strength.
However, not everything is better with digital servos. They cost more, draw more power both on average and especially in short bursts. The demands on the power supply are therefore higher, with associated costs, weight and space requirements. For general use, standard analogue servos are therefore often perfectly adequate and perhaps a better choice.
Sizes
Servos come in several different sizes. Put simply, there are small, medium and large. Larger servos are more powerful, but of course also heavier and take up more space. Certain sizes are common, though the exact dimensions may vary slightly between manufacturers. The dimensions given are for the body, i.e. excluding the shaft and mountings. There are often extra-powerful servos in a particular size, which have the same dimensions in terms of mounting/fastening, but are taller.
Larger servos may have bigger motors and gearboxes as well as sturdier mountings, and are generally, all else being equal, stronger than the smaller ones.
Nano: approx. 20x8.6x17 mm; Micro: approx. 22x12x27 mm; Standard: approx. 40x20x38 mm; Giant: approx. 59x29x50 mm
Gearbox
The task of the gearbox is to reduce the speed and increase the torque of the small, fast and weak DC motor located in the servo. Gearboxes come in several different materials, with different characteristics. Servos always ship with a gearbox, but they can also be replaced if the previous one wears out, or if you want to upgrade.
The main difference between the different materials is the wear resistance – the gearbox is not only worn by intentional loads, but also by external forces. Another difference is the noise level, which may be worth keeping in mind for the servos that will be used in the home and other indoor environments. 3D printers and robots of various kinds are more pleasant to have running if they don't make as much noise!
The most common material in servo gearboxes is nylon. Nylon is lightweight, inexpensive, has low friction and yet is relatively strong. It is found in inexpensive general purpose servos, and has a relatively long service life. However, it cannot withstand high torques.
Another type of composite used in gearboxes is carbonite, which is more durable than nylon.
Gearboxes are also made of different metals metal. Both aluminum and brass (or combinations of them) are common. They are much more durable than nylon and carbonite gearboxes, but also slightly heavier. Metal gearboxes are normally quieter than plastic gearboxes.
The next step up is gearboxes made entirely of steel. They are even more powerful than those in brass/aluminum, and heavier. Finally, there are titanium gearboxes, which are lighter but stronger than steel – but also very expensive.
Horns and shaft types
Arms and wheels of various kinds can be attached to the gears of the output shaft. They are known as horns, or servo horns. A set of horns is often included with servos. They are available in both plastic and metal, in different lengths and designs. The horns are mounted on the output shaft, and can be angled relatively freely. Although we talk about angles when we discuss controlling servos, we are referring to the output shaft and not the horns – the servo can’t know what is attached to the shaft.
There are several different sizes of output shaft gears. The various gears are called splines – somewhat confusing as the teeth (cogs) on the gears may also be called splines. Most often, however, the teeth are simply called teeth.
The shaft types are divided according to the number of teeth and the outer diameter of the shaft. What axis a servo has depends, among other things, on the size – small servos usually have a small axis – but also on how powerful the servo is. Here are some of the most common output shafts, from small to large:
| Diameter (mm) | Number of teeth | Name |
|---|---|---|
| 4 | 15 | A15T / A1 |
| 5 | 25 | B25T / B1 |
| 5.6 | 24 | C24T / C1 |
| 6 | 25 | H25T / 3F |
| 7.6 | 15 | D15T / D1 |
In addition to the usual horn that often come with the servos, you can buy holders and fasteners for special purposes, e.g. wheels (for use with continuous servos), grabbing claws and gears of different sizes. There are also brackets for mounting other servos, so that you can create movements in several dimensions.
Motor type
There are three main motors in the servo - that is, the DC motor located inside the servo. Most common is a regular DC motor with brushes, core, stator and rotor. They come in all different sizes, and are cheap and suitable for general purpose use.
Another type is coreless motors, which is a type of motor without an iron core. They work according to the same principle as DC motors, with brushes and commutators, but are lighter because the weight of the iron core has been saved. Coreless motors have lower inertia, resulting in faster starts and stops, higher precision and lower noise. A disadvantage is that they overheat more easily than ordinary brushed DC motors.
Lastly, there are brushless DC motors (BLDC). They have no bristles, which provides long life and quiet running. BLDC motors often have high precision and high efficiency (efficiency). The disadvantages are mainly that they require more complicated peripheral electronics and thus cost significantly more.
More on control
As mentioned, the most common control scheme is PWM control within 1000-2000 microseconds, with 1500us as the middle position. Some servos expect other intervals, e.g. 900 - 2100uS, which may require the reprogramming of microcontrollers, e.g. Many servos can handle greater angles than stated, e.g. -10° to 190°, by simply sending shorter or longer pulses than 1000-2000 milliseconds. However, this may damage the servo, so always consult the datasheet or product description before trying.
The pulse period can also vary, and different servos can handle different intervals. The allowable period length is usually specified in ms, and can be very short, to around 3ms in some digital servos, or up to 30ms or more in some types. The period is often called the frame rate.
The Deadband
All servos have a certain “resolution”, a minimum change in pulse width required for the servo to move the motor. The name of this is the dead band, and is usually in the order of 3-5us. If the pulse width is 1500 microseconds and increases to 1502us, then many servos will not do anything different – a bigger change is required for it to be perceived as a new angle.
Without the deadband, small variations in the pulse width (from noise) would cause the motor to constantly make small adjustments, which would both draw current and cause wear.
Serial control
There are also servos that can be controlled serially. One variant is to use CAN-Bus, which is used in vehicles and many other contexts. Some variants based on CAN are, for example, DroneCAN and UAVCAN. The servo manufacturer Futaba has also developed its own serial protocol for servos, S.Bus, as well as S.Bus2, which is bidirectional (can retrieve data from sensors, among other things). There are also servos controlled with RS485.
A major advantage of serial protocols is that there is less cabling to handle, which in addition to saving time and money also saves on weight – crucial when servos are used in drones and other flying things.
In addition to the servos, other sensors that measure e.g. pressure, speed or battery voltage can coexist on a bi-directional servo bus. Serial protocols also do not require as many outputs on a control unit as when each servo has its own output.
360° servos
In addition to common, positional servos, there are also servos without any end stops, which rotate 360° continuously. They use the same control scheme as regular servos, but instead of determining an angle, the PWM signal determines a varying speed forwards or backwards. For example, continuous servos can be used with other electronics that replace the sensor in the servo, or simply with manual control.
In the middle position (e.g. 1500us), continuous servos should be stationary. On some models, finding a zero position where the servo stops completely is difficult, so the shaft will always rotate slowly in some diretions. Other 360° servos have a trimmer for adjusting the zero position. You simply send a constant 1500us signal to the servo and adjust until the servo is stationary.
Servos with external feedback
Some servos have an extra cable, connected to the internal potentiometer. With such, you get access to the position of the servo arm in the form of a voltage, which varies by a few volts. Exactly what voltages it moves between depends on the supply voltage and how the potentiometer is wired internally.
The servo still keeps track of and regulates the shaft position, but having access to the potentiometer still has its uses, for instance when controlling robots and other machines. With a feedback output, one may “record” servo movements and save them, by simply moving the servo arm while it is idle (without any control signal). Feedback from the servo also makes it possible to control the servo with higher precision, create slow movements with less choppiness, or use the information to calculate, for example, how hard a servo is working, how fast it can move, or whether it can withstand external forces.