Topic #14 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 put the poles? Heuristics Linear Quadratic Regulator How well does this approach work?
Fall 2007 16.31 14 1 Pole Placement Approach So far we have looked at how to pick K to get the dynamics to have some nice properties (i.e. stabilize A) λ i (A) λ i (A BK) Classic Question: where should we put these closed-loop poles? Approach #1: use time-domain specifications to locate dominant poles roots of: s 2 + 2ζω n s + ω 2 n = 0 Then place rest of the poles so they are much faster than the dominant behavior. Example: could keep the same damped frequency w d and then move the real part to be 2 3 times faster than real part of dominant poles ζω n Just be careful moving the poles too far to the left because it takes a lot of control effort Rules of thumb for 2nd order response: 10-90% rise time t r = 1 + 1.1ζ + 1.4ζ2 ω n Settling time (5%) t s = ζω 3 n Time to peak amplitude t p = π ω n 1 ζ 2 Peak overshoot M p = e ζω nt p
Fall 2007 16.31 14 2 Approach #2: Could also choose closed-loop poles to mimic a system that has performance similar to what you want Just set pole locations equal to those of the prototype system. Various options exist Bessel Polynomial Systems of order k G p (s) = 1 B k (s) 1.2 G Step response 1 0.8 0.6 0.4 k = 1 2 10 Step response of G p for various k 0.2 k 1 2 3 4 5 6 7 8 9 10 0 0 0.5 1 1.5 2 2.5 3 Time (sec) Roots of normalized bessel polynomials corresponding to a settling time of 1 second Pole locations of B 1 (s) -4.6200-4.0530 ± j2.3400-5.0093, - 3.9668 ± j3.7845-4.0156 ± j5.0723, - 5.5281 ± j1.6553-6.4480, - 4.1104 ± j6.3142-5.9268 ± j3.0813-4.2169 ± j7.5300, - 6.2613 ± j4.4018, - 7.1205 ± j1.4540-8.0271, - 4.3361 ± j8.7519, - 6.5714 ± j5.6786, - 7.6824 ± j2.8081-4.4554 ± j9.9715, - 6.8554 ± j6.9278, - 8.1682 ± j4.1057, - 8.7693 ± j1.3616 9.6585, - 4.5696 ± j11.1838, - 7.1145 ± j8.1557, - 8.5962 ± j5.3655, - 9.4013 ± j2.6655-4.6835 ± j-12.4022, - 7.3609 ± j9.3777, - 8.9898 ± j6.6057, - 9.9657 ± j3.9342, - 10.4278 ± j1.3071 Figure 1: Bessel root locations. All scaled to give settling times of 1 second, which you can change to t s by dividing the poles by t s. Figure by MIT OpenCourseWare.
Fall 2007 16.31 14 3 Procedure for an n th order system: Determine the desired settling time t s Find the k = n polynomial from the table. Divide pole locations by t s Form desired characteristic polynomial Φ d (s) and use acker/place to determine the feedback gains. Simulate to check performance and control effort. Example: with A = so that n = k = 3. G(s) = 5 4 0 1 0 0 0 1 0 1 s(s + 4)(s + 1) B = Want t s = 2 sec. So there are 3 poles at: 5.0093/2 = 2.5047 and ( 3.9668 ± 3.7845i)/2 = 1.9834 ± 1.8922i Use these to form Φ d (s) and find the gains using acker 1 0 0 The Bessel approach is fine, but the step response is a bit slow (little overshoot allowed)
Fall 2007 16.31 14 4 Approach #3: Select the poles to match the n th order polynomial that was designed to minimize the ITAE integral of the time multiplied by the absolute value of the error J IT AE = in response to a step function. 0 t e(t) dt Both Bessel and ITAE are tabulated in FPE-508. Comparison for k = 3 (Given for ω 0 = 1 rad/sec, so slightly different than numbers given on previous page) φ B d = (s + 0.9420)(s + 0.7465 ± 0.7112i) IT AE φd = (s + 0.7081)(s + 0.5210 ± 1.068i) So the ITAE poles are not as heavily damped. Some overshoot Faster rise-times. Problem with both of these approaches is that they completely ignore the control effort required the designer must iterate.
Fall 2007 16.31 14 5 Linear Quadratic Regulator An alternative approach is to place the pole locations so that the closed-loop system optimizes the cost function: [ J LQR = y(t) T Qy(t) + u(t) T Ru(t) ] dt 0 where: y T Qy = x T (C T QC)x {assume D = 0} is the State Cost u T Ru is called the Control Cost with penalty R Basic form of Linear Quadratic Regulator problem. State cost written using output y T Qy, but we could define a new system output z = C z x that is not based on a physical sensor measurement. [ J LQR = x T (t)(cz T QC z )x(t) + ρ u(t) T u(t) ] dt 0 Selection of z used to isolate the system states you are most concerned about, and thus would like to be regulated to zero. R = ρi effectively sets the controller bandwidth MIMO Optimal control is a time invariant linear state feedback u(t) = K lqr x(t) where K lqr found by solving an Algebraic Riccati Equation (ARE) K lqr Details to follow. 0 = A T P + P A + C T QC P BR 1 B T P = R 1 B T P
Fall 2007 16.31 14 6 Figure 2: Example #1: G(s) = 8 14 20 (s+8)(s+14)(s+20) with control penalty ρ and 10ρ
Fall 2007 16.31 14 7 Figure 3: Example #2: G(s) = 0.94 s 2 0.0297 with control penalty ρ and 10ρ
Fall 2007 16.31 14 8 Figure 4: Example #3: G(s) = 8 14 20 (s 8)(s 14)(s 20) with control penalty ρ and 10ρ
Fall 2007 16.31 14 9 Figure 5: Example #4: G(s) = (s 1) (s+1)(s 3) with control penalty ρ and 10ρ
Fall 2007 16.31 14 10 Figure 6: Example #5: G(s) = 10ρ (s 2)(s 4) (s 1)(s 3)(s 2 +0.8s+4)s 2 with control penalty ρ and
Fall 2007 16.31 14 11 Regulator Summary Dominant second and prototype design approaches (Bessel and ITAE) place the closed-loop pole locations with no regard to the amount of control effort required. Designer must iterate on the selected bandwidth (ω n ) to ensure that the control effort is reasonable. LQR selects closed-loop poles that balance between state errors and control effort. Easy design iteration using R Sometimes difficult to relate the desired transient response to the LQR cost function. Key thing is that the designer is focused on system performance issues rather than the mechanics of the design process
Fall 2007 16.31 14 12 LQR Examples - (step4.m) 1 % LQR examples for 16.31 2 % Fall 2007 3 % Jonathan How, MIT 4 set(0, DefaultLineLineWidth,2) 5 6 if 1 7 clear all;fig=1; 8 % system 9 G=tf(8*14*20,conv([1 8],conv([1 14],[1 20]))); 10 [a,b,c,d]=ssdata(g); 11 R=1e-3; 12 k=lqr(a,b,c *c,r); 13 k2=lqr(a,b,c *c,10*r); 14 15 figure(fig);clf;fig=fig+1; 16 % find the feedforward gains 17 Nbar=inv(-c*inv(a-b*k)*b); 18 Nbar2=inv(-c*inv(a-b*k2)*b); 19 20 sys1=ss(a-b*k,b*nbar,c,d); 21 sys2=ss(a-b*k2,b*nbar2,c,d); 22 23 t=[0:.005:1]; 24 [y,t,x]=step(sys1,t); 25 [y2,t2,x2]=step(sys2,t); 26 27 figure(fig);clf;fig=fig+1; 28 plot(t,y, --,t2,y2, LineWidth,2);axis([0 1 0 1.2]) 29 grid; 30 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthEast ) 31 xlabel( time (sec), FontSize,14);ylabel( Y output, FontSize,14); 32 title( Step Response, FontSize,14) 33 hold on 34 plot(t2([1 end]),[.1.1]*y2(end), r-- ); 35 plot(t2([1 end]),[.1.1]*9*y2(end), r-- ); 36 hold off 37 38 text(.4,.6,[ K=,num2str(k)], FontSize,14) 39 text(.4,.8,[ Nbar=,num2str(Nbar)], FontSize,14) 40 set(gca, FontSize,14) 41 print -dpng -r300 srl12.png 42 43 if 1 44 figure(fig);clf;fig=fig+1; 45 f=logspace(-1,2,400); 46 gcl1=freqresp(sys1,f); 47 gcl2=freqresp(sys2,f); 48 loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)), LineWidth,2);%grid 49 axis([.1 100.01 2]) 50 xlabel( Freq (rad/sec), FontSize,14);ylabel( G_{cl}, FontSize,14) 51 title( Closed-loop Freq Response, FontSize,14) 52 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthWest ) 53 set(gca, FontSize,14) 54 print -dpng -r300 srl13.png 55 end 56 57 end % if 0 58 59 %%%%%%%%% 60 if 1 61 clear all 62 fig=4; 63 64 G=tf(8*14*20,conv([1-8],conv([1-14],[1-20]))) 65 [a,b,c,d]=ssdata(g); 66 R=.1 67 k=lqr(a,b,c *c,r); 68 k2=lqr(a,b,c *c,10*r);
Fall 2007 16.31 14 13 69 70 % find the feedforward gains 71 Nbar=inv(-c*inv(a-b*k)*b); 72 Nbar2=inv(-c*inv(a-b*k2)*b); 73 74 sys1=ss(a-b*k,b*nbar,c,d); 75 sys2=ss(a-b*k2,b*nbar2,c,d); 76 77 t=[0:.005:1]; 78 [y,t,x]=step(sys1,t); 79 [y2,t2,x2]=step(sys2,t); 80 81 figure(fig);clf;fig=fig+1; 82 plot(t,y, --,t2,y2, LineWidth,2);axis([0 1 0 1.2]) 83 grid; 84 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthEast ) 85 xlabel( time (sec), FontSize,14);ylabel( Y output, FontSize,14); 86 title( Step Response, FontSize,14) 87 hold on 88 plot(t2([1 end]),[.1.1]*y2(end), r-- ); 89 plot(t2([1 end]),[.1.1]*9*y2(end), r-- ); 90 hold off 91 92 text(.4,.6,[ K=,num2str(k)], FontSize,14) 93 text(.4,.8,[ Nbar=,num2str(Nbar)], FontSize,14) 94 set(gca, FontSize,14) 95 print -dpng -r300 srl22.png 96 97 if 1 98 figure(fig);clf;fig=fig+1; 99 f=logspace(-1,2,400); 100 gcl1=freqresp(sys1,f); 101 gcl2=freqresp(sys2,f); 102 loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)), LineWidth,2);%grid 103 axis([.1 100.01 2]) 104 xlabel( Freq (rad/sec), FontSize,14);ylabel( G_{cl}, FontSize,14) 105 title( Closed-loop Freq Response, FontSize,14) 106 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthWest ) 107 set(gca, FontSize,14) 108 print -dpng -r300 srl23.png 109 end 110 111 end % if 0 112 %%%%%%%%%%%%%% 113 114 if 1 115 clear all 116 fig=7; 117 118 G=tf(.94,[1 0-0.0297]); 119 [a,b,c,d]=ssdata(g); 120 R=.1 121 k=lqr(a,b,c *c,r); 122 k2=lqr(a,b,c *c,10*r); 123 124 % find the feedforward gains 125 Nbar=inv(-c*inv(a-b*k)*b); 126 Nbar2=inv(-c*inv(a-b*k2)*b); 127 128 sys1=ss(a-b*k,b*nbar,c,d); 129 sys2=ss(a-b*k2,b*nbar2,c,d); 130 131 t=[0:.01:30]; 132 [y,t,x]=step(sys1,t); 133 [y2,t2,x2]=step(sys2,t); 134 135 figure(fig);clf;fig=fig+1; 136 plot(t,y, --,t2,y2, LineWidth,2);axis([0 30 0 1.2]) 137 grid; 138 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthEast ) 139 xlabel( time (sec), FontSize,14);ylabel( Y output, FontSize,14); 140 title( Step Response, FontSize,14) 141 hold on 142 plot(t2([1 end]),[.1.1]*y2(end), r-- );
Fall 2007 16.31 14 14 143 plot(t2([1 end]),[.1.1]*9*y2(end), r-- ); 144 hold off 145 146 text(15,.6,[ K=,num2str(k)], FontSize,14) 147 text(15,.8,[ Nbar=,num2str(Nbar)], FontSize,14) 148 set(gca, FontSize,14) 149 print -dpng -r300 srl32.png 150 151 if 1 152 figure(fig);clf;fig=fig+1; 153 f=logspace(-3,3,400); 154 gcl1=freqresp(sys1,f); 155 gcl2=freqresp(sys2,f); 156 loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)), LineWidth,2);%grid 157 axis([.1 100.01 2]) 158 xlabel( Freq (rad/sec), FontSize,14);ylabel( G_{cl}, FontSize,14) 159 title( Closed-loop Freq Response, FontSize,14) 160 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthWest ) 161 set(gca, FontSize,14) 162 print -dpng -r300 srl33.png 163 end 164 165 end % if 0 166 167 %%%%%%%%%%%% 168 if 1 169 clear all 170 fig=10; 171 172 G=tf([1-1],conv([1 1],[1-3])); 173 [a,b,c,d]=ssdata(g); 174 R=.1 175 k=lqr(a,b,c *c,r); 176 k2=lqr(a,b,c *c,10*r); 177 178 % find the feedforward gains 179 Nbar=inv(-c*inv(a-b*k)*b); 180 Nbar2=inv(-c*inv(a-b*k2)*b); 181 182 sys1=ss(a-b*k,b*nbar,c,d); 183 sys2=ss(a-b*k2,b*nbar2,c,d); 184 185 t=[0:.01:10]; 186 [y,t,x]=step(sys1,t); 187 [y2,t2,x2]=step(sys2,t); 188 189 figure(fig);clf;fig=fig+1; 190 plot(t,y, --,t2,y2, LineWidth,2);axis([0 10-1 1.2]) 191 grid; 192 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthEast ) 193 xlabel( time (sec), FontSize,14);ylabel( Y output, FontSize,14); 194 title( Unstable, NMP system Step Response, FontSize,14) 195 hold on 196 plot(t2([1 end]),[.1.1]*y2(end), r-- ); 197 plot(t2([1 end]),[.1.1]*9*y2(end), r-- ); 198 hold off 199 200 text(5,.6,[ K=,num2str(k)], FontSize,14) 201 text(5,.8,[ Nbar=,num2str(Nbar)], FontSize,14) 202 set(gca, FontSize,14) 203 print -dpng -r300 srl42.png 204 205 if 1 206 figure(fig);clf;fig=fig+1; 207 f=logspace(-2,2,400); 208 gcl1=freqresp(sys1,f); 209 gcl2=freqresp(sys2,f); 210 loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)), LineWidth,2);%grid 211 axis([.1 100.01 2]) 212 xlabel( Freq (rad/sec), FontSize,14);ylabel( G_{cl}, FontSize,14) 213 title( Closed-loop Freq Response, FontSize,14) 214 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthWest ) 215 set(gca, FontSize,14) 216 print -dpng -r300 srl43.png
Fall 2007 16.31 14 15 217 end 218 219 end % if 0 220 221 %%%%%%%%%%%% 222 clear all 223 fig=13; 224 225 G=tf(conv([1-2],[1-4]),conv(conv([1-1],[1-3]),[1 2*.2*2 2^2 0 0])); 226 [a,b,c,d]=ssdata(g); 227 R=.1 228 k=lqr(a,b,c *c,r); 229 k2=lqr(a,b,c *c,10*r); 230 231 % find the feedforward gains 232 Nbar=inv(-c*inv(a-b*k)*b); 233 Nbar2=inv(-c*inv(a-b*k2)*b); 234 235 sys1=ss(a-b*k,b*nbar,c,d); 236 sys2=ss(a-b*k2,b*nbar2,c,d); 237 238 t=[0:.01:10]; 239 [y,t,x]=step(sys1,t); 240 [y2,t2,x2]=step(sys2,t); 241 242 figure(fig);clf;fig=fig+1; 243 plot(t,y, --,t2,y2, LineWidth,2);axis([0 10-1 1.2]) 244 grid; 245 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthEast ) 246 xlabel( time (sec), FontSize,14);ylabel( Y output, FontSize,14); 247 title( Unstable, NMP system Step Response, FontSize,14) 248 hold on 249 plot(t2([1 end]),[.1.1]*y2(end), r-- ); 250 plot(t2([1 end]),[.1.1]*9*y2(end), r-- ); 251 hold off 252 253 text(1,.6,[ K=,num2str(k)], FontSize,14) 254 text(1,.8,[ Nbar=,num2str(Nbar)], FontSize,14) 255 set(gca, FontSize,14) 256 print -dpng -r300 srl52.png 257 258 if 1 259 figure(fig);clf;fig=fig+1; 260 f=logspace(-2,2,400); 261 gcl1=freqresp(sys1,f); 262 gcl2=freqresp(sys2,f); 263 loglog(f,abs(squeeze(gcl1)),f,abs(squeeze(gcl2)), LineWidth,2);%grid 264 axis([.1 100.01 2]) 265 xlabel( Freq (rad/sec), FontSize,14) 266 ylabel( G_{cl}, FontSize,14) 267 title( Closed-loop Freq Response, FontSize,14) 268 legend([ \rho=,num2str(r)],[ \rho=,num2str(10*r)], Location, SouthWest ) 269 set(gca, FontSize,14) 270 print -dpng -r300 srl53.png 271 end