Linear Control System Project
Linear Control System Project
Linear Control System Project
Project
Submitted by
TALHA RIAZ Capt. Shazma Sohail Ahmad
Reg # 327885 Reg # 359287 Reg # 330019
Pre-requisite: Converting given LTV system into LTI system
First of all the given LTV sys was converted to LTI sys through given sinusoidal transformation
matrix using following Matlab code:
clear all, close all, clc
w=200*pi;
J=0.01;
J_z=0.017;
K_i=0.01;
K_o=0.1;
H=(J_z-J)*w;
t=1;
PT = [cos(w*t) -sin(w*t) 0 0; sin(w*t) cos(w*t) 0 0; 0 0 cos(w*t) -sin(w*t); 0
0 sin(w*t) cos(w*t)]
PT_I = inv(PT)
A = [0 w 1 0;-w 0 0 1; 0 0 0 -H/J; 0 0 H/J 0]
B = K_i*[0 0;0 0;sin(w*t) cos(w*t);-cos(w*t) sin(w*t)]
C = K_o*[w*cos(w*t) w*sin(w*t) sin(w*t) -cos(w*t)]
C_out = [1 0 0 0;0 1 0 0]
B_z = PT_I*B
C_z = C*PT
Where A_bar & B_bar are the augmented matrices. Integral Controller to state output Feedback
Controller Block Diagram:
Complete Code
clear all,
close all,
clc
w=200*pi;
J=0.01;
J_z=0.017;
K_i=0.01;
K_o=0.1;
H=(J_z-J)*w;
t=1;
PT = [cos(w*t) -sin(w*t) 0 0; sin(w*t) cos(w*t) 0 0; 0 0 cos(w*t) -sin(w*t); 0 0 sin(w*t)
cos(w*t)]
PT_I = inv(PT)
A = [0 w 1 0;-w 0 0 1; 0 0 0 -H/J; 0 0 H/J 0]
B = K_i*[0 0;0 0;sin(w*t) cos(w*t);-cos(w*t) sin(w*t)]
C = K_o*[w*cos(w*t) w*sin(w*t) sin(w*t) -cos(w*t)]
C_out = [1 0 0 0;0 1 0 0]
B_z = PT_I*B
C_z = C*PT
rank(ctrb(A,B_z))
K = place(A,B_z,[-3 -4 -5 -7])
H = (place(A',C_out',[-60 -80 -100 -140]))'
N = -inv(C_out*inv(A-B_z*K)*B_z)
%C_bar = [C_z 0]
K_i = place(A_bar, B_bar,[-12 -14 -15 -16 -50 -55])
K_f = [K_i(1) K_i(3) K_i(5) K_i(7); K_i(2) K_i(4) K_i(6) K_i(8)]
K_ig = [K_i(9) K_i(11); K_i(10) K_i(12)]
Results
PT =
1.0000 -0.0000 0 0
0.0000 1.0000 0 0
0 0 1.0000 -0.0000
0 0 0.0000 1.0000
PT_I =
1.0000 0.0000 0 0
-0.0000 1.0000 0 0
0 0 1.0000 0.0000
0 0 -0.0000 1.0000
A=
0 628.3185 1.0000 0
-628.3185 0 0 1.0000
0 0 0 -439.8230
0 0 439.8230 0
B=
0 0
0 0
0.0000 0.0100
-0.0100 0.0000
C=
C_out =
1 0 0 0
0 1 0 0
B_z =
0 0
0 0
0 0.0100
-0.0100 0
C_z =
62.8319 0 0 -0.1000
ans =
K=
1.0e+07 *
H=
1.0e+05 *
0.0012 0.0019
-0.0019 0.0007
-1.8994 -0.3079
0.5278 -1.9224
N=
1.0e+03 *
-0.6622 -2.2044
2.0957 0.6339
A_bar =
0 628.3185 1.0000 0 0 0
-628.3185 0 0 1.0000 0 0
0 0 0 -439.8230 0 0
0 0 439.8230 0 0 0
-1.0000 0 0 0 0 0
0 -1.0000 0 0 0 0
B_bar =
0 0
0 0
0 0.0100
-0.0100 0
0 0
0 0
W=
1.0e+11 *
ans =
K_i =
1.0e+07 *
K_f =
1.0e+07 *
K_ig =
1.0e+06 *
0.1126 1.0308
-1.0861 -0.0957
Simulink design
Constant input tracking
Results