High Power Servo

V1.00 22-Oct-01

Status: Untested


1. Introduction

Making a high power servo might seem like a simple job: Just get a normal servo, fit an amplifier to the motor leads, and fit a powerful DC motor to the output of the amplifier. However, this will probably not work. The reason it won't work is very complex, a simple search on the web for "control theory" will confirm this complexity. Control theory is a large subject in its own right, and makes heavy use of mathematical calculus, and differential equations. This web site is not the place for introducing these subjects to lay-robot builder, and so I have replaced them with some experiment techniques and rules of thumb that can be used instead.


2. Control theory and stability

Why is it so complicated? A small servo in a radio control kit works as follows:

A "position demand" signal is detected by the control electronics. This signal represents a required position for the motor shaft to be in. The potentiometer attached to the shaft is used to tell the electronics where the motor shaft actually is. If there is a difference between the actual position and the demand position, then the electronics drives the motor in the appropriate direction to reduce that difference. The difference is called the "error signal", E, in control theory parlance.

E = Pa - Pd

E = Error signal
Pa = actual position
Pd = Demand position

The strength at which the motor is driven to reduce the error signal depends on how large the error signal is. If the error is large, then the motor must be driven hard and quick to reduce it. If the error is small, then the motor will only require a small push to reduce the error to nothing. Therefore, the strength of the motor drive signal is proportional to the error signal.

Vm = G x E

Vm = Motor drive level
E = Error signal
G = constant of proportionality.

The 'G' in this equation is the gain of the electronic circuit that detects the error signal and drives the motor.

Here is a control block diagram of the system with these signal names shown:

The circle with a cross in it is a summing junction (in this case the lower entry point to it is negated first, so it is a subtracting junction). The triangle is the amplifier with gain G.

So why don't we drive the motor at full power all the time? That is, why don't we make 'G' in the above equation very high, or even infinite (the amplifier output will saturate at the positive or negative power rail if the gain is very high)?


2.1. An experiment

Imagine this experiment. You are sitting at a desk. Along the other side of the desk is a bank of lights, stretching from the left hand side right over to the right hand side. These lights are lit at random, one at a time, and your job is to point to the light that is lit as quickly as possible, with your arm straight and outstretched.

(apologies for the picture, you get the idea!)

The amount of muscle power you require to point to the next light as quickly as possible will depend on how far away the next light is from the one you are currently pointing at. If the next light is next door to the one you are currently pointing at, you only require a little muscle power to move your arm. If, however, you are pointing to the leftmost light and the rightmost one is the next to be lit, you will need much more muscle power to swing your arm over as quickly as possible. As you get near to the new light, you will reduce the muscle power to make sure that you don't overshoot it. This is the same as the description above, where the amount of motor power required is proportional to the difference between the actual and the required positions.

So now can you imagine what would happen if you applied the maximum muscle power regardless of how far away the next light is? If the next light was next door to the current one, you would swing your arm over as hard as possible, and completely overshoot it. Then you must swing your arm back the other way again to compensate, but you will overcompensate, and your arm will overshoot in the other direction. In fact you will just end up swinging your arm back and forth wildly and never get to the required position. This is exactly what happens in a control application where the gain of the system is too high - it oscillates, and is unstable.

Now what would happen if you only applied a very small muscle force? You would have trouble keeping track of the lights - you would always be lagging behind the movement.

At some point in between these situations, you will be applying just the right amount of force so that as your arm swung over to the light, it would slow down and finish pointing right at the correct spot.

In control theory, these three situations are called "underdamped", "overdamped", and "critically damped".

In fact the first situation is an extreme case of underdamping - instability - where the waveform doesn't die away as in the graph above, but continues to oscillate forever with the same amplitude.


2.2. The question of "Gain"

So how can we work out what is the optimum gain in the system so the motor moves as closely as possible in a critical damped manner? To do this mathematically would be very complicated. We would need to know the transfer function of the motor (torque out from voltage in) - information we are unlikely to have to hand, friction coefficients for all parts of the system, and the moment of inertia of the motor, and the load it is attached to. Using those values, and the known value of gain of the motor drive circuit, we could use standard control theory methods to calculate the maximum gain for stability. This is done is section 5.2. for academic interests sake, but I don't suggest that you do it for your robot!

The solution is to build a circuit where the gain is variable with a simple single knob-potentiometer, like the volume control on a hi-fi amplifier. Then we can experimentally adjust the gain until the system operates exactly how we want it too. If necessary, the gain potentiometer could then be replaced with a fixed value resistor.


3. Building the power servo

We are going to need a motor to start with. I am assuming that you will be getting the motor from an unknown source. You may use a relatively small motor such as a car windscreen wiper motor, or you may be using a large powerful motor such as the Bosch GPA750 often used as a wheel drive motor in fighting robots. The size of the motor will have a bearing on the electronics used to drive it. A smaller motor can use a single chip drive module, which can drive up to a couple of Amps. A larger motor will need a speed controller circuit similar to that descibed in the Speed Controllers pages. A commercially purchased speed controller such as the 4QD or Vantec models are appropriate for this purpose.

I'll go through the control block digram shown in section 2 above part by part and present designs for each section.


3.1. The summing junction

The summing junction is the part which performs the equation above:

E = Pa - Pd

E = Error signal
Pa = actual position
Pd = Demand position

We also want to negate the value of the demand position. A suitable circuit is shown below:


3.2. The signal amplifier - voltage gain stage

This circuit applies a gain of between 0 and 1000:

If more gain is required, this circuit can be fitted with a fixed 1M feedback resistor, and another identical section added with the variable 1M resistor. This would then allow the gain to be adjusted between 1000 and 1,000,000.


3.3. The power amplifier - current gain stage

Now we have the correct voltage to drive the motor, we need to supply the current. The way this is done depends on the size of the motor. For small motors up to a few amps, this can be achieved using a single motor drive IC. For larger motors, a PWM signal generator and speed controller circuit will be necessary.


3.3.1. Single chip motor driver

There are two ways of doing this. For small motors, a constant voltage drive can be used. This is just a class-B power amplifier as found in audio amplifiers. At most this is 50% efficient, the remaining power being dissipated in the output drive transistors. The alternative is to use Pulse Width Modulation control and chop the output. The average voltage is then proportional to the PWM mark:space ratio. See here for a description of PWM. Constant voltage control
Any power amplifier chip can be used to drive a motor in this manner. A suitable candidate is the L149 4 Amp power op-amp. This requires a positive and negative power supply, with one motor terminal attached to the amplifier output, and the other to ground:

Alternatively, the motor can be placed between two L149s driven in anti- phase in a bridge configuration:

In this circuit, the LM324 U6a is used to invert the drive signal which then drives the right hand L149. Therefore, the motor left hand terminal sees a voltage Vm, and the right hand terminal -Vm, and so the voltage across the motor is

Vm - (-Vm) = 2Vm PWM control
SGS Thomson make a range of small motor driver ICs, which can be viewed here. We'll take as an example the L298N. This is a dual full bridge motor driver, each channel can handle 4 Amps at up to 48 Volts. If higher current is required, the two channels can be paralleled. It does not incorporate speed control so we will have to do that ourselves.

The PWM must be generated by a voltage to PWM converter circuit, an example of which is presented in the PWM Generators page using the SG3525. The complete circuit is shown below:

Click on the circuit diagram to open it in a new window.

Note that this is not striclty as "single-chip" solution, but the motor driver section is just one chip rather than a speed controller made up of discrete transistors.

Short circuit protection can be added to this circuit quite easily. The motor current goes through pins 1 and 15 of the L298 (which are tied straight to ground in the diagram above). If a sense resistor is placed here, a comparator can be used to compare the voltage with a reference value. The SG3525 output can be disabled by taking the SD (pin 10) input high.

The inputs to this circuit are an analogue (0 to 5 volts) speed demand signal, and a logic level direction signal. The logic direction signal can be generated by the error amplifier - it is effectivel just the sign of the error signal (+ve or -ve).

A circuit for generating a demand and a direction signal pair from a bipolar (-ve & +ve) input signal is presented in the Speed & Direction circuits.

An application note including PWM driving of the L298N is available from ST here.


3.3.2. Speed controllers for larger motors

If the motor will be drawing a lot more current than the L298 can handle (more than 4 Amps), then a full speed controller may be required. This can be bought off the shelf, or one can be built from scratch. See the Speed Controllers page for details of this. Similar to the signle chip method of section 3.3.1, the speed controller must have an analogue speed demand input, and a logic direction input to be used in this power servo mode. If this is not the case, then these signals can be generated using the circuits presented in the section Speed & Direction circuits .


3.4. The position potentiometer

In the same manner as the small servos that are common in RC kits, the potentiometer needs to be attached to the motor shaft. This may be rather difficult depending on the diameter of the motor shaft and the load that the motor is driving.


3.4.1. Through mounting

This method can only be used if the motor shaft is quite thin, and the pot can be threaded onto the motor shaft. The pot must be of a suitable kind (without a knob shaft) designed for mounting onto shafts.


3.4.2. End mounting

In this method, the potentiometer is mounted on the end of the motor shaft. This can only be done if the load is not attached to the end of course. The load may be driven off a gear wheel which is fitted further up the motor shaft.

There may be some non-alignment in the axis of the potentiometer shaft and the motor shaft. In this case, an Oldham coupling would make a suitable joint between the two.


3.4.3. Geared mounting

This may be the easiest method. A rubber wheel is mounted pressing up against the motor shaft such that it turns when the motor shaft turns. The ratio between the diameter of the motor shaft and the wheel will determine how the angle of the motor shaft varies with the angle of the potentiometer according to the following equation:


3.5. The servo decoder section

If you want the power servo to respond to the pulse width coding scheme used in PPM radio kits, then you will require the 1ms - 2ms input pulse to be converted to a 0 - 5v signal which is suitable for the "Demand position" signal. A circuit for doing this can be found in the Receiver Decoder page.


3.6. Mechanical endstops

The potentiometer which detects the motor shaft position will be damaged if it is turned beyond its endpoint. Therefore you should fix some sort of end-stop mechanism to the motor shaft. This may be a disk with a slot welded to the shaft, with a spigot in the slotto prevent the shaft turning more than a certain angle:


4. Setting up, testing, and operating the power servo

When you have connected the functional blocks described in section 3, set the gain control to its minimum (x1). Move the motor shaft by hand to one of the endstops.

Drive the servo with a mid-point signal, and see what happens. The motor may not move at all. Gradually turn up the gain until the motor moves. If the motor starts spinning back and forth (oscillating), then the gain is too high. When the motor appears to have moved into the midpoint position, change the demand to one extreme, and make sure the motor moves to its endstop. Now move the demand to the other extreme, and the motor should move to its other endstop. If the motor does not move far enough, the gain may be set too low.

When the servo is fixed in the robot, and the motor is driving a load, then it is possible that the gain may need to be increased to overcome the frictional force of the load.

Once a suitable gain setting has been found, the gain pot may be replaced with a fixed resistor, or better still, a dob of hot-melt glue dripped onto it to stop it moving due to vibration. This will allow the setting to be changed if necessary.


5. Control Theory

This section is very mathematical, using A-level and beyond mathematical techniques, and is presented here just for academic interest. It is not necessary to use this or understand it to build a power servo motor of your own!


5.1. The second order differential equation and SHM

In this exercise, we shall investigate the effects of changing the damping parameter b in the ordinary differential equation:

y is the position of the object at a point in time. The three coefficients, a, b, and c, determine the motion of the object under these conditions. The first coefficient, a, is a measure of the springiness in the system, the second coefficient, b, is a measure of the damping in the system, and the third coefficient, c, is the mass of the object. a and c determine the frequency of oscillation, and b determines the rate at which the oscillation decays.


5.2. Servo Motor stability and step response

So, how do you calculate the largest value of gain, and what does the response to a step change in the position demand signal look like at various gain settings? The answers to these questions are quite involved, and so rather than fitting them in here, I have put them in a separte page here:

Servo motor stability and step response.


6. Devices used in this circuit

The following devices were used in this circuit. Click on the manufacturer’s name to go to their web site, or the device name to go to the device datasheet.

Manufacturer Device
SGS Thompson SG3525A SMPS controller
L298N Motor controller
L149 Power Opamp
LM324 Quad signal opamp

Philips Semiconductors

74HC04 Hex inverter


7. Links

These links are scored for interest and quality of information given from 0 to 5. A preceding 'C' means it is a commercial company, and a preceding 'E' means it is an educational site.

[E5] A basic introduction to radio control servos

[E3] Explanations of simple harmonic motion, oscillations, and damping.

[E2] A set of slides describing wheel positioning servo systems for robots

Back to circuits index