0% found this document useful (0 votes)
35 views6 pages

B20EE004 CS Lab 5

The document describes an experiment to find a feedback matrix K to stabilize a closed-loop system. It provides the system matrices A and B, calculates the controllability matrix Qc, finds the poles and uses place() to calculate K. A model is defined and simulated with ode23() to plot the response.

Uploaded by

Abhishek kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views6 pages

B20EE004 CS Lab 5

The document describes an experiment to find a feedback matrix K to stabilize a closed-loop system. It provides the system matrices A and B, calculates the controllability matrix Qc, finds the poles and uses place() to calculate K. A model is defined and simulated with ode23() to plot the response.

Uploaded by

Abhishek kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Experiment-5

Objective
The design objective is to find the feedback matrix k such that the
closed-loop system is stable.

Theory
Calculations
Codes

Finding K.
A=[0 1 0 0; 16.3106 0 0 0; 0 0 0 1; -1.0637 0 0 0];

B=[0 ;-1.4458; 0 ;0.9639];

Q_c=ctrb(A, B); % finding the the Controllability


Matrix
cnt_out=det(Q_c); % finding the determinant to check
whether it is controllable or not
pole=[-1.3 -1 -2 -4]; % pole of the system
k=place(A,B,pole); % finding the k of the system
disp(k);

Plotting the graph.


function xdot= model1(t,x)
A = [0 -1.4458 0 -23.5819; -1.4458 0 -23.5819 0; 0 0.9639 0
1.5379; 0.9639 0 1.5379 0];
B = [-0.0470; 0; -0.0705; 0];
pole=[-1.3 -1 -2 -4];
K=place(A,B,pole);
u = -K*x;
xdot = A*x+B*u;
end

tspan = [0 10];
[t,x] = ode23(@model1, tspan, [0,0,-4.039, 4.039]);
plot(t,x);

Results
Conclusion

If the determinant of the controllability matrix is not equal to 0 then the system is
completely controllable and we find the state feedback gain matrix using pc matrix. Which
can be calculated using p1 matrix. This p1 matrix is obtained by the matrix multiplication of
[0 0 0 1] and Qc-1 matrix.

You might also like