Ideal Derivative Compensation
close all
G1=tf(1,poly([-1 -2 -5]))
rlocus(G1)
axis([-4 1 -4 4])
sgrid(0.4,0)
[K1,P]=rlocfind(G1)
T1=feedback(K1*G1,1)
Gc=tf([1 2],[0 1]) % Gc=(s+2)
G2=G1*Gc
figure
rlocus(G2)
axis([-4 1 -8 8])
sgrid(.4,0)
[K2,P]=rlocfind(G2)
T2=feedback(K2*G2,1)
figure
step(T1,T2)
legend('uncompensated','PD compensated')
grid
close all
G1=tf(1,poly([-1 -2 -5]))
rlocus(G1)
axis([-4 1 -4 4])
sgrid(0.4,0)
title('Uncompensated ')
[K1,P]=rlocfind(G1)
T1=feedback(K1*G1,1)
Gc1=tf([1 2],[0 1]) % Gc=(s+2)
Gc2=tf([1 3],[0 1]) % Gc=(s+3)
Gc3=tf([1 4],[0 1]) % Gc=(s+4)
G2=G1*Gc1
G3=G1*Gc2
G4=G1*Gc3
figure
rlocus(G2)
axis([-4 1 -8 8])
sgrid(.4,0)
title('Compensated with s+2')
[K2,P]=rlocfind(G2)
T2=feedback(K2*G2,1)
figure
rlocus(G3)
axis([-4 1 -8 8])
sgrid(.4,0)
title('Compensated with s+3')
[K3,P]=rlocfind(G3)
T3=feedback(K3*G3,1)
figure
rlocus(G4)
axis([-4 1 -8 8])
sgrid(.4,0)
title('Compensated with s+4')
[K4,P]=rlocfind(G4)
T4=feedback(K4*G4,1)
figure
step(T1,T2,T3,T4)
legend('uncompensated','S+2','S+3','S+4')
grid
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
𝐾 𝐾
𝐺𝑝 = = 3
𝑠(𝑠 + 5)(𝑠 + 15) 𝑠 + 20𝑠 2 + 75𝑠
−1
𝐾= ] = 254
𝐺𝑝 𝑠=−1.8+3.5𝑗
For unity feedback 1+KGp(s)H(s) = 0
𝑠 + 20𝑠 + 75𝑠 + 𝐾 = 𝑠 3 + 20𝑠 2 + 75𝑠 + 254
3 2
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
𝜎
4 4
𝜎= = = 7.27 or 𝜎 = 4 x 1.8 = 7.2
𝑇𝑠 0.55
Dominate poles of compensated system S1,2= -7.27±𝑗 𝜔𝑑
4 7.27
𝜎 = 𝜁𝜔𝑛 = 7.2 ⬌ 𝜔𝑛 = = = 15.9 rad/s
𝜁 0.456
𝜔𝑑 = 𝜔𝑛 √1 − 𝜁 2 = 15.9 × √1 − 0.21 =14.13 rad/s
Or
𝜔𝑑
=𝑡𝑎𝑛 (𝑐𝑜𝑠 −1 (0.456))
𝜎
𝜔𝑑
= 𝑡𝑎𝑛 (62.8) , 𝜔𝑑 = 7.27 x 1.94 = 14.13
7.27
Dominate poles S1,2= -7.27 ±14.13j
Next, we design the location of the compensator zero.
14.14 14.14 14.14
𝜃𝑧 − 𝑡𝑎𝑛−1 ( ) − [180 − 𝑡𝑎𝑛−1 (7.27−5)] − [180 − 𝑡𝑎𝑛−1 ( 7.27 )]= -180
15−7.27
𝜃𝑧 − 62.2 − 100 − 117= -180
𝜃𝑧 = 99
14.13
= tan(180-99)
7.25−𝜎
14.13
= 6.3
7.27−𝜎
𝜎 = 5.2
Gc(s ) = s+5.2
𝐾 𝐾(𝑠 + 5.2)
𝐺𝑝𝑐 = (𝑠 + 5.2). = 3
𝑠(𝑠 + 5)(𝑠 + 15) 𝑠 + 20𝑠 2 + 75𝑠
−1
𝐾= ] = 254
𝐺𝑝𝑐 𝑠=−7.27+14.13𝑗
For unity feedback 1+KGpc(s)H(s) = 0
𝑠 + 20𝑠 + 75𝑠 + 254(𝑠 + 5.2) = 𝑠 3 + 20𝑠 2 + 329𝑠 + 1320 =0
3 2
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')
The phase Lead Compensator
The following figure shows a phase-lead network wherein the phase of output
voltage leads the phase of input voltage for sinusoidal inputs.
- From pole-zero configuration of phase-lead network it is observed that the
zero is nearer to origin as compared to pole, hence the effect of zero is
dominant, therefore, the phase-lead network, when introduced in
cascade with forward-path of a transfer function, the phase shift is
increased.
- The Bode plot of phase-lead network reveals that the lead network allows
to pass high frequencies and low frequencies are attenuated.
-
- The gain margin and phase margin can be adjusted to a desired value by
using a phase lead compensation network but the bandwidth is
increased. The increase in bandwidth results in reduction in settling time
and thus speed of the time response is improved.
Where K= 4*Kc
Physical Realization of Lead compensator
clc
clear all
numg=1; deng=poly([0 -4 -6]); G=tf(numg,deng)
pos=input('Type desired percent overshoot ');
z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2);
rlocus(G);
sgrid(z,0);
[K,p]=rlocfind(G);
operatingpoint=p(2); gain=K
estimated_settling_time=4/abs(real(p(2)))
estimated_peak_time=pi/abs(imag(p(2)))
estimated_percent_overshoot=pos
estimated_damping_ratio=z
estimated_natural_freq=sqrt(real(p(2))^2+imag(p(2))^2)
numkv=conv([1 0],numg); denkv=deng; sG=tf(numkv,denkv);
sG=minreal(sG); Kv=dcgain(K*sG); ess=1/Kv
T=feedback(K*G,1); step(T);
disp('Please press any key to continuous')
pause
% (use 30% OS, Ts=1.986, b=5)
Ts=input('Type Desired Settling Time ');
b=input('Type Lead Compensator Zero, (s+b). b= ');
% (use a=43 (pole))
a=input('Enter a Test Lead Comp Pole,(s+a). a = ');
numge=conv(numg,[1 b]); denge=conv([1 a],deng);
Ge=tf(numge,denge); wn=4/(Ts*z);
rlocus(Ge); axis([-10,10,-10,10]); sgrid(z,wn)
[K,p]=rlocfind(Ge); Gc=tf([1 b],[1 a])
operatingpoint=p(2); gain=K
estimated_settling_time=4/abs(real(p(2)))
estimated_peak_time=pi/abs(imag(p(2)))
estimated_percent_overshoot=pos
estimated_damping_ratio=z
estimated_natural_freq=sqrt(real(p(2))^2+imag(p(2))^2)
s=tf([1 0],1); sGe=s*Ge; sGe=minreal(sGe);
Kv=dcgain(K*sGe); ess=1/Kv; T1=feedback(K*Ge,1);
step(T,T1)
legend('Uncompensated', 'Compensated')
Phase Lead Compensator Design
The design of a phase lead compensator is carried out as per the following methods:-
Example
Design a lead compensator for a system with G(s) = 10 / (s(s + 1)) such that the desired
damping ratio is ζd = 0.5 and the desired natural frequency is ωnd = 3. You should
compare with two design solutions. The first solution should be based on the one we
learned in class (Graphical method), and the other can be based on selecting the
zero of the compensator as the pole of G(s) at s = −1.
- For the two designs, find the SSE corresponding to a unit ramp input (i.e., find
the static-velocity error constant Kv).
- Show the step response for the uncompensated and compensated system. What
do you conclude?
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.
1. PD (Proportional-Derivative) Compensator
Characteristics
• Frequency Response:
o Gain: The derivative term (K_d s) causes the gain to increase with frequency
(a slope of +20 dB/decade). This amplifies high-frequency signals, including
noise.
o Phase: It introduces a constant +90° phase lead at all frequencies. This is its
most valuable property.
• Time-Domain Effect: The derivative term acts on the rate of change (slope) of
the error. It predicts what the error will be in the near future and applies a
corrective action based on that prediction. This "anticipatory" effect provides
damping to the system.
• Root Locus Effect: Adds a zero at s = -K_p/K_d. This zero pulls the root locus to
the left in the s-plane, making the system more stable (increasing damping) and
faster (increasing natural frequency).
Primary Applications
1. Improving Stability and Reducing Overshoot: This is the primary use. The
derivative term provides damping, which reduces oscillations and overshoot in the
transient response.
2. Speeding Up Transient Response: By increasing the system's natural frequency, it
allows for a faster response time (e.g., reduced rise time and settling time).
3. Practical Note: A pure differentiator (K_d s) is not physically implementable because
its gain goes to infinity as frequency increases. In practice, it is always implemented
as a Lead Compensator. This makes the PD controller a specific case of a lead
compensator.
Lead Compensator
• Frequency Response:
o Gain: It provides a boost in gain at medium frequencies.
o Phase: It introduces positive phase (phase lead).
• Time-Domain Effect: The phase lead increases the damping of the system,
reducing overshoot and oscillations. The gain boost can also help speed up the
response.
• Root Locus Effect: Adds a pole and a zero. The zero dominates, pulling the root
locus to the left, towards a more stable region of the s-plane.
Primary Applications
1. Increasing Phase Margin (Improving Stability): This is its core purpose. It is used
when a system has excessive overshoot or even instability (low phase margin). By
adding phase lead at the crossover frequency, it directly increases the phase
margin.
o Example: A disk drive read/write head positioning system. A lead
compensator can be used to ensure the head moves quickly to the correct
track (fast settling time) without oscillating around it, which would prevent
reading data.
2. Speeding Up System Response: The gain boost from the lead compensator
increases the crossover frequency, which generally leads to a faster transient
response (e.g., reduced rise time).
3. Practical Implementation of PD Action: As mentioned, a lead compensator with
the pole placed at a very high frequency approximates an ideal PD controller.
Therefore, the lead compensator is the practical, realizable version of a PD
controller.