Professional Documents
Culture Documents
COs to be achieved:
CO3: Design discrete time controllers in time and frequency domain.
Theory:
For a given second order system, design a digital lag compensator to meet following
specifications:
An overshoot of and steady state error= .
Use bilinear transformation.
Plot step response of uncompensated and compensated system. Also obtain bode plot for
both.
clc;
close
all; clear
all;
s=tf('s');
K=2;
Gs=K/((s)*(s+1));
Gz=c2d(Gs,0.1,'zoh')
aug=[0.1,1];
gwss = bilin(ss(Gz),-
1,'S_Tust',aug); gw=tf(gwss)
figure (1);
rlocusplot(gw);
grid on
title('Uncompensated System');
[Gm,Pm,Wgm,Wpm]=margin(gw);
Department of Electronics Engineering
DCS /Jan -May
2019
K. J. Somaiya College of Engineering, Mumbai-77
(Autonomous College Affiliated to University of Mumbai)
Department of Electronics Engineering
%lag compensator
z=tf('z',0.1);
lag=(9*((83*z)-81))/((179*z)-177);
figure (2);
rlocusplot(lag);
grid on
title('Lag Compensator');
%final compensated
final= Gz*lag;
figure (3);
rlocusplot(final);
grid on
title('Compensated System');
Output:
K. J. Somaiya College of Engineering, Mumbai-77
(Autonomous College Affiliated to University of Mumbai)
Department of Electronics Engineering
clc;
clear all;
close all;
t=input('Enter sampling time: ');
s=tf('s');
gc=1/((s)*(s+1));
gz=c2d(gc,0.1,'zoh');
aug=[0.1,1];
gwss = bilin(ss(gz),-1,'S_Tust',aug);
gw=tf(gwss);
bode(gw,gwss);
margin(gw)
grid;
title('Bode plot of uncompensated system');
figure
zpk(gz)
z=tf('z',0.1);
cz=9*((83*z-81)/((179*z)-177));
gc1=gz*cz;
aug=[0.1,1];
gwss1=bilin(ss(gc1),-1,'S_Tust',aug);
gw2=tf(gwss1)
bode(gw2);
margin(gw2)
grid;
title('Bode plot of compensated system');
K. J. Somaiya College of Engineering, Mumbai-77
(Autonomous College Affiliated to University of Mumbai)
Department of Electronics Engineering
Output:
ans =
0.0048374 (z+0.9672)
--------------------
(z-1) (z-0.9048)
gw2 =
Ans: One basic need of control system design is to obtain desired output value, these two
controller and compensator are there to fulfill this purpose. Ultimate aim is same for both, but
the difference is -
A controller is an element whose role is to maintain a physical quantity in a desired level.
For example we have a Temperature controller, pH controller, speed control, PID controller.
In other words, aim of controller design is to reduce the error between the reference and the
output signal which is fed back to the controller with input (reference) signal.
A compensator is a modification of system dynamics, to improve characteristics of the open-
loop plant so that it can safely be used with feedback control. For example to improve
stability, uncouple a system, to a 'lead/lag compensator, phase compensator. In case of Lead
and Lag compensator which are often designed to satisfy phase and gain margins, these bode
plot of the system itself changes after the insertion of compensator, bode plot indirectly
represents system dynamics.
Conclusion: