AL: 436-433 Mechanical Systems Part A: State-Space Systems Lecture AL Case study
Case study AL: Design of a satellite attitude control system see Franklin, Powell & Emami-Naeini, Ch. 9. Requirements: accurate pointing of scientific sensor package package isolated from vibrations, etc. of main body of satellite must repond to commanded change in pointing direction with t s s, M p 5%
Available sensors/actuators AL: 3 Star tracker keep image of star centred on focal plane of a telescope provides noisy but accurate (on average) measure of θ Rate gyro provides clean measure of θ Cold-gas jets provide fast, accurate control torque θ θ
AL: 4 Model Model as two inertias connected by flexible structure States: [ ] T θ θ θ θ = x [ ] u y u J J b J k J b J k J b J k J b J k [] / / / / / / / / / + = + = x x x State-space equations of motion: Reference input r = desired θ Controller output u is torque T c b k u = T c J J θ y = θ
Model Transfer function Y ( s) bs + k G( s) = = U( s) s s + bs + k = s K ( ) ( s + σ) ( s + ςω + ω ) n s n AL: 5 k u = T c J J b θ y = θ Parameters Inertias: J =, J =. Temperature fluctuations cause:.38.9 k.4 k / b. k / hence, oscillatory mode characterised by: ω n rad/s. ζ.
Strategy Design for worst case nominal plant slowest natural response (ω n = ) lightest damping (ζ =.) Hence nominal plant: J =, J =., k =.9, b =.36.9.36.9.36 x = x +.9.36.9.36 / J y = x + [] [ ] u.36 G( s) = s ( s + 5) ( s +.4s + ) Check robustness by calculating performance with other parameter combinations u AL: 6
Pole placement design of control law Nominal plant Y ( s).36 G( s) = = U ( s) s ( s + 5) ( s +. ± j) Symmetric root locus + ρg( s) G( s) = AL: 7 % n - m = odd no. 3 % Hence draw deg locus G = ss(a, B, C, D); [z,p,k] = zpkdata(g,'v'); Z = [z; -z]; - P = [p; -p]; - GG = zpk(z,p,-k*k) -3 rlocus(gg) Get locus Imag 4 Symmetric root -4-4 -3 - - 3 4 Real
Symmetric root locus axis([- - ]) sgrid AL: 8 4 Symmetric root locus 3 Imag Axis - - -3-4 -4-3 - - 3 4 Real Axis
Symmetric root locus axis([- - ]) sgrid Select desired closed-loop poles AL: 9 Select poles with ω n.5 rad/s [rho,clp]=rlocfind(gg).5 Symmetric root locus Specs: t s s, M p 5% dominant poles ω n.5 rad/s, ζ.5 Imag axis.5 -.5 - -.5 - - - Real axis
Symmetric root locus axis([- - ]) sgrid Select desired closed-loop poles AL: Select poles with ω n.5 rad/s: [rho,clp]=rlocfind(gg).5 Symmetric root locus ρ =.6 dclp =.45 ± j.34.5 ± j.5 Imag axis.5 -.5 - Full state-feedback control law u = Kx -.5 - - - Real axis K = place(a,b,dclp) K = [-.8.5.68.6]
State-space design examined... AL: We now have a control law, assuming full state feedback: u = Kx Before proceeding, examine this state-space design in classical control terms open-loop transfer function open-loop frequency response what is the effective compensation? stability margins root locus: sensitivity to variations in open-loop gain closed-loop transfer function
Open-loop transfer function AL: % Get all states as plant outputs: Ga = G; Ga.c = eye(4); % Form open-loop TF: Gol = ss(k)*ga; zpk(gol) Zero/pole/gain:.6 (s+.36) (s^ +.64s +.8698) ----------------------------------------- s^ (s^ +.4s + ) r + u Ga ss(k) x Compensator zeros Plant poles
Effect of feedback on OL freq. resp. AL: 3 5 Effect of state-feedback on OLFR Amplitude ratio -5 - - with state-fb plant alone - Phase (deg) - -3 unstable with simple -4 output feedback u = ky - Frequency (rad/s) state feedback u = Kx stabilises with phase lead
Stability margins AL: 4 margin(gol) Bode Diagrams Gm=-48.8 db (at.35337 rad/sec), Pm=6.87 deg. (at.4 rad/sec) 4 ω c =.4 rad/s Phase (deg); Magnitude (db) - -5 - GM = -5 PM = 6 - - Frequency (rad/sec)
Sensitivity to loop-gain variations.5 placed pole (k = ) AL: 5 Plant pole Root locus for k.5 compensator zero Imag axis -.5 r + u k - Ga -.5 - -.5 - -.5.5 ss(k) x Real axis
Closed-loop transfer function AL: 6 % Form closed-loop system Gcl = feedback(ga, tf(k)); Gcl = Gcl(,); % select single output y disp('closed-loop transfer function') zpk(gcl) Plant zero: 5 Zero/pole/gain:.36364 (s+5) ---------------------------------------------- (s^ +.95s +.35) (s^ +.96s +.3) r + u Ga ss(k) x Placed CLPs:.45 ± j.34.5 ± j.5
Robustness test % Try same controller with stiff spring model k = 4/; % corresponds to wn = b = k/5; % corresponds to zeta =. As = [ -k/j -b/j k/j b/j k/j b/j -k/j -b/j]; Gs = ss(as, B, C, D); disp('stiff-spring plant transfer function') Gzpk = zpk(gs) Zero/pole/gain:.777 (s+5) --------------------- s^ (s^ +.8s + 4) ω n = ζ =. AL: 7
Stiff-spring plant with nominal controller AL: 8 Gsa = Gs; Gsa.c = eye(4); Gscl = feedback(gsa, tf(k)); Gscl = Gscl(,); disp('stiff-spring closed-loop transfer function') zpk(gscl) Zero/pole/gain:.777 (s+5) --------------------------------------------- (s^ +.4s +.3455) (s^ +.5s + 4.) figure(3), step(gcl, Gscl) legend('nominal plant', 'stiff plant') grid on
Step responses of nominal and stiff-spring plants with nominal controller AL: 9 Step Response 3 nominal plant stiff-spring plant.5 Amplitude.5 M p = 8% t s (%) = s M p = 3% t s (%) = s.5 5 5 5 Time (sec.)
Estimator AL: % F&P select CLPs corresponding to rho = 3.5e7 eclp = rlocus(gg,3.5e7); % We want the stable ones declp = eclp(find(real(eclp)<)) % Plot them rlocus(gg) hold on plot(real(declp), imag(declp), 'gs',... 'MarkerFaceColor','g') plot(real(dclp), imag(dclp), 'rs',... 'MarkerFaceColor','r') hold off axis([-8 8-8 8]), axis equal sgrid
Estimator and controller poles AL: 8 Symmetric root locus 6 A xis g a Im 4 - -4 Estimator poles chosen very fast (8 x controller poles) avoid compromising robustness fast estimator almost equivalent to direct state feedback (provided model is accurate and sensor noise is low!) -6-8 - -5 5 Real Axis
Estimator gains; regulator TF AL: % State-estimator gains L = place(a', C', declp)' % Form regulator H = reg(g, K, L); 4 L = 53 5498 disp('regulator transfer function') zpk(h) Zero/pole/gain: -743.584 (s+.3) (s^ +.985s +.8439) --------------------------------------------- (s^ + 6.96s + 85.8) (s^ + 6.44s + 79.9)
Frequency response of effective FB compensator bode(-h) % -H because u = -Kx^ built into H AL: 3 r K u xˆ Plant Estimator 6 4 y Bode Diagrams Frequency response of effective feedback compensator effective compensator H looks like lead compensation Phase (deg); Magnitude (db) - 5 5 5 - Frequency (rad/sec)
Open-loop transfer function AL: 4 Grol = -H*G; zpk(grol) Zero/pole/gain: 69.589 (s+5) (s+.3) (s^ +.985s +.8439) ------------------------------------------------------------------- s^ (s^ +.4s + ) (s^ + 6.96s + 85.8) (s^ + 6.44s + 79.9) Plant dynamics Compensator dynamics pzmap(grol) 8 Pole-zero map 6 4 Imag Axis - -4-6 -8 - -3-5 - -5 - -5 5 Real Axis
Stability margins AL: 5 % OLTF Grol = -H*G; margin(grol) Open-loop frequency response Gm=4.45 db (at 5.6595 rad/sec), Pm=45.859 deg. (at.394 rad/sec) 4 ω c =.3 rad/s Phase (deg); Magnitude (db) - -4 - - GM = 4 db PM = 46-3 - Frequency (rad/sec)
Imag Axis 5 5 5-5 - Sensitivity to loop-gain variations Root locus with regulator gain as parameter placed estimator poles (k = ) Root locus for k rlocus(grol) Root locus with regulator gain as parameter placed.5 controller poles (k = ) AL: 6-5 - -5-5 - -5 - -5 5 Real Axis r u k y Plant K Estimator effective compensator xˆ Imag Axis.5 -.5 - -.5 - - - Real Axis
Closed-loop transfer function AL: 7 % Form closed-loop system Grcl = feedback(g, H, +); % Show poles and zeros of CL system pzmap(grcl) 8 6 4 Pole-zero map estimator dynamics approximately cancelled in TF from r y Imag Axis - selected controller poles -4-6 -8 - -3-5 - -5 - -5 5 Real Axis selected estimator poles
Closed-loop response of regulated system AL: 8 step(grcl, Gsrcl) 4 Step Response Closed-loop response of regulated system dc gain 3.5 3 Amplitude.5 M p = 8% t s (%) = s BackgroundResponseObjectLine nominal plant stiff-spring plant.5.5 M p = 7% t s (%) = s quite different from direct state FB case 5 5 5 Time (sec.)
Examine stiff-spring system more closely... AL: 9 8 6 4 Sensitivity to variations in loop gain Gsrol = -H*Gs; rlocus(gsrol) poorly-damped mode (ζ =.5) could be excited by disturbance inputs 6 5 Imag Axis - -4 Imag Axis 4 3-6 -8 - -6-5 -4-3 - - Real Axis root locus structure different from nominal system - -6-5 -4-3 - - Real Axis dominant CLPs
Response to impulsive disturbance x = zeros(8,); x() = ; % set ydot = initial(grcl,gsrcl,x) Initial Condition Results AL: 3.6.4. BackgroundResponseObjectLine nominal plant stiff-spring plant Lightly damped modes now dominate the response Plant output y -. -.4 ω n = 5., ζ =.5 ω n =., ζ =.4 -.6 -.8 5 5 5 3 35 4 Time (sec.)
Tracking system AL: 3 u ss N u r N x x r + K + u Plant y N x N u = A C B D xˆ Estimator u = Kˆ x + ( KN N )r x + Implement with: Simulink model, or with MATLAB commands u
MATLAB implementation AL: 3 N u r N x + x r u K + Plant xˆ Estimator y G G G3 G4 G5 r Nu Nx K G + x^ Hest u u y G = [Nu; ss(nx)]; G = [, ss(k)]; G3 = [; G]; G4 = G3*G; Hest = estim(g, L, [], []); Hest = Hest(:5,:); % suppress y^ G5 = feedback(g4,hest,[:5],[:]); Gtcl = G5*G;
Closed-loop response of tracking system AL: 33 % Step response step(gtcl).4 Closed-loop step response of tracking system From: U(). nominal plant dc gain = Amplitude To: Y().8.6 stiff-spring plant.4. 5 5 5 Time (sec.)
Simulink implementation AL: 34 Control Tc r Nu Nu u K K G Position reference Sum Nx Sum K Sum3 Plant Q y Torque disturbance Hest Mux Estimator Mux sensors = []; % observed output = y known = []; % control input = u Hest = estim(g, L, sensors, known); Hest = Hest(:5,:); % suppress y^ output
Estimation errors Simulate with random initial plant states, but zero initial estimator states AL: 35 x = rand(4,)*. sim( sim_ex9 ) plot(tout,xout(:,:4)-xout(:,5:8)) 5 State estimation errors e = x xˆ e e e3 e4 Estimation error 5-5 - -5.5.5 Time