Filters, Cost Functions, and Controller Structures Robert Stengel Optimal Control and Estimation MAE 546 Princeton University, 218! Dynamic systems as low-pass filters! Frequency response of dynamic systems! Shaping system response! LQ regulators with output vector cost functions! Implicit model-following! Cost functions with augmented state vector min Δu J = min Δu 1 2 Δx T (t)qδx(t) + Δu T (t)r dt subject to Δ!x(t) = FΔx(t) + G Copyright 218 by Robert Stengel. All rights reserved. For educational use only. http://www.princeton.edu/~stengel/mae546.html http://www.princeton.edu/~stengel/optconest.html 1 First-Order Low-Pass Filter 2
Low-Pass Filter Low-pass filter passes low-frequency signals and attenuates high-frequency signals 1 st -order example Δ!x ( t) = aδx( t) + aδu( t) a =.1, 1, or 1 Laplace transform, with x() = Δx( s) = a ( s + a) Δu( s) Frequency response, s = jω Δx( jω ) = a Δu jω ( jω + a) 3 Response of 1 st -Order Low-Pass Filters to Step Input and Initial Condition Δ!x ( t) = aδx( t) + aδu( t) a =.1, 1, or 1 Smoothing effect on sharp changes 4
Frequency Response of Dynamic Systems 5 Response of 1 st -Order Low-Pass Filters to Sine-Wave Inputs Input Output Δu( t) = sin t sin 2t sin 4t x ( t) = 1x( t) + 1u( t)!x ( t) = x( t) + u( t) x ( t) =.1x( t) +.1u ( t) 6
Response of 1 st -Order Low- Pass Filters to White Noise Δ!x ( t) = aδx( t) + aδu( t) a =.1, 1, or 1 7 Relationship of Input Frequencies to Filter Bandwidth Δu( t) = sin ωt sin 2ωt sin 4ωt BANDWIDTH Input frequency at which output magnitude = 3dB How do we calculate frequency response? 8
Bode Plot Asymptotes, Departures, and Phase Angles for 1 st -Order Lags H red ( jω ) = 1 jω +1 General shape of amplitude ratio governed by asymptotes Slope of asymptotes changes by multiples of ±2 db/dec at poles or zeros of H(jω) Actual AR departs from asymptotes AR asymptotes of a real pole When ω =, slope = db/ dec When ω λ, slope = 2 db/ dec H blue ( jω ) = 1 jω +1 H green ( jω ) = 1 jω +1 Phase angle of a real, negative pole When ω =, ϕ = When ω = λ, ϕ = 45 When ω ->, ϕ -> 9 9 2 nd -Order Low-Pass Filter Δ!!x ( t) = 2ζω n Δ!x ( t) ω 2 n Δx( t) + ω 2 n Δu( t) Laplace transform, with I.C. = Δx( s) = ω n 2 s 2 + 2ζω n s + ω n 2 Δu s Frequency response, s = jω Δx( jω ) = ω n 2 ( jω ) 2 + 2ζω n jω! H ( jω )Δu jω 2 + ω n Δu ( jω ) 1
2 nd -Order Step Response Increased damping decreases oscillatory over/undershoot Further increase eliminates oscillation 11 Amplitude Ratio Asymptotes and Departures of Second-Order Bode Plots (No Zeros) AR asymptotes of a pair of complex poles When ω =, slope = db/dec When ω ω n, slope = 4 db/ dec Height of resonant peak depends on damping ratio 12
Phase Angles of Second-Order Bode Plots (No Zeros) Phase angle of a pair of complex negative poles When ω =, ϕ = When ω = ω n, ϕ = 9 When ω ->, ϕ -> 18 Abruptness of phase shift depends on damping ratio 13 Transformation of the System Equations Time-Domain System Equations Δ!x(t) = F Δx(t) + G Δy(t) = H x Δx(t) + H u Laplace Transforms of System Equations sδx(s) Δx() = F Δx(s) + G Δu(s) [ ] Δx(s) = [ si F] 1 Δx() + GΔ u(s) Δy(s) = H x Δx(s) + H u Δu(s) 14
Transfer Function Matrix Laplace Transform of Output Vector Δy(s) = H x Δx(s) + H u Δu(s) = H x [ si F] 1 [ Δx() + G Δu(s) ]+ H u Δu(s) 1 G + H u = H x si F Δu(s) + H si F x = Control Effect + Initial Condition Effect Transfer Function Matrix relates control input to system output with H u = and neglecting initial condition H (s) = H x [ ] 1 Δx() [ si F] 1 G (r x m) 15 Scalar Frequency Response from Transfer Function Matrix Transfer function matrix with s = jω H (jω ) = H x Δy i ( s) Δu j s [ jωi F] 1 G (r x m) = H ij(jω ) = H xi [ jωi F] 1 G j (r x m) H xi = i th row of H x G j = j th column of G 16
Second-Order Transfer Function Second-order dynamic system Δ!x ( t) = Δ!x 1 ( t) Δ!x 2 ( t) = f 11 f 12 f 21 f 22 Δy( t) = Δy 1 ( t) Δy 2 ( t) = h 11 h 12 h 21 h 22 Δx 1 ( t) Δx 2 ( t) + g 11 g 12 g 21 f 22 Δx 1 ( t) Δx 2 ( t) Δu 1 ( t) Δu 2 ( t) Second-order transfer function matrix adj h H (s) = H x A( 11 h 12 s)g = h 21 h 22 det ( r n) ( n n) ( n m) (n = m = r = 2) = ( r m) = ( 2 2) ( s f 11 ) f 12 f 21 s f 22 ( s f 11 ) f 12 f 21 s f 22 g 11 g 12 g 21 f 22 17 Scalar Transfer Function from Δu j to Δy i H ij (s) = k ijn ij (s) Δ(s) = k ij s q + b q 1 s q 1 +...+ b 1 s + b s n + a n 1 s n 1 +...+ a 1 s + a Just one element of the matrix, H(s) Denominator polynomial contains n roots Each numerator term is a polynomial with q zeros, where q varies from term to term and n 1 ij ( s z 2 ) ij... s z q ( s λ 2 )...( s λ n ) = k ij s z 1 s λ 1 ij # zeros = q # poles = n 18
Scalar Frequency Response Function for Single Input/Output Pair H ij (jω ) = k ij jω z 1 jω λ 1 Substitute: s = jω ij ij ( jω z 2 ) ij... jω z q ( jω λ 2 )...( jω λ n ) jφ (ω ) = a(ω)+ jb(ω) AR(ω) e Frequency response is a complex function of input frequency, ω Real and imaginary parts, or ** Amplitude ratio and phase angle ** 19 MATLAB Bode Plot with asymp.m http://www.mathworks.com/matlabcentral/ http://www.mathworks.com/matlabcentral/fileexchange/1183-bode-plot-with-asymptotes 2 nd -Order Pitch Rate Frequency Response, with zero bode.m asymp.m 2
Desirable Open-Loop Frequency Response Characteristics (Bode) High gain (amplitude) at low frequency Desired response is slowly varying Low gain at high frequency Random errors vary rapidly Crossover region is problem-specific 21 Examples of Proportional LQ Regulator Response 22
Example: Open-Loop Stable and Unstable 2 nd -Order LTI System Response to Initial Condition F S = F U = 1 16 1 1 16 +.5 Stable Eigenvalues = -.5 + 3.9686i -.5-3.9686i Unstable Eigenvalues =.25 + 3.9922i.25-3.9922i 23 Example: Stabilizing Effect of Linear- Quadratic Regulators for Unstable 2 nd -Order System min Δu J = min Δu 1 2 ( Δx 2 1 + Δx 2 2 + rδu 2 )dt For the unstable system = c 1 c 2 r = 1 Control Gain (C) =.262 1.857 Riccati Matrix (S) = 2.21.291.291.126 Δx 1 (t) Δx 2 (t) = c Δx (t) c Δx (t) 1 1 2 2 r = 1 Control Gain (C) =.28.1726 Riccati Matrix (S) = 3.7261.312.312 1.9183 Closed-Loop Eigenvalues = -6.461-2.8656 Closed-Loop Eigenvalues = -.5269 + 3.9683i -.5269-3.9683i 24
Example: Stabilizing/Filtering Effect of LQ Regulators for the Unstable 2 nd - Order System r = 1 Control Gain (C) =.262 1.857 Riccati Matrix (S) = 2.21.291.291.126 Closed-Loop Eigenvalues = -6.461-2.8656 r = 1 Control Gain (C) =.28.1726 Riccati Matrix (S) = 3.7261.312.312 1.9183 Closed-Loop Eigenvalues = -.5269 + 3.9683i -.5269-3.9683i 25 Example: Open-Loop Response of a Stable 2 nd -Order System to Random Disturbance Eigenvalues = -1.1459, -7.8541 26
Example: Disturbance Response of Unstable System with Optimal Feedback 27 LQ Regulators with Output Vector Cost Functions 28
Quadratic Weighting of the Output Δy(t) = H x Δx(t) + H u J = 1 2 = 1 2 Δy T (t)q y Δy(t) dt {[ H x Δx(t) + H u ] T Q y [ H x Δx(t) + H u ]}dt Note: State, not output, is fed back 29 Quadratic Weighting of the Output min J = min 1 Δu Δu 2! min 1 Δu 2 Δx T (t) Δx T (t) Δu T (t) Δu T (t) H T x Q y H x H T x Q y H u H T u Q y H x H T u Q y H u + R o Q O M O M O T Δx(t) dt R O + R o Δx(t) dt = ( R O + R o ) 1 M T O + G T O P SS Δx( t) = CΔx( t) Output vector may not contain control (i.e., H u = ) Ad hoc R o added to assure invertability 3
min J = 1 Δy T (t)q y Δy(t) Δu 2 dt = 1 2 State Rate Can Be Expressed as an Output to be Minimized Δ!x(t) = FΔx(t) + G Δy(t) = H x Δx(t) + H u " FΔx(t) + G Δ!x T (t)q y Δ!x(t) dt min Δu J = min Δu! min Δu 1 2 1 2 Δx T (t) 1 M SR T + G SR T P SS = R SR + R o Δx T (t) F T Q Δu T (t) y F G T Q y F Δu T (t) Q SR T M SR Special case of output weighting F T Q y G Δx(t) dt G T Q y G + R o M SR Δx(t) dt R SR + R o Δx( t) = CΔx( t) 31 Implicit Model-Following LQ Regulator Simulator aircraft dynamics Δ x(t) = FΔx(t) + G Ideal aircraft dynamics Δ x M (t) = F M Δx M (t) Feedback control law to provide dynamic similarity = C IMF Δx( t) Princeton Variable-Response Research Aircraft F-16 Another special case of output weighting 32
Implicit Model-Following LQ Regulator Assume state dimensions are the same Δ!x(t) = FΔx(t) + G Δ!x M (t) = F M Δx M (t) If simulation is successful, Δx M (t) Δx(t) and Δ!x M (t) F M Δx(t) 33 Implicit Model-Following LQ Regulator Cost function penalizes difference between actual and ideal model dynamics J = 1 2 {[ Δ x(t) Δ x M (t)] T Q M [ Δ x(t) Δ x M (t)]}dt min Δu J = min Δu! min Δu 1 2 1 2 Δx(t) Δx(t) T ( F F M ) T Q M F F M G T Q M T Q IMF M IMF T M IMF R IMF + R o ( F F M ) T Q M G ( F F M ) G T Q M G + R o Δx(t) dt Therefore, ideal model is implicit in the optimizing feedback control law Δx(t) = ( R IMF + R o ) 1 M T IMF + G T IMF P SS Δx( t) = CΔx( t) dt 34
Cost Functions with Augmented State Vector 35 Integral Compensation Can Reduce Steady-State Errors! Sources of Steady-State Error! Constant disturbance! Errors in system dynamic model! Selector matrix, H I, can reduce or mix integrals in feedback Δ!x(t) = FΔx(t) + G Δ ξ! ( t) = H I Δx(t) Δ!x(t) Δ! ξ t = F G H I Δx(t) Δξ t + G 36
= C B Δx t! C B Δx t LQ Proportional- Integral (PI) Control t C I H I Δx τ C I Δξ( t) dτ where the integral state is Δξ t t! H I Δx τ dim H I dτ = m n define Δχ ( t)! Δx t Δξ t 37 Integral State is Added to the Cost Function and the Dynamic Model 1 min J = min Δu Δu 2 = min Δu 1 2 Δx T (t)q x Δx(t) + Δξ T ( t)q ξ Δξ t Δχ T (t) subject to = R 1 G T = C B Δx t + Δu T (t)r Q x Q ξ Δχ(t) + ΔuT (t)r dt Δ!χ(t) = F χ Δχ(t) + G χ C I Δξ( t) P SSΔχ(t) = C χ Δχ(t) dt 38
Integral State is Added to the Cost Function and the Dynamic Model = C χ Δχ(t) = C B Δx t Δu(s) = C χ Δχ(s) = C B Δx s = C B Δx s [ ] Δu(s) = C Bs + C I H x s C I Δξ( t) C I Δξ( s) H C x Δx( s) I Δx( s) s Bode Plot of Control Law: Integrator plus numerator matrix of zeros 39 Actuator Dynamics and Proportional-Filter LQ Regulators 4
Actuator Dynamics May Impact System Response Hydraulic Actuator Electric Motor Electro/ mechanical transduction via small piston Force multiplication by large piston 41 Actuator Dynamics May Affect System Response Δ!x(t) = FΔx(t) + G Augment state dynamics to include actuator dynamics Δ!u(t) = K + Δv(t) Δ!x(t) F G = Δ!u(t) K Δx(t) + Control variable is actuator forcing function I v Δv(t) 42
LQ Regulator with Actuator Dynamics 1 min J = min Δv Δv 2 = min Δv Re-define state and control vectors Δχ(t)! 1 2 F χ! Δx T (t)q x Δx(t) + Δu T (t)r u + Δv T (t)r v Δv(t) dt Δχ T (t) Δx(t) F G K Q x R u ; Δv( t) = Control ; G χ! I v Δχ(t) + ΔvT (t)r v Δv(t) dt subject to Δ!χ(t) = F χ Δχ(t) + G χ Δv(t) 43 LQ Regulator with Actuator Dynamics 1 Δv(t) = C χ Δχ(t) = R v = C B Δx( t) C A I v T PSS Δx( t) Control Velocity Δv(s) = C B Δx s C A Δu(s) 44
LQ Regulator with Actuator Dynamics Δ!u(t) = K C A C B Δx t sδu(s) = KΔu(s) C A Δu(s) C B Δx s si + K + C A Control Displacement Δu(s) = C B Δx( s) Δu(s) = si + K + C A 1 CB Δx( s) 45 LQ Regulator with Artificial Actuator Dynamics LQ control variable is derivative of actual system control Δ x(t) Δ u(t) = F G Δx(t) + I Δv(t) Δv(t) = Δ!u Int (t) = C B Δx( t) C A C A introduces artificial actuator dynamics, e.g., low-pass filter 46
Proportional-Filter (PF) LQ Regulator Δχ(t) = Δx(t) ; F = F G χ ; G χ = I Optimal LQ Regulator Δv(t) = Δ!u Integrator (t) = C χ Δχ(t) C A provides low-pass filtering effect on the control input Δu(s) = [ si + C A ] 1 C B Δx( s) 47 Proportional LQ Regulator: High- Frequency Control in Response to High-Frequency Disturbances 2nd-Order System Response with Perfect Actuator Good disturbance rejection, but high bandwidth may be unrealistic 48
Proportional-Filter LQ Regulator Reduces High-Frequency Control Signals 2nd-Order System Response... at the expense of decreased disturbance rejection 49 Next Time: Linear-Quadratic Control System Design 5
Supplemental Material 51 Princeton Variable-Response Research Aircraft (VRA) 52
Aircraft That Simulate Other Aircraft Closed-loop control Variable-stability research aircraft, e.g., TIFS, Learjet, NT-33A, and Princeton Variable-Response Research Aircraft (Navion) USAF/Calspan TIFS Princeton VRA USAF/Calspan NT-33A CalSpan Learjet 53