Exp 3
Exp 3
Experiment 3
State feedback controller for the regulator problem
AIM : Using MATLAB, to design a state feedback controller for a regulator system
THEORY :
The linearised state equation of the dynamics of the pendulum on cart is given by
PROCEDURE :
i. In the ‘main’ script file, check for controllability as the first step. If the system is
controllable, proceed with the controller design. Use the acker () command of
MATLAB for the design of the controller, and initial() command to simulate the
response of the system without and with control, for comparison and study.
ii. Plot the graphs of the states vs. time (a) for the uncontrolled, (b) controlled system,
iii. graph of control input u = − Kx vs. time.
MATLAB CODE :
%%EXPERIMENT 3:
%%REGULATOR PROBLEM - INVERTED PENDULUM PROBLEM
M = 2;
m = 0.1;
G = 10;
l = 0.5;
t = 0:0.1:10;
x_0 = [0.1; 0; 0; 0];
if rank(M_c)<size(A,1)
disp('system is controllable');
end
system is controllable
%%Stability Check
for k=1:length(eig_A)
if eig_A(k) > 0
check=1;
end
end
if check==1
disp('system is unstable')
end
system is unstable
K = acker(A,B,P);
disp('EOC');
EOC
CONSLUSION :
From the Open loop response graph we can infer that the system is highly unstable as it keeps on
increasing/decreasing unboundedly.
The Closed loop response shows the regulatory operation of the system which controls the system
to bring it to zero.
The feedback controller output shows how state feedback control takes place to bring the state to
zero.