Lead Lag Compensator
1. Introduction
Lead and lag compensators are used quite extensively in control. A lead compensator can increase the
stability or speed of response of a system; a lag compensator can reduce (but not eliminate) the steady-
state error. Depending on the effect desired, one or more lead and lag compensators may be used in
various combinations.
Lead, lag, and lead/lag compensators are usually designed for a system in transfer function form.
2. Lead or phase-lead compensator using root locus
A first-order lead compensator C(s) can be designed using the root locus. A lead compensator in root locus
form is given by
(𝑠 − 𝑧0 )
𝐶(𝑠) = 𝐾𝑐
(𝑠 − 𝑝0 )
where the magnitude of 𝑧0 is less than the magnitude of 𝑝0 A phase-lead compensator tends to shift the
root locus toward to the left in the complex s-plane. This results in an improvement in the system's
stability and an increase in its response speed.
How is this accomplished? If you recall finding the asymptotes of the root locus that lead to the zeros at
infinity, the equation to determine the intersection of the asymptotes along the real axis is the following.
∑(𝑝𝑜𝑙𝑒𝑠) − ∑(𝑧𝑒𝑟𝑜𝑠)
𝑎=
(#𝑝𝑜𝑙𝑒𝑠) − (#𝑧𝑒𝑟𝑜𝑠)
When a lead compensator is added to a system, the value of this intersection will be a larger negative
number than it was before. The net number of zeros and poles will be same (one zero and one pole are
added), but the added pole is a larger negative number than the added zero. Thus, the result of a lead
compensator is that the asymptotes' intersection is moved further to the left in the complex plane, and
the entire root locus is shifted to the left as well. This tends to increase the region of stability and the
system's response speed.
In MATLAB a phase-lead compensator in root locus form is implemented using the following commands
(where 𝐾𝑐 , z, and p are defined).
s = tf('s');
C_lead = Kc*(s-z)/(s-p);
We can interconnect this compensator C(s) with a plant P(s) using the following code.
sys_ol = C_lead*P;
3. Lead or phase-lead compensator using frequency response
A first-order phase-lead compensator can also be designed using a frequency response approach. A lead
compensator in frequency response form is given by the following.
1 + 𝑎𝑇𝑠
𝐶(𝑠) = [𝑎 > 1]
1 + 𝑇𝑠
Note that this is equivalent to the root locus form repeated below
𝑠 − 𝑧0
𝐶(𝑠) = 𝐾𝑐
𝑠 − 𝑝0
with p =1 / T, z = 1 / aT, and 𝐾𝑐 = 𝑎. In frequency response design, the phase-lead compensator adds
positive phase to the system over the frequency range 1 / aT to 1 / T. A Bode plot of a phase-lead
compensator C(s) has the following form.
The two corner frequencies are at 1 / aT and 1 / T; note the positive phase that is added to the system
between these two frequencies. Depending on the value of a, the maximum added phase can be up to
90 degrees; if you need more than 90 degrees of phase, two lead compensators in series can be employed.
The maximum amount of phase is added at the center frequency, which is calculated according to the
following equation.
1
𝜔𝑚 =
𝑇 √𝑎
The equation which determines the maximum phase is given below.
𝑎−1
𝑠𝑖𝑛𝜙 =
𝑎+1
Additional positive phase increases the phase margin and thus increases the stability of the system. This
type of compensator is designed by determining a from the amount of phase needed to satisfy the phase
margin requirements, and determining T to place the added phase at the new gain-crossover frequency.
Another effect of the lead compensator can be seen in the magnitude plot. The lead compensator
increases the gain of the system at high frequencies (the amount of this gain is equal to a). This can
increase the crossover frequency, which will help to decrease the rise time and settling time of the system
(but may amplify high frequency noise).
In MATLAB, a phase-lead compensator C(s) in frequency response form is implemented using the
following code (where a and T are defined).
s = tf('s');
C_lead = (1+a*T*s)/(1+T*s);
We can then interconnect it with a plant P(s) using the following code.
sys_ol=C_lead*P;
4. Lag or phase-lag compensator using root locus
A first-order lag compensator C(s) can be designed using the root locus. A lag compensator in root locus
form is given by the following.
(𝑠 − 𝑧0 )
𝐶(𝑠) =
(𝑠 − 𝑝0 )
This has a similar form to a lead compensator, except now the magnitude of 𝑧0 is greater than the
magnitude of 𝑝0 (and the additional gain Kc is omitted). A phase-lag compensator tends to shift the root
locus to the right in the complex s-plane, which is undesirable. For this reason, the pole and zero of a lag
compensator are often placed close together (usually near the origin) so that they do not appreciably
change the transient response or stability characteristics of the system.
How does the lag controller shift the root locus to the right? Below is repeated the equation for finding
where the asymptotes of the root locus intersect along the real axis.
∑(𝑝𝑜𝑙𝑒𝑠) − ∑(𝑧𝑒𝑟𝑜𝑠)
𝑎=
(#𝑝𝑜𝑙𝑒𝑠) − (#𝑧𝑒𝑟𝑜𝑠)
When a lag compensator is added to a system, the value of this intersection will be a smaller negative
number than it was before. The net number of zeros and poles will be the same (one zero and one pole
are added), but the added pole is a smaller negative number than the added zero. Thus, the result of a
lag compensator is that the asymptotes' intersection is moved to the right in the complex plane, and the
entire root locus is shifted to the right as well.
It was previously stated that a lag compensator is often designed to minimally change the transient
response of system because it generally has a negative effect. If the phase-lag compensator is not
supposed to change the transient response noticeably, what is it good for then? The answer is that a
phase-lag compensator can improve the system's steady-state response. It works in the following
manner. At high frequencies, the lag compensator will have unity gain. At low frequencies, the gain will
be 𝑧0 /𝑝0 which is greater than 1. This 𝑧0 /𝑝0 factor will multiply the position, velocity, or acceleration
constant (𝐾𝑝 , 𝐾𝑣 𝑜𝑟 𝐾𝑎 ), and the steady-state error will thus decrease by the same factor.
In MATLAB, a phase-lag compensator C(s) in root locus form is implemented by employing the following
code where it is again assumed that z and p are previously defined.
We can then
s = tf('s');
C_lag = (s-z)/(s-p);
We can also interconnect the compensator with a plant P(s) as follows.
sys_ol = C_lag*P;
5. Lag or phase-lag compensator using frequency response
A first-order phase-lag compensator also can be designed using a frequency response approach. A lag
compensator in frequency response form is given by the following.
1 1 + 𝑎𝑇𝑠
𝐶(𝑠) = ( ) [𝑎 < 1]
𝑎 1 + 𝑇𝑠
The phase-lag compensator looks similar to phase-lead compensator, except that a is now less than 1.
The main difference is that the lag compensator adds negative phase to the system over the specified
frequency range, while a lead compensator adds positive phase over the specified frequency. A Bode plot
of a phase-lag compensator has the following form.
The two corner frequencies are at 1 / T and 1 / aT. The main effect of the lag compensator is shown in
the magnitude plot. The lag compensator adds gain at low frequencies; the magnitude of this gain is equal
to a. The effect of this gain is to cause the steady-state error of the closed-loop system to be decreased
by a factor of a. Because the gain of the lag compensator is unity at middle and high frequencies, the
transient response and stability are generally not impacted much.
The side effect of the lag compensator is the negative phase that is added to the system between the two
corner frequencies. Depending on the value a, up to -90 degrees of phase can be added. Care must be
taken that the phase margin of the system with lag compensation is still satisfactory. This is generally
achieved by placing the frequency of maximum phase lag, 𝜔𝑚 as calculated below, well below the new
gain crossover frequency.
1
𝜔𝑚 =
𝑇 √𝑎
In MATLAB, a phase-lag compensator C(s) in frequency response form is implemented using the following
code, again assuming that a and T are defined.
s = tf('s');
C_lag = (a*T*s+1)/(a*(T*s+1));
We can again interconnect the compensator with a plant P(s) as follows.
sys_ol = C_lag*P;
6. Lead-lag compensator using either root locus or frequency response
A lead-lag compensator combines the effects of a lead compensator with those of a lag compensator. The
result is a system with improved transient response, stability, and steady-state error. To implement a
lead-lag compensator, first design the lead compensator to achieve the desired transient response and
stability, and then design a lag compensator to improve the steady-state response of the lead-
compensated system.
7. Example: Cruise Control: Frequency Domain Methods for Controller Design
7.1. System model
The transfer function model for the cruise control problem is given below.
𝑉(𝑠) 1 𝑚/𝑠
𝑃(𝑠) = = [ ]
𝑈(𝑠) 𝑚𝑠 + 𝑏 𝑁
For this example, let's assume that the parameters of the system are
(m) vehicle mass 1000 kg
(b) damping coefficient 50 N.s/m
(r) reference speed 10 m/s
(u) nominal control force 500 N
and the block diagram of a typical unity feedback system is shown below.
7.2. Performance specifications
Rise time < 5 sec
Overshoot < 10%
Steady-state error < 2%
7.3. Bode plot and open-loop response
The first step in solving this problem using frequency response is to determine what open-loop transfer
function to use. Just like for the Root-Locus design method, we will only use a proportional controller to
solve the problem. The block diagram and the open-loop transfer function are shown below.
𝑌(𝑠) 𝐾𝑝
=
𝐸(𝑠) 𝑚𝑠 + 𝑏
In order to use a Bode plot, the open-loop response must be stable. Let 𝐾𝑝 equal to 1 for now and see
how the open-loop response looks like. Create a new m-file and enter the following commands.
m = 1000;
b = 50;
u = 500;
Kp = 1;
s = tf('s');
P_cruise = 1/(m*s+b);
C = Kp;
step(u*C*P_cruise)
As you can see, the open-loop system is stable; thus, we can go ahead and generate the Bode plot. Change
the above m-file by deleting the step command and adding in the following command.
bode(C*P_cruise);
7.4. Proportional controller
Let’s see what system characteristics we can determine from the above Bode plot.
The steady-state error can be found from the following equation:
1
𝑠𝑠 𝑒𝑟𝑟𝑜𝑟 = . 100%
1 + 𝑀𝑤→0
For this system, the low frequency gain is -34dB = 0.02; therefore, the steady-state error should be 98%.
We can confirm this by generating a closed-loop step response as follows.
r = 10;
sys_cl = feedback(C*P_cruise,1);
step(r*sys_cl);
We need to increase the low frequency gain in order to improve the steady-state error. Specifically, the
error needs to be < 2%; therefore, 1/(1+ 𝑀𝑤=0 ) < 0.02 ⇒ 𝑀𝑤=0 > 49 = 33.8 dB. Since, the low frequency
gain is -34 dB and the steady-state error limit needs us to have a low frequency gain of 33.8 dB, to reach
the desired steady-state error using proportional control only, requires a 𝐾𝑝 > (34 dB + 33.8 dB) = 67.8
dB = 2455. Let's look at the Bode diagram of the compensated open-loop system.
Kp = 2500;
C = Kp;
bode(C*P_cruise);
As you can see from the Bode plot above, the low frequency magnitude is now, 34 dB. Now let's simulate
the step response of the closed loop system with this gain.
sys_cl = feedback(C*P_cruise,1);
step(r*sys_cl);
The steady-state error meets the requirements; however, the rise time is much shorter than is needed
and is unreasonable in this case since the car cannot accelerate to 10 m/s in 2 sec. Therefore, we will try
using a smaller proportional gain to reduce the control action required along with a lag compensator to
reduce the steady-state error.
7.5. Lag Compensator
The lag compensator adds gain at the low frequencies while keeping the bandwidth frequency at the
same place. This is actually what we need: Larger low frequency gain to reduce the steady-state error and
keep the same bandwidth frequency to maintain the desired rise time. The transfer function of the lag
controller is:
𝑠 + 𝑧0
𝐶𝑙𝑎𝑔 (𝑠) =
𝑠 + 𝑝0
The pole and the zero of a lag controller need to be placed close together. Also, it states that the steady-
state error will be reduced by a factor of 𝑧0 /𝑝0 . For these reasons, let 𝑧0 equal 0.1 and 𝑝0 equal 0.02.
The proportional gain, 𝐾𝑝 = 1000 was chosen by trial-and-error.
Kp = 1000;
zo = 0.1;
po = 0.02;
C_lag = (s+zo)/(s+po);
bode(Kp*C_lag*P_cruise);
Let's confirm the performance by generating a closed-loop step response.
sys_cl = feedback(Kp*C_lag*P_cruise,1);
t = 0:0.1:20;
step(r*sys_cl,t);
As you can see, there is a very slight overshoot, the steady state error is close to zero, and the rise time is
under 5 seconds. The system has now met all of the design requirements. No more iteration is needed.