Lead Compensators
Why Use Lead Compensators? - Goals For This Lesson
What Is A Lead Network?
Root Locus Effects
Example
Bode' Plot Effects
Implementing Digital Leads
Problems
You are at:  Design Techniques - Compensators - Lead Compensators
Return to Table of Contents

Why Use Lead Compensators?

        Lead compensators are sometimes the best controller to use to get a system to do what you want it to do.  It's as simple as that.  They are an option that you may need if you cannot use anything in the PID family to bring a system's performance within specifications.  There's no guarantee that a lead compensator will do the trick, but it is another weapon in the arsenal.


Goals Of This Lesson

        Before we get very far, we need to establish what our goals are for lead compensators.

Given a Compensator Transfer Function:
  Know which compensators are leads and which are lags.
Given a lead compensator,
Determine the effects of the lead compensator on closed loop system behavior using Bode' plot methods,
Determine the effects of the lead compensator on closed loop system behavior using Root Locus methods,
Given a system to be controlled,
Determine if a lead compensator can be used to satisfy closed loop system specifications,
Given a system in which a lead compensator can be used,
Determine the parameters of a lead compensator to produce a closed loop system that meets specifications.

What Is A Lead Compensator?

        A lead compensator can be thought of in several different ways.

        Next, we will examine those implications.  A lead compensator will have a transfer function of the form:
        Here's a Bode' plot for a transfer function, G(s), with:

G(s) = (10s + 1)/(s + 1)

        This Bode' plot shows the essential characteristic of a phase lead compensator. If, for example,         Here note the following in the plot of the example we encountered earlier.         On this page we have a video that shows how lead networks behave as the ratio of the pole to the zero changes.

        You can see the features of a lead network.         In the next section, we'll look at how you can use a lead network in a system.

Using Lead Compensators

        Usually, a lead network is used as part of the controller in a feedback system.

We'll use this system as an example system to investigate the effects of using a lead network.

 Now, let's look at how the lead network affects how the system behaves.  We'll look at root locus effects first and Bode' plot effects later.


Root Locus Effects

        Now consider the system just above.  It has open loop poles at -1 and -4.

Here you can see the effect of adding a lead network.

Note the following for these root loci.

        Check this system again.

Click to see the effects noted above.

 Now, here's a video that puts a lot of things together.

        In the video, we can see the effects we discussed earlier - and some others.         There are some interesting ways we can use the insight obtained from what we have done so far.  Let's look at an example problem.  We'll use the same system we considered earlier.  That system is again shown below.

        We are going to assume that we have some specifications for the system, and we will discuss them in more detail later.  In brief, we want the following:

        We need to interpret these specifications somewhat. Here's the root locus for the system when proportional control is used.
        We do know, however, that we can get the poles within the allowable region.  Here is the clip with a lead compensator with a variable pole.  You saw this clip just above.  The lead compensator has a zero at s = -5, and a variable pole.

        Play the clip here.  You can set the pole to any value from -3 to the limit of the graph.

        Now, what do you do if you don't have a ready made movie?  It is still possible to compute parameters that will produce a pole in a given location.  Here's the process and an example system. Here is the plot of the two open-loop poles for the example system.

        To get the root locus to go through that point - after adding a compensator - you need to apply a root locus rule.  Remember, for a point to lie on the root locus the sum of the angles must be an odd multiple of 180o. We will walk through this, one singularity at a time.
        Here, we can compute the angle.  The desired pole location is at -4 + 3j.  That means that the angle shown above is 135o.  Since this is a pole, it's in the denominator of the transfer function and so the net contribution to the calculation is -135o.

        Look at the next singularity, the pole at -4.

        Compute the angle from this pole.         To this point the computation has been straightforward.  But, now we need to add something - a lead compensator? - that will change the angle at the point we want on the root locus by 45o.  Let's examine what happens when we add a zero.



Q1  What is the furthest point to the left where you can put the zero?



        Now, you have the limits on where the zero can't be placed, so you can design a compensator.  Here's what you need to do.
Example

        We'll continue with the example system we have been using.  You should have found that you cannot put the compensator zero to the left of -7.  At s = -7 you get an added 45o from the zero.

Now you need to determine where the pole will be.
What remains is to determine the gain, Kc, that will put the closed loop poles where we want them.  We'll start on that by looking at a root locus for the compensated system.  That's shown below.

Check out features of the root locus plot.
Q2  What is the root locus gain for the system above?

Enter your answer in the box below, then click the button to submit your answer.  You will get a grade on a 0 (completely wrong) to 100 (perfectly accurate answer) scale.

Your grade is:


        What we have discovered in this section is a fairly powerful technique for producing response that we want.  Here's the technique.

What if you fail?  There are other options.         In any event, the technique here is not infallible, but can often help.  Try it, and if it works it may work very well.

Bode Plot Effects

        If we add a lead compensator to a system, we can also interpret effects on the Bode' plot for the system.  In this section, we'll do that.

        First, we need the Bode' plot for the original system.  The system we want to control has two poles at s = -1 and s = -4.  The transfer function we will use for the Bode' plot is:

 G(s) = 10/(s + 1)(s + 4).

Here's the Bode' plot for the system we want to control.

        This system - as shown - has a DC gain of about 7.5 db, and the phase asymptotically approaches -180o.

        Now, let's examine the effect of adding a lead network.  On this plot you can see the effect of adding the lead network.  We have added the same lead compensator as we used for the root locus demonstration.  That compensator has a zero at -5 and a pole at -10.

        At first glance, it doesn't seem like the magnitude of the effect is very large when viewed on the Bode' plot.  However, consider designing for some given phase margin.

        Let's look at designing for a 30o phase margin.  This plot below shows how to obtain a phase margin of 30o.  The purple line shows the -150o crossing and the corresponding gain - which is about -17 db.  We could raise the gain by 17 db and have a 30o phase margin.

        The plot below is the Bode' plot for the system with lead compensation.  Again, the purple line is placed at -150o.



        The example we just examined shows most of the things you expect to happen when you use lead compensation.
A System Design Example

 Here's a model of a chemical process.  This process has three time constants and three gains.

        We want to control this system to meet several specifications.         If possible, we would like to use proportional control since that would be the simplest solution. 
Q3  What proportional gain, Kp, do we need to get 2% SSE?

Enter your answer in the box below, then click the button to submit your answer.  You will get a grade on a 0 (completely wrong) to 100 (perfectly accurate answer) scale.

Your grade is:


        For a SSE of 2%, we need an open loop gain (DC) of about 50 (49 actually!).  Since: We'd like to show you a simulation for a gain, Kp, of 250.  This is what we have.  It's not pretty.

 The  complete transfer function is:
G(s) = K1 K2 K3 Kp/[(.5s + 1)(4s + 1)(2s + 1)]

G(s) = 0.25 K1 K2 K3 Kp/[(s + 2)(s + 0.25)(s + 0.5)]

G(s) = 0.05 Kp/[(s + 2)(s + 0.25)(s + 0.5)]

G(s) = KRL/[(s + 2)(s + 0.25)(s + 0.5)]

We can plot a root locus to determine the gain at which the system becomes unstable.  From the above calculation, we know that:         Here's the root locus, and the points at a root locus gain of 4.1 are emphasized because that is the gain at which the closed loop poles enter the right half of the s-plane.  Clearly, for a root locus gain of 12.5 the system is unstable, and that's what we already learned from the calculation of the step response.

        The conclusion we reach is this.         We ought to verify things on using a Bode' plot.  Here's the Bode' plot for the system.  This Bode' plot is drawn for a DC gain of 1.0 for the open loop system.

NOTE:  There is pretty good agreement between the root locus and Bode' plot estimates (5.3% and 5.7%) and given that we are using graphical techniques to estimate this, that is very good agreement.

        There's one other conclusion we can draw from the Bode' plot and root locus analysis.

        Clearly, we need to do something if we want to control this system.  Now consider the possibility of adding a lead compensator.  We will examine how we can change the system's behavior with this compensator. Next, you can look at the root locus for this system.  The approach we will take is that we will add a pole - in the lead compensator - at s = -7, and vary the location of the zero that we add in the lead compensator.  We'll use a video to show how the location of the zero affects things.

Note the following. Let's look at that root locus again.  There are several different things that happen that are interesting and can be used to get more insight into how compensators affect systems that are a little more complex.         The real question is this.  Can we get a stable system with acceptable SSE?  We're really not getting help on that from this information.  It's going to be hard to extract that kind of information from the root locus plot even though we are getting some insight into how to speed up the closed loop system.

        At this point, we should consider looking at frequency domain information.  Here's a copy of the Bode' plot for the uncompensated system.  Here you can see that the -180o crossing occurs when the magnitude is at about -24 db at a frequency near 0.2 Hz..  We could increase the gain by a maximum of 24 db.  Thats about a factor of 15.8.  That will not produce a very good SSE - something more than 5%..

        Now, we can work from this Bode' plot and the root locus to design a compensator.  We'll use the root locus insight and start by choosing the pole and zero at:

Next, plot the Bode' plot for the system+compensator.  We chose the gain for the Bode' plot to give a DC gain of 1.0 (0db).
        Now, let's consider how well we can get the system to perform.  If we add 36 db, then. Now, let's go back to the root locus and check how this plays out there.

        At this point, we have good agreement between our root locus analysis and our Bode' plot analysis.  In both cases, the DC gain for the onset of instability is a little over 60.         Here is a simulation of the system with the gain set to give 2% SSE.v The system is stable.

        We need to consider some options for what we can do.  Some options include the following..         Taking the second approach above - using another lead network - a second lead network was tried.  For this trial we worked from the lead compensator we had been considering above.  However, instead of a pole at s = -7, we argued in the following way.
Note that several features of the response have greatly improved.         There may be some drawbacks to this approach.  It might require a very large control effort to achieve these results.  You'll have to know your system well.  In some systems you just can't get a large enough control effort.  In aircraft, for example, there are limits on how far you can more the aileron, etc.  In a motor, the drive amplifier might saturate.  You get the message.  You'll have to know what is reasonable for your system when you drive it that hard, but the linear analysis says that you can get where you want with enough control effort.



Designing Lead Compensators

        If you need to design a lead compensator, you will need to choose the pole and zero location.  Click here for a short note on how to compute the pole and zero location.


Implementing Digital Lead Compensators

        There will be times when you need a lead compensator, and the appropriate place to put the lead compensator is in lines of code within the control program.  That presents a problem that we need to solve and it defines the goal of this section.

Given an analog compensator transfer function Compensator Transfer Function:
        We're going to work with the idea that you can replace s with (z - 1)/(z T) in moving from analog/continuous systems to digital/sampled systems.  We will assume that you have a compensator transfer function of the form below.

Gcomp(s) = Gc( tzs+ 1 )/( tps+ 1 )

The algorithm is simple.

        Assume that we have a lead compensator.  The transfer function we will assume we have is of this form.:

We choose particular values

G(s) = [ s/3 + 1]/[ s/15 + 1}

or

G(s) = (15/3) [ s + 3 ]/[ s + 15 ]

We choose this transfer function only because it has numbers that won't get confusing as we go along.  We start with the first step in the algorithm.

We immediately realize that we need to know the sampling period, T.  This system has a time constant of 1/15 sec. and the sampling period should be less than that.  Let's assume that we are sampling at a rate of 50 samples/second, so:

T = 0.02

Replacing s, we get:

        Rewriting the expression for the transfer function, we note that the transfer function is the ratio of the lead compensator output to the lead compensator input in the z-domain.  Manipulating the expression above, we get:

where:         The expression - in the z-domain - relating the input and output of the compensator can give us the difference equation we want.  This difference equation is easy to implement in code."

        Here's the difference equation.  It's not hard at all.  Start by cross multiplying the equation above to get:

 [(1 + 15T) zY[z] - Y[z]] = [15/3][(1 + 3T) zU[z] - U[z]]

Then, take the inverse transform of both sides to obtain:

[15/3][(1 + 3T) uk+1 - uk] = [(1 + 15T) yk+1 - yk+1]

 or:
yk+1 = [5(1 + 3T)uk+1 - 5uk + yk]/[1 + 15T]
OldInput = 0.; /* Initialize OldInput and OldOutput */
OldOutput = 0.;
.
.
NewInput = Error;
NewOutput = (OldOutput + NewInput*5*(1+3*T) - 5*OldOutput)/(1 + 15*T);
OldOutput = NewOutput;
OldInput = NewInput;
Note the following for the code.         We haven't given you the whole story here.  There are other methods for transforming continuous systems - like compensators - into computer implementations using z-transform methods.


Some Questions About Controllers etc.

        So far you have looked at controllers and compensators for systems.  In all cases the approach has been to find a transfer function that will make the system perform well - in some sense.  However, consider these facts.

        You may want to consider control algorithms that are nonlinear.  Controllers that make decisions are inherently nonlinear.

        There's a whole world of nonlinear controllers out there.  In this lesson set we haven't done much with them - nor will we.  But we do talk about a very different kind of controller - a fuzzy controller - and you may want to consider that approach.


Problems
 


Return to Table of Contents

Send us your comments on these lessons.