Professional Documents
Culture Documents
Final Exam Project: Department of Electrical Engineering Student Name: Naveed Mazhar
Final Exam Project: Department of Electrical Engineering Student Name: Naveed Mazhar
Project
ECE 830
Table of Contents
List of Figures.........................................................................................3
Non Linear Equations.............................................................................4
System Linearization..............................................................................5
Matrices of State Space..........................................................................9
Open Loop Eigen Values.......................................................................10
Controllability and Observability..........................................................10
Calculations and Methodology Used....................................................10
Feedback matrices, K and K for each case..........................................11
Closed-loop eigenvalues for each case................................................11
Observer matrix L & observer eigenvalues..........................................12
Results for your best design with minimal inputs and outputs.............13
Summary discussion of your process and results.................................14
References...........................................................................................15
Appendix..............................................................................................15
List of Figures
Figure 1(Outputs Plot using all inputs and outputs).............................13
Figure 2(Output Plot with minimum Inputs & Outputs)........................14
Figure 3 (SIMULINK Implementation of minimum I/O's System)...........18
1 1 s
2 2 s
D1
2
s Pm1 1 [V1 G11 V1V2{G12cos (1 2 ) B12 sin(1 2 )}
s
1
2 H1
V1V3{G13cos (1 3 ) B13 sin(1 3 )}]
D2
2
s Pm 2 2 [V2 G22 V2V1{G21cos ( 2 1 ) B21 sin( 2 1 )}
s
2
2H 2
V2V3{G23cos ( 2 3 ) B23 sin( 2 3 )}]
In these equations and represent the rotational angle and speed respectively. The
static VAR compensator (SVC) equation is as follows:
B SVC
1
K
K
BSVC R V3 R Vref
TR
TR
TR
This whole system has three inputs Pm1, Pm2 and Vref and three outputs 1, 2 and V3. The
third output V3 is defined by following equation:
V3
1 1 s
2 2 s
D1
2
Pm1 1 [V1 G11 V1V2{G12cos(1 2 ) B12 sin(1 2 )}
1 s
2 H1
D2
2 s
2H 2
Y V {cos(1 ) j sin(1 )} Y32V2{cos( 2 ) j sin( 2 )}
{G23cos ( 2 3 ) B23 sin( 2 3 )} ]
V2 31 1
G33 j[ B33 BSVC ]
B SVC
Vref
TR
TR
G33 j[ B33 BSVC ]
TR
System Linearization
As the non-linear system is very complex to understand and analyze, so it will be
linearized now. First, the output V3 equation will be simplified.
V3
V3
V3 R jS R 2 S 2
Where
G332 ( B33 x5 )2
1
G332 ( B33 x5 ) 2
Also we define variables RR,SS and GG for further use to provide simplicity.
RR V1 G31 cos x1 B31 sin x1 V2 G32 cos x2 B32 sin x2
S
S
S
Z
Z
R S
V3 1 S
S
R
S
Z V3 Z
Z
2
Now, let us describe the system by state variables x 1, x2, x3, x4 and x5 instead of 1, 2, 1,
2 and BSVC. Also, the system inputs will be defined by u 1, u2 and u3 replacing Pm1, Pm2
and Vref. Hence, after these change of variables, the system transforms to following:
f1 x1 x3 s
f 2 x2 x4 s
f 3 x3 s
2 H1
D1
2
u1 x3 [V1 G11 V1V2 {G12 cos( x1 x2 ) B12 sin( x1 x2 )}
V1
f 4 x4 s
2H 2
f5 x5
D2
2
u2 x4 [V2 G22 V2V1{G21cos ( x2 x1 ) B21 sin( x2 x1 )}
1
K Y31V1{cos( x1 ) j sin( x1 )} Y32V2 {cos( x2 ) j sin( x2 )} K R
x5 R
u3
TR
TR
G33 j[ B33 x5 ]
TR
f1
x2
f1
x3
f1
x4
f 2
x
1
f 2
x2
f 2
x3
f 2
x4
f
A 3
x1
f 4
x1
f 5
x1
f 3
x2
f3
x3
f3
x4
f 4
x2
f 4
x3
f 4
x4
f 5
x2
f5
x3
f5
x4
f1
x1
f1
x2
f1
x3
f1
x4
f 2
x2
f 2
x3
f 2
x4
f 3
x2
f 3
x3
f 3
x4
f 2
x1
f 3
x1
f1
x5
f 2
x5
f3
x5
f 4
x5
f5
x5
[ X ,U ,Y ][ X ,U ,Y ]
f1
x5
f 2
x5
f 3
x5
[ X ,U ,Y ][ X ,U ,Y ]
f1
u
1
f1
u2
f 2
u
1
f 2
u2
f 3
u1
f3
u2
f 5
u1
f5
u2
f 4
u1
~
~ ~
~ ~
f 4
u2
f1
u3
f 2
u3
f3
u3
f 4
u3
f5
u3
~ ~
[ X ,U ,Y ][ X ,U ,Y ]
V3
1
R V1G31 sin x1 V1 B31 cos x1 S V1 B31 sin x1 V1G31 cos x1
x1 GG.V3
V3
1
R V2G32 sin x2 V2 B32 cos x2 S V2 B32 sin x2 V2 G32 cos x2
x2 GG.V3
V3 V3
0
x3 x4
3
V3 1
2
2 2
R RR S SS ( B33 x5 ) G33 ( B33 x5 )
x5 V3
f1 f1 f1 f1
0
x1 x2 x4 x5
f1
1
x3
f 2 f 2 f 2 f 2
0
x1 x2 x3 x5
f 2
1
x4
V1
f 3
s
x1
2 H1
f 3
x2
2 H1 V1
f 3
D
1
x3
2 H1
f 3
0
x4
[G cos( x ) B sin( x )]
1
3
12
1
3
13
3
f 3
( R * RR S * SS )
2
2 2
s V1
(
B
x
)
G
(
B
x
)
33
5
33
33
5
f 4
0
x3
f 4
D
2
x4
2H 2
3
f 4
( R * RR S * SS )
2
2 2
s V2
(
B
x
)
G
(
B
x
)
33
5
33
33
5
f 5
K 1
R R V1G31 sin x1 V1 B31 cos x1 S V1 B31 sin x1 V1G31 cos x1
x1
TR V3
f 5
K 1
R R V2G32 sin x2 V2 B32 cos x2 S V2 B32 sin x2 V2 G32 cos x2
x2
TR V3
f 5 f 5
0
x3 x4
3
f 5
1 K R ( R * RR S * SS )
2
2 2
( B33 x5 ) G33 ( B33 x5 )
x5
TR TR
V3
0
0
0
0
s
2H 2
0
0
s
2 H1
K R
TR
~ ~
[ X ,U ,Y ][ X ,U ,Y ]
C 0
V3
x1
0
0
V3
x2
1 0
0 1
0 0
V3
x5
~ ~
[ X ,U ,Y ][ X ,U ,Y ]
0
0
1
0
0
0
0
0
1
0
-20.0834
6.7781
-0.0740
0
1.0695
42.3090 115.7154
0
0.01 9.3304
-3.3126
3.3126
0
0
-43.4178
0
0
0
0
0
0
5.5769
0
0
0
37.7
0
0
0 112.5
0
0
1 0
0
0
0
0 1
0
>>
-43.4314 + 0.0000i
0.0017 +10.9218i
0.0017 -10.9218i
10
-0.0369 + 4.1353i
-0.0369 - 4.1353i
by the command
K=place(A,B,poles1)
Then a full order observer was designed which was used with state
feedback matrix.
The observer poles were placed at
poles2=[-10 -12 -13 -16 -18];
by the command
L=place(A',C',poles2').
The minimum order observer was designed by first checking how many
minmimum inputs/outputs were sufficient to maintain controllability
and observability.
rank(ctrb(A,B(:,1)))
>>
5
rank(obsv(A,C(1,:)))
>>
5
11
It showed that system was both controllable and observable with single
input and single outout.
And the state feedback control with minimum order observer was
deisgned by the following code
B=B(:,1);
C=C(1,:);
poles1=[-2 -3 -4 -5 -6];
rank(ctrb(A,B))
rank(obsv(A,C))
K=place(A,B,poles1)
eig(A-B*K)
poles2=[-10 -12 -13 -16 -18];
L=place(A',C',poles2')
L=L';
eig(A-L*C)
eig([A -B*K;L*C A-B*K-L*C])
-5.0000
-4.0000
-3.0000
-2.0000
13
14
The Figure 1 shows the output plot while dealing the minimum input minimum output
system. It can be observed that the system stabilizes to its equilibrium with output
feedback control, whatever initial condition is applied.
15
References
[1] Linear System Theory by W.J. Rugh
[2] Non-Linear System Theory by Hassan K. Khalil
Appendix
Appendix A
clc;clear all;close all;
%% Given Constants
H1=26*1.3;
D1=5;
H2=5;
D2=0.1;
Kr=9;
Tr=0.08;
ws=377;
G11=0.7096; B11=-3.4484;
G12=0.1610; B12=1.0999;
G13=0.1614; B13=2.1754;
G21=0.1610; B21=1.0999;
G22=0.2990; B22=-3.0905;
G23=0.1931; B23=1.9327;
G31=0.1614; B31=2.1754;
G32=0.1931; B32=1.9327;
G33=0.8212; B33=-4.0607;
%Nominal Equlibria
V1=1.0481;
V2=1.0256;
V3o=1.0958;
delta1=0.0870;
delta2=0.2204;
delta3=-0.1491;
u1=1.5584;
u2=1.63;
x1=delta1;x2=delta2;
x3=ws;x4=ws;
x5=0.2498;
%% Equations
GG=sqrt(G33^2+(B33+x5)^2);
R=(V1*(G31*cos(x1)-B31*sin(x1))+V2*(G32*cos(x2)-B32*sin(x2)))/GG;
S=(V1*(B31*cos(x1)+G31*sin(x1))+V2*(B32*cos(x2)+G32*sin(x2)))/GG;
V3=sqrt(R^2+S^2);
RR=R*GG;
SS=S*GG;
C=[0 0 1 0 0;0 0 0 1 0;0 0 0 0 0];
16
C(3,1)=(1/V3o)*(R*(-V1*G31*sin(x1)-V1*B31*cos(x1))+S*(-V1*B31*sin(x1)...
+V1*G31*cos(x1)))/GG;
C(3,2)=(1/V3o)*(R*(-V2*G32*sin(x2)-V2*B32*cos(x2))+S*(-V2*B32*sin(x2)...
+V2*G32*cos(x2)))/GG;
C(3,5)=-(1/V3o)*(R*RR+S*SS)*((B33+x5)*((G33^2+(B33+x5)^2)^(-3/2)));
A=zeros(5,5);
A(1,1)=0;
A(1,2)=0;
A(1,3)=1;
A(1,4)=0;
A(1,5)=0;
A(2,1)=0;
A(2,2)=0;
A(2,3)=0;
A(2,4)=1;
A(2,5)=0;
A(3,1)=-(ws/(2*H1))*(V1*V2*(-G12*sin(x1-x2)+B12*cos(x1-x2))
+V1*((C(3,1)...
*(G13*cos(x1-delta3)+B13*sin(x1-delta3)))+...
(V3o*(-G13*sin(x1-delta3)+B13*cos(x1-delta3)))));
A(3,2)=(ws/(2*H1))*-(V1*V2*(G12*sin(x1-x2)-B12*cos(x1-x2))
+V1*((C(3,2)...
*(G13*cos(x1-delta3)+B13*sin(x1-delta3)))));
A(3,3)=-D1/(2*H1);
A(3,4)=0;
A(3,5)=(ws/(2*H1))*(-V1*C(3,5))*(G13*cos(x1-delta3)+B13*sin(x1-delta3));
A(4,1)=(ws/(2*H2))*-(V2*V1*(G21*sin(x2-x1)-B21*cos(x2-x1))
+V2*((C(3,1)...
*(G23*cos(x2-delta3)+B23*sin(x2-delta3)))));
A(4,2)=(ws/(2*H2))*-(V2*V1*(-G21*sin(x2-x1)+B21*cos(x2-x1))
+V2*((C(3,2)...
*(G23*cos(x2-delta3)+B23*sin(x2-delta3)))...
+(V3o*(-G23*sin(x2-delta3)+B23*cos(x2-delta3)))));
A(4,3)=0;
A(4,4)=-D2/(2*H2);
A(4,5)=(ws/(2*H2))*(-V2*C(3,5))*(G23*cos(x2-delta3)+B23*sin(x2-delta3));
A(5,1)=-Kr/Tr*C(3,1);
A(5,2)=-Kr/Tr*C(3,2);
A(5,3)=0;
A(5,4)=0;
A(5,5)=-(1/Tr)-(Kr/Tr)*C(3,5);
B=[zeros(2,3);ws/(2*H1) 0 0;0 ws/(2*H2) 0;0 0 Kr/Tr];
D=zeros(3,3);
disp('A=');disp(A);disp('B=');disp(B);
disp('C=');disp(C);disp('D=');disp(D);
17
Appendix B
clc;clear all;close all;
%%
A=[0 0 1 0 0;
0 0 0 1 0
-20.0834 6.7781 -0.0740 0 -1.0695
42.3090 -115.7154 0 -0.01 -9.3304
-3.3126 3.3126 0 0 -43.4178];
B=[0 0 0;0 0 0;5.5769 0 0;0 37.7 0;0 0 112.5];
C=[0 0 1.0000 0 0;
0 0 0 1.0000 0;
0.0294 -0.0294 0 0 0.2748]
D=zeros(3,3);
%%
eig(A)
rank(ctrb(A,B))
rank(obsv(A,C))
%%
poles1=[-2 -3 -4 -5 -6];
K=place(A,B,poles1)
eig(A-B*K)
poles2=[-10 -12 -13 -16 -18];
L=place(A',C',poles2')
L=L';
eig(A-L*C)
eig([A -B*K;L*C A-B*K-L*C])
%%
rank(ctrb(A,B(:,1)))
rank(obsv(A,C(1,:)))
Bmin=B(:,1);
Cmin=C(1,:);
poles1=[-2 -3 -4 -5 -6];
K=place(A,Bmin,poles1)
eig(A-Bmin*K)
poles2=[-10 -12 -13 -16 -18];
L=place(A',Cmin',poles2')
L=L';
eig(A-L*Cmin)
eig([A -Bmin*K;L*Cmin A-Bmin*K-L*Cmin])
sys=ss(([A -Bmin*K;L*Cmin A-Bmin*K-L*Cmin]),[Bmin;0;0;0;0;0],[[Cmin 0 0
0 0 0];[0 0 0 0 0 0 0 0 0 0]],[0;0])
step(sys)
Appendix C
18
19