tut10 - 035188 2011 10 LQR 1 1 2 1 2"" 1 u t x A u...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: - 035188 2011 - 10 + LQR 1 . , : 1. . . 2. . : 1. ) (. ) ( . 2. " . " - - ,: 1 u ( t ) x A u ' = + x B yC u = + x D S tt S e a e a p c 1 y ( t ) 035188 2011 - . : 1 u(t) u u x =A + u ' x B y=C + u x D S tate-S pac e 1 s Integrator M atrix A A x^ x^ 1 y (t) B V tor B ec B u d t(x^ /d ) C V tor C ec y^ 2 y ^(t) A . ? ) strictly proper): . - 035188 2011 - : , . , , , . , . (Luenberger Observer) , . , : - 035188 2011 - 1 u(t) u u x' = Ax+Bu y = Cx+Du State-Space 1 s Integrator Matrix A Ax^ x^ y y 1 y(t) B Vector B Bu d/dt(x^ ) C Vector C y^ L(y-y^ ) A Vector L L y-y^ : . ? : - . 2 : 035188 2011 - " , :. , . -. L - . - , : L: - : 035188 2011 - . 2 : - : 035188 2011 - - . - . - . - . . - : : , . . , . : - 035188 2011 - - : 1 u(t) u u x' = Ax+Bu y = Cx+Du State-Space 1 s Integrator Matrix A Ax^ x^ y y 1 y(t) B Vector B Bu d/dt(x^ ) C Vector C y^ L(y-y^ ) A Vector L L y-y^ : - 035188 2011 - .: - . : - : 035188 2011 - - , 2 : . ,- : - 035188 2011 - , . , . : - 035188 2011 - . . , - . , - - : - - : : - 1 r(t) fr Gain fr u u 035188 2011 - 1 y r x' = Ax+Bu y = Cx+Du State-Space 1 s Integrator Matrix A Ax^ x^ y y(t) B Vector B Bu d/dt(x^ ) C Vector C y^ L(y -y ^ ) A Vector L L y -y ^ Vector F F : , . : : - 035188 2011 - : . " - 035188 2011 - . . - - . 2 . - 035188 2011 - , 4- : 1. 2. 3. 4. + . + . + . + . - MATLAB close all clear all clc %% Parameters Definition A = [-1 1;1 -2]; B = [1 0]'; C = [1 0]; wf = wl = zeta pf = pl = 1; %design parameter 1; %design parameter = 0.8; wf * [-zeta+sqrt(zeta^2 - 1) -zeta-sqrt(zeta^2 - 1)]; wl * [-zeta+sqrt(zeta^2 - 1) -zeta-sqrt(zeta^2 - 1)]; F = place(A,B,pf); L = place(A',C',pl)'; Af = A - B*F; Al = A - L*C; fr = -1/(C*Af^-1*B); %% System Simulation dt = 0.01; t = 0:dt:10; r(1:length(t)) = 1; - Input.time = t'; Input.signals(1).values = r'; Input.signals(1).dimentions = 1; 035188 2011 - [TimeVec x y] = sim('Sys',[0 length(t)*dt],,Input); figure; plot(TimeVec,x,'LineWidth',2) grid on axis([0 length(t)*dt ylim]) legend('Real h_1(t)','Real h_2(t)','Estimated h_1(t)','Estimated h_2(t)') xlabel('Time (Sec)') ylabel('Real and Estimated state vector','FontSize',16) title(sprintf('\\omega_F = %g \\omega_L = %g',wf,wl)) ) ): 1 r(t) r fr Gain fr u u x' = Ax+Bu y = Cx+Du State-Space 1 s Integrator Matrix A Ax^ x^ y y 1 y(t) K*u Vector B Bu d/dt(x^ ) K*u Vector C y^ L(y -y ^ ) K*u Vector L K*u y -y ^ Vector F K*u - 1 ) ) F = 1 L = 1 8 035188 2011 - Real and Estimated state vector Real h1(t) 7 6 5 4 3 2 1 0 -1 Real h (t) 2 Estimated h (t) 1 Estimated h2(t) 0 1 2 3 4 5 6 Time (Sec) 7 8 9 10 . 2 ) ) - F = 1 L = 5 1.5 035188 2011 - Real and Estimated state vector 1 0.5 0 Real h (t) 1 2 -0.5 Real h (t) Estimated h (t) 1 2 Estimated h (t) -1 0 0.5 1 1.5 2 2.5 3 Time (Sec) 3.5 4 4.5 5 . . 3 ) ) - F = 5 L = 1 3.5 035188 2011 - Real and Estimated state vector Real h (t) 1 2 3 2.5 2 1.5 1 0.5 0 -0.5 Real h (t) Estimated h (t) 1 2 Estimated h (t) 0 0.5 1 1.5 2 2.5 3 Time (Sec) 3.5 4 4.5 5 1 . 4 ) ) - F = 5 L = 5 2.5 035188 2011 - Real and Estimated state vector Real h1(t) 2 Real h2(t) Estimated h1(t) 1.5 Estimated h2(t) 1 0.5 0 -0.5 -1 0 0.2 0.4 0.6 0.8 1 1.2 Time (Sec) 1.4 1.6 1.8 2 . " ( /) . - 035188 2011 - 2 (Linear Quadratic Regulator) . , : 1. 2. 3. 4. 5. 6. 7. 8. 9. Overshoot ... 2 . : 1. 2. Loop Shaping . , . . - 035188 2011 - ) Q -R ): SISO, . : . , , Linear Quadratic Regulator (LQR). - Q -R - - 2 : 1. 2. 035188 2011 - . . Q , . , "" . R , . "" . (Algebric Riccati Equation). . . , . , . - 035188 2011 - " -MATLAB: care(A,B,Cz'*Cz,rho) LQR " : ,- , : -LQR - 035188 2011 - , P . 2 . . : Q . , - , . SISO R R R . : . : - 035188 2011 - -MATLAB - . close all clear all clc R = [0.0001 0.01 0.1]; A = [-1 1;1 -2]; B = [1 0]'; C = [1 0]; Pr = tf(ss(A,B,C,0)); n = size(A,1); lambda = 0.5; Q = [lambda 0;0 lambda]; figure; for i = 1:length(R) P = care(A,B,Q,R(i)); F = 1/R(i)*B'*P; Af = A - B*F; fr = -1/(C*Af^-1*B); sys = ss(Af,B,C,0) * fr; T = tf(sys); Cr = minreal(1/Pr * T/(1 - T)); Tu = minreal(Cr/(1 + Pr*Cr)); [y t x] = step(sys); [u tu] = step(Tu); hold on subplot(1,2,1); plot(t,y,'LineWidth',2,'Color',[i/length(R) 0 1-i/length(R)]) grid on legend(sprintf('R = %g',R(1)),sprintf('R = %g',R(2)),sprintf('R = %g',R(3))) axis([0 t(end) ylim]) title(sprintf('h1(t) with \\lambda = %g',lambda),'FontSize',16) xlabel('Time (Sec)') ylabel('h_1(t)') hold on subplot(1,2,2); plot(tu,u,'LineWidth',2,'Color',[i/length(R) 0 1-i/length(R)]) grid on legend(sprintf('R = %g',R(1)),sprintf('R = %g',R(2)),sprintf('R = %g',R(3))) axis([0 0.1 ylim]) title(sprintf('Control effort with \\lambda = %g',lambda),'FontSize',16) xlabel('Time (Sec)') ylabel('Control effort') - end hold off 035188 2011 - 1.4 S tep R espo nse fo r h1(t) with = 0.5 R = 0.0001 R = 0.01 R = 0.1 80 70 60 50 Control effort C o ntro l effo rt with = 0.5 R = 0.0001 R = 0.01 R = 0.1 1.2 1 0.8 h 1 (t) 40 30 20 10 0 0.6 0.4 0.2 0 0 0.5 1 1.5 Tim e (S ec ) 2 2.5 0 0.02 0.04 0.06 Tim e (S ec ) 0.08 0.1 -R . - . h1(t) with R = 1 1 0.9 0.8 0.7 0.6 h (t) 1 =0 =5 = 100 0.5 0.4 0.3 0.2 0.1 0 0 0.2 0.4 0.6 0.8 1 1.2 Time (Sec) 1.4 1.6 1.8 2 - 035188 2011 - . . 2 : : 2 - 035188 2011 - , "" . . .- - , - - ? - - : 035188 2011 - - -. - : . - - : 035188 2011 - . -LQR . . " , , ". - 035188 2011 - " Return Difference : : - nyquist 035188 2011 - LQR : 1. ) ). 2. LQR : - 035188 2011 - .- : , : " , . : - : - 035188 2011 - ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online