Design via Root Locus
The Characteristics of P, I, and D
PID controller
Lead- Lag Compensator
Passive realization of compensators
Lag-lead compensator implemented with cascaded lag and lead
networks with isolation
Example
Design a PI controller to drive the step response error to zero for the unity feedback
system shown in Figure below, where
The system operates with a damping ratio of 0.5. Compare the specifications of the
uncompensated and compensated systems.
close all
K=1
G1=tf(K,poly([-1 -3 -10])) % G1=K/(s+1)(s+3)(s+10)
rlocus(G1)
sgrid(0.5,0)
Gc=tf([1 0.1],[1 0]) % Gc=(s+0. 1)/s
G2=G1*Gc
figure
rlocus(G2)
title('Plant + PI')
sgrid(0.5,0)
figure
K=71
T1=feedback(K*G1,1)
T2=feedback(K*G2,1)
figure
step(T1,T2)
legend('uncompensated','compensated')
Root Locus
30
0.5
20
System: G1
Gain: 70.8
Pole: -1.53 + 2.61i
Damping: 0.505
10
Overshoot (%): 15.9
Frequency (rad/sec): 3.03
Imaginary Axis
-10
-20
0.5
-30
-40 -30 -20 -10 0 10 20
Real Axis
Step Response
1
uncompensated
compensated
0.9
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 10 20 30 40 50 60
Time (sec)
Plant without PI controller
Dominate poles S1,2= -1.5±2.58j
= =
( + 1)( + 3)( + 10) + 14 + 43 + 30
−1
= = 70.6
. .
Matlab commands
>> s= - 1.5 +j*2.6
s = -1.5000 + 2.6000i
>> k=abs((s+1)*(s+3)*(s+10))
k= 70.6419
4
= = 2.6 !"#$%
1.5
3.14
= = 1.2 !"#$%
2.6
70.6
&= = = 2.35
(1). (3). (10) 30
1 1
! = = = 0.3
1 + & 3.35
For unity feedback 1+KGp(s)H(s) = 0
+ 14 + 43 + 30 + = + 14 + 43 + 100.5 = 0
>> roots([1 14 43 100.5])
-1.5+2.6'
-1.5−2.6'
-10.9
Plant with PI
( ). ) *
= ( = .
( )( )( ))
1+K ( ( ) ( )=0
( + 1)( + 3)( + 10)
=− + . . = 71.8
( + 0.1)
s=-1.5 +j*2.56
s = -1.5000 + 2.5600i
>> k=abs((s*(s+1)*(s+3)*(s+10))/(s+0.1))
k= 70.00
70.0
&= = =∞
(0)(1). (3). (10) 0
1
! = =0
1+∞
For unity feedback 1+KG(s)H(s) = 0
( + 1)( + 3)( + 10) + ( + 0.1) = .
+ 14 + 43 + 30 + 71.8 + 7.18 = 0
Roots([1 14 43 102 7.18])
-1.5+2.6'
-1.5−2.6'
- 0.0728 ,
-10.9
Example
The unity feedback system shown in Figure below is operating with 10%
overshoot.
a. What is the value of the appropriate static error constant?
b. Find the transfer function of a lag network so that the appropriate static error
constant equals 4 without appreciably changing the dominant poles of the
uncompensated system.
c. Use MATLAB or any other computer program to simulate the system to see the
effect of your compensator.
close all
K=1
Gp=zpk([],[-1,-3,-5],K) %G1=1/(s+1)(s+3)(s+5)
rlocus(Gp)
title('Plant without lag')
sgrid(0.59,0)
figure
Gc=zpk([-0.3],[-0.1],1)
G=Gp*Gc
rlocus(G)
sgrid(0.59,0)
title('Plant with lag')
figure
K=20 % from root locus os=10%
Tp= feedback(K*Gp,1)
Tpc=feedback(K*G,1)
step(Tp/Tp,Tp,Tpc)
legend('Ref','without lag','with lag')
Example
Consider the unity feedback system shown in Figure below,
a. Design a PI controller to drive the ramp response error to zero for any K
that yields stability.
b. Use MATLAB to simulate your design for K = 1. Show both the input ramp
and the output responses on the same plot.
……………………………………………………………………………………………………………………………………………..
close all
K=1
G1=zpk([],[0,-2,-5],K) %G1=1/s(s+2)(s+5)
Gc=zpk([-0.01],[0],1) %Gc=(s+0.01)/s
G2=G1*Gc
rlocus(G1)
title('Root locus without PI')
figure
rlocus(G2)
title('Root locus with PI')
figure
T1= feedback(G1,1)
T2=feedback(G2,1)
Ts=tf(1,[1,0]) %Form 1/s to integrate step input
T1=T1*Ts
T2=T2*Ts
t=0:0.1:300;
step(Ts,T1,T2,t) %Show input ramp and ramp response
legend('ramp','without PI','with PI')
title('ramp response')
close all
K=1
Gp=zpk([],[0,-7],K)
rlocus(Gp)
sgrid(0.517,0)
figure
Gc=zpk([-0.2],[-0.01],1)
G=Gp*Gc
rlocus(G)
sgrid(0.517,0)
figure
K1=45.8
K2=44.8
Tp= feedback(K1*Gp,1)
Tpc=feedback(K2*G,1)
T1=tf(1,[1,0]) %Form 1/s to integrate step input
Tp=Tp*T1
Tpc=Tpc*T1
t=0:0.1:20;
step(T1,Tp,Tpc) %Show input ramp and ramp response
legend('ramp','without lag','with lag')
title('ramp response')
close all
K=1
G1=tf(K,poly([-1 -2 -10])) % G1=K/(s+1)(s+2)(s+10)
rlocus(G1)
sgrid(0.174,0)
[K1,p1]=rlocfind(G1)
Gc=tf([1 0.1],[1 0]) % Gc=(s+0. 1)/s
G2=G1*Gc
figure
rlocus(G2)
title('Plant + PI')
sgrid(0.174,0)
[K2,p2]=rlocfind(G2)
figure
T1=feedback(K1*G1,1)
T2=feedback(K2*G2,1)
figure
step(T1,T2)
legend('uncompensated','compensated')
The effect of a PD (Proportional-Derivative) controller on the transient response of
a system can be summarized as follows:
1. Proportional (P) Term: The proportional term in the PD controller provides a
control action that is proportional to the error between the desired input and the
actual output of the system. This term helps to reduce the steady-state error and
improve the overall system response, but it does not inherently provide any
damping or stability.
2. Derivative (D) Term: The derivative term in the PD controller provides a control
action that is proportional to the rate of change of the error. This term introduces
damping to the system and helps to improve the transient response by reducing
overshoot, oscillations, and settling time.
The effects of the PD controller on the transient response can be described as
follows:
a. Overshoot Reduction: The derivative term in the PD controller helps to dampen the
oscillations and reduce the overshoot in the system's response. By providing a control
action that opposes the rate of change of the error, the derivative term can effectively limit
the magnitude of the overshoots.
b. Reduced Settling Time: The combination of the proportional and derivative terms in
the PD controller can help to decrease the settling time of the system's response. The
proportional term provides a more immediate control action, while the derivative term
helps to quickly damp out the oscillations, leading to a faster settling time.
c. Improved Stability: The derivative term in the PD controller can improve the stability of
the system by providing additional damping. This can be particularly beneficial for systems
that are prone to oscillations or instability, as the derivative term helps to counteract these
undesirable behaviors.
d. Sensitivity to Noise: One potential drawback of the PD controller is its sensitivity to
noise or high-frequency disturbances. The derivative term can amplify the effects of these
high-frequency components, which may require additional filtering or noise reduction
techniques to be effectively managed.
The specific impact of the PD controller on the transient response will depend on the tuning
of the proportional and derivative gains, as well as the characteristics of the underlying
system. Proper tuning of the PD controller is essential to achieve the desired balance
between response time, overshoot, and stability.
The effect of a Lead controller on the transient response and stability of a system can
be summarized as follows:
a. Overshoot Reduction: The Lead controller, which is a type of phase-lead compensation,
can effectively reduce the overshoot in the system's transient response. The phase-lead
compensation introduces an additional lead term, which provides a control action that
opposes the rate of change of the error. This opposes the tendency of the system to
overshoot the desired setpoint, resulting in a more damped and controlled response.
b. Faster Rise Time: The Lead controller can improve the rise time of the system's response.
The phase-lead compensation introduces a faster response by advancing the phase of the
system, effectively reducing the time required for the output to reach the desired value.
c. Reduced Settling Time: The combination of reduced overshoot and faster rise time can
contribute to a shorter settling time for the system's response. The Lead controller helps
the system reach the desired value and then settle around it more quickly.
d. Improved Stability Margins: The Lead controller can enhance the stability margins of
the system, particularly the phase margin. By introducing a phase-lead compensation, the
Lead controller can effectively counteract the phase lag inherent in the system, resulting in
an increased phase margin. This improved phase margin translates to a more stable and
robust system.
e. Increased Bandwidth: The Lead controller can also increase the bandwidth of the
system. The phase-lead compensation effectively extends the frequency range over which
the system can respond accurately, allowing for a higher bandwidth and potentially faster
dynamic responses.
f. Tradeoff with Noise Sensitivity: While the Lead controller can improve the transient
response and stability, it may also increase the system's sensitivity to high-frequency noise
or disturbances. The phase-lead compensation amplifies the high-frequency components,
which may require additional measures, such as filtering, to mitigate the noise effects.
Example
Design a PD controller (cascaded not feedback !!!) for the system shown in Figure below to
reduce the settling time by a factor of 4 while continuing to operate the system with 20%
overshoot. Compare between uncompensated and compensated system.
Dominate poles S1,2= -1.8±3.5j
Ts = 4/1.8 = 2.22 Tp= 3.14/3.5 = 0.89
= =
( + 5)( + 15) + 20 + 75
−1
= / = 254
.0 .
For unity feedback 1+KGp(s)H(s) = 0
+ 20 + 75 + = + 20 + 75 + 254
roots([1 20 75 254 ])
ans =
-16.3656
-1.8172 + 3.4954i
-1.8172 - 3.4954i our approximation is valid
To improve settling time by 4
Ts= 2.22/4 =0.55 Ts: of uncompensated system =2.22
4
= = 0.55
1
. .
1= = = 7.27 or 1 = 4 x 1.8 = 7.2
23 ).
Dominate poles of compensated system S1,2= -7.27±' 4%
. 9. 9
1 = 546 = 7.2 ⬌ 46 = = = 15.9 rad/s
8 )..
4; = 46 <1 − 5 = 15.9 × √1 − 0.21 =14.13 rad/s
Or
4;
=?@$ A"# (0.456)B
1
CD
= ?@$ (62.8) , 4; = 7.27 x 1.94 = 14.13
9. 9
Dominate poles S1,2= -7.27 ±14.13j
Next, we design the location of the compensator zero.
.. . .. . .. .
EF − ?@$ G H − I180 − ?@$ G9. HJ − I180 − ?@$ G 9. HJ= -180
9. 9 9 9
EF − 62.2 − 100 − 117= -180
EF = 99
..
= tan(180-99)
9. K
..
= 6.3
9. 9 K
1 = 5.2
Gc(s ) = s+5.2
( + 5.2)
( = ( + 5.2). =
( + 5)( + 15) + 20 + 75
−1
= / = 254
( 9. 9 ..
For unity feedback 1+KGpc(s)H(s) = 0
+ 20 + 75 + 254( + 5.2) = + 20 + 329 + 1320 =0
roots([1 20 329 1320 ])
-7.3767 +14.0421i
-7.3767 -14.0421i
-5.2465 Second order approximation OK by assuming pole/zero cancellation
Pole of Gp(-5.24)/ zero of Gc(-5.2)
Note: You will see that the compensator zero for cascade compensation is a closed-
loop zero, yielding the possibility of pole-zero cancellation. However, PD compensation is usually
noisy and not always practical. What about feedback compensation ?
close all
K=1
G1=tf(K,poly([0 -5 -15])) %G1=K/s(s+5)(s+15)
Gc=zpk([-5.2],[],1) %Gc=(s+0.5.2)
Gpc=G1*Gc
K=257
Tun=feedback(K*G1,1)
Tc=feedback(K*Gpc,1)
figure
t=0:0.1:10;
step(Tun,Tc,t)
legend('uncompensated','compensated')
Notes
⮚ The advantages of a passive lead network over an active PD controller are that: No
additional power supplies are required.
⮚ The disadvantage is that the additional pole does not reduce the number of branches of the
root locus that cross the imaginary axis into the right-half-plane, while the addition of the
single zero of the PD controller tends to reduce the number of branches of the root locus
that cross into the right half-plane.
Feedback Compensation
⮚ Compensator is at the feedback (not cascaded compensator).
⮚ More complicated than cascade.
⮚ Generally, provide faster response.
⮚ Can be used in cases where noise is a concern if we use cascade compensators.
⮚ May not require additional gain.
⮚ A popular feedback compensator is a rate sensor that acts as differentiator.
❖ In aircraft and ship applications, the rate sensor can be a rate gyro that
responds with an output voltage proportional to the input angular velocity.
❖ In many other systems this rate sensor is implemented with a tachometer.
⮚ A tachometer is a voltage generator that yields a voltage output proportional to input
rotational speed.
The configuration included feedback compensator (rate feedback) is shown in following figure.
Note that feedback compensator Hc(s) is placed in the minor loop of a feedback control
system.
The design of feedback compensation consists of finding the gains, such as , 1 @$% L. Similar
to cascade compensation. Consider compensation as adding poles and zeros to feedback section
for the equivalent system.
The equivalent block diagram is shown in figure below
Example (Compensating zero via rate feedback)
Given the system of Figure (a), design rate feedback compensation, as shown in Figure (b), to
reduce the settling time by a factor of 4 while continuing to operate the system with 20%
overshoot.
From Figure(a) (This part is explained in a previous example)
Dominate poles S1,2= -1.8±3.53j
Ts = 4/1.8 = 2.22
Tp= 3.14/3.5 0.89
= =
( + 5)( + 15) + 20 + 75
0
= / = 258 and O = = 3.44
MN 9
.0 .
syms s
'G(s)'
G= 1/(s*(s+5)*(s+15));
pretty(G)
s= -1.8+3.53j;
G=subs(G,s)
'Magnitude'
K= 1/abs(G)
K=258
Or using vector method
M1= sqrt(power(1.8,2)+power(3.52,2));
M2= sqrt(power(3.2,2)+power(3.52,2));
M3= sqrt(power(13.2,2)+power(3.52,2));
K= M1*M2*M3
syms s
'G(s)'
K=258
G= K/(s*(s+5)*(s+15));
Kv=limit(s*G,0)
Kv = 3.44
Design a PD compensator
Determine the location of the dominant poles for the compensated system
To achieve a fourfold decrease in the settling time, the real part of the desired pole must be
increased by a factor of 4.
The root locus for the feedback compensated system:-
1
( )P ( ) = . Q( + )
( + 5)( + 15) Q
1
Q( + )
Q
( )P ( ) =
( + 5)( + 15)
*R *S ( TU ) *R *S ( .. )
( )P ( ) = =
( )( ) ( )( )
The gain ( Q )at compensated pole (-7.236 +j14.1) = 257
( )P( ) = −1
Q( + 5.42)
= −1
( + 5)( + 15)
( )( )
Q = ( .. )
@? = ( −7.236 + '14.1)
Q = 257
But Q = = = 0.185
V" 5.42
257
= = 1388
0.185
Q(
+ 5.42)
( )P ( ) =
( + 5)( + 15)
In order to evaluate the steady-state error characteristic, Kv is found from second figure
(unity feedback) to be
O = = 4.18
A75 + QB
the closed-loop transfer function is
( )
( )= =
1 + ( )P( ) W + 20 + A75 + QB + X
close all
K1=1388;
Kf=0.185;
T=tf(K1,[1 20 (75+(K1*Kf)) K1])
step(T)
stepinfo(T)
title('Compensated System')
Note
For feedback compensator, the open-loop zero is not a closed-loop zero, and there is no pole-
zero cancellation. You will see that the compensator zero for cascade compensation is a closed-
loop zero, yielding the possibility of pole-zero cancellation. However, PD compensation is
usually noisy and not always practical.
close all
K=1
G1=tf(K,poly([0 -5 -15])) %G1=K/s(s+5)(s+15)
Gc=zpk([-5.2],[],1) %Gc=(s+0.5.2)
Gpc=G1*Gc
K=257
Tun=feedback(K*G1,1) %un: uncompensated
Tcc=feedback(K*Gpc,1) %cc: cascaded compensated
K1=1388
Kf=0.185 %K=K1*Kf = 257
H=tf([Kf 1], [0 1])
Tfc=feedback(K1*G1,H) %fc: feedback compensated
t=0:0.1:10;
step(Tun,Tcc,Tfc,t)
legend('uncompensated','cascaded compensated', 'feedback
compensated')