You are on page 1of 26

EE 4314

Examples on Compensator Design



Spring 2011

Stability Margins
Gain margin: (GM): Factor
by which the gain can be
raised before instability
results
Phase margin (PM):
Amount by which the
phase of G(j) exceeds
-180 when |KG(j)|=1
Stability Margins
GM and PM are measures
of how close the Nyquist
plot comes to encircling
the -1 point

Lead Compensator Design Summary

Lag Compensator Design Summary
Design Example Root Locus (p. 261)

G s
( )
=
u s
( )
o
e
s
( )
=
160 s + 2.5
( )
s + 0.7
( )
s
2
+ 5s + 40
( )
s
2
+ 0.03s + 0.06
( )
The transfer function between the
elevator input and the pitch attitude
is
where

is the pitch angle* (degrees)

is the elevator angle (degrees)

u

o
e
Design the controller so that

1. Rise time of 1 sec or less
2. Overshoot less than 10%
* see sec 10.3 for details
Design Example Root Locus
According to the specifications:
From (3.60) p.116:

t
r
~
1.8
e
n
From (3.64) p.118:

M
p
= e
t, / 1,
2

e
n
>1.8 rad/sec

, >0.6
As a result, desired closed-loop pole should be at:

p =o je
d
where

o =, e
n
e
d
=e
n
1,
2
(3.56) p.112
Design Example Root Locus
Lets look at open loop response of the system, by using Matlab:

>> num = 160 .* conv([1 2.5], [1 0.7]);
>> den = conv([1 5 40], [1 0.03 0.06]);
>> sysOl = tf(num, den);
>> step(sysOl)

Design Example Root Locus
Now, look at the root locus of the system:

>> Wn = 1.8;
>> DR = 0.6;
>> sigma = DR * Wn;
>> Wd = Wn * sqrt(1 - DR^2);
>> p = -sigma + j*Wd;
>> q = -sigma - j*Wd;
>> rlocus(sysOl)
>> hold on
>> plot(p, '*')
>> plot(q, '*')
>> grid on
Design Example Root Locus
Root Locus Plot
Design Example Root Locus
Using rlocfind command to find the gain K that yield the closed-loop
poles that locate as close to the desired poles location as possible:

>> rlocfind(sysOl)
Select a point in the graphics window

selected_point =

-0.9755 + 0.4105i


ans =

0.3260
Use K = 0.3260
Design Example Root Locus
Use proportional gain K = 0.326 to see if it gives satisfactory close-
loop response:

>> sysClP = feedback(0.326*sysOl, 1)

Transfer function:
52.16 s^2 + 166.9 s + 91.28
--------------------------------------------
s^4 + 5.03 s^3 + 92.37 s^2 + 168.4 s + 93.68

>> step(sysClP)


The overshoot is greater than
10 %, rise time is okay.
Design Example Root Locus
Since proportional control is not enough, we can use lead
compensator as a lead compensator would shift the root locus
further to the left (lowering rise time and decreasing the transient
overshoot (p. 249).
From p. 250, the zero of the lead compensator should be placed in
the neighborhood of the desired closed-loop Wn, and the pole
of the lead compensator should be 5 to 20 times of the value of the
zero. Lets pick z = 2 (as Wn = 1.8) and p = 2 * 10 = 20.

D s
( )
= K
s + 2
s + 20
Design Example Root Locus
Now pick gain K of the lead compensator:

>> lead = tf([1 2], [1 20]);
>> sysLead = lead * sysOl;
>> rlocus(sysLead)
>> hold on
>> plot(p, '*')
>> plot(q, '*')
>> grid on
>> hold off
>> rlocfind(sysLead)
Select a point in the graphics window

selected_point =

-8.7708 +14.3523i


ans =

1.7599
Design Example Root Locus
Simulate the step response of the new closed-loop system:

>> sysClLead = feedback(1.7599 * sysLead, 1)

Transfer function:
281.6 s^3 + 1464 s^2 + 2295 s + 985.5
------------------------------------------------------
s^5 + 25.03 s^4 + 422.4 s^3 + 2270 s^2 + 2327 s + 1034

>> step(sysClLead)

Design Example Root Locus

D s
( )
=1.7599
s + 2
s + 20
Design Example Compensator Design from Freq. Response
Example 6.17 (p. 358) a Type 1 Servomechanism System

KG s
( )
= K
10
s s/2.5 +1
( )
s/6 +1
( )
Design a lead compensator so that the PM = 45 and Kv = 10.

From p. 356:

Step 1: Pick K to satisfy error constant
from p. 181

K
v
= lim
s0
sK G s
( )
= K
10
0 +1
( )
0 +1
( )
K =1
Design Example Compensator Design from Freq. Response
Step 2: Evaluate the PM of the uncompensated system using K
obtained from step 1

>> Gs = tf(10, conv([1 0], conv([1/2.5 1], [1/6 1])))

Transfer function:
10
----------------------------
0.06667 s^3 + 0.5667 s^2 + s

>> [mag, phase, w] = bode(Gs);
>> [GM, PM, Wcg, Wcp] = margin(mag, phase, w)

GM =

0.8540

PM =

-4.1158

Wcg =

3.8730

Wcp =

4.1910
Design Example Compensator Design from Freq. Response
Step 3: Add extra margin (about 5-10) and determine the phase lead

|
max
= 45
o
+ 5
o
(4
o
)
= 54
o
Step 4: Determine from (6.40) p. 349:

o

o =
1sin|
max
1+ sin|
max

o = 0.1
Step 5: Pick at the crossover frequency:

e
max

1/T =e
max
o
T ~ 0.5


D s
( )
=
Ts+1
oTs+1
=
0.5s +1
0.05s +1
Design Example Compensator Design from Freq. Response
Step 6: Draw the compensated frequency response and check the PM:


>> lead = tf([0.5 1], [0.05 1]);
>> sysLead = lead * Gs;
>> [mag, phase, w] = bode(sysLead);
>> [GM, PM, Wcg, Wcp] = margin(mag, phase, w)

GM =

2.3204

PM =

22.9367

Wcg =

11.5132

Wcp =

7.2994

Design Example Compensator Design from Freq. Response
We can use sisotool command to find GM, PM, Wcp, Wcg:

>> sisotool(sysLead)

Design Example Compensator Design from Freq. Response
Step 6: Iterate on the design until all specifications are met.
Add an additional lead compensator if necessary.

We can see that with only on lead compensator, we can only get the
PM of 23.

So, we need to repeat Step 1 Step 5 again to add additional lead
compensator.

Assuming the second iteration gives:



D s
( )
=
Ts+1
oTs+1
=
0.25s +1
0.025s +1
Design Example Compensator Design from Freq. Response
Lets check the PM new compensated system:

>> secondLead = tf([0.25 1], [0.025 1]);
>> sysDoubleLead = secondLead * sysLead;
>> [mag, phase, w] = bode(sysDoubleLead);
>> [GM, PM, Wcg, Wcp] = margin(mag, phase, w)

GM =

3.8669


PM =

45.6362


Wcg =

30.7887


Wcp =

13.7805
Design Example Compensator Design from Freq. Response
The overall compensator becomes:


D s
( )
=
0.5s +1
(0.05s +1)
0.25s +1
(0.025s +1)
Lets take a look at the step responses of the compensated system:

>> sysLeadCl = feedback(sysLead, 1);
>> sysDoubleLeadCl = feedback(sysDoubleLead, 1);
>> step(sysLeadCl)
>> hold on
>> step(sysDoubleLeadCl)
>> hold off
>> grid on
>> legend('Single Lead Compensator', 'Double Lead Compensator')
Design Example Compensator Design from Freq. Response
Step responses of the single lead compensator system vs double
lead compensator system
Compensator Design Conclusion

Lead Compensator => PD Controller

Speed up system response
Lowering the rise time
Decreasing the overshoot


Lag Compensator => PI Controller

Improve steady-state accuracy

You might also like