Date post: | 02-Nov-2014 |
Category: |
Documents |
Upload: | bico-altahir |
View: | 133 times |
Download: | 0 times |
• The main objective of control II is to cover the topics of three main items namely error analysis, PID controller, and compensators with all their types.
2
3
Error Analysis
• Steady state Error is a measure of system accuracy when a specific type of input is applied to a control system.
• Steady state errors are unavoidable in design, just keep the error to minimum.
(tolerable value)
• Steady-state error is the difference between the input and the output for a prescribed test input as t .
4
5
• Errors contributing factors:
• S.S errors caused by nonlinear elements:
• -Nonlinear Dead Zone.
• -Nonlinear Friction
• If an amplifier is used in a control system has input –output characteristics as shown in following figure output
input0 D-D
Mag. Less than DZ point
6
• When the input magnitude is less than the dead zone, the output of the amplifier would be zero and the control will not be able to correct the error.
• So the steady state error is related to the size of the dead zone.
• In control physical objects, friction is unavoidable.
• Coulumb friction is a common cause of steady state errors in control systems.
7
• Consider that the torque generated by a step motor is related to the rotor position of the motor.
• When there is no friction, the step motor is supposed to have a zero steady state error.
• However the rotor of the motor sees a coulumb friction torque Tf.
• Then the motor torque must first overcome this frictional torque before producing any motion.
8
• Thus as the motor torque falls below Tf, it may stop at any position inside the shaded band as shown.
Tf
-Tf
Torque
0
0 is equilibrium point
Threshold to move
Configuration SSE
• The SSE that must be analyzed are errors that arise from the configuration of the system itself.
• For example changing K (forward gain) will affect the SSE.
• Type of input also affect the SSE value.
9
10
• S.S Error of Linear Systems:• Depends on input and the type of the
system.• In control system if: r(t) is the reference input C(t) controlled output. e(t) error signal then: e(t) = r(t) – c(t)• Provided that r(t) and C(t) are
dimensionally the same i.e voltage controlling a voltage, position controlling a position, and so on.
Open-Loop S.S.E
• r(t) is input, y(t) is the output, G is gain then for open-loop
ess = lim [(r(t) – y(t)] t
in Laplace e(s) = r(s) – y(s)
but y(s) = G(s)r(s) then
e(s) = r(s) – G(s)r(s) = [1 – G(s)]r(s)
11
Example
• If G(s) =
7s2 + 18s + 15
s3 + 5s2 + 11s + 15
Find open loop ess(t) for a Ramp input
12
Solution
• We have e(s) = [1 – G(s)]r(s) and ess(t) = lim s e(s)
s0
se(s) = s[s3 + 5s2 + 11s +15 –(7s2 + 18s + 15)]1/s2
s3 + 5s2 + 11s + 15
= s2 – 2s -7
s3+5s2 + 11s +15 13
• And ess(t) = lim s e(s)
s0
= -7/15
check using Matlab
14
15
Feedback Error
• The last equation is valid for open loop systems only.
• The feedback loop element H(s) is usually incorporated in the feedback loop.
• Here we have a feedback error E(t).
Or
E(t) = r(t) – b(t)
16
G(s)
H(s)b(t)
B(s)
e(t)
E(s)-+
r(t)
R(s)
C(t)
C(s)
E(t) = r(t) – b(t)
E(s) = R(s) – B(s) = R(s) – H(s)C(s)
17
• For example if 10v reference signal is used to regulate 100v supply, H is constant and equal to 0.1
• When the output voltage is exactly 100v (hopefully) , the error signal is
• E(t) = 10 – (0.1)(100) = 0
• The S.S error of a feedback control system is defined as the error when time approaches infinity.
S.S Error =ess = lim E(t) t
18
• With reference to Laplace transformed, error function is: (see feedback diagram)
E(s) = R(s) 1+G(s)H(s)• By use of the final value theorem, the
steady state error of a system is:
ess = lim E(t) = lim sE(s) t s0
• Thus
ess = lim sR(s) s0 1+G(s)H(s) (*)
19
• S.S error due to a Step input: (static position eror)
• In step input, the laplace transform of input is R/S then last equation becomes:
ess = lim R s0 1+G(s)H(s)
= R (1)
1+ lim G(s)H(s)
s0
20
• For convenience we define
• Kp = lim G(s)H(s) type 0
s0
where Kp is the step error constant.
• Then
ess(t) = R
1+ Kp
• We see that for ess to be zero for step input Kp must be infinity.
21
• S.S error due to Ramp input: (static velocity error)
• Input r(t) = Rt.us(t) and Laplace of r(t) is
• R(s) = R/s2 sub. In equation (*)
ess = lim R s0 s+sG(s)H(s)
= R (2)
lim sG(s)H(s) s0 type 1
22
• If we define Kr as Ramp error constant
= lim sG(s)H(s) s0
• Then the Ramp equation is:
ess = R
Kr which is the S.S error when the input is a Ramp function.
• For ess to be zero when input is a Ramp,
Kr must be infinity
23
S.S Error
r(t)
t
Output c(t)
Ramp S.S Error
24
• S.S Error due to Parabolic input: (acceleration error)
• P(t) = Rt2 us(t)• t • And Laplace transform of P(t) is:• P(s) = R• s3 then ess in eq. (*) is:
• ess = R (3)• S2 + lim S2G(s)H(s)• s0
• =0 when s goes to 0 (but limit does not because S2 may be cancelled by G(s) or H(s) )
25
• And defining the parabolic error constant as Ka where Ka = lim S2G(s)H(s)
• s0
• Then
• ess = R
• Ka
• Taking power of S we can write
Type 0 system s=0
Type 1 system s=1
Type 2 system s=2 and so forth.
26
Type of system
s
step
Kp
Ramp
Kr
prb
Ka
Step
e=R/(1+kp)
Ramp
e=R/kr
Parab
e=R/ka
0 k 0 0 ess=R/(1+kp) ess= ess=
1 k 0 ess= 0 ess=R/k ess=
2 k ess= 0 ess=0 ess=R/K
3 ess= 0 ess= 0 ess= 0
S.S errors due to step, Ramp, and parabolic inputs
• Example
A unity feedback system with forward TF G = 120(s+2)/[(s+3)(s+4)] find the SSE if input was:
• i/ 5u(t), ii/ 5t u(t) iii/ 5t2 u(t)
27
• Solution:
i/ input 5 u(t) has 5/s input step function thus we use eq (1)
= 5/[(1 + lim G(s).H(s)] s0
= 5/ [ 1 + 20] = 5/21
28
• ii/ input 5t u(t) = 5/s2 so type 1 so we use eq (2) for a ramp input
R• lim sG(s)H(s) H(s)=1
• s0
• = 5/0 =
29
30
• iii/ input 5t2 u(t) = 10/s3 so type 2 we use eq (3) for a parabolic input
R
• lim s2G(s)H(s)• s0
• = 10/0 =
• Use Matlab to ensure the previous answers for each input.
• Example :
Find the SSE for a unity feedback system for the last three inputs if G(s) =
100[(s+2)(s+6)]/[s(s+3)(s+4)]
31
• Solution:
i/ for input 5/s type 0 SSE = 5/ = 0
ii/ for input 5/s2 type 1 SSE = R/[lim sG(s)] s will cancel s for G(s) so (5.12)/(100.12)
=
5/100 = 1/2032
• iii/ For input 5t2 u(t) = 10/s3 we obtain
SSE = 10/0 =
33
Using Kp, Kr, and Ka
• It is useful to find the above three static error constant values first then apply according to input.
• Example: For the following figure find the three error constants then find the error of the system for step, ramp, and parabolic inputs.
34
35
500(s+2)(s+5)
(s+8)(s+10)(s+12)
e(t)
E(s)-+
r(t)
R(s)
C(t)
C(s)
• Solution
kp = lim G(s) = 500 x2x5
s0 8x10x12 = 5.208
Kr = lim sG(s) = 0 s0
Ka = = lim s2G(s) = 0 s0
36
• For step input SSE = 1/[1+kp] = 0.161
• For a ramp input SSE = 1/Kr 1/0 =
• For a parabolic input SSE = 1/Ka =1/0 =
37
• What information you find if we say the Kp for a system = 1000?
• 1. system is stable
• 2. System is type 0
• 3. input test signal is step.
• 4. Kr= Ka= 0 and ess =
• 5. SEE = 1/(1+Kp) = 1/1001
38
Gain design due required error
• A unity feedback system with G(s) =
K(s+5)/[s(s+6)(s+7)(s+8)]
Find value of K so that SEE is 10% in type 1 system
39
• Solution:
SEE = 1/Kr = 0.1 so Kr = 10
but Kr = lim sG(s)
s0 = (Kx5)/(6x7x8)
which yields K= 672
(use Matlab to solve this problem)
40
• Example:
A unity feedback system with forward TF
G(s) = K(s+12)/[(s+14)(s+18)]
Find the value of K to yield 10% SSE
41
• Answer:
this is type 0 so 1/(1+Kp) = 0.1
and Kp= 9
But Kp = lim G(s) = (Kx12)/(14x18)
s0 from which
K= 189
42
43
PID Controller
• How to use Proportional (P), the integral (I), and the derivative (D) controls, to obtain a desired response.
• Consider the following unity feedback system:
44
Plant: A system to be controlledController: Provides the excitation for the plant; Designed to control the overall system behavior.
45
A block diagram of a PID controller
46
• The transfer function of the PID controller looks like the following:
Kp = Proportional gain KI = Integral gain Kd = Derivative gain
47
• The variable (e) represents the tracking error, the difference between the desired input value (R) and the actual output (Y).
• This error signal (e) will be sent to the PID controller.
• The controller computes both the derivative and the integral of this error signal.
48
• The signal (u) just past the controller is now equal to:
• The proportional gain (Kp) times the magnitude of the error plus the integral gain (Ki) times the integral of the error plus the derivative gain (Kd) times the derivative of the error.
49
-This signal (u) will be sent to the plant, and the new output (Y) will be obtained.
-The new output (Y) will be sent back to the sensor again to find the new error signal (e).
50
• The controller takes this new error signal and computes its derivative and its integral again.
This process goes on and on
51
The characteristics of P, I, and D controllers
• A proportional controller (Kp) will have the effect of reducing the rise time and will reduce ,but never eliminate, the steady state error.
• An integral control (Ki) will have the effect of eliminating the steady-state error, but it may make the transient response worse.
52
• A derivative control (Kd) will have the effect of increasing the stability of the system, reducing the overshoot, and improving the transient response.
• Effects of each of controllers Kp, Kd, and Ki on a closed-loop system are summarized in the following table .
53
CL RESPONSE
RISE TIME
OVERSHOOT
SETTLING TIME
S-S ERROR
Kp Decrease Increase Small Change Decrease
Ki Decrease Increase Increase Eliminate
KdSmall
ChangeDecrease Decrease Small Change
54
Example simple mass, spring, and damper problem
55
• The modeling equation of this system is
56
• Let
M = 1kg
b = 10 N.s/m
k = 20 N/m
Find Zeta
57
• The goal is to show how each of Kp, Ki and Kd contributes to obtain
• Fast rise time
• Minimum overshoot
• No steady-state error
58
Open-loop step response
• num=1;
• den=[1 10 20];
• step(num,den)
59
From the previous response
• The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of the output to an unit step input.
This corresponds to the steady-state error of 0.95, quite large indeed.
Furthermore, the rise tr time is about one second, and the settling time ts is about 1.5 seconds.
60
• Let's design a controller that will reduce the rise time, reduce the settling time, and eliminates the steady-state error.
Proportional control
• From the table shown before, we see that the proportional controller (Kp) reduces the rise time, increases the overshoot, and reduces the steady-state error.
61
• The closed-loop transfer function of the above system with a proportional controller is:
62
• Let the proportional gain (Kp) equals 300
• Kp=300;
• num=[Kp];
• den=[1 10 20+Kp];
• t=0:0.01:2;
• step(num,den,t)
63
The above plot shows that the proportional controller reduced both the rise time and the steady-state error, increased the overshoot, and decreased the settling time by small amount.
64
Proportional-Derivative control
• Previous table shown above, we see that the derivative controller (Kd) reduces both the overshoot and the settling time.
• The closed-loop transfer function of the given system with a PD controller is:
65
• Kp=300;
• Kd=10;
• num=[10 300];
• den=[1 20 320];
• t=0:0.01:2;
• step(num,den,t)
66
The derivative controller reduced both the overshoot and the settling time, and had small effect on the rise time and the steady-state error.
67
Proportional-Integral control• From the table, we see that an integral
controller (Ki) decreases the rise time, increases both the overshoot and the settling time, and eliminates the steady-state error.
• For the given system, the closed-loop transfer function with a PI control is:
68
• Kp=30;
• Ki=70;
• num=[30 70];
• den=[1 10 50 70];
• t=0:0.01:2;
• step(num,den,t)
69
The response shows that the integral controller eliminated the steady-state error.
70
Proportional-Integral-Derivative control
• Now, let's take a PID controller.
• The closed-loop transfer function of the given system with a PID controller is:
71
• Kp=350;
• Ki=300;
• Kd=50;
• num=[Kd Kp Ki];
• den=[1 10+Kd 20+Kp Ki];
• t=0:0.01:2;
• step(num,den,t)
72
Now, we have obtained the system with no overshoot, fast rise time, and no steady-state error.
73
Step Response
Time (sec)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Tips for designing a PID controller
• Obtain an open-loop response and determine what needs to be improved
• Add a proportional control to improve the rise time • Add a derivative control to improve the overshoot • Add an integral control to eliminate the steady-
state error • Adjust each of Kp, Ki, and Kd until you obtain a
desired overall response.
74
75
Compensators
• Compensators are used to alter the response of a control system in order to accommodate the set design criteria.
• By introducing additional poles and/or zeros to a system, the response of the system will change significantly.
76
• The compensator is an additional device or a component to improve the system performance. (may be beside the original controller).
77
• Lead compensation alters the transient response of systems.
• This includes overshoot, rise time (TR), settling time (TS), and peak time (TP).
• Lag compensation alters steady-state error of systems. (but may get the transient worse- it is the pay)
78
Type of Compensators
Cascade Compensators
R(s) C(s)
G(s)Gc(s)
79
where
makes this a lead compensator and abs(Z) = 1/T1 closer to origin makes this a lag compensator. abs(P) = 1/T2 closer to origin
80
• Feedback Compensators
R(s) C(s)
G(s)
Gc(s)
81
• Consider the first order compensator
k(s + z)
Gc(s) =
(s + p)
Gc(s) is added to achieve a min SSE and the relative required stability.
82
Phase-Lead • Phase-Lead is provided by
Gc = 1 + Ts >1
1 + Ts
= p/z >1 (required ratio of zero to pole of the compensator when < 1 gives a Lag compensator).
Phase-Lead zero = -1/ (T)
Phase-Lead pole = -1/T
• Thus representing phase-lead using poles and zeros
• Gc = S + 1/ (T)
• S + (1/T)
• So when you find and T the compensator is ready.
83
84
Phase-Lead
• In the previous equation if z < p , the compensator is a Lead compensator.
• • -1/T -1/ (T)
zp
The zeros are closer to the origin than poles
85
86
• 1/ The magnitude of Gc is 20 log • 2/ The max phase Lead m occurs half way
between poles and zeros frequencies therefore m = z.p = 1/(T ) and T = 1/ (m )
m meets the Half of the magnitude
• 3/ For compensated max phase sin() = - 1 +1
• Maximum phase shift φmax of phase-lead compensator
• = sin-1 - 1• + 1
and occurs at m = 1/(T )
The value of gain at that frequency is
(0.5)20 log = 10 log
87
Steps in design of phase-lead compensator
• STEP 1.
• Choose gain K to satisfy steady-state requirements.
• STEP 2.
• Draw Bode-diagram of KG(s) and find PM
• = (current phase margin)
88
• STEP 3.
• Find the difference of phase margin
• = Required PM – Current PM
• Step 4
• give a margin of 5 degree and apply sin formula to find
• sin( ) = ( - 1)/( +1)
• from which find
89
• STEP 5.
• Find The new crossover frequency ωc = ωm at (0.5)20 log
• Apply T = 1/[msqrt()] to find T
• Step 6
• Construct Gc(s)
• Check the new cascaded Gc(s).G(s) (and C.L ) Bode to ensure the required PM
90
91
Phase-Lead Example
• A unity feedback system with open loop TF
• k• (10s+1)(s+1)
• Is required to have• 1/steady state error does not exceed 1% for a
unit step (static position error kp)• 2/Open-Loop phase margin of at least 45o
92
Solution
• i/ Determine the required value of k for Ess
• ess = 0.01 = lim SE(s) =
= lim [ 1/(1+[(k/(1+10s)(1+s))] for unit step
ess= 1/(1 + kp)
0.01 = 1/(1+ kp) from which
kp = 1/0.01
= 100 then k = 100
ii/ Check the current phase margin of kG(s)
( with k=100) from which the current
PM = 20
93
94
KG(s) Bode before Compensation
-60
-40
-20
0
20
40M
ag
nitude (
dB
)
10-3
10-2
10-1
100
101
102
-180
-135
-90
-45
0
Phas
e (
deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 19.8 deg (at 3.08 rad/sec)
Frequency (rad/sec)
95
• So a difference of (45-20) = 25 should be compensated
• Since we have a margin of 5 degree we choose 30o and substitute
sin(30) = ( - 1)/( +1) from which
= 3 so the compensator TF
Gc(s) = 1+3Ts
1+ Ts
96
• Now the value of T must be found.• We have mag of Gc at max phase shift
= (0.5) 20 log • = 20 log 3 = 9.54 dB and we know m meets the Half of the magnitude of the
max phase-lead shift • = (0.5)(9.54) = -4.77 dB (-ve)
• Now from Bode m = 4 rad/sec and hence T = 1/[msqrt()] =1/[(4)sqrt(3)]
• T = 0.14
97
• So Gc will be
• Gc = 1 + 0.42S
• 1 + 0.14S
• To check the effect of Gc see the Bode & response of the O.L with and without the compensator. (new ph margin of 45.1)
98
Compensated open-Loop bode diagram
-100
-50
0
50M
agnitu
de (
dB
)
10-3
10-2
10-1
100
101
102
103
-180
-135
-90
-45
0
Ph
ase (
deg
)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 45.1 deg (at 4.09 rad/sec)
Frequency (rad/sec)
Step response for open loop after compensation (with k=100)
Step Response
Time (sec)
Am
plit
ude
0 10 20 30 40 50 600
10
20
30
40
50
60
70
80
90
100
100
-60
-40
-20
0
20
Magnitu
de (
dB
)
10-1
100
101
102
-180
-135
-90
-45
0
Phase (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 81 deg (at 5.45 rad/sec)
Frequency (rad/sec)
Bode of compensated Closed Loop
101
Step Response
Time (sec)
Am
plit
ude
0 0.5 1 1.5 2 2.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Response of closed loop after compensation
Another Phase-Lead example
• Consider the system with open-Loop T.F of
• G(s) = 4/[s(s+2)]
• Is desired to have at least 50 phase margin with 0.1 ess for a ramp input.
•
• PracticePractice
102
Solution
• Wit h a Ramp input it is a velocity error KvWit h a Ramp input it is a velocity error Kv
• We know ess = 1/Kv We know ess = 1/Kv
• 0.1 = 1/Kv so kv = 10 0.1 = 1/Kv so kv = 10
• With k=10 G(s) = 40/[s(s+2)]With k=10 G(s) = 40/[s(s+2)]
• 1/ From Bode of the open- loop the phase 1/ From Bode of the open- loop the phase margin is 18 degree, so 50-18 =32 should margin is 18 degree, so 50-18 =32 should be compensated.be compensated.
• Take 5 degree as safety gives 37 degreeTake 5 degree as safety gives 37 degree103
• Sin(37) = ( - 1)/( +1) from which
• = 4.1
• Thus Gc = 1 + (4.1)TS
• 1 + T S
• Now T must be found
• -20 log = -12.3
•
104
• Half of -12.3 = -6.13 correspond to m
• From Bode m = 8.7 rad/sec
• hence T = 1/[msqrt()] = 0.056 sec
• Thus Gc = 1+ (0.056)(4.1)S
• 1 + (0.056 ) S
105
106
-50
0
50
Magnitu
de (
dB
)
10-1
100
101
102
-180
-135
-90
Ph
ase (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 18 deg (at 6.17 rad/sec)
Frequency (rad/sec)
Bode of k.G(s) uncompensated
• Or Gc = 1 + 0.23S
• 1+ 0.056S
• Will be in series with G(s)
• (Gc).(G(s)) = 9.2 s + 40
• -------------------------------------
• 0.056 s^3 + 1.112 s^2 + 2 s
• Now check (Gc).K.(G) phase margin
107
108
-100
-50
0
50
Magnitu
de (
dB
)
10-1
100
101
102
103
-180
-135
-90
Phase (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 50.1 deg (at 8.93 rad/sec)
Frequency (rad/sec)
Bode for Gc(s).(G(s))Note: the 50 PM is obtained
109
-100
-50
0
50
Magn
itude (
dB
)
10-1
100
101
102
103
-180
-135
-90
Phase (
deg
)
CompensatedUncompensated
Bode Diagram
Frequency (rad/sec)
Compensated & Uncompensated Bode
Phase-Lead Verification
• Suppose that a phase Lead is
Gc(s) = 1 + 5s
1 + s
from which T = 1 and = 5
Calculate
from Bode verify max and m
110
max = sin-1 - 1 5 - 1
+ 1 = 5+1 = 41.8
From Bode is the same
Also it is at = 0.45 which correspond to half magnitude = 7.0 as shown.
= 10 Log 5 = 7
Holds with = 1/[T.sqr()] = 1/[1.sqr(5)]
= 0.45
111
• Also we check PZ s-plane to ensure that zero is closer to origin than the pole.
• Repeat for the other Phase-Lead compensators
112
113
Pole-Zero Map
Real Axis
Imagin
ary
Axis
-1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Zero is closer to origin than pole in Phase-Lead
114
10-2
10-1
100
101
102
0
30
60
System: wFrequency (rad/sec): 0.452Phase (deg): 41.8
Phase (
deg)
Bode DiagramGm = Inf , Pm = -180 deg (at 0 rad/sec)
Frequency (rad/sec)
0
5
10
15
System: wFrequency (rad/sec): 0.452Magnitude (dB): 7.05
Magnitu
de (
dB
)
Phase-Lag Compensator Design
• Called PI type compensator.
• Transfer function of a phase-lag compensator:
• Gc(s) = s + z
• s + p
• where |p| < | z |
• The multiplier = | p | | z |.
115
• Representing phase-Lag using poles and zeros
• Gc = S + 1/ (T)
• S + (1/T)
• But for < 1 (fraction)
• Written as TS + 1
• TS + 1 116
117
• Here the pole is dominant (closer to origin)
• -1/ (T) -1/T
S-plane
Pz
Effect of Phase-Lag compensator
• Take = 1/10 , z= -10 , p= -1 then the transfer function will be (T=1)
• Gc = s + 10
• 10s + 10
• Bode diagram of this compensator will be as shown
118
119
Bode Diagram of the Example Phase-Lag Compensator
Max decrease
attenuation
• The logarithmic mean frequency is
ωm = sqrt(pz) = sqrt(10) =3.16 (rad/s)
• The overall attenuation is
• α = p/z = 1/10 = 0.1 (< 1 )
• 20log(α ) = −20 (dB) ,
• and the maximum decrease in phase (at the mean frequency) is
• 120
121
The main use of a phase-lag compensator is to decrease the steady-state error.
The cost is often to increase the system’s rise and settling times (slower system).
Phase-Lag design steps• 1- Find loop gain K required to satisfy
the steady-state error requirement.
• 2- Evaluate the phase margin (PM) of the uncompensated system with the loop gain K to determine if proportional control is sufficient.
122
• 3- Using the Bode diagram of the uncompensated system, find the frequency where the phase margin requirement is satisfied.
• 4- Place the zero of the compensator at least one decade below this frequency.
123
• 5- Using the Bode diagram, determine the attenuation required to make the chosen frequency the new zero-dB crossover frequency.
• 6- Calculate α by setting the required attenuation (negative dB) equal to 20log(α ) .
124
125
7- Calculate the pole location p =α z , and define the compensator to be
8- Check the phase margin of the compensated system to see if the desired value has beenattained.
1 + Ts 1 + Ts
126
Phase-Lag Compensator
• A phase-Lag compensator element has a TF of Gc =
1 + Ts
1 + Ts
But for < 1
The Lag compensator adds a real pole (-1/(T) and a real zero (-1/ T) in the s-plane (-1/ T) is to the left of -1/T
• Note that we can use either a lead compensator or a lag compensator to satisfy the specs.
• The difference is that the lag compensator increases the phase margin by reducing the gain crossover frequency,
127
• whereas the lead compensator increases the phase margin by adding more phase to the system.
128
• Therefore, the response of the system with the lead compensator will generally be faster than that of the same system with a lag compensator.
• The choice of controller will depend on the application requirements and constraints.
129
Lag example
• Consider P(s) = 1/[s(s+1)] .
• Design a lag compensator so that the O. L phase margin is at least 45 (above -180), and 0.1 ess for a unit ramp
• (also you can check the C.L PM)
•
130
Solution
• 1. find k = 1/kv = 1/0.1 = 10 then
k.G(s) = 10/[s(s + 1)
• 2. plot margin of k.G(s)
• 3. find the frequency at which the new phase is satisfied.
• 4. find the dB drop needed to get this frequency the cross over frequency
131
132
-100
-50
0
50
100M
agnitude (
dB
)
10-2
10-1
100
101
102
-180
-135
-90
Phase (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 18 deg (at 3.08 rad/sec)
Frequency (rad/sec)
Uncompensated k.G(s)
Mg cross over Should be here
-20 dB drop needed
• From previous Bode the 45 above -180 correspond to c = 1 rad/s
• Locate the zero =-1/(T) at one decade below or z= 0.1
• From Bode the attenuation dB needed to compensate the 45 degree is -20 dB
• So 20 log = -20 dB hence
• = 0.1 133
• Now from zero =0.1wc =0.1 = 1/(T)
• 0.1 = 1/(0.1T)
• So T = 100
• Or p= .z = (0.1)(0.1) = 0.01
• Thus Gc = 10 . 10S + 1
• 100S + 1
134
• Now check the new Bode with the compensator.
• Note the 45 PM is obtained for the new O.L Bode.
135
136
Compensated [Gc(s).G(s)]
-100
-50
0
50
100
150
Magnitu
de (
dB
)
10-4
10-3
10-2
10-1
100
101
102
-180
-135
-90
Phase (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 45.2 deg (at 0.791 rad/sec)
Frequency (rad/sec)
137
Lag Compensator design Example 2
• A unity feedback system with open loop TF of k
• (1+10s)(1+s)(1+0.5s)
• Is required to have a phase margin of at least 45o and step sse does not exceed 1% of the C-loop
• Determine the value of k and design a suitable phase-Lag compensator for the loop.
138
Lag compensator design Solution2
• As in the Lead solution
• 0.01 = 1/( 1+ kp) and k = 100
• From K.G(s) Bode diagram the phase margin is -25.7 ( -ve means below -180)
• and the required is +45.
• (+45 above -180 for the compensated line)
• With 5 degree tolerance take 50 so
• -180+50 = -130o
139
Uncompensated K.G(s) PM = -25.7
-100
-50
0
50M
agnitu
de (
dB
)
Bode DiagramGm = -9.21 dB (at 1.52 rad/sec) , Pm = -25.7 deg (at 2.42 rad/sec)
Frequency (rad/sec)
10-3
10-2
10-1
100
101
102
-270
-180
-90
0
System: gFrequency (rad/sec): 0.619Phase (deg): -130
Phase (
deg)
-22 dB
• So the new required wc is 0.62 rad/s
• Now take z = 0.1 wc (one decade below)
• = 0.1(6.2) = 0.062 =z
• the mag of dB that should be decreased so as to let the new zero cross over is 22 dB .
• So 20 log = -22 thus = 0.08
140
• We know z= 0.062 1/ T = 1/(0.08T)
• from which T = 202 sec
• So Gc = 1 + TS = 1 + 16 S
• 1 + TS 1+ 202S
• with k=100 in cascade with G(s)
141
142
-150
-100
-50
0
50M
agnitu
de (
dB
)
10-4
10-3
10-2
10-1
100
101
102
-270
-180
-90
0
Phase (
deg)
Bode DiagramGm = 12.1 dB (at 1.46 rad/sec) , Pm = 43.9 deg (at 0.633 rad/sec)
Frequency (rad/sec)
Compensated Gc(s).K.G(s) for example 2
143
-150
-100
-50
0
50M
agnitu
de (
dB
)
10-2
10-1
100
101
102
-270
-180
-90
0
Phase (
deg)
Bode DiagramGm = 9.64 dB (at 1.46 rad/sec) , Pm = 47.5 deg (at 0.948 rad/sec)
Frequency (rad/sec)
Compensated CL Bode
144
Step Response
Time (sec)
Am
plit
ude
0 5 10 15 20 25 30 35 400
0.2
0.4
0.6
0.8
1
1.2
1.4
System: ggclSettling Time (sec): 17.8System: ggcl
Rise Time (sec): 1.93
System: ggclFinal Value: 0.99
Compensated C.L step Response for example 2
145
Step Response
Time (sec)
Am
plit
ude
0 5 10 15 20 250
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
Uncompensated C.L step Response for example 2
Phase Lag-Lead
• A combination of Lag with Lead .
• Lead overcome the pay of lag .
• Lag overcome the pay of Lead.
• Practice for G(s) = k/[(s+1)(s+2)(s+10)]
• With 0.01 position error (for step)
146
147
Electronic circuit that is Lead network if R1C1>R2C2 Lag network if R1C1<R2C2
Problem 1
• For the electrical network derive its transfer function and state if it is lead or Lag network.
• Hints:
• use T = R1C and = R2/(R1+R2)
148
149
Problem 1 circuit
150
151
Divide num and den by to get the last T.F
Problem 2 • 1/ For a unity feedback system if forward
loop TF is G(s) = 4/[s(s+0.5)]• Study this system find:• - Static velocity error constant (= )• - Damping ratio =• - Current PM = • Then construct a phase Lag-Lead
compensator and check again.• Discuss the effect of Lag-Lead on the
relative stability. 152
• Plot step response of the compensated and uncompensated system in one graph.
• Plot unit ramp response for compensated and uncompensated in one graph
• Watch SSE and discuss.
• use lead only then lag only and compare.
153
• Look at Table 9.1 in Norman Nise for using operational amp to have P I D
compensators.
154
Gain adjustmentusing Frequency Response
• One of the most important issues in control system design is to add an amplifier without affecting the response so much.
• We know that adding a gain K will increase overshoot of the C.L system
155
• The problem is to know the suitable gain K that improve the system without increasing the overshoot. (gain adjustment)
• To do gain adjustment via frequency response, the following relationships must be known
156
Zeta & overshoot relation
• = - Lin(ov %)
• ()2 + Lin2(ov%)
• Find for 9.5%
• Prove that for 20% OV = 0.456
157
Phase-margin & zeta
• PM = tan-1 2 • -2 2 + 1+ 4 4
•
158
Phase-Margin & • If phase-margin = 60o then is found
where 60 is the difference between -180 and 60 or -180+60 = -120 .
• Then from Bode is found.
159
K adjustment design example
• For the following position control system use frequency response to find the value of the preamplifier K to yield 9.5% overshoot for the C.L step response.
160
161
K 100/(s+100 1/(s+36) 1/s C(s)R(s)
Desired position(set point)
Pre-amp
Power amp.Motor &Load
shaft velocity Shaft
position
Position control system
Solution
• 1. Choose initial gain value (k = 3.6 )
• 2. Draw Bode for the C.L system with gain = 3.6
• C.L = 360
• S3 + 136S2 + 3600S + 360
162
• 3. use overshoot eq. to find
• = 0.6
• 4. use PM eq. to find PM
• PM = 59.2
• 5. find on the Bode that yield (-180+59.2 = -120.8) = 14.8 rad/s
163
164
-200
-150
-100
-50
0
Magnitu
de (
dB
)
Bode DiagramGm = 62.7 dB (at 60 rad/sec) , Pm = -180 deg (at 0 rad/sec)
Frequency (rad/sec)
10-3
10-2
10-1
100
101
102
103
104
-270
-180
-90
0
System: gFrequency (rad/sec): 14.7
Phase (deg): -120
Phase (
deg)
C.L with k = 3.6
• 6. At 14.8 Magnitude is -44 dB
• Then
• 20 Log Km = 44 dB
• From which Km= 162.2
• 7. finally K = (initial K)*Km = 3.6x162.2
• = 583.9
165
166
Step Response
Time (sec)
Am
plit
ude
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.40
0.2
0.4
0.6
0.8
1
1.2
1.4
System: gclTime (sec): 0.181Amplitude: 1.09
Step response after adding 583.9 gain Note overshoot% = 0.09 = 9%
Gain Adjustment using Root Locus
• The root-locus can be used to determine the value of the loop gain , which results in a satisfactory closed-loop behavior.
• Remember very high gain leads to instability.
167
168
In general, the open-loop transfer function is given by
• The characteristic equation of the closed-loop transfer function is
• 1 + K.G(s).H(s) = 0
• Therefore
• 1 = -K.G(s).H(s) then
169
170
it follows that for a point in the s-plane to be in the root- locus when 0 < K < it must satisfy the following two conditions
171
• And
angles of zeros of G(s).H(s) - angles of poles of G(s).H(s) = r(180)
• Where r = +1,3,…….
•
172
173
Root-Locus for Gain adjustment
• 1. Max (marginal) gain determination
• Adding gain K to remove the SSE should be done carefully.
• R.L is useful in finding the suitable gain that makes the Transient Response of the C.L acceptable.
174
• Assume G(s) = 1/[(s+1)(s+2)]
• G(s) = 1/[(s2 + 3s + 2)]
• Check the C.L step Response.
• Check the C. L R.L
175
176
Step Response
Time (sec)
Am
plit
ude
0 0.5 1 1.5 2 2.5 3 3.5 40
0.05
0.1
0.15
0.2
0.25
0.3
0.35
C.L Response of G(s) with K =1 Has got about 0.7 SSE (very high)
Increasing K will reduce the C.L SSE but will get the Transient worse.
177
-1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0-4
-3
-2
-1
0
1
2
3
4Root Locus
Real Axis
Imagin
ary
Axis
Means whatever was the value of K the system will never be Unstable, but what about the transient? Will get worse when we increase the gain k to reduce the SSE.
• Now assume we injected k= 200 to solve the problem of SSE.
• Using static position error for this system will give k=100 to have 1% (0.01) SSE.
• 0.01= 1/(1 + Kp) from which Kp=100
178
• To have 0.5% SSE Kp= 200
• The SSE will be reduced but there may be bad transient response.
• So the solution of removing the SSE by adding an amplifier gain K is not a perfect solution.
179
180
Step Response
Time (sec)
Am
plit
ude
0 0.5 1 1.5 2 2.5 3 3.5 40
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
System: glFinal Value: 0.99
With gain K = 200 SSE may be solved but the transient is worse
Adding a Pole at origin
• A pole at origin means 1/s must be inserted in cascade with G(s).
• But what is the max gain that can be used with this integral?
• Look at the C.L response with added integrator (with k=1 before adding any gain)
181
182
Step Response
Time (sec)
Am
plit
ude
0 2 4 6 8 10 12 14 16 180
0.2
0.4
0.6
0.8
1
1.2
1.4
System: ggclFinal Value: 1
C.L response after adding a pole at the origin with k=1 but look at the Root-Locus (also Ts is too late)
183
Root Locus
Real Axis
Imagin
ary
Axis
-7 -6 -5 -4 -3 -2 -1 0 1 2-5
-4
-3
-2
-1
0
1
2
3
4
5
System: ggclGain: 5.03
Pole: 0.0027 + 1.42iDamping: -0.00191
Overshoot (%): 101Frequency (rad/sec): 1.42
It is clear that the max gain =5 after that any increase of k will get the C.L system unstable.
184
Step Response
Time (sec)
Am
plit
ude
0 20 40 60 80 100 1200
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
System: ggclFinal Value: 1
C.L response with an integrator and k=5To show that k=5 is marginal.
2. RL for conditioned K findingzeta condition
• The procedure for finding K is:
• 1/ Construct an accurate root-locus plot.
• 2/ For a given ζ draw a line from origin at angle = cos-1 ζ measured from negative real axis (from left to right- clockwisw) .
• 3/ The desired closed-loop pole S1 is at the intersection of this line and the root-locus.
185
• 4/ Estimate the vector lengths from S1 to poles and zeros and apply the magnitude criterion as given to find K.
186
Root Locus Example2
• The open-loop transfer function of a control system is given by
•
• KGH(s) = k
• s(s+1)(s+4)
• Obtain K such that the damping ratio of the closed-loop poles will be equal to 0.6
187
Solution • 1/ The Root-Locus for the O.L TF is
shown (with k=1).
• For ζ = 0.6 so = cos-1 0.6 = 53.13
• 2/ The line drawn at this angle intersects the root-locus at S1 = -0.42+j0.56
• 3/Now make a line from this point to every pole and zero (vectors lengths)
188
189
-12 -10 -8 -6 -4 -2 0 2-4
-3
-2
-1
0
1
2
3
4
0.6
0.6
1
System: sysGain: 2.05
Pole: -0.418 + 0.56iDamping: 0.598
Overshoot (%): 9.62Frequency (rad/sec): 0.699
Root Locus
Real Axis
Imagin
ary
Axis
• 4/ then K = (3.66)(0.8)(0.7) = 2.05 (when you click on the intersection point k will be given)
• So the compensated closed loop will be
• C(s) = 2.05
R(s) s3+5s2 + 4s + 2.05
190
• To obtain the C.L step response and time-domain specifications, we use the following commands.
• numc=2.05;
• denc=[1 5 4 2.05];
• T=tf(numc, denc) • ltiview('step', T) % chance for changing figure
191
192
Step Response
Time (sec)
Am
plit
ude
0 5 10 150
0.2
0.4
0.6
0.8
1
1.2
1.4System: g
Peak amplitude: 1.09Overshoot (%): 9.28
At time (sec): 5.89
Step Response of the C. L
193
ExampleRoot Locus
P*I*D compensator
• i/ Check the response and Root Locus of CL system.
• Ii/ Use a suitable P*I*D compensator then check again
1
(s+1)(s+2)(s+10) -
Uncompensated C.L
• For C.L
• G=tf([1],[1 13 32 21 ])
• Rlocus(g)
• Step(g)
194
195
-30 -25 -20 -15 -10 -5 0 5 10-20
-15
-10
-5
0
5
10
15
20Root Locus
Real Axis
Imagin
ary
Axis
Uncompensated C.LMax Gain =380
196
Step Response
Time (sec)
Am
plit
ude
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
0.045
0.05
Uncompensated CL Response
197
Solution
• The CL response for a unit step will give
• Ts = 4.37 , Tr=2.44 and
• ss = 0.047 (very poor)
• A block of P*I*D compensator must be added in cascade to improve the system.
•
Integral only as compensator
• Now adding an integral only as compensator in cascade with the plant will solve the problem of the steady-state but may get the transient worse.
• Multiply the open-loop with 1/s
• G=tf([1],[1 13 32 20 0])
• Gcl=feedback(g,1)
198
• Gcl =
• 1
• -------------------------------------------
• s^4 + 13 s^3 + 32 s^2 + 20 s + 1
• Then check step response
199
200
Step Response
Time (sec)
Am
plit
ude
0 20 40 60 80 100 1200
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
CL Response of integral only solved the SSE but the transient is worse
201
1
(s+1)(s+2)(s+10)
K(s+a)
s
PID Compensated System
A block of P*I*D compensator must be added in cascade to improve the system.
202
• Take k=1 , a=0.1 and check the CL response and Root Locus
• Why Root Locus?
• To see that the new compensated RL will pass the same points and still improve the system (Ts, Tr,…)
• Gc = (S+0.1)/S
• Gc=tf([1 0.1],[1 0])
• Gc is cascaded with g
• ggc= series(g,gc)
• And the C.L is
• ggcl= feedback(ggc,1)
• = s + 0.1
• ----------------------------------------------
• s^4 + 13 s^3 + 32 s^2 + 21 s + 0.1
203
204
0 200 400 600 800 1000 12000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Step Response
Time (sec)
Am
plit
ude
C.L step response with k=1 , a= 0.1Notice the worse Ts, Tr.
205
-30 -25 -20 -15 -10 -5 0 5 10-20
-15
-10
-5
0
5
10
15
20Root Locus
Real Axis
Ima
gin
ary
Axis
Root locus for ggcl when gc has k=1 , a=0.1Notice the same path for system g. Thus PID compensator doesn't change the system root locus path (which is required)
• Now we have to improve the step response Ts, Tr, …….
• We know that adding the zero improve the response by shifting the root locus to the left, so we choose z=1 instead of 0.1 and check the step response and root locus again.
206
• Gc= (s+1)/s
• And ggc=
• s + 1
• ------------------------------------
• s^4 + 13 s^3 + 32 s^2 + 20 s
• The C.L is ggcl =
• s + 1
• --------------------------------------------
• s^4 + 13 s^3 + 32 s^2 + 21 s + 1
207
208
Step Response
Time (sec)
Am
plit
ude
0 20 40 60 80 100 1200
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step response for ggcl with k=1 and a=1 instead of 0.1Note the improvement of Ts and Tr compared with a=0.1 (zero value)
209
-30 -25 -20 -15 -10 -5 0 5 10-20
-15
-10
-5
0
5
10
15
20Root Locus
Real Axis
Imagin
ary
Axis
Root locus for ggcl with k=1 and a=1 instead of 0.1
• The PID compensator eliminate the SSE and has a little improvement on the transient response.
• Try PD with removing the origin pole (1/s) which result in PD only ( k(s+a))
• Take a=1
210
• One of the main benefits of the root locus is that it gives you the cross-point gain
• Take k = 130
• Then ggcl =
• 130 s + 130
• ---------------------------------
• s^3 + 13 s^2 + 162 s + 150
211
212
Step Response
Time (sec)
Am
plit
ude
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
System: ggclFinal Value: 0.867
Step response for k=130, then a=130Note the strong improvement on Ts, and Tr, but still there is a SSE
213
-7 -6 -5 -4 -3 -2 -1 0-25
-20
-15
-10
-5
0
5
10
15
20
25
System: ggclGain: 0Pole: -6 + 10.7iDamping: 0.49Overshoot (%): 17.1Frequency (rad/sec): 12.2
System: ggclGain: 3.32Pole: -6 - 23.4iDamping: 0.249Overshoot (%): 44.6Frequency (rad/sec): 24.1
Root Locus
Real Axis
Imagin
ary
Axis
C.L Root locus for k=a=130Note that adding any gain will keep the system stable but overshoot will be increased since damping will decrease.
• For PD compensator (k(s+a)) you can take k larger than 130 and check the response until you reach your criteria.
• (try k=250, 500, 750,1000)
214
Benefits of Root Locus in design
• 1. Shows the cross-point gain value.
• 2. shows if there is unlimited gain increase when path goes vertically.
• 3. finds the gain k required for a given damping ratio.
• 4.Shows the effect of adding poles or zeros on the system behaviour. (prove)
• 5. shows the contour when changing more than one parameter (k + another variable)
215
Nichols Plot• Nichols Plot gives another way to depict
frequency response information
• —by plotting the magnitude versus phase curve in the semi logarithmic scale (for w from zero to infinity).
• Nichols chart can be generated using the nichols(G) function for the MATLAB transfer function G.
216
M circles and Nichols Chart
• Consider G(jw) forward T.F
M is the magnitude of the C.L with unity feedback [H(jw) = 1]
so M= G(jw)/[1+G(jw)]
and G(jw) is complex = X+jy
217
• M circle is developed as:
Let G( jω)=X+jY, where X is the and Y the imaginary
Then M =
218
Example
• Consider a unity feedback system with open-loop transfer function
• To produce a Nichols chart for the given system, with the closed-loop dB M-contours superimposed, we use:
219
• G=tf([10],[1 5 0])
• Nichols(G);
• Ngrid;
220
Using Defined Parameters
• s = tf('s');
• G = 45/(s*(s+5));
• w = 0.5:50;
• nichols(G,w);
• ngrid;
• The following plot appears
221
222
-360 -315 -270 -225 -180 -135 -90 -45 0-40
-30
-20
-10
0
10
20
30
40
6 dB
3 dB
1 dB
0.5 dB
0.25 dB
0 dB
-1 dB
-3 dB
-6 dB
-12 dB
-20 dB
-40 dB
Nichols Chart
Open-Loop Phase (deg)
Ope
n-Lo
op G
ain
(dB
)