New & Events

## Introduction to Servos Part I

### What is Servoing?

The goal of a servo is to adjust some output to keep an input at a constant value (typically 0). Think about how the cruise control feature on a car works: the cruise control adjusts the gas throttle (the servo’s output) in order to keep the speedometer reading (the servo’s input) a specific value.  The servo accomplishes this goal by feedback: if the speed is too low, the servo gives the car more gas and the car speeds up and visa versa. Even though the speed of the car is a function of many variables (the amount of gasoline getting to the engine, the incline of the road, the speed of the car, the wind speed and direction, etc), the servo only needs to measure the speed of the car and it needs a way to adjust the speed of the car. Instead of using a servo, you could develop a model to calculate the speed of the car as a function of all those variables listed above and then solve for the necessary amount of gasoline to give the car, that would be much more difficult and less accurate.

#### Definition of Terms / Formalism / Assumptions

Using cruise control as an example, let’s write out the canonical form of a feedback control system and define some terms:

• Reference Input (r) — This is the setpoint, or the reference that the measured quantity is compared against. For cruise control, this would be, say, 65 MPH.
• Error Signal (e) — This is the input that the servo system is trying to drive to 0.  In the above example, it is the difference between the car’s measured speed and the desired speed (the cruise control setpoint or the reference input).
• Control Signal (u) — This is the output of the servo. It is often called simple ‘Servo Output’. In the case of cruise control, is it the gas throttle to the car.
• Loop Filter (GLF) — This is transfer function of the servo and it determines how the Control Signal is generated from the Error Signal.
• Plant (GP) — This is the system or process that is being controlled  by the servo system. In the above example, the car is the plant as it is what is being controlled.
• Controlled Output (c) — This is the output of the plant that is being controlled. In this example, the car’s speed.
• Primary Feedback Signal (b) — This is what the Reference Input signal is compared against to generate the error signal. In the above example, it would be the measured speed from the speedometer.
• Feedback Elements (H) — Typically, these are measurements or sensors as they convert the Controlled Output into the Primary Feedback Signal. In many setups they can be ignored. If we assume that the car speed is the same as the measured car speed from the speedometer, then this block can be removed from the diagram above and the Controlled Output is the as the Primary Feedback Signal.
• Disturbance (n) — These are (generally unknown) challenges to maintaining the Controlled Output at its desired value. In the cruise control example, they would include the wind speed and direction, the road incline and anything else that could affect the speed of the car. In the absence of any disturbances there would rarely be a need for a servo system.

Using these new terms, we can rewrite the cruise control diagram into a more general formalism. Now let’s make one important assumption: that this system is linear. While in general the Loop Filter (GLF) could be an arbitrary function e, the input error signal, we will assuming that the Loop Filter output is proportional to the error input:. We will make this assumption about every element inside the feedback loop.

#### Is the Servo Doing Good?

Now that we have a formalism for describing a servo, it is time to define a metric for how well the servo is doing. Let’s say we want our car to maintain a constant speed of r=65 MPH. If we disengage the servo (disconnect u or the gas throttle adjust in the diagrams), let’s say the car speeds along at c0=64 MPH  (doesn’t matter why — car is going downhill, gas pedal is stuck, etc). In this case, our error (e) is 1 MPH. Now we engage the servo, what does our speed go to? Ideally 65 MPH, but let’s see. For the sake of simplicity, let’s assuming the H=1 and that b=c. This really means that we are accurately measuring the actual car speed. Using our assumption of linear response, we can write a simple equation to relate each block’s input and output:

Where did the c0 come from in the equation defining c? Well, we know that in the absence of u, the car’s speed is c0=64MPH (that’s the car speed without the servo engaged) and we are assume that the system is linear, so as u increases from 0, the output c must increase in proportion.  Combining these equations, we get:

Notice that is the measured speed when the servo is not engaged. So  is the error signal without a servo loop. Let’s definite eo as the error signal without the servo engaged:  and combine that with the previous equation to get:

From this we can see a few interesting things. is the ratio of the close-loop (locked) error to the original (unlocked) error eo. Ideally this ratio would be very small as the error is small compared to the original error. If we set G=0.5 (G stands for gain), then the error is increased by a factor of 2. The error increased and more gain only amplifies the error …  this is positive feedback. Positive feedback is feedback in the same direction as the error signal so it amplifies any errors. We want negative feedback where the feedback tries to counter-act the original error. If we set G=-0.5, then the error goes to 0.67 of its original value. Quick sanity check, if G=0, then the error is unchanged  – the servo is off. If G=-9, then our error is reduced by a factor of 10. This is the basic point of servoing — we can reduce our error by an amount proportional to . In the case that |G|>>1, then the error is divided by approximately G.

So then we set G = -∞ and our error signal drops to 0 and we are done, right? Sadly, no. In Part II we’ll look at bandwidth and the limits of a servo.

Introduction to Servos Part II