Lag Compensator
Lag Compensator
Lag Compensator
C ONTENTS
I INTRODUCTION 2
II DESIGN PROCEDURE 2
II-A Compensator Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
II-B Outline of the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
II-C Compensator Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
II-D Making the Bode Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II-E Gain Crossover Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II-F Determination of α . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II-G Determination of zc and pc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
References 14
L IST OF F IGURES
1 Magnitude and phase plots for a typical lag compensator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Bode plots for G(s) in Example 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Bode plots for the plant after the steady-state error specification has been satisfied. . . . . . . . . . . . . . . . . 9
4 Bode plots for the compensated system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Closed-loop frequency response magnitudes for the example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Step and ramp responses for the closed-loop systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
These notes are lecture notes prepared by Prof. Guy Beale for presentation in ECE 421, Classical Systems and Control Theory, in the Electrical and
Computer Engineering Department, George Mason University, Fairfax, VA. Additional notes can be found at: http://teal.gmu.edu/~gbeale/examples.html.
2
I. INTRODUCTION
The purpose of phase lag compensator design in the frequency domain generally is to satisfy specifications on steady-state
accuracy and phase margin. There may also be a specification on gain crossover frequency or closed-loop bandwidth. A phase
margin specification can represent a requirement on relative stability due to pure time delay in the system, or it can represent
desired transient response characteristics that have been translated from the time domain into the frequency domain.
The overall philosophy in the design procedure presented here is for the compensator to adjust the system’s Bode magnitude
curve to establish a gain-crossover frequency, without disturbing the system’s phase curve at that frequency and without
reducing the zero-frequency magnitude value. In order for phase lag compensation to work in this context, the following two
characteristics are needed:
• the uncompensated Bode phase curve must pass through the correct value to satisfy the phase margin specification at
some acceptable frequency;
• the Bode magnitude curve (after the steady-state accuracy specification has been satisfied) must be above 0 db at the
frequency where the uncompensated phase shift has the correct value to satisfy the phase margin specification (otherwise
no compensation other than additional gain is needed).
If the compensation is to be performed by a single-stage compensator, then it must also be possible to drop the magnitude
curve down to 0 db at that frequency without using excessively large component values. Multiple stages of compensation can
be used, following the same procedure as shown below. Multiple stages are needed when the amount that the Bode magnitude
curve must be moved down is too large for a single stage of compensation. More is said about this later.
The gain crossover frequency and closed-loop bandwidth for the lag-compensated system will be lower than for the
uncompensated plant (after the steady-state error specification has been satisfied), so the compensated system will respond more
slowly in the time domain. The slower response may be regarded as a disadvantage, but one benefit of a smaller bandwidth
is that less noise and other high frequency signals (often unwanted) will be passed by the system. The smaller bandwidth will
also provide more stability robustness when the system has unmodeled high frequency dynamics, such as the bending modes
in aircraft and spacecraft. Thus, there is a trade-off between having the ability to track rapidly varying reference signals and
being able to reject high-frequency disturbances.
The design procedure presented here is basically graphical in nature. All of the measurements needed can be obtained from
accurate Bode plots of the uncompensated system. If data arrays representing the magnitudes and phases of the system at
various frequencies are available, then the procedure can be done numerically, and in many cases automated. The examples
and plots presented here are all done in MATLAB, and the various measurements that are presented in the examples are
obtained from the various data arrays.
The primary references for the procedures described in this paper are [1]–[3]. Other references that contain similar material
are [4]–[11].
−2
−4
−6
Magnitude (db)
−8
−10
−12
−14
−16
−3 −2 −1 0 1 2 3
10 10 10 10 10 10 10
Frequency (r/s)
−5
−10
−15
−20
Phase (deg)
−25
−30
−35
−40
−45
−50
−3 −2 −1 0 1 2 3
10 10 10 10 10 10 10
Frequency (r/s)
C. Compensator Gain
The first step in the design procedure is to determine the value of the gain Kc . In the procedure that I will present, the gain
is used to satisfy the steady-state error specification. Therefore, the gain can be computed from
ess_plant Kx_required
Kc = = (3)
ess_specif ied Kx_plant
where ess is the steady-state error for a particular type of input, such as step or ramp, and Kx is the corresponding error
constant of the system. Defining the number of open-loop poles of the system G(s) that are located at s = 0 to be the System
Type N , and restricting the reference input signal to having Laplace transforms of the form R(s) = A/sq , the steady-state
error and error constant are (assuming that the closed-loop system is bounded-input, bounded-output stable)
∙ N +1−q ¸
As
ess = lim N (4)
s→0 s + Kx
where £ ¤
Kx = lim sN G(s) (5)
s→0
For N = 0, the steady-state error for a step input (q = 1) is ess = A/ (1 + Kx ). For N = 0 and q > 1, the steady-state
error is infinitely large. For N > 0, the steady-state error is ess = A/Kx for the input type that has q = N + 1. If q < N + 1,
the steady-state error is 0, and if q > N + 1, the steady-state error is infinite.
The calculation of the gain in (3) assumes that the given system Gp (s) is of the correct Type N to satisfy the steady-state
error specification. If it is not, then the compensator must have one or more poles at s = 0 in order to increase the overall
System Type to the correct value. Once this is recognized, the compensator poles at s = 0 can be included with the plant
Gp (s) during the rest of the design of the lag compensator. The values of Kx in (5) and of Kc in (3) would then be computed
based on Gp (s) being augmented with these additional poles at the origin.
Example 1: As an example, consider the situation where a steady-state error of ess_specif ied = 0.05 is specified when the
reference input is a unit ramp function (q = 2). This requires an error constant Kx_required = 1/0.05 = 20. Assume that the
plant is Gp (s) = 200/ [(s + 4) (s + 5)], which is Type 0. Then the compensator must have one pole at s = 0 in order to
satisfy this specification. When Gp (s) is augmented with this compensator pole at the origin, the error constant of Gp (s)/s
is Kx = 200/ (4 · 5) = 10, so the steady-state error for a ramp input is ess_plant = 1/10 = 0.1. Therefore, the compensator
requires a gain having a value of Kc = 0.1/0.05 = 20/10 = 2. ¨
Once the compensator design is completed, the total compensator will have the transfer function
Kc (s/zc + 1)
Gc_lag (s) = (N −Nsys )
· (6)
s req (s/pc + 1)
where Nreq is the total required number of poles at s = 0 to satisfy the steady-state error specification, and Nsys is the number
of poles at s = 0 in Gp (s). In the above example, Nreq = 2 and Nsys = 1.
5
If the compensator does not have any poles at the origin, the gain Kc just shifts the plant’s magnitude curve by 20∗log10 |Kc |
db at all frequencies. If the compensator does have one or more poles at the origin, the slope of the plant’s magnitude curve
also is changed by −20 db/decade at all frequencies for each compensator pole at s = 0. In either case, satisfying the steady-
state error sets requirements on the zero-frequency portion of the magnitude curve, so the rest of the design procedure will
manipulate the magnitude and phase curves without changing the magnitude curve at zero frequency. The plant’s phase curve
is shifted by −90◦ (Nreq − Nsys ) at all frequencies, so if the plant Gp (s) has the correct System Type, then the compensator
does not change the phase curve at this point in the design.
The remainder of the design is to determine (s/zc + 1) / (s/pc + 1). The values of zc and pc will be chosen to satisfy the
phase margin and crossover frequency specifications. Note that at ω = 0, the magnitude |(jω/zc + 1) / (jω/pc + 1)| = 1 ⇒ 0
db and the phase ∠ (jω/zc + 1) / (jω/pc + 1) = 0 degrees. Therefore, the low-frequency parts of the curves just plotted
will be unchanged, and the steady-state error specification will remain satisfied. The Bode plots of the complete compensated
system Gc_lag (jω)Gp (jω) will be the sum, at each frequency, of the plots made in this step of the procedure and the plots of
(jω/zc + 1) / (jω/pc + 1).
F. Determination of α
Once the compensated gain crossover frequency has been determined, the amount of attenuation that the lag compen-
sator must provide at that frequency can be evaluated. For all frequencies greater than about 4 ∗ zc , the magnitude of the
(jω/zc + 1) / (jω/pc + 1) part of the lag compensator is −20 ∗ log10 (α) db. Therefore, high frequencies (relative to zc ) will
be attenuated by −20 ∗ log10 (α) db. Thus, α can be determined by evaluating the magnitude of G(jω) in (7) at the frequency
ω x_compensated . If |G (jω x_compensated )| is expressed in db, then the value of α is computed from
⎛ ⎞
|G (jω x_compensated )|db
⎝ ⎠
20
α = 10 (9)
and if |G (jω x_compensated )| is expressed as an absolute value, then the value of α is computed from
α = |G (jω x_compensated )|absolute_value (10)
6
G(s) = 120/[s(s+1)(s+2)(s+3)]
100
50
33.4 db
0
−50
Magnitude (db) & Phase (deg)
−100
−130 deg
−150
−200
−250
−300
−350
ω = 0.39 r/s
−400
−2 −1 0 1 2 3
10 10 10 10 10 10
Frequency (r/s)
magnitude of G (jω) by the same amount. Since the magnitude of a product of transfer functions is the product of the individual
magnitudes, the value of α for each of the stages is
√
αstage = nstage αtotal (13)
where nstage is the number of stages to be used in the compensator, given by
⎧ ⎫
⎪
⎪ 2, 10 < αtotal ≤ 100 ⎪
⎪
⎪
⎨ 3, 100 < αtotal ≤ 1000 ⎪
⎬
nstage = .. .. (14)
⎪
⎪ . . ⎪
⎪
⎪
⎩ ⎪
⎭
n, 10n−1 < αtotal ≤ 10n
Example 4: If the value α = 46.6 in Example √ 3 is assumed to be too large, two stages of compensation can be used. Each
stage would be given an attenuation of αstage = 46.6 = 6.83. When the compensator√is implemented, the gain Kc = 2 could
also be divided evenly between the two stages in the same fashion, with Kc_stage = 2 = 1.414. ¨
G. Determination of zc and pc
The last step in the design of the transfer function for the lag compensator is to determine the values of the pole and
zero. We have already determined their ratio α, so only one of those terms is a free variable. We will choose to place the
compensator zero and then compute the pole location from pc = zc /α. Figure 1 is the key to deciding how to place zc . In
that example, zc = 2.5, and at the frequency ω = 25 r/s (one decade above the frequency corresponding to the value of zc ),
the magnitude is constant at −15.9 db, and the phase shift of the compensator is −4.7◦ . Because of the nature of the tangent
of an angle, the phase shift for a single-stage lag compensator will never be more negative than −5.7◦ at a frequency one
decade above the location of the compensator zero. In determining the compensated gain crossover frequency in (8), we added
10◦ to the specified phase margin to account for phase shift from the compensator at ω x_compensated . Therefore, if the value
of the compensator zero is chosen to correspond to the frequency one decade below ω x_compensated , then the phase margin
will always be satisfied. Smaller values of zc can also be used. Lower limits on the values of zc and pc are governed by the
values of the corresponding electronic components used to implement the compensator.1 The compensator’s zero and pole are
computed from
ω x_compensated zc
zc ≤ , pc = (15)
10 α
Example 5: Continuing from Example 3, with ω x_compensated = 0.39 r/s and α = 46.6, acceptable values for the compen-
sator’s zero and pole are zc = 0.39/10 = 0.039 and pc = 0.039/46.6 = 8.37 · 10−4 . The complete compensator for these
examples is
2 (s/0.039 + 1) 0.0429 (s + 0.039)
Gc_lag (s) = = (16)
s (s/8.37 · 10−4 + 1) s (s + 8.37 · 10−4 )
If the compensator is split into two stages, as in Example 4, then zc = 0.39/10 = 0.039 and pc = 0.039/6.83 = 5.71 · 10−3
can be used for the zero and pole for each stage of the compensator.
Placing the zero at zc = 0.039 and using two stages of compensator uses up all of the 10◦ safety factor included in expression
(8). To assure that the phase margin specification will be satisfied when using multiple stages of lag compensation, I use the
following technique for determining the compensator’s zero and pole:
ω x_compensated zc
zc = , pc = (17)
10nstage αstage
which for this example gives zc = 1.95 · 10−2 and pc = 2.86 · 10−3 , and the total compensator is
¡ ¢2 " ¡ ¢ #2
2 s/1.95 · 10−2 + 1 1 1.414 s/1.95 · 10−2 + 1
Gc_lag (s) = = · (18)
s (s/2.86 · 10−3 + 1)2 s (s/2.86 · 10−3 + 1)
" ¡ ¢ #2
1 0.207 s + 1.95 · 10−2
= ·
s (s + 2.86 · 10−3 )
with nstage = 2 and αstage = 6.83. ¨
The lag compensator is ideal in the sense that any amount of magnitude attenuation can be theoretically provided by a single
stage of compensation since α = |G (jω x−compensated )|abs_val > 1. The effects of negative phase shift from the compensator
can be made negligible by making zc suitably small. The need for multiple stages of compensation is dictated by implementation
considerations in the choice of electronic component values.
1 The textbook by Ogata [3] has a table in Chapter 5 that shows op amp circuits for various types of compensators.
8
B. Compensator Gain
The given plant is Type 1, and the steady-state error specification is for a ramp input, so the compensator does not need
to have any poles at s = 0. Only the gain Kc needs to be computed for steady-state error. The steady-state error for a ramp
input for the given plant is
∙ ¸
280 (s + 0.5)
Kx_plant = lim s · (20)
s→0 s (s + 0.2) (s + 5) (s + 70)
∙ ¸
2 (s/0.5 + 1)
= lim s ·
s→0 s (s/0.2 + 1) (s/5 + 1) (s/70 + 1)
=2
1
ess_plant = = 0.5 (21)
Kx
Since the specified value of the steady-state error is 0.02, the required error constant is Kx_required = 50. Therefore, the
compensator gain is
ess_plant 0.5
Kc = = = 25 (22)
ess_specif ied 0.02
Kx_required 50
= = = 25
Kx_plant 2
This value for Kc will satisfy the steady-state error specification, and the rest of the compensator design will focus on the
phase margin specification.
50
|KcGp(j2.45)| = 17.4 db
0
Magnitude (db) & Phase (deg)
−50
−100
−125 deg
−150
−200
ω = 2.45 r/s
−250
−300
−2 −1 0 1 2 3 4
10 10 10 10 10 10 10
Frequency (r/s)
Fig. 3. Bode plots for the plant after the steady-state error specification has been satisfied.
Our ability to graphically determine values for ω x_compensated and α obviously depends on the accuracy and resolution
of the Bode plots of |Kc Gp (jω)|. High resolution plots like those obtained from MATLAB allow us to obtain reasonably
accurate measurements. Rough, hand-drawn sketches would yield much less accurate results and might be used only for first
approximations to the design. Being able to access the actual numerical data allows for even more accurate results than the
MATLAB-generated plots. The procedure that I use when working in MATLAB generates the data arrays for frequency,
magnitude, and phase from the following instructions:
w = logspace(N1,N2,1+100*(N2-N1));
[mag,ph] = bode(num,den,w);
semilogx(w,20*log10(mag),w,ph),grid
where N1= log10 (ω min ), N2 = log10 (ω max ), and num, den are the numerator and denominator polynomials, respectively, of
Kc Gp (s). For this example,
N1= −2;
N2= 4; £ ¤
¡£ ∗ 1 0.5 ¤ ;
num= 25 ∗ 280 ¡£ ¤ £ ¤¢¢
den=conv 1 0.2 0 , conv 1 5 , 1 70 ;
The data arrays mag, ph, and w can be searched to obtain the various values needed during the design of the compensator.
√
is ω = 2 · 3 = 2.45 r/s. Searching the MATLAB data arrays storing the frequency and phase information gives the value
ω = 2.4531 r/s (using 100 equally-spaced values per decade of frequency), so the estimate obtained from the graph is very
accurate in this example.
E. Calculating α
The lag compensator must attenuate |Kc Gp (jω)| so that it has the value 0 db at frequency ω = 2.45 r/s. From the magnitude
curve in Fig. 3, it is easy to see that |Kc Gp (j2.45)|db is between 15 db and 20 db. An accurate measurement of the graph
would provide a value of 17.4 db for the magnitude. The corresponding value of α is calculated by using (9), and the result
is α = 7.435, which can be easily implemented with a single stage of compensation. A search of the MATLAB data array
storing the magnitudes (as absolute values) yields 7.435 as the element corresponding to ω = 2.45 r/s, so equation (10) is
verified.
25 (s/0.245 + 1) 25 (4.08s + 1)
Gc_lag (s) = = (23)
(s/0.033 + 1) (30.3s + 1)
3.37 (s + 0.245)
=
(s + 0.033)
50
0
Magnitude (db) & Phase (deg)
−50
KcGp(jω)
−100 KcGp(jω)
−150
−200
ω = 2.45 r/s
−250
−300
−3 −2 −1 0 1 2 3 4
10 10 10 10 10 10 10 10
Frequency (r/s)
0
−3 db
−20
−40
Magnitude (db)
−60
−80
−100
G (s)
−120 p
KcGp(s)
G (s)G (s)
c p
−140
−2 −1 0 1 2 3
10 10 10 10 10 10
Frequency (r/s)
To implement the compensator using the circuit in [3] note that there are 6 unknown circuit elements (R1 , C1 , R2 , C2 , R3 ,
R4 ) and 3 compensator parameters (Kc , zc , pc ). Therefore, three of the circuit elements can be chosen to have convenient
values. To implement the original lag compensator Gc_lag (s) in this design example, we can use the following values
= C2 = 0.47 μF = 4.7 · 10−7 F,
C1 R3 = 10 KΩ = 104 Ω (27)
1
R1 = = 8.67 MΩ = 8.67 · 106 Ω
zc C1
1
R2 = = 64.4 MΩ = 6.44 · 107 Ω
pc C2
R3 Kc
R4 = = 33.6 KΩ = 3.36 · 104 Ω
α
where the elements in the first row of (27) were specified and the remaining elements were computed from (26).
I. Summary
In this example, the phase lag compensator in (23) is able to satisfy both of the specifications of the system given in (19). In
addition to satisfying the phase margin and steady-state error specifications, the lag compensator also produced a step response
with shorter settling time.
In summary, phase lag compensation can provide steady-state accuracy and necessary phase margin when the Bode magnitude
plot can be dropped down at the frequency chosen to be the compensated gain crossover frequency. The philosophy of the lag
compensator is to attenuate the frequency response magnitude at high frequencies without adding additional negative phase
shift at those frequencies. The step response of the compensated system will be slower than that of the plant with its gain set
to satisfy the steady-state accuracy specification, but its phase margin will be larger. The following table provides a comparison
between the systems in this example.
13
1.6
1.4
1.2
Output Amplitude
0.8
0.6
0.4
G (s)
p
0.2 K G (s)
c p
G (s) (s)
c p
0
0 1 2 3 4 5 6 7 8 9 10
Time (s)
7
Output Amplitude
2 Gp(s)
K G (s)
1 c p
G (s) (s)
c p
0
0 1 2 3 4 5 6 7 8 9 10
Time (s)
Characteristic Symbol Gp (s) Kc Gp (s) Gc_lag (s)Gp (s) Gc_lag_2 (s)Gp (s)
steady-state error ess 0.5 0.02 0.02 0.02
phase margin PM 62.5◦ 18.7◦ 50◦ 54.5◦
gain xover freq ωx 0.88 r/s 9.36 r/s 2.46 r/s 2.45 r/s
time delay Td 1.24 sec 0.035 sec 0.354 sec 0.387 sec
gain margin GM 87.7 3.51 24.8 25.9
gain margin (db) GMdb 38.9 db 10.9 db 27.9 db 28.3 db
phase xover freq ωφ 18.1 r/s 18.1 r/s 17.7 r/s 18.1 r/s
bandwidth ωB 1.29 r/s 14.9 r/s 4.21 r/s 4.12 r/s
percent overshoot PO 13.5% 60.7% 25.3% 17.8%
settling time Ts 7.52 sec 2.38 sec 4.24 sec 3.84 sec
R EFERENCES
[1] J.J. D’Azzo and C.H. Houpis, Linear Control System Analysis and Design, McGraw-Hill, New York, 4th edition, 1995.
[2] Richard C. Dorf and Robert H. Bishop, Modern Control Systems, Addison-Wesley, Reading, MA, 7th edition, 1995.
[3] Katsuhiko Ogata, Modern Control Engineering, Prentice Hall, Upper Saddle River, NJ, 4th edition, 2002.
[4] G.F. Franklin, J.D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems, Addison-Wesley, Reading, MA, 3rd edition, 1994.
[5] G.J. Thaler, Automatic Control Systems, West, St. Paul, MN, 1989.
[6] William A. Wolovich, Automatic Control Systems, Holt, Rinehart, and Winston, Fort Worth, TX, 3rd edition, 1994.
[7] John Van de Vegte, Feedback Control Systems, Prentice Hall, Englewood Cliffs, NJ, 3rd edition, 1994.
[8] Benjamin C. Kuo, Automatic Controls Systems, Prentice Hall, Englewood Cliffs, NJ, 7th edition, 1995.
[9] Norman S. Nise, Control Systems Engineering, John Wiley & Sons, New York, 3rd edition, 2000.
[10] C.L. Phillips and R.D. Harbor, Feedback Control Systems, Prentice Hall, Upper Saddle River, NJ, 4th edition, 2000.
[11] Graham C. Goodwin, Stefan F. Graebe, and Mario E. Salgado, Control System Design, Prentice Hall, Upper Saddle River, NJ, 2001.