CHE517 Advanced Process Control Prof. Shi-Shang Jang Chemical Engineering Department National Tsing-Hua University Hsin Chu, Taiwan Course Description • Course: CHE517 Advanced Process Control • Instructor: Professor Shi-Shang Jang • Text: Seborg, D.E., Process Dynamics and Control, 2nd Ed., Wiley, USA, 2003. • Course Objective: To study the application of advanced control methods to chemical and electronic manufacturing processes • Course Policies: One Exam(40%), a final project (30%) and biweekly homework(30%) Course Outline 1. Review of Feedback Control System 2. Dynamic Simulation Using MATLAB and Simu-link 3. Feedforward Control and Cascade Control 4. Selective Control System 5. Time Delay Compensation 6. Multivariable Control Course Outline - Continued 7. Computer Process Control 8. Model Predictive Control 9. R2R Process Control Chapter 1 Review of Feedback Control Systems • • • • • • • • • Feedback Control Terminology Modeling Transfer Functions P, PI, PID Controllers Block Diagram Analysis Stability Frequency Response Stability in Frequency Domain Feedback Control Transmitter Controller Set point Temp sensor Heat loss stream condensate Examples: • Room temperature control • Automatic cruise control • Steering an automobile • Supply and demand of chemical engineers Feedback Control-block diagram Manipulated variable error + Σ Set point Controller disturbance process Controlled variable - Measured value Sensor + transmitter Terminology: • Set point • Manipulated variable (MV) • Controlled variable (CV) • Disturbance or load (DV) • Process • controller Instrumentation Transmitter Controller Set point Temp sensor Heat loss stream condensate • • • Signal Transmission: Pneumatic 3-15psig, safe longer time lags, reliable Electronic 4-20mA, current, fast, easy to interface with computers, may be sensitive to magnetic and/or electric fields Transducers: to transform the signals between two types of signals, I/P: current to pneumatic, P/I, pneumatic to current Modeling Q Mass M Cp T Q=UA(T-T0) Rate of accumulation = Input – output + generation – consumption d ( MC PT ) Q UA(T T0 ) dt At steady state : let T = TS and Q = QS 0 = QS – UA(TS - T0S) Deviation variables : let T = TS+Td , Q = QS+Qd , T0 = T0s+T0d Then : d MC P dt (Td ) Qd UA(Td T0d ) If system is at steady state initially Td(0) = 0 Transfer Functions Laplace Transforming: M Cp S Td(S) = qd(S) - U A (Td(S) – Tod(S)) Or q d S UATod S Td S SMC p UA SMC p UA qd(S) UA MsC p UA + ∑ + 1 Tod(S) MsC p UA Td(S) Non-isothermal CSTR F0 ρ0 CA0 T0 AB rA = - KCA mol/ft3 T V ρ CA CB steam F ρ CA T K = αe-E/RT condensate • Total mass balance: d (V ) F0 F dt • Mass balance : d (V C A ) F0 C A0 F C A ( KC A )V dt d • Energy balance : (V CPT ) F0CPT0 F C PT (Hr )( KC A ) UA(Ts T ) dt • Initial conditions : V(t=0) = Vi , T(t=0) = Ti , CA(t=0) = CAi • Input variables : F0 , CA0 , T0 ,F Linearization of a Function F(X) aX+b X0 -△ X0 -△ 0 X0+△ △ X Linearization f dx f x, u x dt x x0 u u0 x x0 f ( x0 , u0 ) dxd axd bud 0 dt Laplace Transform sxd s axd s bud s or xd ( s ) K b ud s s a s 1 f u x x0 u u0 u u0 Linearization of Nonisothermal CSTR dVd b11 F0, d b12 Fd dt dC A,d a21Vd a22C A,d b11 F0, d b12 Fd dt dTd a31Vd a32C A,d a33Td b31 F0, d b32C A, d b33Tsd dt i.e. Vd 0 d a C A , d 21 dt Td a31 0 a22 a32 0 Vd b11 b12 0 C A,d b21 b22 a33 Td b31 b32 0 F0,d b23 Fd AX ( s ) BU ( s ) b33 Ts ,d F0,d Vd y 0 0 1 C A,d 0 0 0 Fd CX DU Ts ,d Td Td s C ( sI A) 1 B D U ( s ) G p s Tsd s GL s F0,d ( s ) GL ' s Fd s Common Transfer Functions K=Gain; τ=time constant; ζ=damping factor; D=delay • First Order System • Second Order System CV ( s) K MV s s 1 CV ( s) K 2 2 MV s s 2s 1 • First Order Plus Time Delay CV ( s) K Ds e MV s s 1 • Second Order Plus Time Delay CV ( s) K 2 2 e Ds MV s s 2s 1 Transfer Functions of Controllers • Proportional Control (P) m(s) = Kc[ e(s) ] e(s) m(s) Kc e = Tspt - T • Proportional Integral Control (PI) 1 m( t ) K c e( t ) I 0 e(t)dt t 1 m(s) K c e(s) e(s) Is e(s) K c (1 1 ) Is m(s) • Proportional-Integral-Derivative Control (PID) 1 m( t ) K c e( t ) I m(s) K c de 0 e(t)dt D dt t 1 e(s) 1 Ds Is e(s) K c (1 1 D s) Is m(s) The Stability of a Linear System • Given a linear system y(s)/u(s)= G(s)=N(s)/D(s) where N, D are polynomials • A linear system is stable if and only if all the roots of D(s) is at LHS, i.e., the real parts of the roots of D(s) are negative. Stability in a Complex Plane Im Exponential Decay with oscillatory Purdy oscillatory Exponential growth with oscillatory Fast Exponential growth Exponential Decay Fast Decay Slow Decay Slow growth Purdy oscillatory Stable (LHP) Unstable (RHP) Re Partial Proof of the Theory • For example: y(s)/u(s)=K/(τs+1) • The root of D(s)=-1/τ • In time domain: τy’+y=ku(t) • The solution of this ODE can be derived by y(t)=e-t/τ [∫e1/τku(t)dt+c] • It is clear that if τ<0, limt→∞y →∞. Transfer functions in parallel X(S)= G1(S)*U1(S) + G2(S)*U2(S) X1(S) U1(S) X2(S) G1(S) X1(S) + Σ G2(S) U2(S) X2(S) + X (S) Transfer function Block diagram Tset + Kc Σ - QS control 1 MC P S UA process Measuring device 1 Proportional control No measurement lags Td Tset 1 MC P S UA 1 1 KC MC P S UA KC Td Block Diagram Analysis Xs + e ∑ - Gc(S) L(S) GL(S) m GP(S) Xm X1 + + ∑ Gm(S) e = X s – Xm m = Gc (S) e(s) = Gc e X1 = Gp m = Gp Gc e X = GL L + X1 = GL L + Gp Gc e Xm = Gm X = Gm GL L + Gp Gc e X = GL L + Gp Gc[Xs – Xm] = GL L + Gp Gc [Xs] – Gp Gc [Xm] =GL L + Gp Gc Xs – Gp Gc Gm X G pG c GL X L Xs 1 G pG cG m 1 G pG cG m X(S) Stability of a Closed Loop System • A closed loop system is stable if and only of the roots of its characteristic equation : 1+Gc(s)Gp(s)Gm(s)=0 are all in LHP Level System dh Fin Fout Fin k h dt Given a reference point Fin0 , h0 A A dhd f Fin Fin0 f h h0 Fin,d k hd dt Fin h 2 h0 Laplacing Ashd (s) ahd s Fin,d s or hd s 1 1/ a K Fin.d s As a A / a s 1 s 1 The jacketed CSTR W Set Point TRC FC 2A B Tc Wc T, Ca A Nonisothermal Jacketed CSTR • (i) Material balance of species A dC A W (C A f C A ) 2 kCA dt V • (ii) Energy balance of the jacket dTc A(T Tc ) Wc (Tc Tw ) dt M cCP ' Mc • (iii) Energy balance for the reactor 2 dT W (T f T ) A(T Tc ) HkC A dt V C PV CP • (iv) Dependence of the rate constant on temperature Q k A0 exp( ) T 273 Linearization of Nonisothermal CSTR • CV=T(t) • MV=Wc(t) • It can be shown that Td s K 3 Wc,d s as bs 2 cs 1 A Practical Example –Temperature Control of a CSTR Method of Reaction Curve Process output Maximum slope △C D Dead time τ Time constant time Ziegler-Nichols Reaction Curve Tuning Rule P only PI PID Kc /DKp 0.9/DKp 1.2/DKp I n.a. D/0.3 D/0.5 D n.a. n.a. 0.5D △C D τ △m D= 1 τ =13 k = -0.0202 Kc= -579.2079 τi =3.33 setpoint Ziegler-Nichols Ultimate Gain Tuning Find the ultimate gain of the process Ku. The period of the oscillation is called ultimate period Pu P only PI PID Kc Ku/2 Ku/2.2 Ku/1.7 I n.a. Pu/1.2 Pu/2 D n.a. n.a. Pu/8 Measuring Controller Performance 0 0 IAE y s y t dt et dt ISE y s y t dt et dt 2 2 0 0 0 0 ITAE t y s y dt t et dt Upper Limit of Designed Controller Parameters of PID Controllers • Q: Given a plant with a transfer function G(s), one implements a PID controller for closed loop control, what is the upper limit of its parameters? • A: The upper limit of a controller should be bounded at its closed loop stability. Approaches • Direct Substitution for Kc • Root Locus method for Kc • Frequency Analysis for all parameters An Example + - ○ Kc 1 ( s 1)( s 2)( s 3) 1. Stability Limit by Direct Substitution • At the stability limit (maximum value of Kc permissible), roots cross over to the RHP. Hence when Kc=Ku, there are two roots on the imaginary axis s=±iω • (s+1)(s+2)(s+3)+Ku=0, and set s= ±iω, we have (iω+1)(iω+2)(iω+3)+Ku= 0, i.e. (6+Ku-6ω2)+i(11ω-ω3)=0. This can be true only if both real and imaginary parts vanishes: 11ω-ω3=0→ ω= ±√11 ; 6+Ku-6×11=0 →Ku=60 2. Method of Root Locus Rlocus (sys,k) k(12) ans =69.6706 3. Frequency Domain Analysis • Definitions: Given a transfer function G(s)=y(s)/x(s); Given x(t)=Asinωt; we have y(t) →Bsin(ωt+ψ) • We denote Amplitude Ratio=AR(ω) =B/A; Phase Angle=ψ(ω) • Both AR and ψ are function of frequency ω; we hence define AR and ψ is the frequency response of system G(s) An Example A sin(wt) 1 s 1s 2s 3 B = sin(wt+f) Frequency Response of a first order system y(s) K A G ( s) ; x(t ) A sin wt x( s ) x( s ) s 1 s w A K y(s) s w s 1 KA y (t ) sin(wt f );f tan w 1 w K AR 1 w f tan w 2 2 2 1 2 2 1 2 2 2 Basic Theorem • Given a process with transfer function G(s); • AR(ω)=︳G(iω)︳ • φ(ω)=∠ G(iω) • Basically, G(iω)=a+ib AR a 2 b 2 f tan 1 b / a Example: First Order System 1 G (s) s 1 1 1 i (w ) 1 (w ) G iw i a ib 2 2 2 2 2 2 iw 1 1 w 1 w 1 w 1 AR a 2 b 2 1 2w 2 b f tan 1 tan 1 w a Note that lim AR 0 w lim f 90 w Corollary • If G(s)=G1(s)G2(s)G3(s) • Then AR(G)=AR(G1) AR(G2) AR(G3) • φ(G)=φ (G1) +φ (G2)+φ (G3) • Proof: Omitted Example K1 K2 G ( s) G1 s G2 s 1w 1 2w 1 AR AR1 AR2 K1 1 w 1 2 2 K2 2 w 2 1 2 f f1 f2 tan 1 w 1 tan 1 w 2 Bode Plot: An example G(s)=1/(s+1)(s+2)(s+3) where db=20log10(AR) Nyquist Plot sys=tf(num,den) NYQUIST(sys,{wmin,wmax})) Nyquist Stability Criteria • Given G(iω), assume that at a frequency ωu, such that φ=-180° and one has AR(ωu), the sufficient and necessary condition of the stability of the closed loop of G(s) is such that: AR(ωu) ≦1 The Extension of Nyquist Stability Criteria • Given plant open loop transfer function G(s), such that at a frequency ωu, the phase angle φ(ωu)=-180°. At that point, the amplitude ratio AR=|G (ωu) |, then the ultimate gain of the closed loop system is Ku=1/AR, ultimate period Pu=2π/ ωu. Simulink Example Response 0.165 0.5 s GP e 2.5s 1 D1.4 3.7-1.4=2.3 time Simulink Example Continued >> sys=tf(1,[1 6 11 6]) Transfer function: 1 ---------------------s^3 + 6 s^2 + 11 s + 6 >> bode(sys) wu=3.5 ARu=-38db =10-38/20 =0.0162 Ku=1/ARu=80 Simulink Example Continued 1. Reaction Curve Approach: KC=1.2/DKp=1.2*2.5/(0.5*0.165)=36; I=D/0.5=1;D=D*0.5=0.25 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 9 10 Simulink Example Continued 1. Ultimate properties Approach: Ku/1.7=80/1.7=47;I=Pu/2= 2* / 2wU =0.9;D=Pu/8=0.22