Topic #13 16.
31 Feedback Control Systems
State-Space Systems Full-state Feedback Control How do we change the poles of the state-space system? Or, even if we can change the pole locations. Where do we change the pole locations to? How well does this approach work?
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 131
Full-state Feedback Controller
Assume that the single-input system dynamics are given by x(t) = Ax(t) + Bu y = Cx(t) so that D = 0. The multi-actuator case is quite a bit more complicated as we would have many extra degrees of freedom. Recall that the system poles are given by the eigenvalues of A. Want to use the input u(t) to modify the eigenvalues of A to change the system dynamics. r
y A, B, C
x(t)
K Assume a full-state feedback of the form: u = r Kx(t) where r is some reference input and the gain K is R1n If r = 0, we call this controller a regulator Find the closed-loop dynamics: x(t) = = = y =
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Ax(t) + B(r Kx(t)) (A BK)x(t) + Br Acl x(t) + Br Cx(t)
Fall 2007
16.31 132
Objective: Pick K so that Acl has the desired properties, e.g., A unstable, want Acl stable Put 2 poles at 2 2i Note that there are n parameters in K and n eigenvalues in A, so it looks promising, but what can we achieve?
Example #1: Consider: x(t) =
1 1 1 2
x(t) +
1 u 0
Then det(sI A) = (s 1)(s 2) 1 = s2 3s + 1 = 0 so the system is unstable.
Dene u = k1 k2 x(t) = Kx(t), then 1 k1 1 k2 1 1 1 Acl = ABK = k1 k2 = 0 1 2 1 2
which gives det(sI Acl ) = s2 + (k1 3)s + (1 2k1 + k2) = 0
Thus, by choosing k1 and k2, we can put i(Acl ) anywhere in the complex plane (assuming complex conjugate pairs of poles).
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 133
To put the poles at s = 5, 6, compare the desired characteristic equation (s + 5)(s + 6) = s2 + 11s + 30 = 0 with the closed-loop one s2 + (k1 3)x(t) + (1 2k1 + k2) = 0 to conclude that k1 = 14 k1 3 = 11 1 2k1 + k2 = 30 k2 = 57 so that K = 14 57 , which is called Pole Placement. Of course, it is not always this easy, as lack of controllability might be an issue. Example #2: Consider this system: 1 1 1 x(t) = x(t) + u 0 0 2 with the same control approach 1 1 1 k1 1 k2 1 Acl = ABK = k1 k2 = 0 0 2 0 2 so that det(sI Acl ) = (s 1 + k1)(s 2) = 0 So the feedback control can modify the pole at s = 1, but it cannot move the pole at s = 2. System cannot be stabilized with full-state feedback. Problem caused by a lack of controllability of the e2t mode.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 134
Consider the basic controllability test: 1 1 1 1 Mc = B AB = 0 0 0 2 So that rank Mc = 1 < 2. Modal analysis of controllability to develop a little more insight 1 1 A= , decompose as AV = V = V 1AV 0 2 where = Convert x(t) = Ax(t) + Bu z = z + V 1Bu T where z = z1 z2 . But: 1 1 1 1 V 1B = = 0 0 0 1 so that the dynamics in modal form are: 1 0 1 z= z+ u 0 0 2
z=V 1 x(t)
1 0 0 2
V =
1 1 0 1
V 1 =
1 1 0 1
With this zero in the modal B-matrix, can easily see that the mode associated with the z2 state is uncontrollable. Must assume that the pair (A, B) are controllable.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 135
Ackermanns Formula
The previous outlined a design procedure and showed how to do it by hand for second-order systems. Extends to higher order (controllable) systems, but tedious. Ackermanns Formula gives us a method of doing this entire design process is one easy step. K = 0 . . . 0 1 M1d(A) c Mc = B AB . . . An1B d(s) is the characteristic equation for the closed-loop poles, which we then evaluate for s = A. It is explicit that the system must be controllable because we are inverting the controllability matrix. Revisit Example # 1: d(s) = s2 + 11s + 30 1 1 1 1 1 1 = Mc = B AB = 0 0 1 2 0 1 So K = 0 1 1 1 1 1 1 2 + 11 1 1 1 2 + 30I
1 2 0 1 43 14 = 0 1 = 14 57 14 57
Automated in Matlab: place.m & acker.m (see polyvalm.m too)
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 136
Origins of Ackermanns Formula
For simplicity, consider third-order system (case #2 on 73), but this extends to any order. 1 a1 a2 a3 A= 1 0 0 B = 0 C = b 1 b2 b3 0 0 1 0 See key benet of using control canonical state-space model This form is useful because the characteristic equation for the system is obvious det(sI A) = s3 + a1s2 + a2s + a3 = 0
Can show that 1 a1 a2 a3 Acl = A BK = 1 0 0 0 k 1 k2 k3 0 1 0 0 a1 k1 a2 k2 a3 k3 = 1 0 0 0 1 0 so that the characteristic equation for the system is still obvious: cl (s) = det(sI Acl ) = s3 + (a1 + k1)s2 + (a2 + k2)s + (a3 + k3) = 0
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 137
Compare with the characteristic equation developed from the desired closed-loop pole locations: d(s) = s3 + (1)s2 + (2)s + (3) = 0 to get that a1 + k1 = 1 k1 = 1 a1 . . . . . . an + kn = n kn = n an
To get the specics of the Ackermann formula, we then: Take an arbitrary A, B and transform it to the control canonical form (x(t) z = T 1x(t)) Solve for the gains K using the formulas above for the state z (u = Kz) Then switch back to gains needed for the state x(t), so that K = KT 1 u = Kz = Kx(t)
Pole placement is a very powerful tool and we will be using it for most of this course.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 138
Reference Inputs
So far we have looked at how to pick K to get the dynamics to have some nice properties (i.e. stabilize A) The question remains as to how well this controller allows us to track a reference command? Performance issue rather than just stability.
Started with x(t) = Ax(t) + Bu u = r Kx(t) y = Cx(t)
For good tracking performance we want y(t) r(t) as t
Consider this performance issue in the frequency domain. Use the nal value theorem:
t
lim y(t) = lim sY (s)
s0
Thus, for good performance, we want sY (s) sR(s) as s 0 Y (s) =1 R(s) s=0
So, for good performance, the transfer function from R(s) to Y (s) should be approximately 1 at DC.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 139
Example #1: Consider: x = y =
1 1 1 2
x(t) +
1 u 0
1 0 x(t) Already designed K = 14 57 Then the closed-loop system is x(t) = (A BK)x(t) + Br y = Cx(t) Which gives the transfer function Y (s) = C (sI (A BK))1 B R(s) 1 s + 13 56 1 = 1 0 0 1 s 2 s2 = 2 s + 11s + 30
Assume that r(t) is a step, then by the FVT Y (s) = 2 = 1 !! R(s) 30
s=0
So our step response is quite poor!
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1310
One solution is to scale the reference input r(t) so that u = N r Kx(t) N extra gain used to scale the closed-loop transfer function
Now we have x(t) = (A BK)x(t) + B N r y = Cx(t) so that Y (s) = C (sI (A BK))1 B N = Gcl (s)N R(s)
If we had made N = 15, then 15(s 2) Y (s) = 2 R(s) s + 11s + 30 so with a step input, y(t) 1 as t .
Clearly can compute 1 N = Gcl (0)1 = C(A BK)1B
Note that this development assumed that r was constant, but it could also be used if r is a slowly time-varying command.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1311
So the steady state step error is now zero, but is this OK? See plots big improvement in the response, but transient a bit weird.
Figure 1: Response to step input with and without the N correction.
Step Response (step1.m)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
% full state feedback for topic 13 % reference input issues % a=[1 1;1 2];b=[1 0];c=[1 0];d=0; k=[14 57]; Nbar=-15; sys1=ss(a-b*k,b,c,d); sys2=ss(a-b*k,b*Nbar,c,d); t=[0:.025:4]; [y,t,x]=step(sys1,t); [y2,t2,x2]=step(sys2,t); plot(t,y,--,t2,y2,LineWidth,2);axis([0 4 -1 1.2]);grid; legend(u=r-Kx,u=Nbar r-Kx,Location,SouthEast) xlabel(time (sec));ylabel(Y output);title(Step Response) print -dpng -r300 [Link]
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1312
Pole Placement Examples
Example from Problem set G(s) = 8 14 20 (s + 8)(s + 14)(s + 20)
Target pole locations 12 12i, 20
Figure 2: Response to step input with and without the N correction. Gives the desired steady-state behavior, with little diculty!
Figure 3: Closed-loop frequency response. Clearly shows unity DC gain
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1313
Example from second problem set 0.94 s2 0.0297 Target pole locations 0.25 0.25i G(s) =
Figure 4: Response to step input with and without the N correction. Gives the desired steady-state behavior, with little diculty!
Figure 5: Closed-loop frequency response. Clearly shows unity DC gain
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1314
Ok, so lets try something very challenging. . . 8 14 20 G(s) = (s 8)(s 14)(s 20) Target pole locations 12 12i, 20
Figure 6: Response to step input with and without the N correction. Gives the desired steady-state behavior, with little diculty!
Figure 7: Closed-loop frequency response. Clearly shows unity DC gain
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1315
The worst possible. . . G(s) = Unstable, NMP!! Target pole locations 1 i (s 1) (s + 1)(s 3)
Figure 8: Response to step input with and without the N correction. Gives the desired steady-state behavior, with little diculty!
Figure 9: Closed-loop frequency response. Clearly shows unity DC gain
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1316
Full state feedback process is quite simple as it can be automated in Matlab using acker and/or place
With more than 1 actuator, we have more than n degrees of freedom in the control we can change the eigenvectors as desired, as well as the poles.
The real issue now is where to put the poles. . .
And to correct the fact that we cannot usually measure the state develop an estimator.
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
16.31 1317
Example Codes (step3.m)
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
% Examples of pole placement with FSFB % demonstrating the Nbar modifcation to the reference command % % Jonathan How % Sept, 2007 % % system [a,b,c,d]=tf2ss(8*14*20,conv([1 8],conv([1 14],[1 20]))) % controller gains to place poles at specified locations k=place(a,b,[-12+12*j;-12-12*j;-20]); % find the feedforward gains Nbar=-inv(c*inv(a-b*k)*b); sys1=ss(a-b*k,b,c,d); sys2=ss(a-b*k,b*Nbar,c,d); t=[0:.01:1]; [y,t,x]=step(sys1,t); [y2,t2,x2]=step(sys2,t); figure(1);clf plot(t,y,--,t2,y2,LineWidth,2);axis([0 1 0 1.2]);grid; legend(u=r-Kx,u=Nbar r-Kx);xlabel(time (sec));ylabel(Y output) title(Step Response) hold on plot(t2([1 end]),[.1 .1]*y2(end),r--); plot(t2([1 end]),[.1 .1]*9*y2(end),r--); hold off text(.4,.6,num2str(k),FontSize,16) text(.4,.8,num2str(Nbar),FontSize,16) print -dpng -r300 [Link] figure(1);clf f=logspace(-1,2,400); gcl1=freqresp(sys1,f); gcl2=freqresp(sys2,f); loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)),LineWidth,2);grid xlabel(Freq (rad/sec)) ylabel(G_{cl}) title(Closed-loop Freq Response) legend(u=r-Kx,u=Nbar r-Kx) print -dpng -r300 [Link] %%%%%%%%% % example 2 % clear all [a,b,c,d]=tf2ss(8*14*20,conv([1 -8],conv([1 -14],[1 -20]))) k=place(a,b,[-12+12*j;-12-12*j;-20]) % find the feedforward gains Nbar=-inv(c*inv(a-b*k)*b); sys1=ss(a-b*k,b,c,d); sys2=ss(a-b*k,b*Nbar,c,d); t=[0:.01:1]; [y,t,x]=step(sys1,t); [y2,t2,x2]=step(sys2,t); figure(2);clf plot(t,y,--,t2,y2,LineWidth,2);axis([0 1 0 1.2]) grid; legend(u=r-Kx,u=Nbar r-Kx) xlabel(time (sec));ylabel(Y output);title(Step Response) hold on plot(t2([1 end]),[.1 .1]*y2(end),r--); plot(t2([1 end]),[.1 .1]*9*y2(end),r--);
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
16.31 1318
hold off text(.4,.6,num2str(k),FontSize,16) text(.4,.8,num2str(Nbar),FontSize,16) print -dpng -r300 [Link] figure(2);clf f=logspace(-1,2,400); gcl1=freqresp(sys1,f); gcl2=freqresp(sys2,f); loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)),LineWidth,2);grid xlabel(Freq (rad/sec)) ylabel(G_{cl}) title(Closed-loop Freq Response) legend(u=r-Kx,u=Nbar r-Kx) print -dpng -r300 [Link] %%%%%%%%%%%%%% % example 3 clear all [a,b,c,d]=tf2ss(.94,[1 0 -0.0297]) k=place(a,b,[-1+j;-1-j]/4) % find the feedforward gains Nbar=-inv(c*inv(a-b*k)*b); sys1=ss(a-b*k,b,c,d); sys2=ss(a-b*k,b*Nbar,c,d); t=[0:.1:30]; [y,t,x]=step(sys1,t); [y2,t2,x2]=step(sys2,t); figure(3);clf plot(t,y,--,t2,y2,LineWidth,2);axis([0 30 0 2]) grid; legend(u=r-Kx,u=Nbar r-Kx) xlabel(time (sec));ylabel(Y output);title(Step Response) hold on plot(t2([1 end]),[.1 .1]*y2(end),r--); plot(t2([1 end]),[.1 .1]*9*y2(end),r--); hold off text(15,.6,num2str(k),FontSize,16) text(15,.8,num2str(Nbar),FontSize,16) print -dpng -r300 [Link] figure(3);clf f=logspace(-3,1,400); gcl1=freqresp(sys1,f); gcl2=freqresp(sys2,f); loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)),LineWidth,2);grid xlabel(Freq (rad/sec)) ylabel(G_{cl}) title(Closed-loop Freq Response) legend(u=r-Kx,u=Nbar r-Kx) print -dpng -r300 [Link] %%%%%%%%%%%% % example 4 clear all [a,b,c,d]=tf2ss([1 -1],conv([1 1],[1 -3])) k=place(a,b,[[-1+j;-1-j]]) % find the feedforward gains Nbar=-inv(c*inv(a-b*k)*b); sys1=ss(a-b*k,b,c,d); sys2=ss(a-b*k,b*Nbar,c,d); t=[0:.1:10]; [y,t,x]=step(sys1,t); [y2,t2,x2]=step(sys2,t);
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
Fall 2007
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
16.31 1319
figure(3);clf plot(t,y,--,t2,y2,LineWidth,2);axis([0 10 -1 1.2]) grid; legend(u=r-Kx,u=Nbar r-Kx) xlabel(time (sec));ylabel(Y output) title(Unstable, NMP system Step Response) hold on plot(t2([1 end]),[.1 .1]*y2(end),r--); plot(t2([1 end]),[.1 .1]*9*y2(end),r--); hold off text(5,.6,num2str(k),FontSize,16) text(5,.8,num2str(Nbar),FontSize,16) print -dpng -r300 [Link] figure(4);clf f=logspace(-2,2,400); gcl1=freqresp(sys1,f); gcl2=freqresp(sys2,f); loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)),LineWidth,2);grid xlabel(Freq (rad/sec)) ylabel(G_{cl}) title(Closed-loop Freq Response) legend(u=r-Kx,u=Nbar r-Kx) print -dpng -r300 [Link]
October 14, 2007
Cite as: Jonathan How, course materials for 16.31 Feedback Control Systems, Fall 2007. MIT OpenCourseWare ([Link] Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].