MME 4450/9521 Control Systems: Optimal Control with State Feedback

Verified

Added on  2023/06/15

|22
|2361
|337
Homework Assignment
AI Summary
This assignment solution covers several aspects of control systems, including determining the optimal gain vector using state feedback, finding the parameter 'r' for critical damping, calculating closed-loop system poles, and verifying results using MATLAB's 'lqr' command. It also involves determining the Kalman filter gain L and estimator system poles with specified weighting matrices. Furthermore, the assignment includes a double pendulum system analysis, involving state feedback and LQR control, alongside MATLAB program implementations for each section, with detailed explanations and results. The document concludes with an analysis of white noise and Kalman filter applications, including program implementations and comparative error estimations. Desklib provides this solution along with numerous other resources to aid students in their studies.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Dell
[COMPANY NAME] [Company address]
CONTROL SYSTEM
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Table of Contents
Question-1.................................................................................................................................1
Question -2................................................................................................................................6
Question-3...............................................................................................................................13
References...............................................................................................................................20
Document Page
Question-1
Given data:
The performance index J is given by
Where r > 0 scalar parameter
(a) Optimal gain vector K
The state feedback control law is given by u = -kx
To find the value of C (sI – A)-1 B
(SI –A)-1 = adj(SI-A)det(SI-A)
C (sI – A)-1 B = [1 0][s -1 0 s+1 ] -1 [0 1 ]
= [1 0] 1s(s+1) [s+1 1 0 s ][0 1 ]
= [1 0] 1/s2+s [1 s ]
= 1/s2+s [1+0]
C (sI – A)-1 B = 1/s2+s
The above equation is representing the value of  = [1 0 1 0 ] , B =[1 0 ] , Ĉ =[1 0]
A = [0 1 0 -1 ], B = [0 1 ]
Mcx = [B, AB]
AB = [1 -1 ]
Mcx = [1 1 0 -1 ]
 = [1 0 1 0 ] , B =[1 0 ]
Document Page
Mcz = [B, ÂB]
Mcz = [0 1 1 1 ]
To find the similarity transform relating the two. It is given by
Mcz[Mcx]-1 = T
[Mcx]-1 = [1 1 0 -1 ] 1/-1 [-1 -1 0 1 ]
= [0 1 1 1 ][-1 -1 0 1 ]
T = [0 1 1 2 ]
To find the optimal gian vector K
K = ǨT
 = [1 0 1 0 ] , B =[1 0 ]
Â-BǨ =[1-k -k 1 0 ]
The desired pole polynomial is given by S2+2s+1
Now the above value is changed by
Where Ǩ = [3 1]
Now substitute the value for Ǩ in Â-BǨ equation
= [1-3 -1 1 0 ]
=[-2 -1 1 0 ]
Therefore the original feedback system is given by
K = ǨT
K = [3 1] [0 1 1 2 ]
Finally the optimal gain vector K = [-5 -3]
(b) K is critically dampled
Given
The closed loop system is given by
When K=-5
G(s) = c(s)/R(s)
= -5/s2+s-5
=-5/s2+2 ᶓ ωns+ωn2
The critically damped system ᶓ =1
The equation is given by
= -5/ s2+2 ωns+ωn2
= -5/s(s+ωn)2
The closed system with K is critically damped the given equation is
C(s) =-5/s(s+ωn)2
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
C(s) =-3/s(s+ωn)2
(c) The closed loop system poles
The given system is C(s) =-5/s(s+ωn)2
=A/s +B/(s+ωn)2 +C/(s+ ωn)
The pole values are determined by the above equation
= -1+4.582/2 = 1.791
P1 = 1.791
P2 = -2.791
(d) Part (a) and (c) using LQR command
When comparing the closed loop system the below figure show in the matlab window.
This plot indicates the closed loop system poles using the LQR command
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
n (samples)
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
Amplitude
Step Response
Document Page
(e) Kalman filter gain L
given
Q = 6xI2x2
R =1
G =I2x2
The given kalman filter gain L is given by
Q = 6x[1 0 0 1 ]
Q =[6 0 0 6 ]
G = [1 0 0 1 ]
L = ½ [6 0 0 6 ] +1/2 (1)
= [3 0 0 3 ]+[0.5]
= [1.5 0 0 1.5 ]
The gain value of the kalman filter is givevn by
L = [1.5 0 0 1.5 ]
Document Page
(f) Using LQE
The below plot indicates the kalman filter gain L using the matlab comman LQE
Program for kalman filter using LQE
clear all;
clc;
display('------------Linear Quadratic Estimator-----------------')
A=input('enter the A matrix =[0 1; 0 -1]);
B=input('enter the B matrix =[0 1]);
C=input('enter the C matrix =[1 0]);
[b,a]=ss2tf(A,B,C);
sys1=tf(b,a)
Q=input('enter value of q = [6 0 0; 0 6 0; 0 0 6]
else
Q=transpose(C)*C
end
R=input('enter the matrix of R(no. of columns must be equal to B) = 1');
N=input('enter value of N = 0 ')
else
N=0
End
L = 2.25;
end
[K,S,e]=lqe(A,B,Q,R,N,L)
sys=ss(A,B,C,D)
subplot(311)
step(sys)
n=length(K);
AA=A - B * K
for i=1:n
BB(:,i)=B * K(i);
end
display(BB)
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
CC=C
for i=1:n
sys(:,i)=ss(AA,BB(:,i),CC);
end
subplot(312)
step(sys(:,1))
subplot(313)
step(sys(:,2))
Question -2
(a) Double pendulum system
Given
Document Page
Solution
Concept of control system in state feedback
State feed back
Impact of state feedback on behaviour
Closed loop poles
It is clear that state feedback changes behavioura and allows us to move the closed –loop
poles
Document Page
The closed –loop poles are eigenvalues of A-BK
Find the impact of the state feedback
closed loop
apply these above values are given below
A = 0 0 1 0 0 0 -29.4 19.6 0 0 1 0
14.7 -4.9 0 0
B = (0 0 0 -1/2(4))
= (0 0 0 -0.125)T
B =0 0 0 -0.125
C = 1 0 0 0 0 0 1 0
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Find the closed-loop poles
A = 0 0 1 0 0 0 -29.4 19.6 0 0 1 0
14.7 -4.9 0 0
B=0 0 0 -0.125
C = 1 0 0 0 0 0 1 0 Now K = k1 k2 k3 k4
A-BK= -29.4-K1 19.6-K2
14.7- K3 -4.9-K3
Closed – loop poles
K1=29.4 K2=19.6 k3=-29.4
(b) Program for using LQR
= -29.4-K1 19.6
14.7- K3 -4.9-K3
K1=29.4 K2=19.6 k3=-29.4
clear all;
clc;
display('------------Linear Quadratic Regulator-----------------')
A=input('enter the A matrix =[14.7 -4.9 0 0]);
B=input('enter the B matrix =[0 0 0 -0.125]);
C=input('enter the C matrix =[1 0 0 0]);
[b,a]=ss2tf(A,B,C);
sys1=tf(b,a)
Q=input('enter value of q = [10 0 0 0; 0 10 0 0; 0 0 10 0; 0 0 0 10]
else
Q=transpose(C)*C
end
R=input('enter the matrix of R(no. of columns must be equal to B) = 1');
N=input('enter value of N = 0 ')
else
Document Page
N=0
End
[K,S,e]=lqr(A,B,Q,R,N,L)
sys=ss(A,B,C,D)
subplot(311)
step(sys)
n=length(K);
AA=A - B * K
for i=1:n
BB(:,i)=B * K(i);
end
display(BB)
CC=C
for i=1:n
sys(:,i)=ss(AA,BB(:,i),CC);
end
subplot(312)
step(sys(:,1))
subplot(313)
step(sys(:,2))
(c ) program for Q= 100 I4x4 R =1
Change the transpose
X(0)=0.1
0
0
0
clear all;
clc;
display('------------Linear Quadratic Regulator-----------------')
Document Page
A=input('enter the A matrix =[0.1, 29.4]);
B=input('enter the B matrix =[0, 19.6]);
C=input('enter the C matrix =[0, 29.4]);
[b,a]=ss2tf(A,B,C);
sys1=tf(b,a)
Q=input('enter value of q = [100 0 0 0; 0 100 0 0; 0 0 100 0; 0 0 0 100]
else
Q=transpose(C)*C
end
R=input('enter the matrix of R(no. of columns must be equal to B) = 1');
N=input('enter value of N = 0 ')
else
N=0
End
[K,S,e]=lqr(A,B,Q,R,N,L)
sys=ss(A,B,C,D)
subplot(311)
step(sys)
n=length(K);
AA=A - B * K
for i=1:n
BB(:,i)=B * K(i);
end
display(BB)
CC=C
for i=1:n
sys(:,i)=ss(AA,BB(:,i),CC);
end
subplot(312)
step(sys(:,1))
subplot(313)
step(sys(:,2))
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
(d)LQR
U=-KX
The open loop and closed loop both are same in the LQR system
Document Page
(e) The behaviour of Q is unit step response (time domain) in the given following graph
Question-3
Ideal of white noise
Unconditional mean and variance are constant
Document Page
Serially uncorrelated men/variance are same
Conditional and unconditional mean /varience are same
(a) Mean and variance
Mean= 70,102.89 -8389.626 -3120
-8770 1026.0084 384
-3120 384 144
Varience = 73984 0 196
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
0 1 2 3 4 5 6 7 8
104
0
1
2
3
4
5
6
7
8 104
(b) Kalman filter
Program
A=[14.7 -4,9 0 0];
B=[0 0 0 -0.125];
Q=[10 0 0 0;
0 10 0 0;
0 0 10 0;
0 0 0 10];
R = 1;
K = lqr(A,B,Q,R)
Ac = [(A-B*K)];
Document Page
Bc = [B];
Cc = [C];
T=0:0.01:5;
U=0.2*ones(size(T));
[Y,X]=lsim(Ac,Bc,Cc,U,T);
plot(T,Y)
legend('Cart','Pendulum')
output
Document Page
(c) program for initial and lsim
A=[14.7 -4,9 0 0];
B=[0 0 0 -0.125];
Q=[100 0 0 0;
0 100 0 0;
0 0 100 0;
0 0 0 100];
R = 1;
K = lqr(A,B,Q,R)
Ac = [(A-B*K)];
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Bc = [B];
Cc = [C];
T=0:0.01:5;
U=0.2*ones(size(T));
[Y,X]=lsim(Ac,Bc,Cc,U,T);
plot(T,Y)
legend('Cart','Pendulum')
(d) estimate error
when comparing the a and b value the below plot are shown in the matlab window.
Document Page
Document Page
References
Anon, (2017). [online] Available at:
https://www.researchgate.net/post/How_can_we_obtain_the_Gain_Vector_or_Matrix_in
_this_form_for_the_LQR_control [Accessed 28 Nov. 2017].
Filter, K. (2017). Kalmanfilter design, Kalman estimator - MATLAB kalman - MathWorks
United Kingdom. [online] In.mathworks.com. Available at:
http://in.mathworks.com/help/control/ref/kalman.html [Accessed 28 Nov. 2017].
In.mathworks.com. (2017). Linear-Quadratic Regulator (LQR) design - MATLAB lqr -
MathWorks United Kingdom. [online] Available at:
http://in.mathworks.com/help/control/ref/lqr.html [Accessed 28 Nov. 2017].
In.mathworks.com. (2017). LQR.m - File Exchange - MATLAB Central. [online] Available
at: http://in.mathworks.com/matlabcentral/fileexchange/47399-lqr-m [Accessed 29 Nov.
2017].
In.mathworks.com. (2017). Simulink Control Design Documentation - MathWorks United
Kingdom. [online] Available at: https://in.mathworks.com/help/slcontrol/index.html
[Accessed 29 Nov. 2017].
Www2.ensc.sfu.ca. (2017). CTM Example: State-space design for the inverted pendulum.
[online] Available at:
http://www2.ensc.sfu.ca/people/faculty/saif/ctm/examples/pend/invSS.html [Accessed
29 Nov. 2017].
chevron_up_icon
1 out of 22
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]