Prcess Dynamics and Cntrl Subject: Frequency Respnse Analysis Prfessr Cstas Kiparissides Department f Chemical Engineering Aristtle University f Thessalniki December 6, 204 Frequency Respnse Analysis: A Review
Respnse f First-Order Systems Let us assume a sine wave input functin, U(t) = α sin(ωt), is intrduced int a first rder dynamic system. Its Laplace transfrm will be given by U(s) s αω 2 2 ω () Thus, fr a first-rder dynamic system, the Y(s) utput deviatin variable will be: Y(s) Κ αω p 2 2 (τs ) (s ω ) (2) K α τω ω τωs τ ω s / τ s ω s ω p 2 2 2 2 2 2 Respnse t Sine Wave Functin The time respnse f the first-rder dynamic system will be given by the inverse Laplace transfrm f Y(s), Eq. (2). Y(t) K p α 2 2 τ ω t τ (τω e sin ω t τω csω t) At steady-state K p α Y s (t) 2 2 τ ω (sin ω t τω csω t) (3) (4) Using the fllwing trignmetric prperties: p csω + q sinω = r sin(ω+φ) ; r = (p 2 +q 2 ) /2 and φ = tan - (p/q) (5) Equatin (4) is written: K p α Y s (t) sin(ω t φ ) ; φ tan ( ωτ) 2 2 τ ω (6) 2
αα'δος6-2-204 Respnse t Sine Wave Functin U(t) U (t)μt φ Y s (t) εταβατικήπερίοtransient Stage Y s (t) t Time respnse f a first-rder dynamic system t a sinusidal input Respnse t Sine Wave Functin % Frequency respnse f a first-rder system % t a sinusidal input Kp = 7; T = 2; sys = tf([kp],[t ]); a = ; w = 2; t = [0 : 0.0 : 2*pi/w]'; u = a*sin(t*w); [y,t] = lsim(sys,u,t); figure() plt(t,y,'k-',t,u,'k:') grid n xlabel( Time, sec') ylabel('y(t)') title(['time respnse f a first-rder system '... 't a sinusidal input']) ps = 0; legend('y(t)','u(t)',ps) 3
Frequency Respnse Analysis Κp Κp G(iω ) G(s) siω τs τiω siω (7) G(iω) K p ( τiω) K τiω p ( τiω)( τiω) τω 2 2 (8) Magnitude 2 2 2 2 τω G(iω) ReG(iω) ImG(iω) K p 2 2 τω /2 K p 2 2 2 τω (9) Argument Im G(iω ) φ tan tan ( ωτ) ReG(iω ) (0) Frequency Respnse Analysis Amplitude Rati, (AR) 2 2 Kpα τω Kp α (AR) α α 2 2 τω G(iω) Phase Shift, φ φ φ 2π(t T) tan (ωτ) tan ( ωτ) 4
Frequency Respnse Analysis Asympttic analysis f (AR) and φ with respect t ωτ. AR K p 2 * 2 2 lg lg( τ ω ) () AR AR lim lg 0 ; lim lg lg(τω ) K K ωτ0 ωτ p p (2) ωτ0 lim φ 0 ; lim φ 90 (3) ωτ and φ = tan - (-) = -45 if ω = ω c (4) Bde Plt AR Λ.Ε K p slpe κλίση = - 0. 0.0 0.0 0. = ω c τ 0 ωτ 00 Amplitude Rati w.r.t. t ωτ 5
Bde Plt 0 φ -45-90 0.0 0. 0 ωτ 00 Phase Shift w.r.t. t ωτ Bde Plts fr a First-rder System Kp = 7 ; T = 2 ; sys = tf([kp],[t ]) ; w = lgspace(lg0(0^(-2)/t),lg0(0^2/t)) ; [mag,phase] = bde(sys,w) ; AR = zers(,length(mag)) ; fr j = ::length(mag) AR(,j) = mag(:,:,j) ; end figure() lglg(w*t,ar/kp,'k-') ylim([0.0 0]) grid n xlabel('\mega\tau') ylabel( AR / K_p') title(['pltting Frequency Respnse']) phi = zers(,length(phase)) ; fr i = ::length(phase) phi(,i) = phase(:,:,i) ; end figure(2) semilgx(w*t,phi,'k-') grid n xlabel('\mega\tau') ylabel('\phi (^)') title(['pltting Frequency Respnse']) 6
Example: Parameter Estimatin Estimate the parameters (K p and τ) f a first-rder prcess, frm the fllwing frequency respnse data. Angular Frequency ω (rad/sec) Slutin p 2 2 2 Amplitude Rati AR= G(iω) Phase Shift φ 5.00 0..30 4.80 0.2 2.80 3.80 0.4 38.65 2.60 0.8 57.99 2.30.0 63.43.25 2.0 75.96 0.63 4.0 82.87 0.40 6.0 85.23 Κ (AR)( ω τ ) ; τ tan(φ) ( ω) Example: Parameter Estimatin (Λ (AR).Ε ) (a) (α ) At ωτ A.R = K p = 5 Amplitude Rati w.r.t. t ωτ 0. 0 φ 0. 0.5 0 ωτ (b) (β ) T = /ω c =/0.5 = 2 min -45-90 Phase Shift w.r.t. t ωτ ω 0. 0 7
αα'δος6-2-204 Respnse t Sine Wave Functin Let us assume a sine wave input functin, U(t) = α sin(ωt), is intrduced int a secnd rder dynamic system. The Y(s) respnse f the system will be given by Kp A Ys () 2 s 2 2ss 2 2 U(t) U(t)Μt φ Y s (t) εταβατικήπερίοtransient Stage Y s (t) t Respnse f a secnd rder system t a sinusidal input Respnse t Sine Wave Functin 8
Frequency Respnse Analysis Magnitude (Amplitude Rati) 2 2 2 2 τω G(iω) ReG(iω) ImG(iω) K p 2 2 τω Argument (Phase Shift) Im G(iω ) φ tan tan ( ωτ) ReG(iω ) /2 K p 2 2 2 τω Where G(iω) = G(s) s=iω is a cmplex transfer functin Steady-state Respnse t a Sine Wave This part describes the steady-state respnse f a secnd rder system t a sinusidal input functin. It is btained frm the system s transfer functin by substituting the Laplace variable s in the TF with iω. Kp Kp G(iω) G(s) (5) siω 2 2 2 2 τ s 2ζτs τω 2ζτiω siω r 2 2 (τω) i(2ζτω) G(iω) K (6) p ( τω) 2 2 2 (2ζτω) 2 G(iω) is a cmplex functin. Its magnitude will be equal t the rati f the utput respnse amplitude ver the respective value f the input signal while its argument is equal t the phase shift. K p G(iω ) (7) 2 2 2 2 ( τ ω ) (2ζτω) 2τζω φ tan 2 2 τ ω (8) 9
S.S Respnse t a Sine Wave Thus, fr a sine wave input, the steady state respnse f the system is described by the fllwing equatin: K pα Υ s(t) G(iω) α sin(ωt φ) sin(ωt φ) 2 2 2 2 ( τ ω ) (2τζω) (9) Remarks: It is clear frm Eq. (9) that a sinusidal input (U(t)=αsinωτ) prduces a sinusidal utput f the same frequency as the input. Amplitude Rati (AR): α' Kp (AR) α G(iω) ( τω) (2ζτω) 2 2 2 2 The phase shift f the utput lags behind that f the input by φ (Eq. 8). (20) Frequency Respnse Analysis Asympttic analysis f (AR) and φ with respect t ωτ. AR 2 2 2 2 lg lg (ω τ ) (2ζτω) K p 2 (2) AR AR lim lg 0 ; lim lg 2lg(ωτ) K Κ ωτ0 ωτ p p (22) If τω 0 then tanφ 2ζωτ ; φ 0 If τω then tanφ ; φ 90 2ζ If <τω then tanφ ; φ 80 ωτ 0
Bde Plts 0 Λ.Ε. AR ζ = 0, Κ K p 0,3 0,5 0,8 2,0 0. (α) (a) 0.0 0. 0 ωτ 0 φ -45 0,8 0,5 0,3 ζ = 0, Figure: Frequency respnse plts fr a secnd-rder system. a) (AR/K p ) w.r.t. ωτ and b) φ w.r.t. ωτ 2,0-90 -35 (b) (β) -80 0. ωτ 0 Frequency Respnse Analysis The amplitude rati plt exhibits a maximum fr certain values f ζ. We can calculate this value by differentiating Eq. (20) with respect t ωτ and setting the result t zer: d d(ωτ) (ω τ ) 2ω τ 4ζ ω τ 2 2 2 2 2 2 2 2 0 (23) max 2 (ωτ) 2ζ ; ζ 0.707 (24) AR K 2 p max 2ζ ζ (25) Nte: As ζ0, the AR K p
Frequency Respnse Analysis Chapter 4 MATLAB: Respnse t Sine Wave % Frequency Respnse f a Secnd-Order System t a Sinusidal Input Kp = ; T = ; z = 0.2; sys = tf([kp],[t^2 2*z*T ]); a = ; w = 2; t = [0 : 0.0 : 24*pi/w]; u = a*sin(t*w); [y,t] = lsim(sys,u,t); figure() plt(t,y,'k-',t,u,'k:') grid n xlabel(['t/\tau']) ylabel('y(t)') title(['time respnse f a secnd-rder system t a sinusidal input']) ps = 0; legend('y(t)','u(t)',ps) 2
MATLAB: Respnse t Sine Wave % BODE Plts: Secnd-Order System Kp = 7 ; T = ; z = 0.2 ; sys = tf([kp],[t^2 2*z*T ]) ; w = lgspace(lg0(0^(-)/t),lg0(0^/t),200) ; [mag,phase] = bde(sys,w) ; AR = zers(,length(mag)) ; fr j = ::length(mag) AR(,j) = mag(:,:,j) ; end figure() lglg(w*t,ar/kp,'k-') ylim([0.0 0]) grid n xlabel('\mega\tau') ylabel('ar / K_p') title(['amplitude rati AR / K_p w.r.t. \mega\tau']) phi = zers(,length(phase)) ; fr i = ::length(phase) phi(,i) = phase(:,:,i) ; end figure(2) semilgx(w*t,phi,'k-') grid n xlabel('\mega\tau') ylabel('\phi (^)') '\upsiln \mega\tau']) title(['phase Shift \phi w.r.t. \mega\tau']) Respnse f n First-Order Systems % Sinusidal Respnse f n First-Order Systems in Series Kd = ; n = 5 ; % number f dynamic systems in series T = /n ; v = [T ] ; v2 = [T ] ; fr i = :(n-) v2 = cnv(v,v2) ; end sys = tf([kd^n],v2) ; w = lgspace(lg0(0^(-)/t),lg0(0^2/t),200) ; [mag,phase] = bde(sys,w) ; AR = zers(,length(mag)); fr j = ::length(mag) AR(,j) = mag(:,:,j) ; end figure() lglg(w*t,ar/(kd^n),'k-') xlim([0. 00]) ylim([0.0 ]) grid n xlabel('\mega\tau') ylabel('ar / K_p') title(['amplitude rati, AR/K_p w.r.t. \mega\tau']) phi = zers(,length(phase)); fr i = ::length(phase) phi(,i) = phase(:,:,i); end figure(2) semilgx(w*t,phi,'k-') grid n xlabel('\mega\tau') ylabel('\phi (^)') title(['phase Shift, \phi w.r.t. \mega\tau']) 3
Bde Diagram G AR d (iω) n Κ d n = n = 2 n = 5 0. 0.0 0. 0 ωτ 00 0 φ -00 Figure : Frequency Respnse Plts fr n Nn- Interacting First- Order Systems in Series. a) (AR/K p ) w.r.t. ωτ and b) φ w.r.t. ωτ -200-300 -400 n = n = 2 n = 5 0. 0 ωτ 00 Frequency Respnse Analysis and Cntrl System Design 4
Frequency Respnse Analysis Chapter 3 Advantages:. Applicable t dynamic mdels f any rder (including nn-plynmials). 2. Designer can specify desired clsed-lp respnse characteristics. 3. Infrmatin n stability and sensitivity/rbustness is prvided. Disadvantage: The apprach tends t be iterative and time-cnsuming (interactive cmputer graphics desirable, MATLAB) Frequency Respnse Analysis Sme facts fr cmplex number thery: Fr a cmplex number: b w a bj Im a Re( w), b Im( w) w a Re It fllws that a wcs( ), b wsin( ) where w Re( w) 2 Im( w) 2 Im( w) arg( w) tan Re( w) such that w we j 5
Frequency Respnse Analysis Fr a general transfer functin s rs () e ( sz ) ( s z Gs m) () qs () ( s p) ( s pn ) Frequency Respnse summarized by G( j) G( j) e j where G( j ) is the mdulus f G(jω) and j is the argument f G(jω) Nte: Substitute fr s=jω in the transfer functin. Frequency Respnse Analysis The respnse f any linear prcess G(s) t a sinusidal input is a sinusidal. The Amplitude Rati f the resulting signal is given by the mdulus f the transfer functin mdel expressed in the frequency dmain, G(jω). The Phase Shift is given by the argument f the transfer functin mdel in the frequency dmain. i.e. 2 2 AR G( j) Re( G( j)) Im( G( j)) Im( G( j)) Phase Angle tan Re( G( j)) 6
Frequency Respnse Analysis n T study frequency respnse, we use tw types f graphical representatins.. The Bde Plt: Plt f AR vs. ω n lg-lg scale Plt f φ vs. ω n semi-lg scale 2. The Nyquist Plt: Plt f the trace f G(jω) in the cmplex plane n Plts lead t effective stability criteria and frequencybased design methds Frequency Respnse: Examples. Pure Capacitive Prcess G(s)=/s G ( j ) K j K j j j AR K K /, tan 0 2 2. Dead Time G(s) = e -ϴs G( j ) e j AR, 7
0 2 Bde Plts Pure Capacitive Prcess AR K 2 AR 0 0 0 0-2 0-0 0-89 Phase Angle -89.5-90 -90.5-9 0-2 0-0 0 Frequency (rad/sec) Bde Plts fr First-Order System Chapter 3 8
Bde Plts fr Time-Delay System Chapter 3 Frequency Respnse f Cmplex Systems 3. n prcess in series Gs () G () sg () s Frequency respnse f G(s) G( j) G( j) Gn ( j) j j G ( j) e Gn ( j) e n Therefre, n AR G( j) Gi ( j) i n n arg( G( j)) arg( Gi ( j)) i i i n 9
Frequency Respnse f Cmplex Systems 4. n first rder prcesses in series K K Gs () n s ns K K AR n 2 2 n 2 2 tan tan n 5. First rder plus delay AR K p () 2 2 s Kpe Gs () s, tan ( ) Bde Plts fr Cmplex T. Functins Use a Bde plt t illustrate frequency respnse. Plt f lg G vs. lg and vs. lg Chapter 3 G G G G 2 3 G G G G 2 2 3 l g G l g G l g G l g G G G G G G G G 2 3 2 3 l g G l g G l g G G G G 2 2 20
Bde Plts Gs () G () sg 2 () sg 3 () s G() s, G2() s, G3() s 0s 5s s AR 0 0 0-2 G 3 G 2 G 0-4 0-4 0-3 0-2 0-0 0 0 0-00 -200-300 0-4 0-3 0-2 0-0 0 0 G( j) 2 2 2 2 2 2 ( 0 )( 5 )( ) tan ( 0) tan ( 5) tan ( ) 0 0 Bde Plts Gs ()e s G( j ), G () s e G () s G () s G () s d s 2 2 3 AR 0-2 G=G d 0-4 0-4 0-3 0-2 0-0 0 0 0-00 -200-300 G d G 0-4 0-3 0-2 0-0 0 0 2
Bde Plts Example Chapter 3 0.5s 5(0.5s) e Gs () (20s)(4s) Frequency Respnse f P Cntrller Recall that the frequency respnse is characterized by. Amplitude Rati (AR) 2. Phase Angle () Chapter 3 Fr any transfer functin, G(s) A R G ( j ) G ( j ) Prprtinal Cntrller G () s K AR K, 0 C C C 22
Frequency Respnse f PI PI Cntrller Chapter 3 GC() s KC ARKC 2 2 Is I tan I The Bde plt fr a PI cntrller is shwn in next slide. Nte b = / I. Asympttic slpe ( 0) is - n lg-lg plt. Frequency Respnse f PI AR K c 2 2 I tan ( / I ) 0 3 AR 0 2 0 0 0 0-3 0-2 0-0 0 0 0-20 -40-60 -80-00 0-3 0-2 0-0 0 0 23
Chapter 3 Frequency Respnse f PID Ideal PID Cntrller. Gc() s Kc( Ds) (448) s I Series PID Cntrller. The simplest versin f the series PID cntrller is τi s Gcs Kc τds (4-50) τi s Series PID Cntrller with a Derivative Filter. τis τds Gcs Kc τis ατds (4-5) Frequency Respnse f PID 0 3 2 AR K c D I tan D I AR 0 2 0 0 0 0-3 0-2 0-0 0 0 00 50 0-50 -00 0-3 0-2 0-0 0 0 24
Bde Plts f PID Chapter 3 Bde plts f ideal parallel PID cntrller and series PID cntrller with derivative filter (α = ). Ideal parallel: Gc s2 4s 0s Series with Derivative Filter: 0s 4s Gc s 2 0s 0.4s Nyquist Plts Plt f G(jω) in the cmplex plane as ω is varied Relatin t Bde plt AR is distance f G(jω) fr the rigin Phase angle, φ, is the angle frm the real psitive axis Example: First rder prcess (K=, τ=) G( j) 25
Nyquist Plts Dead-time Secnd Order Third Order Nyquist Plts Gs () 3 2 s 3s 3s Effect f dead-time (secnd rder prcess) Gs (), G d () s e 2s s 2 3 s 26
Cntrller Design in Frequency Dmain Analyze G OL (s) = G C G V G P G M (pen lp gain) Three methds in use: Chapter 3 () Bde plt G, vs. (pen lp F.R.) - Chapter 3 (2)Nyquist plt - plar plt f G(j) (3)Nichls chart G, vs. G/(+G) (clsed lp F.R.) Advantages: D nt need t cmpute rts f characteristic equatin Can be applied t time delay systems Can identify stability margin, i.e., hw clse yu are t instability. Sustained Oscillatins in FB Cntrl Chapter 3 27
Frequency Stability Criteria. Bde Stability Criterin 2. Nyquist Stability Criterin Bde Stability Criterin: Chapter 3 A clsed-lp system is unstable if the FR f the pen-lp T.F G OL =G C G P G V G M, has an amplitude rati greater than ne at the critical frequency, C. Otherwise, the clsed-lp system is stable. Nte: value f where the pen-lp phase angle is 80 0. C The Bde Stability Criterin prvides inf n clsed-lp stability frm pen-lp FR inf. Bde Stability Criterin A clsed-lp system is unstable if the frequency f the respnse f the pen-lp G OL has an amplitude rati greater than ne at the critical frequency. Otherwise it is stable. Strategy:. Slve fr ω in 2. Calculate AR arg( GOL( j)) AR G ( j ) OL 28
Check fr stability: Bde Stability Criterin. Cmpute pen-lp transfer functin 2. Slve fr ω in φ=- π 3. Evaluate AR at ω 4. If AR> then prcess is unstable Find ultimate gain:. Cmpute pen-lp transfer functin withut cntrller gain 2. Slve fr ω in φ=- π 3. Evaluate AR at ω 4. Let K cu AR Frequency Stability Analysis Chapter 3 Fr prprtinal-nly cntrl, the ultimate gain K cu is defined t be the largest value f K c that results in a stable clsed-lp system. Fr prprtinal-nly cntrl, G OL = K c G and G = G v G p G m. AR OL (ω)=k c AR G (ω) (4-58) where AR G dentes the amplitude rati f G. At the stability limit, ω = ω c, AR OL (ω c ) = and K c = K cu. K cu AR (ω ) G c (4-59) 29
Example : Bde Stability Criterin Cnsider the transfer functin and cntrller 5e 0. s Gs () Gc () s. 04 ( s)( 05. s) 0. s - Open-lp transfer functin 5e 0. s GOL() s ( s )(. s ). 05 04 0. s - Amplitude rati and phase shift 5 AR 04. 2 2 2 025. 00. 0 05. tan ( ) tan (. ) tan 0. -At ω=.428, φ=-π, AR=6.746 Example 2: Bde Stability Analysis A prcess has a transfer functin, 2 Gp () s (0.5s ) And G V = 0., G M = 0. If prprtinal cntrl is used, determine clsed-lp stability fr 3 values f K c :, 4, and 20. Slutin: The OLTF is G OL =G C G P G V G M G OL r... 2KC () s (0.5s ) The Bde plts fr the 3 values f K c shwn in Fig. 3.9. Nte: the phase angle curves are identical. Frm the Bde diagram: K C AR OL Stable? 0.25 Yes 4.0 Cnditinally stable 20 5.0 N 3 3 30
Frequency Stability Analysis Chapter 3 Bde plts fr G OL = 2K c /(0.5s + ) 3. Example 3: Frequency Stability Analysis Chapter 3 Determine the clsed-lp stability f the system, s 4e Gp ( s) 5s Where G V = 2.0, G M = 0.25 and G C =K C. Find C frm the Bde Diagram. What is the maximum value f K c fr a stable system? Slutin: The Bde plt fr K c = is shwn in Fig. 3.. Nte that:.69 rad min C AR OL C 0.235 K C max = 4.25 AR 0.235 OL 3
Bde Plt fr Kc = Chapter 3 Nyquist Stability Criterin If N is the number f times that the Nyquist plt encircles the pint (-,0) in the cmplex plane in the clckwise directin, and P is the number f pen-lp ples f G OL that lie in the right-half plane, then Z=N+P is the number f unstable rts f the clsed-lp characteristic equatin. Strategy. Substitute s=jω in G OL (s) 2. Plt G OL (jω) in the cmplex plane 3. Cunt encirclements f (-,0) in the clckwise directin 32
Nyquist Stability Criterin Cnsider the transfer functin 0. s 5e Gs () ( s)( 05. s) and the PI cntrller Gc () s. 04 0. s Ultimate Gain and Ultimate Perid Ultimate Gain: K CU = maximum value f K C that results in a stable clsed-lp system when prprtinal-nly cntrl is used. Ultimate Perid: P U 2 C K CU can be determined frm the OLFR when prprtinal-nly cntrl is used with K C =. Thus K CU AR OL C fr K C Nte: First and secnd-rder systems (withut time delays) d nt have a K CU value if the PID cntrller actin is crrect. 33
Gain and Phase Margins The gain margin (GM) and phase margin (PM) prvide measures f hw clse a system is t a stability limit. Chapter 3 Gain Margin: Let A C = AR OL at = C. Then the gain margin is defined as: GM = /A C Accrding t the Bde Stability Criterin, GM > stability Phase Margin: Let g = frequency at which AR OL =.0 and the crrespnding phase angle is g. The phase margin is defined as: PM = 80 + g Accrding t the Bde Stability Criterin, PM >0 stability Gain and Phase Margins Chapter 3 34
Design Gain and Phase Margins Rules f Thumb: A well-designed FB cntrl system will have: Chapter 3.7 GM 2.0 30 PM 45 Clsed-Lp FR Characteristics: An analysis f CLFR prvides useful infrmatin abut cntrl system perfrmance and rbustness. Typical desired CLFR fr disturbance and setpint changes and the crrespnding step respnse are shwn in Appendix J (see Text). 0 0 Bde Plt : Amplitude Rati 0 - Amplitude rati plt.fig 0-2 0-2 0-0 0 35
Bde Plt : Phase Angle 0-50 -00-50 -200-250 -300 0-2 0-0 0 Stability Cnsideratins n n n n n Cntrl is abut stability Cnsidered expnential stability f cntrlled prcesses using: Rth criterin Direct Substitutin Rt Lcus Bde Criterin (Restrictin n phse angle) Nyquist Criterin Nyquist is mst general but smetimes difficult t interpret Rts, Bde and Nyquist all in MATLAB MAPLE is recmmended fr sme applicatins. 36