16.30 topic 15: combined estimators and regulators...nov 05, 2010  · november 5, 2010. fall 2010...

37
Topic #15 16.30/31 Feedback Control Systems State-Space Systems Closed-loop control using estimators and regulators. Dynamics output feedback “Back to reality” Reading: FPE 7.6

Upload: others

Post on 22-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Topic #15

16.30/31 Feedback Control Systems

State-Space Systems

• Closed-loop control using estimators and regulators.

• Dynamics output feedback

• “Back to reality”

• Reading: FPE 7.6

Page 2: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–2

Combined Estimators and Regulators

• Now evaluate stability and/or performance of a controller when K designed assuming

u(t) = −Kx(t)

but implemented as

u(t) = −Kx(t)

• Assume we have designed a closed-loop estimator with gain L

x(t) = (A − LC)x(t) + Bu(t) + Ly(t)

y(t) = Cx(t)

• The closed-loop system dynamics are given by:

x(t) = Ax(t) + Bu(t)

x(t) = (A − LC)x(t) + Bu(t) + Ly(t)

y(t) = Cx(t)

y(t) = Cx(t)

u(t) = −Kx(t)

• Which can be compactly written as: � � � �� � x˙˙ (t)

= A −BK x(t)

xcl(t) = Aclxcl(t) x(t) LC A − BK − LC x(t)

• This does not look too good at this point – not even obvious that the closed-system is stable.

λi(Acl) =??

November 5, 2010

Page 3: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–3

• Can fix this problem by introducing a new variable x = x − x and then converting the closed-loop system dynamics using the similarity transformation T � � � � � �

xcl(t) � x(t)

= I 0 x(t)

= T xcl(t) x(t) I −I x(t)

Note that T = T −1 •

• Now rewrite the system dynamics in terms of the state xcl(t)

Acl T AclT −1 � Acl⇒

• Since similarity transformations preserve the eigenvalues we are guaranteed that

λi(Acl) ≡ λi(Acl)

• Work through the math: � � � � � �

Acl = I 0 A −BK I 0

� I −I LC A − BK − LC � � �

I −I

= A −BK I 0

� A − LC −A + LC �

I −I

= A − BK BK

0 A − LC

¯• Because Acl is block upper triangular, we know that the closed-loop poles of the system are given by

det(sI − Acl) � det(sI − (A − BK)) det(sI − (A − LC)) = 0·

November 5, 2010

Page 4: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–4

• Observation: Closed-loop poles for this system consist of the union of the regulator poles and estimator poles.

• So we can just design the estimator/regulator separately and com­bine them at the end.

• Called the Separation Principle.

• Keep in mind that the pole locations you are picking for these two sub-problems will also be the closed-loop pole locations.

• Note: Separation principle means that there will be no ambiguity or uncertainty about the stability and/or performance of the closed-loop system.

• The closed-loop poles will be exactly where you put them!!

• And we have not even said what compensator does this amazing accomplishment!!!

November 5, 2010

Page 5: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–5

The Compensator

• Dynamic Output Feedback Compensator is the combination of the regulator and estimator using u(t) = −Kx(t)

x(t) = (A − LC)x(t) + Bu(t) + Ly(t)

x(t) = (A − BK − LC)x(t) + Ly(t)⇒

u(t) = −Kx(t)

• Rewrite with new state xc(t) ≡ x(t)

xc(t) = Acxc(t) + Bcy(t)

u(t) = −Ccxc(t)

where the compensator dynamics are given by:

Ac � A − BK − LC , Bc � L , Cc � K

• Note that the compensator maps sensor measurements to actuator commands, as expected.

• Closed-loop system stable if regulator/estimator poles placed in the LHP, but compensator dynamics do not need to be stable.

λi(A − BK − LC) =??

November 5, 2010

Page 6: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–6

• For consistency with the implementation of classical controllers, define the compensator transfer function as

Gc(s) = Cc(sI − Ac)−1Bc

so that u(t) = −Gc(s)y(t)

• Note that it is often very easy to provide classical interpretations (such as lead/lag) for the compensator Gc(s).

• Can implement this compensator with a reference command r(t) using feedback on e(t) = r(t) − y(t) rather than just −y(t)

r Gc(s) Gp(s)

e u y

⇒ u(t) = Gc(s)e(t) = Gc(s)(r(t) − y(t))

• Still have u(t) = −Gc(s)y(t) if r(t) = 0.

• So now write state space model of the compensator as

xc(t) = Acxc(t) + Bce(t)

u(t) = Ccxc(t)

• Intuitively appealing setup because it is the same approach used for the classical control, but it turns out not to be the best approach

More on this later. ⇒

November 5, 2010

Page 7: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

� �

� �

Fall 2010 16.30/31 15–7

Mechanics

Basics:•

e(t) = r(t) − y(t), u(t) = Gce(t), y(t) = Gu(t)

Gc(s) : xc(t) = Acxc(t) + Bce(t) , u(t) = Ccxc(t)

G(s) : x(t) = Ax(t) + Bu(t) , y(t) = Cx(t)

• Loop dynamics L(s) = G(s)Gc(s) ⇒ y(t) = L(s)e(t)

x(t) = Ax(t) +BCc xc(t) xc(t) = +Ac xc(t) +Bce(t)

� � � � � � � � x(t) A BCc x(t) 0

L(s) : = + e(t)⇒ xc(t) 0 Ac xc(t) Bc � � x(t)

y(t) = C 0 xc(t)

• To “close the loop”, note that e(t) = r(t) − y(t), then � � � � � � � �� � �� x(t) A BCc x(t) 0 � � x(t) xc(t)

= 0 Ac xc(t)

+ Bc

r(t) − C 0 xc(t) � �� � � �

A BCc x(t) 0 = + r(t)

−BcC Ac xc(t) Bc � � x(t) y(t) = C 0

xc(t)

• Acl is not exactly the same as on page 15-2 because we have re­arranged where the negative sign enters into the problem. Same result though.

November 5, 2010

Page 8: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

� �

Fall 2010 16.30/31 15–8

Scaling DOFB Compensator

• DOFB = Dynamic Output Feedback

• Assume that the closed-loop system has been written for the system on 15-6, then it is still possible that the DC gain of the response from r to y is not unity

• Scalar input/output assumed for now

• Need to scale the closed-loop to fix this using r ⇒ Nr

• Closed-loop dynamics are

xcl(t) = Aclxcl(t) + BclNr(t)

y(t) = Cclxcl(t)

• So to have the TF of y/u have unity gain at DC, must have

N = − Ccl(Acl)−1Bcl

−1

November 5, 2010

Page 9: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

� � � �

Fall 2010 16.30/31 15–9

Simple Compensator Example

• Let G(s) = 1/(s2 + s + 1) with state-space model given by:

0 1 0 � � A = , B = , C = 1 0 , D = 0

−1 −1 1

• Design the regulator to place the poles at s = −4 ± 4j � � λi(A − BK) = −4 ± 4j ⇒ K = 31 7

• Regulator pole time constant τc = 1/ζωn ≈ 1/4 = 0.25 sec

• Put estimator poles with faster time constant τe ≈ 1/10

• Use real poles, so Φe(s) = (s + 10)2

� C

�−1 � 0 �

L = Φe(A) CA 1

=

⎛ ⎝

� 0 1

�2

+ 20

� 0 1

+

� 100 0

�⎞ ⎠

� 1 0

�−1 � 0 �

� −1 −1 � � �

−1 −1 � � 0 100 0 1 1

99 19 0 19 = =

−19 80 1 80

November 5, 2010

Page 10: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–10

• Compensator:

Ac =

=

=

A − BK − LC� 0 1

−1 −1

� −19 1

−112 −8

0 1

� � 31 7

� −

� 19 80

� � 1 0

Bc = L =

� 19 80

Cc = K = � 31 7

� 1 a=[0 1;−1 −1];b=[0 1]';c=[1 0];d=0;2 k=acker(a,b,[−4+4*j;−4−4*j]);3 l=acker(a',c',[−10 −10]')';4 %5 % For state space for G c(s)6 %7 ac=a−b*k−l*c;bc=l;cc=k;dc=0;

Compensator transfer function: •

U Gc(s) = Cc(sI − Ac)

−1Bc � E

s + 2.553 = 1149

s2 + 27s + 264

Note that the compensator has a low frequency real zero and two • higher frequency poles.

Thus it looks like a “lead” compensator.•

November 5, 2010

Page 11: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–11

Fig. 1: Simple plant – compensator ∼ lead 2–10 rads/sec.

Fig. 2: Loop transfer function L(s) shows the slope change near ωc = 5 rad/sec. Note that we have a large PM and GM.

November 5, 2010

Page 12: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–12

Fig. 3: Freeze compensator poles and zeros; look at root locus of closed-loop poles versus an additional loop gain (nominally α = 1.)

Fig. 4: Closed-loop transfer function.

November 5, 2010

Page 13: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

Fall 2010 16.30/31 15–13

Code: Dynamic Output Feedback Example

% Combined estimator/regulator design for a simple system% G= 1/(sˆ2+s+1)% Jonathan How% Fall 2010%%close all;clear allset(0,'DefaultLineLineWidth',2)set(0,'DefaultFigureColor','None')set(0,'DefaultlineMarkerSize',8);set(0,'DefaultlineMarkerFace','b')set(0, 'DefaultAxesFontSize', 12);set(0, 'DefaultTextFontSize', 12);%a=[0 1;−1 −1];b=[0 1]';c=[1 0];d=0;k=acker(a,b,[−4+4*j;−4−4*j]);l=acker(a',c',[−10 −11]')';%% For state space for G c(s)%ac=a−b*k−l*c;bc=l;cc=k;dc=0;

G=ss(a,b,c,d);Gc=ss(ac,bc,cc,dc);

f=logspace(−1,2,400);g=freqresp(G,f*j);g=squeeze(g);gc=freqresp(Gc,f*j);gc=squeeze(gc);

figure(1);clf;orient tallsubplot(211)loglog(f,abs(g),f,abs(gc),'−−');axis([.1 1e2 .02 1e2])xlabel('Freq (rad/sec)');ylabel('Mag')legend('Plant G','Compensator Gc','Location','East');gridsubplot(212)semilogx(f,180/pi*angle(g),f,180/pi*angle(gc),'−−');axis([.1 1e2 −200 50])xlabel('Freq (rad/sec)');ylabel('Phase (deg)');grid

L=g.*gc;

figure(2);clf;orient tallsubplot(211)loglog(f,abs(L),[.1 1e2],[1 1]);axis([.1 1e2 .2 1e2])xlabel('Freq (rad/sec)');ylabel('Mag')legend('Loop L');gridsubplot(212)semilogx(f,180/pi*phase(L.'),[.1 1e2],−180*[1 1]);axis([.1 1e2 −290 0])xlabel('Freq (rad/sec)');ylabel('Phase (deg)');grid%% loop dynamics L = G Gc%al=[a b*cc;zeros(2) ac];bl=[zeros(2,1);bc];cl=[c zeros(1,2)];dl=0;figure(3)rlocus(al,bl,cl,dl)%% closed−loop dynamics% unity gain wrapped around loop L%acl=al−bl*cl;bcl=bl;ccl=cl;dcl=d;%% scale closed−loop to get zero SS errorN=inv(ccl*inv(−acl)*bcl)

hold on;plot(eig(acl),'d','MarkerFaceColor','b');hold offgrid onaxis([−25 5 −15 15])%% closed−loop freq response%Gcl=ss(acl,bcl*N,ccl,dcl*N);gcl=freqresp(Gcl,f*j);gcl=squeeze(gcl);

November 5, 2010

Page 14: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–14

77 figure(4);clf78 loglog(f,abs(g),f,abs(gcl),'−−');79 axis([.1 1e2 .01 1e2])80 xlabel('Freq (rad/sec)');ylabel('Mag')81 legend('Plant G','closed−loop G {cl}');grid82 title(['Factor of N=',num2str(round(1000*N)/1000),' applied to Closed loop'])83

84 figure(5);clf85 margin(al,bl,cl,dl)86

87 figure(1);export fig reg est1 −pdf;88 figure(2);export fig reg est2 −pdf;89 figure(3);export fig reg est3 −pdf;90 figure(4);export fig reg est4 −pdf;91 figure(5);export fig reg est5 −pdf;92

93 figure(6);clf94 % new form on 16−795 bcl=[−b;−b];96 N=inv(ccl*inv(−acl)*bcl)97 Gnew=ss(acl,bcl*N,ccl,dcl*N);98 [yorig,t]=step(Gcl,2.5);99 [ynew]=step(Gnew,t);

100 plot(t,yorig,t,ynew);setlines(2); 101 legend('Original','New');grid on 102 ylabel('Y');xlabel('Time (s)') 103 figure(6);export fig reg est6 −pdf;

November 5, 2010

Page 15: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–15

Fig. 5: Example #1: G(s) = 8·14·20 (s+8)(s+14)(s+20)

10−1

100

101

102

103

100

Freq (rad/sec)

Mag

GG

c

10−1

100

101

102

103

−200

−150

−100

−50

0

50

Freq (rad/sec)

Phase (

deg)

GG

c

10−1

100

101

102

103

10−2

100

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

103

−250

−200

−150

−100

−50

0

Freq (rad/sec)

Phase (

deg)

November 5, 2010

Page 16: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–16

Fig. 6: Example #1: G(s) = 8·14·20 (s+8)(s+14)(s+20)

−150

−100

−50

0

50

Magnitude (

dB

)

10−1

100

101

102

103

−360

−270

−180

−90

0

Phase (

deg)

Bode DiagramGm = 11 dB (at 40.4 rad/sec) , Pm = 69.7 deg (at 15.1 rad/sec)

Frequency (rad/sec)

10−1

100

101

102

103

10−2

10−1

100

101

102

Freq (rad/sec)

Mag

Plant G

Gcl unscaled

Gcl scaled

November 5, 2010

Page 17: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–17

Fig. 7: Example #1: G(s) = 8·14·20 (s+8)(s+14)(s+20)

−150 −100 −50 0 50 100−150

−100

−50

0

50

100

150

0.91

0.975

0.140.280.420.560.7

0.82

0.91

0.975

20

40

60

80

100

120

140

20

40

60

80

100

120

140

0.140.280.420.560.7

0.82

Root Locus

Real Axis

Ima

gin

ary

Axis

−50 −45 −40 −35 −30 −25 −20 −15 −10 −5 0−25

−20

−15

−10

−5

0

5

10

15

20

250.160.340.50.640.760.86

0.94

0.985

0.160.340.50.640.760.86

0.94

0.985

1020304050

Root Locus

Real Axis

Imagin

ary

Axis

� – closed-loop poles, � -- Plant poles, � – Plant zeros, � – Compensator poles, � – Compensator zeros

• Two compensator zeros at -21.54±6.63j draw the two lower frequency plant poles further into the LHP.

• Compensator poles are at much higher frequency.

• Looks like a lead compensator.

November 5, 2010

Page 18: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–18

Fig. 8: Example #2: G(s) = 20.94

s −0.0297

10−1

100

101

102

103

100

Freq (rad/sec)

Mag

GG

c

10−1

100

101

102

103

−200

−150

−100

−50

0

50

Freq (rad/sec)

Phase (

deg)

GG

c

10−1

100

101

102

103

10−2

100

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

103

−250

−200

−150

−100

−50

0

Freq (rad/sec)

Phase (

deg)

November 5, 2010

Page 19: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–19

Fig. 9: Example #2: G(s) = 0.94 s2−0.0297

−150

−100

−50

0

50

Magnitude (

dB

)

10−2

10−1

100

101

102

103

−270

−225

−180

−135

Phase (

deg)

Bode DiagramGm = 11.8 dB (at 7.41 rad/sec) , Pm = 36.6 deg (at 2.76 rad/sec)

Frequency (rad/sec)

10−1

100

101

102

103

10−2

10−1

100

101

102

Freq (rad/sec)

Mag

Plant G

Gcl unscaled

Gcl scaled

November 5, 2010

Page 20: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–20

Fig. 10: Example #2: G(s) = 20.94

s −0.0297

−20 −15 −10 −5 0 5−15

−10

−5

0

5

10

150.70.82

0.91

0.975

0.140.280.420.560.70.82

0.91

0.975

2.557.51012.51517.520

0.140.280.420.56

Root Locus

Real Axis

Imagin

ary

Axis

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

0.160.340.50.64

0.76

0.86

0.94

0.985

0.25

0.5

0.75

1

1.25

1.5

1.75

2

0.25

0.5

0.75

1

1.25

1.5

1.75

2

0.160.340.50.64

0.76

0.86

0.94

0.985

Root Locus

Real Axis

Ima

gin

ary

Axis

� – closed-loop poles, � -- Plant poles, � – Plant zeros, � – Compensator poles, � – Compensator zeros

• Compensator zero at -1.21 draws the two lower frequency plant poles further into the LHP.

• Compensator poles are at much higher frequency.

• Looks like a lead compensator.

November 5, 2010

Page 21: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–21

Fig. 11: Example #3: G(s) = 8·14·20 (s−8)(s−14)(s−20)

10−1

100

101

102

103

100

Freq (rad/sec)

Mag

GG

c

10−1

100

101

102

103

−200

−150

−100

−50

0

50

Freq (rad/sec)

Phase (

deg)

GG

c

10−1

100

101

102

103

10−2

100

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

103

−250

−200

−150

−100

−50

0

Freq (rad/sec)

Phase (

deg)

November 5, 2010

Page 22: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–22

Fig. 12: Example #3: G(s) = 8·14·20 (s−8)(s−14)(s−20)

−200

−150

−100

−50

0

50

Magnitude (

dB

)

10−1

100

101

102

103

104

−360

−315

−270

−225

−180

−135

Phase (

deg)

Bode DiagramGm = −0.9 dB (at 24.2 rad/sec) , Pm = 6.67 deg (at 35.8 rad/sec)

Frequency (rad/sec)

10−1

100

101

102

103

10−2

10−1

100

101

102

Freq (rad/sec)

Mag

Plant G

Gcl unscaled

Gcl scaled

November 5, 2010

Page 23: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–23

Fig. 13: Example #3: G(s) = 8·14·20 (s−8)(s−14)(s−20)

−250 −200 −150 −100 −50 0 50 100 150−200

−150

−100

−50

0

50

100

150

2000.160.340.50.640.76

0.86

0.94

0.985

0.160.340.50.640.76

0.86

0.94

0.985

50100150200250

Root Locus

Real Axis

Ima

gin

ary

Axis

−25 −20 −15 −10 −5 0 5 10 15 20 25−25

−20

−15

−10

−5

0

5

10

15

20

25

0.76

0.86

0.94

0.985

0.160.340.50.64

0.76

0.86

0.94

0.985

5

10

15

20

25

5

10

15

20

25

0.160.340.50.64

Root Locus

Real Axis

Ima

gin

ary

Axis

� – closed-loop poles, � -- Plant poles, � – Plant zeros, � – Compensator poles, � – Compensator zeros

• Compensator zeros at 3.72±8.03j draw the two higher frequency plant poles further into the LHP. Lowest frequency one heads into the LHP on its own.

• Compensator poles are at much higher frequency.

Not sure what this looks like. •

November 5, 2010

Page 24: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–24

Fig. 14: Example #4: G(s) = (s−1) (s+1)(s−3)

10−1

100

101

102

103

100

Freq (rad/sec)

Mag

GG

c

10−1

100

101

102

103

−200

−150

−100

−50

0

50

Freq (rad/sec)

Phase (

deg)

GG

c

10−1

100

101

102

103

10−2

100

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

103

−250

−200

−150

−100

−50

0

Freq (rad/sec)

Phase (

deg)

November 5, 2010

Page 25: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–25

Fig. 15: Example #4: G(s) = (s−1) (s+1)(s−3)

−80

−60

−40

−20

0

20

Magnitude (

dB

)

10−2

10−1

100

101

102

103

−210

−180

−150

−120

Phase (

deg)

Bode DiagramGm = −3.4 dB (at 4.57 rad/sec) , Pm = −22.4 deg (at 1.41 rad/sec)

Frequency (rad/sec)

10−1

100

101

102

103

10−2

10−1

100

101

102

Freq (rad/sec)

Mag

Plant G

Gcl unscaled

Gcl scaled

November 5, 2010

Page 26: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–26

Fig. 16: Example #4: G(s) = (s−1) (s+1)(s−3)

−50 −40 −30 −20 −10 0 10 20−50

−40

−30

−20

−10

0

10

20

30

40

50

0.76

0.88

0.97

0.120.240.380.50.640.76

0.88

0.97

10

20

30

40

50

10

20

30

40

50

0.120.240.380.50.64

Root Locus

Real Axis

Ima

gin

ary

Axis

−10 −8 −6 −4 −2 0 2 4 6 8 10−10

−8

−6

−4

−2

0

2

4

6

8

10

0.86

0.94

0.985

0.160.340.50.64

0.76

0.86

0.94

0.985

2

4

6

8

10

2

4

6

8

10

0.160.340.50.64

0.76

Root Locus

Real Axis

Ima

gin

ary

Axis

� – closed-loop poles, � -- Plant poles, � – Plant zeros, � – Compensator poles, � – Compensator zeros

• Compensator zero at -1 cancels the plant pole. Note the very unstable compensator pole at s = 9!!

• Needed to get the RHP plant pole to branch off the real line and head into the LHP.

• Other compensator pole is at much higher frequency.

Note sure what this looks like. •

November 5, 2010

Page 27: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

� �

Fall 2010 16.30/31 15–27

B747 DOFB

The previous B747 controller assumed full state feedback - would like • to extend that now to consider output feedback using the output of the washout filtered yaw rate – e

To place the estimator poles, take the approach of just increasing the • frequency of the LQR closed-loop poles by a factor of 2:

λd(Aest) = 2 × λ(Alqr)

Then use pole placement to determine the estimator gains place.m•

1 Gp=WashFilt*sys*H; 2 set(Gp, 'statename', {'xwo' 'beta' 'yaw rate' 'roll' 'phi' 'xa'}); 3 set(Gp, 'inputname', {'rudder inputs' 'aileron'},... 4 'outputname', {'filtered yaw rate' 'bank angle'}); 5 [Ap,Bp,Cp,Dp]=ssdata(Gp); 6 [Klqr,S,Elqr]=lqr(Ap,Bp(:,1),Cp(1,:)'*Cp(1,:),0.1) 7

8 Eest=real(Elqr)*2+2*imag(Elqr)*sqrt(−1); 9 Kest=place(Ap',Cp(1,:)',Eest);Kest=Kest';

Note the transposes on the A and C here in the place command•

Yields the gains •

Lest = −31.500 5.2985 −7.854 −122.6895 121.7798 54.858

Much larger that LQR gains because the poles are moving further •

November 5, 2010

Page 28: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–28

Now form DOFB compensator as before: •

1 na=size(Ap,1); 2 % Form compensator and closed−loop 3 % see 15−5 4 ac=Ap−Bp(:,1)*Klqr−Kest*Cp(1,:);bc=Kest;cc=Klqr;dc=0; 5 Gc=ss(ac,bc,cc,dc); 6 % see 15−7 7 acl=[Ap Bp(:,1)*cc;−bc*Cp(1,:) ac];bcl=[zeros(na,1);bc];ccl=[Cpbeta,zeros(1,na)];dcl=0; 8 Gcl=ss(acl,bcl,ccl,dcl);

Consider the DOFB compensator for this system – it is 6th order • because the augmented plant is (4+1+1) – Gc pole-zero map and closed-loop poles shown

−5 −4 −3 −2 −1 0−3

−2

−1

0

1

2

3

Gc zeros

Gc poles

−5 −4 −3 −2 −1 0−3

−2

−1

0

1

2

3

Root Locus

Real Axis

Ima

gin

ary

Axis

November 5, 2010

Page 29: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–29

• Now consider the time response again to an initial perturbation in β:

0 5 10 15 20 25 30−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Time

β

OL

LQR

Gain

DOFB

• Time response looks good – perhaps even better than LQR, but note that is not inconsistent as this DOFB might be using more control effort, and LQR balances that effort with the state cost

0 2 4 6 8 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Time

x2 a

nd u

2

LQR x2

DOFB x2

LQR u2

DOFB u2

November 5, 2010

Page 30: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

Fall 2010 16.30/31 15–30

Code: B747 LQR, Estimator and DOFB

% B747 lateral dynamics % Jonathan How, Fall 2010 % working from Matlab Demo called jetdemo clear all;%close all % A=[−.0558 −.9968 .0802 .0415;

.598 −.115 −.0318 0; −3.05 .388 −.4650 0;

0 0.0805 1 0]; B=[ .00729 0;

−0.475 0.00775; 0.153 0.143; 0 0];

C=[0 1 0 0; 0 0 0 1];D=[0 0; 0 0]; sys = ss(A,B,C,D); set(sys, 'inputname', {'rudder' 'aileron'},...

'outputname', {'yaw rate' 'bank angle'}); set(sys, 'statename', {'beta' 'yaw rate' 'roll rate' 'phi'}); [Yol,Tol]=initial(ss(A,B,[1 0 0 0],zeros(1,2)),[1 0 0 0]',[0:.1:30]); [V,E]=eig(A) %% CONTROL − actuator dynamics are a lag at 10actn=10;actd=[1 10]; % H(s) in notesH=tf({actn 0;0 1},{actd 1;1 1});%tau=3;washn=[1 0];washd=[1 1/tau]; % washout filter on yaw rateWashFilt=tf({washn 0;0 1},{washd 1;1 1});%Gp=WashFilt*sys*H;set(Gp, 'statename', {'xwo' 'beta' 'yaw rate' 'roll' 'phi' 'xa'});set(Gp, 'inputname', {'rudder inputs' 'aileron'},...

'outputname', {'filtered yaw rate' 'bank angle'}); [Ap,Bp,Cp,Dp]=ssdata(Gp); [Klqr,S,Elqr]=lqr(Ap,Bp(:,1),Cp(1,:)'*Cp(1,:),0.1);rifd(Elqr) %% gain feedback on the filter yaw ratefigure(1);clfrlocus(Ap,Bp(:,1),−Cp(1,:),0);sgrid([.1 .2 .3 .4],[.7 .8 .9 1]);grid on;axis([−1.4 .1 −1.2 1.2])Kgain=−2;Egain=eig(Ap−Bp(:,1)*Kgain*Cp(1,:));rifd(Egain)hold on;plot(Egain+eps*sqrt(−1),'bd');hold offexport fig b747 lqr1 −pdf

Cpbeta=[0 1 0 0 0 0]; % performance output variable Ggain=ss(Ap−Bp(:,1)*Kgain*Cp(1,:),Bp,Cpbeta,0); xp0=[0 1 0 0 0 0]'; [Ygain,Tgain]=initial(Ggain,xp0,Tol); %'

figure(2);clf srl(ss(Ap,Bp(:,1),Cp(1,:),0)); sgrid([.1 .2 .3 .4],[.7 .8 .9 1]) axis([−1.25 1.25 −1.25 1.25]);grid on hold on;plot(Elqr+eps*sqrt(−1),'bd');hold off export fig b747 lqr2 −pdf

% close the LQR loopAcl=Ap−Bp(:,1)*Klqr;Bcl=Bp(:,1);% choose output to just state beta and control uCcl=[Cpbeta;Klqr];Dcl=[0;0];Glqr=ss(Acl,Bcl,Ccl,Dcl);[Y,T]=initial(Glqr,xp0,Tol); %'

figure(3);clfplot(Tol,Yol,T,Y(:,1),Tgain,Ygain);axis([0 30 −1 1]);setlines(2)legend('OL','LQR','Gain')ylabel('\beta');xlabel('Time')grid onexport fig b747 lqr3 −pdf

% estimator poles made faster by jfactor

November 5, 2010

Page 31: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–31

75 jfactor=2.05;76 Eest=jfactor*Elqr;77 Kest=place(Ap',Cp(1,:)',Eest);Kest=Kest';78

79 na=size(Ap,1);80 % Form compensator and closed−loop81 % see 15−582 ac=Ap−Bp(:,1)*Klqr−Kest*Cp(1,:);bc=Kest;cc=Klqr;dc=0;83 Gc=ss(ac,bc,cc,dc);84 % see 15−785 acl=[Ap Bp(:,1)*cc;−bc*Cp(1,:) ac];86 bcl=[zeros(na,1);bc];87 % choose output to be state beta and control u88 ccl=[Cpbeta,zeros(1,na);zeros(1,na) cc];89 dcl=[0;0];90 Gcl=ss(acl,bcl,ccl,dcl);91

92 figure(5);clf93 [p,z]=pzmap(Gc(1,1));94 plot(z+sqrt(−1)*eps,'mo','MarkerFace','m')95 hold on96 plot(p+sqrt(−1)*eps,'bs','MarkerFace','b')97 hold off98 legend('Gc zeros','Gc poles','Location','NorthWest')99 grid on;axis([−5.5 .5 −3 3])

100 export fig b747 lqr5 −pdf 101

102 figure(4);clf 103 rlocus(Gp(1,1)*Gc);axis([−5.5 .5 −3 3]) 104 hold on 105 [p,z]=pzmap(Gp(1,1)); 106 plot(p+sqrt(−1)*eps,'rx','MarkerFace','r') 107 plot(z+sqrt(−1)*eps,'ro','MarkerFace','r') 108 [p,z]=pzmap(Gc(1,1)); 109 plot(p+sqrt(−1)*eps,'mx','MarkerFace','m') 110 plot(z+sqrt(−1)*eps,'mo','MarkerFace','m') 111 p=eig(acl); 112 plot(p+sqrt(−1)*eps,'bd') 113 hold off 114 export fig b747 lqr4 −pdf 115

116 % initial comp at zero 117 [Ycl,Tcl]=initial(Gcl,[xp0;xp0*0],Tol); %' 118

119 figure(3);clf 120 plot(Tol,Yol,T,Y(:,1),Tgain,Ygain,Tcl,Ycl(:,1));axis([0 30 −1 1]); 121 setlines(2) 122 legend('OL','LQR','Gain','DOFB') 123 ylabel('\beta');xlabel('Time') 124 grid on 125 export fig b747 lqr3a −pdf 126

127 figure(6);clf 128 plot(T,Y(:,1).ˆ2,Tcl,Ycl(:,1).ˆ2,T,Y(:,2).ˆ2,Tcl,Ycl(:,2).ˆ2); 129 axis([0 10 0 1]); 130 hold off 131 setlines(2) 132 legend('LQR xˆ2','DOFB xˆ2','LQR uˆ2','DOFB uˆ2') 133 ylabel('xˆ2 and uˆ2');xlabel('Time') 134 grid on 135 export fig b747 lqr3b −pdf

November 5, 2010

Page 32: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–32

Satellite Control Design

• Simple system model – goal is to point payload device (J2 = 0.1) using torque inputs on the larger spacecraft (J1 = 1)

• Sensor is star tracker on payload (angle), and actuator is torque applied to spacecraft

Can form the state space model using the state x = [ θ2 θ 2 θ1 θ

1 ]T •

10bs + 10k • Plant: Gp(s) = s2(s2 + 11bs + 11k)

, k = 0.1 and b = 0.005

• Rigid body part easily controlled using a lead, such as

3s + 1 Klead(s) = 1.5

s + 5

10−1

100

101

102

100

102

Freq (rad/sec)

Mag

Plant G

Compensator Gc

10−1

100

101

102

−200

−100

0

100

200

Freq (rad/sec)

Phase (

deg)

10−1

100

101

102

10−2

100

102

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

−300

−200

−100

0

Freq (rad/sec)

Phase (

deg)

−2 −1.5 −1 −0.5 0 0.5 1−3

−2

−1

0

1

2

3

0.94

0.080.170.280.380.5

0.64

0.8

0.94

0.5

1

1.5

2

2.5

3

0.5

1

1.5

2

2.5

3

0.080.170.280.380.5

0.64

0.8

Root Locus

Real Axis

Imagin

ary

Axis

November 5, 2010

Page 33: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–33

• So problems with this “non-collocated” control is apparent – the flex­ible modes are driven unstable by the lead controller

• The problem with the lightly damped poles is that the loop phase changes very rapidly – get wrong departure angle for the root locus.

• Can improve the design using notch filtering

• The notch has a lightly damped zero pair at a frequency just below the resonant frequency of the system, resulting in a rapid phase change, but in the opposite direction.

• Result is that the departure angle now to the left, not the right.

• Fixes instability problem - but damping of the resonant pole is quite limited – need to find a better location for the notch zeros.

10−1

100

101

102

100

102

Freq (rad/sec)

Mag

Plant G

Compensator Gc

10−1

100

101

102

−200

−100

0

100

200

Freq (rad/sec)

Phase (

deg)

10−1

100

101

102

10−2

100

102

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

−300

−200

−100

0

Freq (rad/sec)

Phase (

deg)

−2 −1.5 −1 −0.5 0 0.5 1−3

−2

−1

0

1

2

3

0.8

0.94

0.080.170.280.380.5

0.64

0.8

0.94

0.5

1

1.5

2

2.5

3

0.5

1

1.5

2

2.5

3

0.080.170.280.380.5

0.64

Root Locus

Real Axis

Ima

gin

ary

Axis

November 5, 2010

Page 34: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

• •

Fall 2010 16.30/31 15–34

Lets try to do it using DOFB – nothing particularly complicated here • in the weights

1 kk=0.1;bb=0.05*sqrt(kk/10);J1=1;J2=0.1; 2 a=[0 1 0 0;−kk/J2 −bb/J2 kk/J2 bb/J2;0 0 0 1;kk/J1 bb/J1 −kk/J1 −bb/J1];na=size(a,1); 3 b=[0 0 0 1/J1]';c=[1 0 0 0];d=0; 4 k=lqr(a,b,c'*c,.1); 5 l=lqr(a',c',b*b',.01);l=l' 6 % 7 % For state space for G c(s) 8 % 9 ac=a−b*k−l*c;bc=l;cc=k;dc=0;

Look at the resulting DOFB controller - × are the plant poles; are the compensator zeros; × are the compensator poles

−4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0−1

−0.5

0

0.5

1

1.5

2

2.5

30.180.340.50.640.78

0.87

0.94

0.985

0.985

0.511.522.533.54

Root Locus

Real Axis

Imagin

ary

Axis

So the DOFB controller puts zeros right near the plant poles – similar • to the notch filter – ensures that the departure angle of the poles is to the left, not the right, so all the poles are stabilized.

Appears to achieve much higher levels of damping in that pole • than the classical/notch filter design did.

November 5, 2010

Page 35: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–35

10−1

100

101

102

100

102

Freq (rad/sec)

Mag

Plant G

Compensator Gc

10−1

100

101

102

−200

−100

0

100

200

Freq (rad/sec)

Phase (

deg)

10−1

100

101

102

10−2

100

102

Freq (rad/sec)

Mag

Loop L

10−1

100

101

102

−300

−200

−100

0

Freq (rad/sec)

Phase (

deg)

10−1

100

101

102

10−2

10−1

100

101

102

Freq (rad/sec)

Ma

g

Factor of N=1 applied to Closed loop

Plant Gclosed−loop G

cl

−300

−200

−100

0

100

Ma

gn

itu

de

(d

B)

10−2

10−1

100

101

102

103

−450

−360

−270

−180

−90

0

Ph

ase

(d

eg

)

Bode DiagramGm = 1.87 dB (at 1.89 rad/sec) , Pm = 11.6 deg (at 1.49 rad/sec)

Frequency (rad/sec)

November 5, 2010

Page 36: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

Fall 2010 16.30/31 15–36

DOFB Summary

• Separation principle gives a very powerful and simple way to develop a dynamic output feedback controller

• Note that the designer now focuses on selecting the appropriate reg­ulator and estimator pole locations.

• Once those and the implementation architecture (i.e., how refer­ence input is applied, as on 15–5) are set, the closed-loop response is specified.

• Can almost consider the compensator to be a by-product.

• The examples show that the design process is extremely simple.

November 5, 2010

Page 37: 16.30 Topic 15: Combined estimators and regulators...Nov 05, 2010  · November 5, 2010. Fall 2010 16.30/31 15–6 • For consistency with the implementation of classical controllers,

MIT OpenCourseWarehttp://ocw.mit.edu

16.30 / 16.31 Feedback Control Systems Fall 2010

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.