SlideShare a Scribd company logo
1 of 17
1
Controls II Final
Arna Friend
Giventhe transfermatrix of a two-input,two-outputsystem:
𝐺( 𝑠) = [
7
𝑠
𝑠 + 2
𝑠2 + 6𝑠 + 5
𝑠 + 3
𝑠2 + 6𝑠 + 5
10
𝑠 + 1
]
Designa discrete time decouplingcontrol systemwithtimestep ∆𝑡 = .005 seconds.Channel one must
have an outputfeedbackcontrollerandachieve settlingtimeof 2 secondsandpercentovershootof the
stepresponse of 10%. Channel 2must have a state variable feedbackcontrollerwithastate observer
and achieve settlingtime of 4secondsand0% overshootof the stepresponse.
FirstI convertedG(s) tothe z-domainforthe expresspurposeof designingthe decouplingfilterW(z):
𝐺( 𝑧) = [
.035
𝑧 − 1
.00495𝑧 − .004901
𝑧2 − 1.97𝑧 + .9704
. 004963𝑧 − .004889
𝑧2 − 1.97𝑧 + .9704
.04998
𝑧 − .995
]
I designedW(z) suchthat:
𝑄( 𝑧) = 𝐺( 𝑧) 𝑊( 𝑧) = [
𝑞11(𝑧) 0
0 𝑞22(𝑧)
]
Thisresultedin:
𝑊( 𝑧) = [
−.04998
. 004963𝑧 − .004889
𝑧 − 1
𝑧2 − 1.97𝑧 + .9704
𝑧 − .995
𝑧2 − 1.97𝑧 + .9704
−.035
.00495𝑧 − .004901
]
And:
𝑞11( 𝑧) =
−.3468𝑧4 + 1.366𝑧3 − 2.019𝑧2 + 1.326𝑧 − .3265
𝑧6 − 5.926𝑧5 + 14.63𝑧4 − 19.27𝑧3 + 14.27𝑧2 − 5.637𝑧 + .9277
𝑞22( 𝑧) =
−.3477𝑧4 + 1.37𝑧3 − 2.024𝑧2 + 1.329𝑧 − .3273
𝑧6 − 5.926𝑧5 + 14.63𝑧4 − 19.27𝑧3 + 14.27𝑧2 − 5.637𝑧 + .9277
To designthe outputfeedbackcontrollerforchannel one,Ibeganbydefiningansdomainmodel
throughpole placement.Ichose the real partof the dominantpolesaccordingtothe settlingtime:
2
𝑝𝑑
𝑟𝑒𝑎𝑙
= −
4
𝑇𝑠𝑒𝑡
= −2
I chose the imaginarypartsof the dominantpolesaccordingtothe dampingratioof .6, correspondingto
overshootof 10%:
𝑝𝑑
𝑖𝑚
=
√1 − 𝜁2
𝜁2 = ±2.6667
I chose the remaining polesas -8, -17, -18 and -20. I thenconstructedthe model transferfunctioninthe
s domainas:
𝐺 𝑀( 𝑠) =
5.44 ∗ 105
𝑠6 + 67𝑠5 + 1709𝑠4 + 20652𝑠3 + 1.217 ∗ 105 𝑠2 + 5.44 ∗ 105
I thenconvertedthe model tothe z-domain:
1.125 ∗ 10−11 𝑧5 = 6.117 ∗ 1010 𝑧4 + 3.09 ∗ 10−9 𝑧3 + 2.946 ∗ 10−9 𝑧2 + 5.299 ∗ 10−10 + 8.86 ∗ 10−12
𝑧6 − 5.678𝑧5 + 13.43𝑧4 − 16.94𝑧3 + 12.01𝑧2 − 4.542𝑧 + .7153
To get the numeratorof the feedbackcontroller,Isubtractedthe coefficientsof the characteristic
polynomial of the model fromthose of the characteristicpolynomial of the plant:
𝐹 =.2478𝑧5 − 1.2012𝑧4 + 2.3296𝑧3 − 2.2589𝑧2 + 1.0952𝑧 − .2124
The denominatorof the feedbackcontrollerwasjustthe numeratorof the plant,delayedbyone sample
to make it the same orderas the numerator.Ithendesignedthe pre-filtertohave the numeratorof the
model andthe numeratorof the plant(delayedbytwosamples) asthe denominator. Simulation
yielded:
3
For channel 2, I designedastate variable controllerwithastate observer. Asinthe case of the output
feedbackcontrollerI beganbydesigningamodel toachieve the designspecificationsof 4second
settlingtime and0%overshoot.Since there isno overshoot,there isjustone real dominantpolewhichI
chose as:
𝑝 𝑑 = −
4
𝑇𝑠𝑒𝑡
= −1
I chose the remainingpolesas -8, -13,-10,-12 and-4. This resultedinthe followingsdomainmodel:
𝐺 𝑀( 𝑠) =
49920
𝑠6 + 48𝑠5 + 905𝑠4 + 8410𝑠3 + 39264𝑠2 + 81632𝑠 + 49920
Convertingtothe z-domainIobtained:
1.047 ∗ 10−12 𝑧5 + 5.766 ∗ 10−11 𝑧4 + 2.952 ∗ 10−10 𝑧3 + 2.853 ∗ 10−10 𝑧2 + 5.203 ∗ 10−11 𝑧 + 8.819 ∗ 10−13
𝑧6 − 5.766𝑧5 + 13.85𝑧4 − 17.75𝑧3 + 12.79𝑧2 − 4.914𝑧 + .7866
I thenconvertedboththe plantandthe model toCCFform, resultinginthe followingfundamental
matrices:
𝐴 𝑃 =
[
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
−.9277 5.6367 −14.2694 19.2653 −14.6306 5.9257]
4
𝐴 𝑀 =
[
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
−.7866 4.9135 −12.7868 17.7457 −13.8518 5.7661]
To obtainfeedbackcontrollerFI used:
𝐹 = [0 0 0 0 0 1] ∗ ( 𝐴 𝑃 − 𝐴 𝑀)
𝐹 = [−.1411 . 7232 −1.4825 1.5196 −.7788 .1596]
I thenbeganthe designof the state observer.Idesignedthe state observertohave 50% of the settling
time of the controlledplant,or2 seconds.Ichose the dominantpole as:
𝑝 𝑑 = −
4
𝑇𝑠𝑒𝑡
= −2
I chose the remainingpolesas -16,-17,-19,-20 and -22. Thisresultedinthe followingmodel of the
observer:
𝐺 𝑂( 𝑠) =
1
𝑠6 + 96𝑠5 + 3711𝑠4 + 72852𝑠3 + 744228𝑠2 + 3.499 ∗ 106 + 4.548 ∗ 106
I thenconvertedtothe z domain:
2.027 ∗ 10−17 𝑧5 + 1.079 ∗ 10−15 𝑧4 + 5.338 ∗ 10−15 𝑧3 + 4.984 ∗ 10−15 𝑧2 + 8.782 ∗ 10−16 + 1.438 ∗ 10−17
𝑧6 − 5.542𝑧5 + 12.79𝑧4 − 15.75𝑧3 + 10.9𝑧2 − 4.024𝑧 + .6188
Andthe to CCF, resultinginthe followingfundamentalmatrix:
𝐴 𝑂 =
[
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
−.6188 4.0240 −10.9015 15.7478 −12.7932 5.5417]
Usingthe fundamental matrix of the observerandthe fundamentalmatrix of the plantIsolvedfor
vectorK as follows:
𝑘1 = −𝐴 𝑂(6,6) + 𝐴 𝑃(6,6)
𝑘2 = −𝐴 𝑂(6,5) + 𝐴 𝑃(6,5) + 𝐴 𝑃(6,6) 𝑘1
𝑘3 = −𝐴 𝑂(6,4) + 𝐴 𝑃(6,4) + 𝐴 𝑃(6,5) 𝑘1 + 𝐴 𝑃(6,6) 𝑘2
𝑘4 = −𝐴 𝑂(6,3)+ 𝐴 𝑃(6,3)+𝐴 𝑃(6,4) 𝑘1 + 𝐴 𝑃(6,5) 𝑘2 + 𝐴 𝑃(6,6) 𝑘5
𝑘5 = −𝐴 𝑂(6,2)+𝐴 𝑃(6,2)+ 𝐴 𝑃(6,3) 𝑘1 + 𝐴 𝑃(6,4) 𝑘2 + 𝐴 𝑃(6,5) 𝑘3 + 𝐴 𝑃(6,6) 𝑘4
5
𝑘6 = −𝐴 𝑂(6,1) + 𝐴 𝑃(6,1)+𝐴 𝑃(6,2) 𝑘1 + 𝐴 𝑃(6,3) 𝑘2 + 𝐴 𝑃(6,4) 𝑘3 + 𝐴 𝑃(6,5) 𝑘4 + 𝐴 𝑃(6,6) 𝑘5
Thisresultedin:
𝐾 =
[
.3840
.4380
.4952
.5554
.6189
.6856]
I thenintroducedafiltertocancel the zerosof the plantso that itsC matrix wouldbe:
𝐶 𝑃 = [1 0 0 0 0 0]
The filterwas:
𝐹𝑍𝐶 =
1
−.3477𝑧4 + 1.37𝑧3 − 2.024𝑧2 + 1.329𝑧 − .3273
I designedmatrix Mas:
𝑀 = 𝐴 𝑃 − 𝐾𝐶 𝑃 =
[
−.3840 1 0 0 0 0
−.4380 0 1 0 0 0
−.4952 0 0 1 0 0
−.5554 0 0 0 1 0
−.6189 0 0 0 0 1
−.1.6133 5.6367 −14.2694 19.2653 −14.6306 5.9257]
FinallyIdesignedafilterinthe reference channel equaltothe numeratorof the model inorderto make
the overall closedlooptransferfunctionequal tothe transferfunctionof the model.Simulationof
channel 2 resultedin:
6
The control effortU1, withreference appliedtochannel one,and nodisturbance,was:
AndU2:
The control effortU1 withreference appliedtochannel twoandnodisturbance was:
7
AndU2:
Whena disturbance wasappliedtochannel one, withnoreference, the systemresponse was:
8
The control effortU1 was:
AndU2:
9
Whena stepdisturbance wasappliedonchannel two,withnoreference signal,the system response
was:
Andcontrol effort U1:
10
AndU2:
I thenintroducedfeasabilityconstraintsonthe control effort,boundingU1 between -1and1 and
boundingU2 between -.75and.75.
WhenI appliedastepreference of magnitude5to channel one,U1 reacheditsuppersaturationlimit,as
shownbelow:
11
U2 was still well withinitslimits:
The systemwasstill able tofollowhigherreferencesbutthe control effortssimplybecame toolarge to
be feasible.Forinstance here isthe systemresponsetoa stepof magnitude 100:
12
On channel two,the systemcouldtrackstepreferencesuptomagnitude 7.5before feasibilitylimitson
the control effortU2 were exceeded.Below are U1 andU2 fora stepreference of 7.5:
AndU2:
13
As inthe previouscase the systemcouldstill trackveryhigh magnitude referencesbutthe control
effortswere beyondfeasibilitylimits.Here isthe responseof channel twotoa stepof magnitude 100:
So althoughthe systemremainsdecoupledandfollowsthe reference forlarge signals,inorderforthe
designconstraintsonbothcontrol effortstobe met,the reference mustbe 5 or below inmagnitude.
Simulationdiagrams:
14
Diagram forstepresponsestoa unitstepinput andfor control efforts:
Diagram forresponsestoa unitstepdisturbance (withthe disturbance onchannel 2for thatcase):
[P1]
[Z1]
[R2]
netsum9
netsum10
NMz2(z)
1
z
1
Unit Delay6
z
1
z
1
z
1
z
1
z
1
U2
U1
G_12s
M(6,1)
-K-
M(5,1)
-K-
M(4,1)
M(3,4)
M(3,1)
M(2,3)
F(6)
F(5)
F(4)
F(3)
F(2)
F(1)
M(1,2)
M(1,1)
M(6,2)
M(2,1)
FZC
Pz
G_21s
G_22s
G_11s
W_22
W_21
Fz
W_12
W_11
[Z2]
[Z1]
[P2]
[P1]
[A]
[Y2]
[Y1]
[Z6]
Goto13
[Z5][Z4]
[Z3]
[U2]
[U1]
M(6,5)
M(6,4)
M(6,3)
K(5)K(4)
K(2)
K(1)
Bp(6)
K(6)
-K-
K(3)
[Z1]
[U2]
[U2]
[P2]
[Z5]
[Z6]
[P2]
[Z4]
[Z3]
[Z2]
[Z1]
[Y2]
From35
[Z6]
[Z5]
[Z4]
[Z3]
[Z2]
[P1]
[Y2]
[Z6]
[Z1]
[Y2]
[Z5]
[Z1]
[Y2]
[Y2]
[Z4]
[U1]
[Z3]
[Z1]
[Y2]
[Y1]
[A]
[Z2]
[Z1]
[Y1]
[Y2]
[U1]
[R2]
[R1]
[P1]
[Z1]
[R1]
netsum9
netsum10
NMz2(z)
1
z
1
Unit Delay6
z
1
z
1
z
1
z
1
z
1
U2
U1
G_12s
M(6,1)
-K-
M(5,1)
-K-
M(4,1)
M(3,4)
M(3,1)
M(2,3)
F(6)
F(5)
F(4)
F(3)
F(2)
F(1)
M(1,2)
M(1,1)
M(6,2)
M(2,1)
FZC
Pz
G_21s
G_22s
G_11s
W_22
W_21
Fz
W_12
W_11
[Z2]
[Z1]
[P2]
[P1]
[A]
[Y2]
[Y1]
[Z6]
Goto13
[Z5][Z4]
[Z3]
[U2]
[U1]
M(6,5)
M(6,4)
M(6,3)
K(5)K(4)
K(2)
K(1)
Bp(6)
K(6)
-K-K(3)
[Z1]
[U2]
[U2]
[P2]
[Z5]
[Z6]
[P2]
[Z4]
[Z3]
[Z2]
[Z1]
[Y2]
From35
[Z6]
[Z5]
[Z4]
[Z3]
[Z2]
[P1]
[Y2]
[Z6]
[Z1]
[Y2]
[Z5]
[Z1]
[Y2]
[Y2]
[Z4]
[U1]
[Z3]
[Z1]
[Y2]
[Y1]
[A]
[Z2]
[Z1]
[Y1]
[Y2]
[U1]
[R2]
[R1]
0
Constant
15
Matlab code:
%% Arna Friend Controls II Final Take Home Exam
% declare s domain transfer matrix to be used for simulation
G_11s = tf(7,[1 0]);
G_12s = tf([1 2],[1 6 5]);
G_21s = tf([1 3],[1 6 5]);
G_22s = tf(10,[1 1]);
% declare time step
dt = .005;
% convert transfer matrix into z domain
G_11z = c2d(G_11s,dt);
G_12z = c2d(G_12s,dt);
G_21z = c2d(G_21s,dt);
G_22z = c2d(G_22s,dt);
% define numerators and denominators in code to avoid rounding errors
[G_11zN G_11zD] = tfdata(G_11z,'v');
[G_12zN G_12zD] = tfdata(G_12z,'v');
[G_21zN G_21zD] = tfdata(G_21z,'v');
[G_22zN G_22zD] = tfdata(G_22z,'v');
% define decoupling filter W(z)
W_12 = tf(G_11zD,G_12zD,dt);
W_22 = tf(-1*G_11zN,G_12zN,dt);
% check that Q_12 = 0
Q_12 = minreal(W_12*G_11z) + minreal(W_22*G_12z);
% this is non-zero but I am certain it is due to rounding error
W_11 = tf(-G_22zN,G_21zN,dt);
W_21 = tf(G_22zD,G_21zD,dt);
% check that Q_21 = 0
Q_21 = minreal(W_11*G_21z)+minreal(W_21*G_22z);
% similarly to Q_12 this is non-zero but the numerator is on the order of
% 10^-18
% construct Q_11 and Q_22
Q_11 = minreal(W_11*G_11z+W_21*G_12z);
[z1 p1 ki] = zpkdata(Q_11,'v'); % assure n0 poles or zeros outside the unit
circle and no uncancelled pole zero pairs.
Q_22 = minreal(W_12*G_21z + W_22*G_22z);
[z2 p2 k2] = zpkdata(Q_22,'v');% assure no poles or zeros outside the unit
circle and no uncancelled pole zero pairs.
% begin design of output feedback controller for channel one
% channel one settling time 2 seconds. Overshoot 10% zeta=.6
% define settling time, damping ratio and proceed with pole placement
T_set = 2;
pd_real = 4/T_set;
16
zeta = .6;
pd_im = pd_real*sqrt(1-zeta^2)/zeta;
pd1 = pd_real+pd_im*1i;
pd2 = pd_real-pd_im*1i;
pnd1 = 8;
pnd2 = 17;
pnd3 = 18;
pnd4 = 20;
% contruct characteristic polynomial
d1 = conv([1 pd1],[1 pd2]);
d2 = conv(d1,[1 pnd1]);
d3 = conv(d2,[1 pnd2]);
d4 = conv(d3,[1 pnd3]);
DMs = conv(d4,[1 pnd4]);
% insure gain of 1
NMs = DMs(end);
GMs = tf(NMs,DMs);
% step(GMs);
% convert to discrete time
GMz = c2d(GMs,dt);
[NMz,DMz]=tfdata(GMz,'v');
[NPz,DPz] = tfdata(Q_11,'v');
F = DMz(2:end)-DPz(2:end);
% feedback controller
Fz = tf(F,[NPz 0],dt);
% pre filter
Pz = tf(NMz,[NPz 0 0],dt);
%%
% channel 2 state variable feedback controller with state observer
% 4 second settling time 0% overshoot
T_set = 4;
p1 = 4/T_set;
p2 = 13;
pnd1 = 4;
pnd2 = 8;
pnd3 = 10;
pnd4 = 12;
d1 = conv([1 p1],[1 p2]);
d2 = conv(d1,[1 pnd1]);
d3 = conv(d2,[1 pnd2]);
d4 = conv(d3,[1 pnd3]);
DMs2 = conv(d4,[1 pnd4]);
NMs2 = DMs2(end);
GMs2 = tf(NMs2,DMs2);
GMz2 = c2d(GMs2,dt);
[NMz2,DMz2] = tfdata(GMz2,'v');
[NPz2,DPz2] = tfdata(Q_22,'v');
% plant and model in CCF form
Ap = [0 1 0 0 0 0;
0 0 1 0 0 0;
0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1;
-1.*fliplr(DPz2(2:end))];
Bp = [0;0;0;0;0;1];
Cp = fliplr(NMz2(2:end));
Am =[0 1 0 0 0 0;
17
0 0 1 0 0 0;
0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1;
-1.*fliplr(DMz2(2:end))];
Bm =[0;0;0;0;0;1];
Cm = fliplr(NMz2(2:end));
F = [0 0 0 0 0 1]*(Ap-Am); % state variable controller
% design state observer to have settling time 2 seconds
T_set_est = 2;
pd = 4/T_set_est;
pnd1 = 16;
pnd2 = 17;
pnd3 = 19;
pnd4 = 20;
pnd5 = 22;
d1 = conv([1 pd],[1 pnd1]);
d2 = conv(d1,[1 pnd2]);
d3 = conv(d2,[1 pnd3]);
d4 = conv(d3,[1 pnd4]);
DMEs = conv(d4,[1 pnd5]);
GEs = tf(1,DMEs);
GEz = c2d(GEs,dt);
[NEz DEz] = tfdata(GEz,'v');
AE = [0 1 0 0 0 0;
0 0 1 0 0 0;
0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1;
-1.*fliplr(DEz(2:end))];
% recursive formula to solve for K
k1 = -AE(6,6)+Ap(6,6);
k2 = -AE(6,5)+Ap(6,5)+Ap(6,6)*k1;
k3 = -AE(6,4)+Ap(6,4)+Ap(6,5)*k1+Ap(6,6)*k2;
k4 = -AE(6,3)+Ap(6,3)+Ap(6,4)*k1+Ap(6,5)*k2+Ap(6,6)*k3;
k5 = -AE(6,2)+Ap(6,2)+Ap(6,3)*k1+Ap(6,4)*k2+Ap(6,5)*k3+Ap(6,6)*k4;
k6 = -AE(6,1)+Ap(6,1)+Ap(6,2)*k1+Ap(6,3)*k2+Ap(6,4)*k3+Ap(6,5)*k4+Ap(6,6)*k5;
K = [k1;k2;k3;k4;k5;k6];
FZC = tf(1,NPz2,dt); %zero cancelling filter
M = Ap-K*[1 0 0 0 0 0]; %because of zero cancelling filter Cp is now [1 0 0 0
0 0]
% filter in the reference channel
FR = tf(NMz2,1,dt);

More Related Content

What's hot

Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationPranamesh Chakraborty
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationPranamesh Chakraborty
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming languageAshwini Mathur
 
The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181Mahmoud Samir Fayed
 
Test s velocity_15_5_4
Test s velocity_15_5_4Test s velocity_15_5_4
Test s velocity_15_5_4Kunihiko Saito
 
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014PyData
 
Do snow.rwn
Do snow.rwnDo snow.rwn
Do snow.rwnARUN DN
 
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Pujana Paliyawan
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining ExplainRobert Treat
 
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185Mahmoud Samir Fayed
 
Reducing the time of heuristic algorithms for the Symmetric TSP
Reducing the time of heuristic algorithms for the Symmetric TSPReducing the time of heuristic algorithms for the Symmetric TSP
Reducing the time of heuristic algorithms for the Symmetric TSPgpolo
 

What's hot (20)

Numerical methods generating polynomial
Numerical methods generating polynomialNumerical methods generating polynomial
Numerical methods generating polynomial
 
Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimization
 
Efficient Programs
Efficient ProgramsEfficient Programs
Efficient Programs
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimization
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming language
 
Analysis of Algorithum
Analysis of AlgorithumAnalysis of Algorithum
Analysis of Algorithum
 
The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181
 
Test s velocity_15_5_4
Test s velocity_15_5_4Test s velocity_15_5_4
Test s velocity_15_5_4
 
ScalaMeter 2012
ScalaMeter 2012ScalaMeter 2012
ScalaMeter 2012
 
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
 
DSP 05 _ Sheet Five
DSP 05 _ Sheet FiveDSP 05 _ Sheet Five
DSP 05 _ Sheet Five
 
DSP 06 _ Sheet Six
DSP 06 _ Sheet SixDSP 06 _ Sheet Six
DSP 06 _ Sheet Six
 
Do snow.rwn
Do snow.rwnDo snow.rwn
Do snow.rwn
 
Block diagrams
Block diagramsBlock diagrams
Block diagrams
 
Test (S) on R
Test (S) on RTest (S) on R
Test (S) on R
 
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining Explain
 
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185
 
Reducing the time of heuristic algorithms for the Symmetric TSP
Reducing the time of heuristic algorithms for the Symmetric TSPReducing the time of heuristic algorithms for the Symmetric TSP
Reducing the time of heuristic algorithms for the Symmetric TSP
 
Finite Difference Method
Finite Difference MethodFinite Difference Method
Finite Difference Method
 

Similar to Arna Friend Controls II Final

Home Work; Chapter 9; Inventory Policy Decisions
Home Work; Chapter 9; Inventory Policy DecisionsHome Work; Chapter 9; Inventory Policy Decisions
Home Work; Chapter 9; Inventory Policy DecisionsShaheen Sardar
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
EJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSEJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSADRIANULLOAP
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)Maho Nakata
 
Design of experiment methodology
Design of experiment methodologyDesign of experiment methodology
Design of experiment methodologyCHUN-HAO KUNG
 
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)SAJJAD KHUDHUR ABBAS
 
Algebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions ManualAlgebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions Manualkejeqadaqo
 
Ece 415 control systems, fall 2021 computer project 1
Ece 415 control systems, fall 2021 computer project  1 Ece 415 control systems, fall 2021 computer project  1
Ece 415 control systems, fall 2021 computer project 1 ronak56
 
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING
Episode 40 :  DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYINGEpisode 40 :  DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYINGSAJJAD KHUDHUR ABBAS
 
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]Pankaj Rathod
 
Econometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualEconometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualLewisSimmonss
 
Push And Pull Production Systems Chap7 Ppt)
Push And Pull Production Systems   Chap7 Ppt)Push And Pull Production Systems   Chap7 Ppt)
Push And Pull Production Systems Chap7 Ppt)3abooodi
 
Math for anomaly detection
Math for anomaly detectionMath for anomaly detection
Math for anomaly detectionMenglinLiu1
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming languageLincoln Hannah
 

Similar to Arna Friend Controls II Final (20)

Project final control
Project final controlProject final control
Project final control
 
Home Work; Chapter 9; Inventory Policy Decisions
Home Work; Chapter 9; Inventory Policy DecisionsHome Work; Chapter 9; Inventory Policy Decisions
Home Work; Chapter 9; Inventory Policy Decisions
 
project designa.docx
project designa.docxproject designa.docx
project designa.docx
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Control charts
Control chartsControl charts
Control charts
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAM
 
EJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSEJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOS
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
 
Design of experiment methodology
Design of experiment methodologyDesign of experiment methodology
Design of experiment methodology
 
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING (Part 2)
 
Algebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions ManualAlgebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions Manual
 
Ece 415 control systems, fall 2021 computer project 1
Ece 415 control systems, fall 2021 computer project  1 Ece 415 control systems, fall 2021 computer project  1
Ece 415 control systems, fall 2021 computer project 1
 
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING
Episode 40 :  DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYINGEpisode 40 :  DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING
Episode 40 : DESIGN EXAMPLE – DILUTE PHASE PNEUMATIC CONVEYING
 
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]
Pushandpullproductionsystems chap7-ppt-100210005527-phpapp01[1]
 
Econometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualEconometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions Manual
 
Push And Pull Production Systems Chap7 Ppt)
Push And Pull Production Systems   Chap7 Ppt)Push And Pull Production Systems   Chap7 Ppt)
Push And Pull Production Systems Chap7 Ppt)
 
Math for anomaly detection
Math for anomaly detectionMath for anomaly detection
Math for anomaly detection
 
Dispersion uwsb
Dispersion   uwsbDispersion   uwsb
Dispersion uwsb
 
DC servo motor
DC servo motorDC servo motor
DC servo motor
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 

Arna Friend Controls II Final

  • 1. 1 Controls II Final Arna Friend Giventhe transfermatrix of a two-input,two-outputsystem: 𝐺( 𝑠) = [ 7 𝑠 𝑠 + 2 𝑠2 + 6𝑠 + 5 𝑠 + 3 𝑠2 + 6𝑠 + 5 10 𝑠 + 1 ] Designa discrete time decouplingcontrol systemwithtimestep ∆𝑡 = .005 seconds.Channel one must have an outputfeedbackcontrollerandachieve settlingtimeof 2 secondsandpercentovershootof the stepresponse of 10%. Channel 2must have a state variable feedbackcontrollerwithastate observer and achieve settlingtime of 4secondsand0% overshootof the stepresponse. FirstI convertedG(s) tothe z-domainforthe expresspurposeof designingthe decouplingfilterW(z): 𝐺( 𝑧) = [ .035 𝑧 − 1 .00495𝑧 − .004901 𝑧2 − 1.97𝑧 + .9704 . 004963𝑧 − .004889 𝑧2 − 1.97𝑧 + .9704 .04998 𝑧 − .995 ] I designedW(z) suchthat: 𝑄( 𝑧) = 𝐺( 𝑧) 𝑊( 𝑧) = [ 𝑞11(𝑧) 0 0 𝑞22(𝑧) ] Thisresultedin: 𝑊( 𝑧) = [ −.04998 . 004963𝑧 − .004889 𝑧 − 1 𝑧2 − 1.97𝑧 + .9704 𝑧 − .995 𝑧2 − 1.97𝑧 + .9704 −.035 .00495𝑧 − .004901 ] And: 𝑞11( 𝑧) = −.3468𝑧4 + 1.366𝑧3 − 2.019𝑧2 + 1.326𝑧 − .3265 𝑧6 − 5.926𝑧5 + 14.63𝑧4 − 19.27𝑧3 + 14.27𝑧2 − 5.637𝑧 + .9277 𝑞22( 𝑧) = −.3477𝑧4 + 1.37𝑧3 − 2.024𝑧2 + 1.329𝑧 − .3273 𝑧6 − 5.926𝑧5 + 14.63𝑧4 − 19.27𝑧3 + 14.27𝑧2 − 5.637𝑧 + .9277 To designthe outputfeedbackcontrollerforchannel one,Ibeganbydefiningansdomainmodel throughpole placement.Ichose the real partof the dominantpolesaccordingtothe settlingtime:
  • 2. 2 𝑝𝑑 𝑟𝑒𝑎𝑙 = − 4 𝑇𝑠𝑒𝑡 = −2 I chose the imaginarypartsof the dominantpolesaccordingtothe dampingratioof .6, correspondingto overshootof 10%: 𝑝𝑑 𝑖𝑚 = √1 − 𝜁2 𝜁2 = ±2.6667 I chose the remaining polesas -8, -17, -18 and -20. I thenconstructedthe model transferfunctioninthe s domainas: 𝐺 𝑀( 𝑠) = 5.44 ∗ 105 𝑠6 + 67𝑠5 + 1709𝑠4 + 20652𝑠3 + 1.217 ∗ 105 𝑠2 + 5.44 ∗ 105 I thenconvertedthe model tothe z-domain: 1.125 ∗ 10−11 𝑧5 = 6.117 ∗ 1010 𝑧4 + 3.09 ∗ 10−9 𝑧3 + 2.946 ∗ 10−9 𝑧2 + 5.299 ∗ 10−10 + 8.86 ∗ 10−12 𝑧6 − 5.678𝑧5 + 13.43𝑧4 − 16.94𝑧3 + 12.01𝑧2 − 4.542𝑧 + .7153 To get the numeratorof the feedbackcontroller,Isubtractedthe coefficientsof the characteristic polynomial of the model fromthose of the characteristicpolynomial of the plant: 𝐹 =.2478𝑧5 − 1.2012𝑧4 + 2.3296𝑧3 − 2.2589𝑧2 + 1.0952𝑧 − .2124 The denominatorof the feedbackcontrollerwasjustthe numeratorof the plant,delayedbyone sample to make it the same orderas the numerator.Ithendesignedthe pre-filtertohave the numeratorof the model andthe numeratorof the plant(delayedbytwosamples) asthe denominator. Simulation yielded:
  • 3. 3 For channel 2, I designedastate variable controllerwithastate observer. Asinthe case of the output feedbackcontrollerI beganbydesigningamodel toachieve the designspecificationsof 4second settlingtime and0%overshoot.Since there isno overshoot,there isjustone real dominantpolewhichI chose as: 𝑝 𝑑 = − 4 𝑇𝑠𝑒𝑡 = −1 I chose the remainingpolesas -8, -13,-10,-12 and-4. This resultedinthe followingsdomainmodel: 𝐺 𝑀( 𝑠) = 49920 𝑠6 + 48𝑠5 + 905𝑠4 + 8410𝑠3 + 39264𝑠2 + 81632𝑠 + 49920 Convertingtothe z-domainIobtained: 1.047 ∗ 10−12 𝑧5 + 5.766 ∗ 10−11 𝑧4 + 2.952 ∗ 10−10 𝑧3 + 2.853 ∗ 10−10 𝑧2 + 5.203 ∗ 10−11 𝑧 + 8.819 ∗ 10−13 𝑧6 − 5.766𝑧5 + 13.85𝑧4 − 17.75𝑧3 + 12.79𝑧2 − 4.914𝑧 + .7866 I thenconvertedboththe plantandthe model toCCFform, resultinginthe followingfundamental matrices: 𝐴 𝑃 = [ 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 −.9277 5.6367 −14.2694 19.2653 −14.6306 5.9257]
  • 4. 4 𝐴 𝑀 = [ 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 −.7866 4.9135 −12.7868 17.7457 −13.8518 5.7661] To obtainfeedbackcontrollerFI used: 𝐹 = [0 0 0 0 0 1] ∗ ( 𝐴 𝑃 − 𝐴 𝑀) 𝐹 = [−.1411 . 7232 −1.4825 1.5196 −.7788 .1596] I thenbeganthe designof the state observer.Idesignedthe state observertohave 50% of the settling time of the controlledplant,or2 seconds.Ichose the dominantpole as: 𝑝 𝑑 = − 4 𝑇𝑠𝑒𝑡 = −2 I chose the remainingpolesas -16,-17,-19,-20 and -22. Thisresultedinthe followingmodel of the observer: 𝐺 𝑂( 𝑠) = 1 𝑠6 + 96𝑠5 + 3711𝑠4 + 72852𝑠3 + 744228𝑠2 + 3.499 ∗ 106 + 4.548 ∗ 106 I thenconvertedtothe z domain: 2.027 ∗ 10−17 𝑧5 + 1.079 ∗ 10−15 𝑧4 + 5.338 ∗ 10−15 𝑧3 + 4.984 ∗ 10−15 𝑧2 + 8.782 ∗ 10−16 + 1.438 ∗ 10−17 𝑧6 − 5.542𝑧5 + 12.79𝑧4 − 15.75𝑧3 + 10.9𝑧2 − 4.024𝑧 + .6188 Andthe to CCF, resultinginthe followingfundamentalmatrix: 𝐴 𝑂 = [ 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 −.6188 4.0240 −10.9015 15.7478 −12.7932 5.5417] Usingthe fundamental matrix of the observerandthe fundamentalmatrix of the plantIsolvedfor vectorK as follows: 𝑘1 = −𝐴 𝑂(6,6) + 𝐴 𝑃(6,6) 𝑘2 = −𝐴 𝑂(6,5) + 𝐴 𝑃(6,5) + 𝐴 𝑃(6,6) 𝑘1 𝑘3 = −𝐴 𝑂(6,4) + 𝐴 𝑃(6,4) + 𝐴 𝑃(6,5) 𝑘1 + 𝐴 𝑃(6,6) 𝑘2 𝑘4 = −𝐴 𝑂(6,3)+ 𝐴 𝑃(6,3)+𝐴 𝑃(6,4) 𝑘1 + 𝐴 𝑃(6,5) 𝑘2 + 𝐴 𝑃(6,6) 𝑘5 𝑘5 = −𝐴 𝑂(6,2)+𝐴 𝑃(6,2)+ 𝐴 𝑃(6,3) 𝑘1 + 𝐴 𝑃(6,4) 𝑘2 + 𝐴 𝑃(6,5) 𝑘3 + 𝐴 𝑃(6,6) 𝑘4
  • 5. 5 𝑘6 = −𝐴 𝑂(6,1) + 𝐴 𝑃(6,1)+𝐴 𝑃(6,2) 𝑘1 + 𝐴 𝑃(6,3) 𝑘2 + 𝐴 𝑃(6,4) 𝑘3 + 𝐴 𝑃(6,5) 𝑘4 + 𝐴 𝑃(6,6) 𝑘5 Thisresultedin: 𝐾 = [ .3840 .4380 .4952 .5554 .6189 .6856] I thenintroducedafiltertocancel the zerosof the plantso that itsC matrix wouldbe: 𝐶 𝑃 = [1 0 0 0 0 0] The filterwas: 𝐹𝑍𝐶 = 1 −.3477𝑧4 + 1.37𝑧3 − 2.024𝑧2 + 1.329𝑧 − .3273 I designedmatrix Mas: 𝑀 = 𝐴 𝑃 − 𝐾𝐶 𝑃 = [ −.3840 1 0 0 0 0 −.4380 0 1 0 0 0 −.4952 0 0 1 0 0 −.5554 0 0 0 1 0 −.6189 0 0 0 0 1 −.1.6133 5.6367 −14.2694 19.2653 −14.6306 5.9257] FinallyIdesignedafilterinthe reference channel equaltothe numeratorof the model inorderto make the overall closedlooptransferfunctionequal tothe transferfunctionof the model.Simulationof channel 2 resultedin:
  • 6. 6 The control effortU1, withreference appliedtochannel one,and nodisturbance,was: AndU2: The control effortU1 withreference appliedtochannel twoandnodisturbance was:
  • 7. 7 AndU2: Whena disturbance wasappliedtochannel one, withnoreference, the systemresponse was:
  • 9. 9 Whena stepdisturbance wasappliedonchannel two,withnoreference signal,the system response was: Andcontrol effort U1:
  • 10. 10 AndU2: I thenintroducedfeasabilityconstraintsonthe control effort,boundingU1 between -1and1 and boundingU2 between -.75and.75. WhenI appliedastepreference of magnitude5to channel one,U1 reacheditsuppersaturationlimit,as shownbelow:
  • 11. 11 U2 was still well withinitslimits: The systemwasstill able tofollowhigherreferencesbutthe control effortssimplybecame toolarge to be feasible.Forinstance here isthe systemresponsetoa stepof magnitude 100:
  • 12. 12 On channel two,the systemcouldtrackstepreferencesuptomagnitude 7.5before feasibilitylimitson the control effortU2 were exceeded.Below are U1 andU2 fora stepreference of 7.5: AndU2:
  • 13. 13 As inthe previouscase the systemcouldstill trackveryhigh magnitude referencesbutthe control effortswere beyondfeasibilitylimits.Here isthe responseof channel twotoa stepof magnitude 100: So althoughthe systemremainsdecoupledandfollowsthe reference forlarge signals,inorderforthe designconstraintsonbothcontrol effortstobe met,the reference mustbe 5 or below inmagnitude. Simulationdiagrams:
  • 14. 14 Diagram forstepresponsestoa unitstepinput andfor control efforts: Diagram forresponsestoa unitstepdisturbance (withthe disturbance onchannel 2for thatcase): [P1] [Z1] [R2] netsum9 netsum10 NMz2(z) 1 z 1 Unit Delay6 z 1 z 1 z 1 z 1 z 1 U2 U1 G_12s M(6,1) -K- M(5,1) -K- M(4,1) M(3,4) M(3,1) M(2,3) F(6) F(5) F(4) F(3) F(2) F(1) M(1,2) M(1,1) M(6,2) M(2,1) FZC Pz G_21s G_22s G_11s W_22 W_21 Fz W_12 W_11 [Z2] [Z1] [P2] [P1] [A] [Y2] [Y1] [Z6] Goto13 [Z5][Z4] [Z3] [U2] [U1] M(6,5) M(6,4) M(6,3) K(5)K(4) K(2) K(1) Bp(6) K(6) -K- K(3) [Z1] [U2] [U2] [P2] [Z5] [Z6] [P2] [Z4] [Z3] [Z2] [Z1] [Y2] From35 [Z6] [Z5] [Z4] [Z3] [Z2] [P1] [Y2] [Z6] [Z1] [Y2] [Z5] [Z1] [Y2] [Y2] [Z4] [U1] [Z3] [Z1] [Y2] [Y1] [A] [Z2] [Z1] [Y1] [Y2] [U1] [R2] [R1] [P1] [Z1] [R1] netsum9 netsum10 NMz2(z) 1 z 1 Unit Delay6 z 1 z 1 z 1 z 1 z 1 U2 U1 G_12s M(6,1) -K- M(5,1) -K- M(4,1) M(3,4) M(3,1) M(2,3) F(6) F(5) F(4) F(3) F(2) F(1) M(1,2) M(1,1) M(6,2) M(2,1) FZC Pz G_21s G_22s G_11s W_22 W_21 Fz W_12 W_11 [Z2] [Z1] [P2] [P1] [A] [Y2] [Y1] [Z6] Goto13 [Z5][Z4] [Z3] [U2] [U1] M(6,5) M(6,4) M(6,3) K(5)K(4) K(2) K(1) Bp(6) K(6) -K-K(3) [Z1] [U2] [U2] [P2] [Z5] [Z6] [P2] [Z4] [Z3] [Z2] [Z1] [Y2] From35 [Z6] [Z5] [Z4] [Z3] [Z2] [P1] [Y2] [Z6] [Z1] [Y2] [Z5] [Z1] [Y2] [Y2] [Z4] [U1] [Z3] [Z1] [Y2] [Y1] [A] [Z2] [Z1] [Y1] [Y2] [U1] [R2] [R1] 0 Constant
  • 15. 15 Matlab code: %% Arna Friend Controls II Final Take Home Exam % declare s domain transfer matrix to be used for simulation G_11s = tf(7,[1 0]); G_12s = tf([1 2],[1 6 5]); G_21s = tf([1 3],[1 6 5]); G_22s = tf(10,[1 1]); % declare time step dt = .005; % convert transfer matrix into z domain G_11z = c2d(G_11s,dt); G_12z = c2d(G_12s,dt); G_21z = c2d(G_21s,dt); G_22z = c2d(G_22s,dt); % define numerators and denominators in code to avoid rounding errors [G_11zN G_11zD] = tfdata(G_11z,'v'); [G_12zN G_12zD] = tfdata(G_12z,'v'); [G_21zN G_21zD] = tfdata(G_21z,'v'); [G_22zN G_22zD] = tfdata(G_22z,'v'); % define decoupling filter W(z) W_12 = tf(G_11zD,G_12zD,dt); W_22 = tf(-1*G_11zN,G_12zN,dt); % check that Q_12 = 0 Q_12 = minreal(W_12*G_11z) + minreal(W_22*G_12z); % this is non-zero but I am certain it is due to rounding error W_11 = tf(-G_22zN,G_21zN,dt); W_21 = tf(G_22zD,G_21zD,dt); % check that Q_21 = 0 Q_21 = minreal(W_11*G_21z)+minreal(W_21*G_22z); % similarly to Q_12 this is non-zero but the numerator is on the order of % 10^-18 % construct Q_11 and Q_22 Q_11 = minreal(W_11*G_11z+W_21*G_12z); [z1 p1 ki] = zpkdata(Q_11,'v'); % assure n0 poles or zeros outside the unit circle and no uncancelled pole zero pairs. Q_22 = minreal(W_12*G_21z + W_22*G_22z); [z2 p2 k2] = zpkdata(Q_22,'v');% assure no poles or zeros outside the unit circle and no uncancelled pole zero pairs. % begin design of output feedback controller for channel one % channel one settling time 2 seconds. Overshoot 10% zeta=.6 % define settling time, damping ratio and proceed with pole placement T_set = 2; pd_real = 4/T_set;
  • 16. 16 zeta = .6; pd_im = pd_real*sqrt(1-zeta^2)/zeta; pd1 = pd_real+pd_im*1i; pd2 = pd_real-pd_im*1i; pnd1 = 8; pnd2 = 17; pnd3 = 18; pnd4 = 20; % contruct characteristic polynomial d1 = conv([1 pd1],[1 pd2]); d2 = conv(d1,[1 pnd1]); d3 = conv(d2,[1 pnd2]); d4 = conv(d3,[1 pnd3]); DMs = conv(d4,[1 pnd4]); % insure gain of 1 NMs = DMs(end); GMs = tf(NMs,DMs); % step(GMs); % convert to discrete time GMz = c2d(GMs,dt); [NMz,DMz]=tfdata(GMz,'v'); [NPz,DPz] = tfdata(Q_11,'v'); F = DMz(2:end)-DPz(2:end); % feedback controller Fz = tf(F,[NPz 0],dt); % pre filter Pz = tf(NMz,[NPz 0 0],dt); %% % channel 2 state variable feedback controller with state observer % 4 second settling time 0% overshoot T_set = 4; p1 = 4/T_set; p2 = 13; pnd1 = 4; pnd2 = 8; pnd3 = 10; pnd4 = 12; d1 = conv([1 p1],[1 p2]); d2 = conv(d1,[1 pnd1]); d3 = conv(d2,[1 pnd2]); d4 = conv(d3,[1 pnd3]); DMs2 = conv(d4,[1 pnd4]); NMs2 = DMs2(end); GMs2 = tf(NMs2,DMs2); GMz2 = c2d(GMs2,dt); [NMz2,DMz2] = tfdata(GMz2,'v'); [NPz2,DPz2] = tfdata(Q_22,'v'); % plant and model in CCF form Ap = [0 1 0 0 0 0; 0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1; -1.*fliplr(DPz2(2:end))]; Bp = [0;0;0;0;0;1]; Cp = fliplr(NMz2(2:end)); Am =[0 1 0 0 0 0;
  • 17. 17 0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1; -1.*fliplr(DMz2(2:end))]; Bm =[0;0;0;0;0;1]; Cm = fliplr(NMz2(2:end)); F = [0 0 0 0 0 1]*(Ap-Am); % state variable controller % design state observer to have settling time 2 seconds T_set_est = 2; pd = 4/T_set_est; pnd1 = 16; pnd2 = 17; pnd3 = 19; pnd4 = 20; pnd5 = 22; d1 = conv([1 pd],[1 pnd1]); d2 = conv(d1,[1 pnd2]); d3 = conv(d2,[1 pnd3]); d4 = conv(d3,[1 pnd4]); DMEs = conv(d4,[1 pnd5]); GEs = tf(1,DMEs); GEz = c2d(GEs,dt); [NEz DEz] = tfdata(GEz,'v'); AE = [0 1 0 0 0 0; 0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1; -1.*fliplr(DEz(2:end))]; % recursive formula to solve for K k1 = -AE(6,6)+Ap(6,6); k2 = -AE(6,5)+Ap(6,5)+Ap(6,6)*k1; k3 = -AE(6,4)+Ap(6,4)+Ap(6,5)*k1+Ap(6,6)*k2; k4 = -AE(6,3)+Ap(6,3)+Ap(6,4)*k1+Ap(6,5)*k2+Ap(6,6)*k3; k5 = -AE(6,2)+Ap(6,2)+Ap(6,3)*k1+Ap(6,4)*k2+Ap(6,5)*k3+Ap(6,6)*k4; k6 = -AE(6,1)+Ap(6,1)+Ap(6,2)*k1+Ap(6,3)*k2+Ap(6,4)*k3+Ap(6,5)*k4+Ap(6,6)*k5; K = [k1;k2;k3;k4;k5;k6]; FZC = tf(1,NPz2,dt); %zero cancelling filter M = Ap-K*[1 0 0 0 0 0]; %because of zero cancelling filter Cp is now [1 0 0 0 0 0] % filter in the reference channel FR = tf(NMz2,1,dt);