arna friend controls ii final

19
Controls II Final Arna Friend Given the transfer matrix of a two-input, two-output system: G ( s) = [ 7 s s +2 s 2 +6 s+ 5 s +3 s 2 +6 s+ 5 10 s +1 ] Design a discrete time decoupling control system with time step ∆t=.005 seconds. Channel one must have an output feedback controller and achieve settling time of 2 seconds and percent overshoot of the step response of 10%. Channel 2 must have a state variable feedback controller with a state observer and achieve settling time of 4 seconds and 0% overshoot of the step response. First I converted G(s) to the z-domain for the express purpose of designing the decoupling filter W(z): G ( z) = [ .035 z1 .00495 z.004901 z 2 1.97 z +.9704 .004963 z.004889 z 2 1.97 z+.9704 .04998 z.995 ] I designed W(z) such that: Q ( z) =G ( z) W ( z ) = [ q 11 ( z) 0 0 q 22 ( z) ] This resulted in: W ( z ) = [ .04998 .004963 z.004889 z1 z 2 1.97 z+.9704 z.995 z 2 1.97 z+.9704 .035 .00495 z.004901 ] 1

Upload: arna-friend

Post on 08-Aug-2015

19 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Arna Friend Controls II Final

Controls II FinalArna Friend

Given the transfer matrix of a two-input, two-output system:

G (s )=[ 7s

s+2s2+6 s+5

s+3s2+6 s+5

10s+1 ]

Design a discrete time decoupling control system with time step ∆ t=.005 seconds. Channel one must have an output feedback controller and achieve settling time of 2 seconds and percent overshoot of the step response of 10%. Channel 2 must have a state variable feedback controller with a state observer and achieve settling time of 4 seconds and 0% overshoot of the step response.

First I converted G(s) to the z-domain for the express purpose of designing the decoupling filter W(z):

G ( z )=[ .035z−1

.00495 z−.004901z2−1.97 z+.9704

.004963 z−.004889z2−1.97 z+.9704

.04998z−.995 ]

I designed W(z) such that:

Q ( z )=G (z )W ( z )=[q11(z ) 00 q22(z)]

This resulted in:

W ( z )=[ −.04998.004963 z−.004889

z−1z2−1.97 z+.9704

z−.995z2−1.97 z+ .9704

−.035.00495 z−.004901 ]

And:

q11 ( z )= −.3468 z4+1.366 z3−2.019 z2+1.326 z−.3265z6−5.926 z5+14.63 z4−19.27 z3+14.27 z2−5.637 z+.9277

q22 ( z )= −.3477 z4+1.37 z3−2.024 z2+1.329 z−.3273z6−5.926 z5+14.63 z4−19.27 z3+14.27 z2−5.637 z+.9277

1

Page 2: Arna Friend Controls II Final

To design the output feedback controller for channel one, I began by defining an s domain model through pole placement. I chose the real part of the dominant poles according to the settling time:

pdreal=−4

T set=−2

I chose the imaginary parts of the dominant poles according to the damping ratio of .6, corresponding to overshoot of 10%:

pdℑ=√1−ζ 2

ζ 2=±2.6667

I chose the remaining poles as -8, -17, -18 and -20. I then constructed the model transfer function in the s domain as:

GM ( s)= 5.44∗105

s6+67 s5+1709 s4+20652 s3+1.217∗105 s2+5.44∗105

I then converted the model to the z-domain:

1.125∗10−11 z5=6.117∗1010 z 4+3.09∗10−9 z3+2.946∗10−9 z2+5.299∗10−10+8.86∗10−12

z6−5.678 z5+13.43 z4−16.94 z3+12.01 z2−4.542 z+.7153

To get the numerator of the feedback controller, I subtracted the coefficients of the characteristic polynomial of the model from those of the characteristic polynomial of the plant:

F=.2478 z5−1.2012 z4+2.3296 z3−2.2589 z2+1.0952 z−.2124

The denominator of the feedback controller was just the numerator of the plant, delayed by one sample to make it the same order as the numerator. I then designed the pre-filter to have the numerator of the model and the numerator of the plant (delayed by two samples) as the denominator. Simulation yielded:

2

Page 3: Arna Friend Controls II Final

For channel 2, I designed a state variable controller with a state observer. As in the case of the output feedback controller I began by designing a model to achieve the design specifications of 4 second settling time and 0% over shoot. Since there is no overshoot, there is just one real dominant pole which I chose as:

pd=−4T set

=−1

I chose the remaining poles as -8, -13,-10,-12 and -4. This resulted in the following s domain model:

GM ( s)= 49920

s6+48 s5+905 s4+8410 s3+39264 s2+81632 s+49920

Converting to the z-domain I obtained:

1.047∗10−12 z5+5.766∗10−11 z4+2.952∗10−10 z3+2.853∗10−10 z2+5.203∗10−11 z+8.819∗10−13

z6−5.766 z5+13.85 z4−17.75 z3+12.79 z2−4.914 z+.7866

I then converted both the plant and the model to CCF form, resulting in the following fundamental matrices:

3

Page 4: Arna Friend Controls II Final

AP=[0 1 0 0 0 00 0 1 0 0 00 0 0 1 0 00 0 0 0 1 00 0 0 0 0 1

−.9277 5.6367 −14.2694 19.2653 −14.6306 5.9257]

AM=[0 1 0 0 0 00 0 1 0 0 00 0 0 1 0 00 0 0 0 1 00 0 0 0 0 1

−.7866 4.9135 −12.7868 17.7457 −13.8518 5.7661]

To obtain feedback controller F I used:

F=[0 0 0 0 0 1 ]∗( AP−AM )

F=[−.1411 .7232 −1.4825 1.5196 − .7788 .1596 ]

I then began the design of the state observer. I designed the state observer to have 50% of the settling time of the controlled plant, or 2 seconds. I chose the dominant pole as:

pd=−4T set

=−2

I chose the remaining poles as -16,-17,-19,-20 and -22. This resulted in the following model of the observer:

GO (s )= 1

s6+96 s5+3711 s4+72852 s3+744228 s2+3.499∗106+4.548∗106

I then converted to the z domain:

2.027∗10−17 z5+1.079∗10−15 z4+5.338∗10−15 z3+4.984∗10−15 z2+8.782∗10−16+1.438∗10−17

z6−5.542 z5+12.79 z4−15.75 z3+10.9 z2−4.024 z+.6188

And the to CCF, resulting in the following fundamental matrix:

AO=[0 1 0 0 0 00 0 1 0 0 00 0 0 1 0 00 0 0 0 1 00 0 0 0 0 1

−.6188 4.0240 −10.9015 15.7478 −12.7932 5.5417]

4

Page 5: Arna Friend Controls II Final

Using the fundamental matrix of the observer and the fundamental matrix of the plant I solved for vector K as follows:

k 1=−AO (6,6 )+AP(6,6)

k 2=−AO (6,5 )+AP (6,5 )+AP (6,6 ) k1

k 3=−AO (6,4 )+AP (6,4 )+A P (6,5 ) k1+AP (6,6 )k 2

k 4=−AO (6,3 )+A P (6,3 )+AP (6,4 )k 1+AP (6,5 ) k2+AP (6,6 ) k5

k 5=−AO (6,2 ) +A P (6,2 )+AP (6,3 ) k1+AP (6,4 ) k2+AP (6,5 ) k3+AP (6,6 ) k4

k 6=−AO (6,1 )+AP (6,1 )+AP (6,2 ) k1+AP (6,3 ) k2+AP (6,4 ) k3+A P (6,5 )k 4+AP (6,6 ) k5

This resulted in:

K=[.3840.4380.4952.5554.6189.6856

]I then introduced a filter to cancel the zeros of the plant so that its C matrix would be:

CP=[1 0 0 0 0 0 ]

The filter was:

FZC=1

−.3477 z4+1.37 z3−2.024 z2+1.329 z−.3273

I designed matrix M as:

M=AP−K CP=[−.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]

Finally I designed a filter in the reference channel equal to the numerator of the model in order to make the overall closed loop transfer function equal to the transfer function of the model. Simulation of channel 2 resulted in:

5

Page 6: Arna Friend Controls II Final

The control effort U1, with reference applied to channel one, and no disturbance, was:

And U2:

6

Page 7: Arna Friend Controls II Final

The control effort U1 with reference applied to channel two and no disturbance was:

And U2:

7

Page 8: Arna Friend Controls II Final

When a disturbance was applied to channel one, with no reference, the system response was:

The control effort U1 was:

8

Page 9: Arna Friend Controls II Final

And U2:

When a step disturbance was applied on channel two, with no reference signal, the system response was:

9

Page 10: Arna Friend Controls II Final

And control effort U1:

And U2:

10

Page 11: Arna Friend Controls II Final

I then introduced feasability constraints on the control effort, bounding U1 between -1 and 1 and bounding U2 between -.75 and .75.

When I applied a step reference of magnitude 5 to channel one, U1 reached its upper saturation limit, as shown below:

U2 was still well within its limits:

11

Page 12: Arna Friend Controls II Final

The system was still able to follow higher references but the control efforts simply became too large to be feasible. For instance here is the system response to a step of magnitude 100:

On channel two, the system could track step references up to magnitude 7.5 before feasibility limits on the control effort U2 were exceeded. Below are U1 and U2 for a step reference of 7.5:

12

Page 13: Arna Friend Controls II Final

And U2:

As in the previous case the system could still track very high magnitude references but the control efforts were beyond feasibility limits. Here is the response of channel two to a step of magnitude 100:

13

Page 14: Arna Friend Controls II Final

So although the system remains decoupled and follows the reference for large signals, in order for the design constraints on both control efforts to be met, the reference must be 5 or below in magnitude.

Simulation diagrams:

Diagram for step responses to a unit step input and for control efforts:

14

Page 15: Arna Friend Controls II Final

[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]

Diagram for responses to a unit step disturbance (with the disturbance on channel 2 for that case):

[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

Matlab code:

%% Arna Friend Controls II Final Take Home Exam

15

Page 16: Arna Friend Controls II Final

% declare s domain transfer matrix to be used for simulationG_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 stepdt = .005; % convert transfer matrix into z domainG_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 = 0Q_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 = 0Q_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_22Q_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 placementT_set = 2;pd_real = 4/T_set;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;

16

Page 17: Arna Friend Controls II Final

pnd3 = 18;pnd4 = 20;% contruct characteristic polynomiald1 = 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 1NMs = DMs(end);GMs = tf(NMs,DMs);% step(GMs);% convert to discrete timeGMz = c2d(GMs,dt);[NMz,DMz]=tfdata(GMz,'v');[NPz,DPz] = tfdata(Q_11,'v');F = DMz(2:end)-DPz(2:end);% feedback controllerFz = tf(F,[NPz 0],dt);% pre filterPz = tf(NMz,[NPz 0 0],dt);%%% channel 2 state variable feedback controller with state observer% 4 second settling time 0% overshootT_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; 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];

17

Page 18: Arna Friend Controls II Final

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 secondsT_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 Kk1 = -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 filterM = 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 channelFR = tf(NMz2,1,dt);

18