۱۴۰۰-۹-۱۷، ۰۶:۲۳ صبح
Servo motors are used for robotic applications that require precision positioning. Before diving too deeply into the ways servos are used in robotics, it’s helpful to first learn about the basic function and form of these critical components of motion control.
What Is A Servo?
At its most elemental, a servo is a precise and powerful way of converting rotational motion into linear motion. A servo (or servo motor, as it’s sometimes known) consists of:
The Electronic Assembly, which consists of an AC or DC electric motor, a controller board, and a potentiometer.
The Case, which is the plastic housing for the motor and other components.
The Drive Gears, which reduce the motor’s high-speed output to a lower speed, higher torque servo output.
The Output Spline, which is attached to the output shaft and is the final interaction point between the servo and object of the motion it is creating. A good example is a servo in a remote-controlled airplane. The output spline of the servo might be attached via a control rod to a control surface such as an aileron or rudder. The motion of the servo would, therefore, cause an equivalent movement of the airplane itself.
How Does A Servo Work?
The servo receives a signal from a motion controller.
Depending on the pulse width modulation (PWM) of the input signal, the servo will rotate a certain amount. At rest, the output spline of a servo is usually at 0°. Based on an expected pulse frequency of 20 milliseconds (ms), a pulse width of 1.5ms will make the output spline rotate 90° in one direction. A pulse width of 2ms will make the output spline continue rotating 90° further to the 180° position. A pulse width of 1ms will make the output spline rotate 180° backward to the 0° starting position.
The potentiometer constantly monitors the position of the output spline. When the output spline reaches the desired position, the power to the motor is cut and the servo robot will hold that position until it receives a signal not to. While stopped in a given position, a servo motor will actively try to hold that position.
A key feature of servos is proportional operation. A servo motor will operate only as fast as it needs in order to rotate from its current position to its desired position. If a servo is stopped at the 180° position but needs to be at the 0° position, the motor will rotate very quickly to get there. If stopped at a position that is already closer to 0°, the motor will rotate much more slowly to get there.
How Are Servos Useful In Robotics?
Servo motors provide numerous benefits in I.M.M robotic applications. They are small, powerful, easily programmable, and accurate. Most importantly, though, they allow for near perfect repeatability of motion. They are used in robotic applications such as:
Robotic Welding: Servo motors are mounted in every joint of a robotic welding arm, actuating movement and adding dexterity.
Robotic Vehicles: Servos are used in the steering systems of the autonomous vehicles used to disarm and dispose of bombs.
The RC Servo or Hobby Servo has been used to move the control surfaces of Radio-Control (RC) model aircraft for many years. It has since become very popular for driving the limb joints of small humanoid robots, and when converted for continuous rotation, the wheels of mobile robots. However, some features optimal for aircraft control are less than ideal for industrial robots. First, let’s get the terminology straight:
The term Servo is short for Servomechanism, a device that uses internal feedback to ensure that its mechanical output follows an input control setting. That’s what I’m talking about here.
A servo motor is the source of motion in a servomechanism, in this case, a small PMDC motor.
A Servomotor is usually a PMDC motor optimised for use in a servomechanism, perhaps featuring rapid acceleration and built-in feedback sensors. They tend to cost a lot of money are definitely not found in hobby servos!
These definitions are important, particularly when searching for suitable devices on the Internet. Use the search term ‘rc servo’.
This type of servo has a rotary output, but the shaft can only rotate a maximum of half a turn or 180°. With a lever called a ‘horn’ attached to the output shaft it can provide a linear push-pull action, hence its original purpose as an actuator for the flight controls of a model aircraft. Outwardly, all ‘standard’ size hobby servos look the same: a rectangular black plastic or alloy box with two sets of fixing lugs, a 3-wire flat cable connection with 0.1in pitch socket header, and a splined output shaft protruding from one side. The original standard size, for example
designed for fairly large radio-control model aircraft with IC engines, now sits alongside more compact versions termed ‘Mini’, ‘Micro’ and ‘Sub-Micro’. For really heavy applications there are sizes even larger than the standard.
All analogue servos are controlled in the same way: angular position is encoded in a constant repetition rate (50Hz) pulse train where the width of a pulse carries the information. A pulse width of 1ms corresponds to maximum anticlockwise while 2ms turns the servo to the maximum clockwise position. It’s often assumed that a servo will turn through 180° with these numbers, but that is usually not the case (see later).
This is usually incredibly weedy and cheap-looking because it has to fit into the case with a whole lot of other components. Fortunately, the gearbox which is necessary to reduce its rotational speed from about 6000rpm to an output in the region of 30rpm, also multiplies the torque available by the same factor.
A lot of gears have to be crammed in to achieve a reduction factor of about 180:1. Of course, the output shaft cannot rotate more than half a turn, so datasheets normally describe servo speed in terms of how long it takes to turn by 60°. For example, a typical figure might be 0.15 secs/60°. That rapid movement could be a problem when using servos to drive the joints of a legged 4 axis robot, 5 axis robot, or 6 axis robot. It does tend to make it lurch about like a mechanical toy but is easily solved by ensuring that movement from one angle to another doesn’t take place in one go. Instead, incremental changes in the PWM signal are made, each separated by a short delay until the target angle is reached.
All RC servos will deliver an impressive amount of torque thanks to the gears - even the Minis and Micros. A standard ‘power’ servo can have a torque figure of around 170N.cm measured at a distance of 1cm along the servo horn. That means, in theory, the servo can hold a weight of over 17kg hanging 1cm away from the output shaft. In practice, a basic low-cost servo with nylon gears and no proper shaft bearings is unlikely to last very long if asked repeatedly to apply its theoretical maximum torque. Load up a servo too heavily and you will soon hear the crunching sound of stripping gear teeth. For robust applications, servo manufacturers make more expensive versions of their products with metal (brass) gears and ball-bearings on the output shaft. Metal gears certainly won’t break easily, but they will wear, ultimately rendering the servo inaccurate due to all the ‘slop’ in the geartrain. They also add to the overall weight, and the increase in geartrain inertia slows the servo’s response to a change. Nylon gears might break if mistreated, but wear is negligible. Servos with gears made from an enhanced plastic formulation called Karbonite are now available offering light-weight, high-strength and long-life – at a price.
For a robot project, it’s very important to select servos with a good margin of torque. I have a toy/educational robot arm driven by mini-servos that’s prone to emitting loud buzzing noises and thrashing about wildly. I’m pretty sure the motors are not up to the task, load-wise.
It’s the electronics that turns a motor-gearbox set into a servomechanism with an operating principle based on feedback control. A potentiometer turned by the output shaft sets the pulse duration of a monostable triggered by the input control pulse. The two pulses are compared and the difference in duration between them provides an error signal to the motor driver circuit. The longer the error pulse, the faster the motor turns, slowing down as the error shrinks until it stops when the error reaches zero. Actually, the motor drive is cut off when a certain minimum error pulse width is achieved, introducing a short ‘deadband’ zone around the target position. The deadband stops the motor jittering once it has stopped, assuming any load has been removed. It must be remembered that with this type of servo, there is no ‘holding force’ applied once the target angle is reached. It means they are not very good for lifting weights and holding position against the force of gravity. They work best with horizontal applications, for example, moving a locking bolt backwards and forwards to unlock and lock a house door. Residual load will cause the motor to keep starting and stopping as it moves in and out of the deadband trying to hold position. This has two consequences: an annoying buzzing sound/vibration, and ultimately the motor windings burning out due to the high stall current flowing. It’s something to be borne in mind when designing a legged robot: make sure the servos are not under heavy load when it’s stationary.
Until recently, the circuits in an RC servo were always analogue; digital servos are available now with a microcontroller doing most of the processing. Going digital improves speed and accuracy by working with a higher PWM frequency: 300Hz, up from the original 50Hz. Digital servos are also faster to react because the microcontroller can drive the motor at high-speed right to the target angle, rather than ramping down to a stop. The downside is a potential drop in reliability by siting a complex digital chip right next to a major source of electrical interference: a PMDC motor!
The format of the control signal which determines the servo position is shown in Fig.2. It may seem over-complicated; why not after all, just use a variable voltage? What we have here is a method of encoding data called Pulse Width Modulation (PWM) used to modulate a Radio Frequency (RF) carrier for a wireless communications link. It all comes back to the original application for the hobby servo – radio-controlled model aircraft. Perhaps confusingly, PMDC motors can be driven directly by a PWM format signal with the pulse-width determining the motor speed. See my article ‘Spinning the Wheels’ for more information.
Earlier I suggested that the output shaft of an RC servo will turn through 180°, but as you can see from Fig.2, the standard pulse width limits of 1 and 2ms only give you about 120°. This seems to be the rule with all the servos I’ve tested and while it may be OK for moving a model aircraft control surface, it could be a handicap for a humanoid robot. Fortunately, by reducing the minimum pulse width to 0.6ms and increasing the maximum to 2.4ms, we can get the full half-turn. This usually works, but no doubt it won’t with some products, so check before purchase. Some of the new digital servos on the market can be programmed for either range.
Most microcontroller chips contain hardware ‘count-capture’ modules that can be programmed to generate PWM signals with no processor overhead. Or there are expansion boards available such as the Kitronik 16-channel module
for the BBC Micro:Bit and the MikroElektronika 16-channel Click module
for anything with a MikroBus socket. Both these modules generate the PWM on-board and communicate with the host microcontroller via an I2C serial bus link. The Pmod CON3
is a simple 4-channel adapter that needs to be connected to host-generated PWM signals.
Nearly all RC servos use a 3-wire flat cable terminated with a plug that fits over a 3-pin 0.1in PCB header. The three signals are Control input, DC power and Ground (Fig.2); wire colours vary between manufacturers, but the format is the same: the power supply +V is always in the middle. There is no polarising key so no matter which way it’s plugged in, +V is correctly connected!
RC servo datasheets often quote values for torque and speed at two different power supply voltages. These are usually +4.8 and +6.0 volts corresponding to the power packs found in model aircraft containing four or five 1.2 volt NiCd rechargeable batteries. The +5 volt logic supply of a robot application will normally be adequate for one or two servos, but a separate supply will be needed for any more. When a servo is holding position under load, its DC motor is drawing a stall current of perhaps 500mA or more, and digital chips sharing the supply are vulnerable to glitches caused by sudden current surges.