FDFDFD
FDFDFD
Apply the knowledge of lag and lead compensators to design a controller to operate a
given system within specification in terms of error and transient response.
Software requirement:
● MATLAB
Home work:
Given equation,
𝑘
𝐺(𝑠) = 𝑠(𝑠+6)(𝑠+10)
.
We need to design a lead-lag compensator with following specification:
Overshoot, OS= 20%
Peak time, 𝑇𝑃 = 𝐻𝑎𝑙𝑓 𝑜𝑓 𝑡ℎ𝑒 𝑜𝑙𝑑 𝑣𝑎𝑙𝑢𝑒..
Steady state error, E(s) = Ten fold of old value.
Input- Ramp time.
Lead compensator:
1 1
ζ= π 2 = π 2 = 0. 45595.
1+( 𝑙𝑛(𝑂𝑆)
) 1+( 𝑙𝑛(0.2)) )
Lag compensator:
Final code:
clear all;
close all;
s=tf('s');
G=1/(s*(s+6)*(s+10)); %transfer function
figure;
rlocus(G); %root locus
sgrid(.4559,0); %zeta=0.4559
[k,poles]=rlocfind(G)
G1=feedback(k*G,1); %actual system
Glead=(s+6)/(s+50.99166);
Glag=(s+0.1)/(s+0.01);
rlocus(G*Glead*Glag);
sgrid(.4559,0); %zeta=0.4559
[k,poles]=rlocfind(G*Glead*Glag)
G3=feedback(k*G*Glead*Glag,1); %Lag-lead compensated system
t = 0:0.1:20;
R1=t; %Unit Ramp
[yy1,t,xx1] = lsim(G1,R1,t); %Response of Type I system to Ramp
input
ee1=R1'-yy1; %Error of Type I system to Ramp input
[y1,t,x1] = lsim(G3,R1,t); %Response of Type I system to Ramp
input
e1=R1'-y1; %Error of Type I system to Ramp input
figure;
plot(t,yy1,'r',t,R1,'b', t,ee1
,'k'),xlabel('Time(sec)'),ylabel('Amplitude');
figure;
plot(t,y1,'r',t,R1,'b', t,e1 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude')
Output:
Lead-lag compensated:
Lead compensated:
Discussion:
In this lab report we designed both lead and lag compensator. For designing the lead lag
compensator we used the root locus of the system. The system’s initial output is taken as
reference from the root locus. Then according to the specification given and proper steps,
we designed a lead compensator. The output of the lead compensator reduced the settling
time by two fold. The system had a set overshoot of 20%. Then we designed a lag
compensator and the lag compensator reduced the steady state error by 10 fold
successfully. According to the design the lead and lag compensator is perfect, but due to
slight error while placing the cursor on root locus in the initial step the output has a
negligible deviation from expected.