Lag Compensator Date:: EX - NO
Lag Compensator Date:: EX - NO
AIM:
To design a lag compensator for a closed loop system using MATLAB.
APPARATUS:
Software: MATLAB
THEORY:
We can manipulate TF, SS, and ZPK models using the arithmetic and model
interconnection
operations described in Operations on LTI Models and analyze them using the model analysis
functions, such as bode and step. FRD models can be manipulated and analyzed in much the
same way you analyze the other model types, but analysis is restricted to frequency-domain
methods.
Using a variety of design techniques, you can design compensators for systems specified
with TF, ZPK, SS, and FRD models. These techniques include root locus analysis, pole
placement, LQG optimal control, and frequency domain loop-shaping. For FRD models, you can
either: Obtain an identified TF, SS, or ZPK model using system identification techniques. Use
frequency-domain analysis techniques.
PROCEDURE:
Write the program in MATLAB editor and save it
Enter the values of numerator and denominator of the uncompensated system given when
asked during execution
Also enter the values of kv, phase margin and margin of safety
bode (g) returns the bode plot of gain adjusted but uncompensated system
MATLAB PROGRAM:
clc;
clear all;
close all;
%% Set up an SS model
A = [0 1
4 -2];
B = [0
1];
C = [1 1];
D = 0;
%% Convert to transfer function
[num,den] = ss2tf(A,B,C,D,1);
sys_tf= tf(num,den)
zpk(sys_tf)
pzmap(sys_tf)
hold
%% Test controllability and observability
CtrlTEstMatrix= ctrb(A,B)
rank(obsrbTestMatrix)
obsrbTestMatrix= obsv(A,C)
rank(obsrbTestMatrix)
%% Place the poles to Butterworth configuration
p = roots([ sqrt(2) 1])
% K = acker(AA,B,p) % this method is not numerically
% reliable and starts to break down rapidly for problems of
% order grater than 5
K = place(A,B,p)
% check the closed-loop pole locations
eig(A-B*K)
pzmap(1,poly(eig(A-B*K)));
OUTPUT
RESULT:
Thus the LAG compensator for a closed system is designed successfully and their output is
verified using MATLAB.