Exercise 8: Level Control and PID Tuning CHEM-E740 Process Automation
. Level Control Tank, level h is controlled. Constant set point. Flow in q i is control variable q 0 q 0 depends linearly: R h
. a) Define The Transfer Function What is the transfer function of the system? G p s = H s Q i (s) Tip: G process (s) = OUTPUT(s) / INPUT(s) Output = level of the tank. Input = Input flow to the tank
.a) Solution: Transfer Function In equilibrium dv/dt = 0, material balance is: dv dt q i q 0 Resistance of the outflow: A dh dt q V= Ah q 0 h R h R dh A dt dh RA dt q i q 0 i Rq i h Input and output are separated -> something*(out) = something*(in)
. a) Transfer Function, II Next the Laplace transform: L: RA dt dt + h = Rq i RAs + H s = RQ i (s) G p s = H s Q i (s) = R RAs +
. b) Step Response? Now the process is controlled by a P-controller. A small step disturbance n 0 is made. What is the responce? Is there going to remain a permanent offset from the set point? Note! Here the step response is made for a controlled process, using an external disturbance. The set point is not changed.
. b) Solution: Step Response Let s have a look at the block diagram. Transfer functions of the measurement device and valve =. Note! Level set point is constant -> X(s)=0
. b) Step Response, II Laplace transform of the level h(t) From the previous (a): Q i s = K p E(s) H s Q i (s) = R RAs + And in addition, the disturbance N(s) H s = K pr R E s + RAs + RAs + N(s) h and H(s) are differencies from the equilibrium, then E(s) = -H(s) E s = H s = K pr R E s RAs + RAs + N(s)
. b) Step Response, III From that we solve E(s): E s = H s = K pr R E s RAs + E s + K pr RAs + = R RAs + N(s) Multiply by RAs+ RAs + N(s) E s RAs + + K p R RAs + = RN(s) E s = R RAs + + K p R N(s)
. b) Step Response, IV Step input is: N s = n 0 Τs Difference is then: E s = R RAs + + K p R n 0 s To get the response e(t) in time domain, we calculate the Laplase inverse transform.
. b) Step Response, V Partial fraction expansion E s = A s + B RAs + + K p R A and B can be solved by using the residy method.
. b) Step Response, VI (Residy) Solve A: take denominator of the term B, numerator is Rn 0. Solve eq. In point where denominator of term A =0. S=0 A ( RA) s Rn0 K p R s0 Rn K 0 p R
. b) Step Response, VII (Residy) Solve B: take denominator of the term A, numerator is Rn 0. Solve eq. In point where denominator of term B =0. (RA)s++K p R=0 s K RA p R B Rn s 0 K pr s RA Rn 0 K RA p R
. b) Step Response, IIX A and B are placed to the eq. E s = Rn 0 + K p R s + + K pr RA Rn 0 + K P R s And finally the inverse transform N(s)
. b) Step Response, IX constant E s = Rn 0 + K p R /(s+a) s + + K pr RA constant Rn 0 + K P R s Use: /(s+a) -> e -at and /s -> e t = Rn +K 0 p R + K p R e RA t
. b) Step Response, X (permanent offset?) e -at, time constant = /a = [R*A / (+Kp R)]. Without the controller the time constant is RA. When the gain K p is increased the time constant decreases. When t-> infinity, the negative exponent grows e -at -> 0. e = Rn 0 + K p R When the gain is bigger, the permanent offset will be smaller.
. c) Step Response, I- controller Same as b, but now we have I-controller instead of P- controller. Is there a permanet offset?
. c) Solution: Step Response, I-controller Transfer function of the I-controller: Now: And the difference: K =/T i K GC ( s), s Ti s KR R H ( s) E( s) N( s) s( RAs ) RAs KR R E( s) H ( s) E( s) N( s) s( RAs ) RAs
. c) Step Response, I-controller Next we solve the E(s): K pr R E( S) N( s) s(( RA) s ) RAs KR R E( s) H ( s) E( s) N( s) s( RAs ) RAs s( RAs ) K pr E( S) RN ( s) s(( RA) s ) Multiply by RAs+ E( s) Rs N( s) RAs 2 s K R
. c) Step Response, I- controller, II After a step response, N(s) Rs n E( s) 0 RAs 2 s K R s n s 0 We can use the eq. (Can be used also in b) lim t f ( t) lim s0 sf( s) 2 Rs n0 e( ) lim se( s) lim s0 s0 2 RAs s K R s 0 No permanent offset.
2. Tuning of the PID Controller We have a process: yout To Workspace Step PID PID Controller 20 (s+)(s+0)(s+2) Zero-Pole Scope time Clock To Workspace
2. The Controller Tune and select the controller. Use a step response (basic Ziegler-Nichols) method. Use stability margin method. Note: Usually the controller output is scaled for the actuator input (for example: valve 0-00%). In this example the saturation (0-) is used. You can try also saturation 0-0, the results are nearly same, a slighly larger process output exeeding are obtained after the step.
2. Example of Controller Gonfiguration Proscon 200NT automation system. PID runs in PLC. Variable and PID Gonfigurations are made in Windows based program. Input variable = measurement utput variable = actuator Default sp Hi/Lo limit for the actuator PID parameters Sp (+ or -) measurement
2. Ziegler-Nichols Controller Gain K Integration time T I Derivation time T D - - P K PI 0,9 K 3.33 PID,2 K 2 0.5
2. Step Response (Ziegler- Nichols) u(t) K α τ
2. Stability Margin Controller Gain K Integration time T I Derivation time T D P 0.5KKR - - PI 0.45K KR T KR.2 PID 0.6K KR 0.5TKR T KR 8
2. Solutions, Ziegler Nichols Use values: Step time Initial value 0 Final value Make a step response for the open loop.
2. Step Response Tank level 0.9 0.8 0.7 0.6 Level 0.5 0.4 0.3 0.2 From picture: K = α = 0.2 τ = 2 0. 0 0 2 3 4 5 6 7 8 9 0 Time
2. P-controller (Ziegler- Nichols) If we choose P-controller, the parameter K is: K p Response with P-control: -> offset K 2.2 0.2 Tank level.5 Level 0.5 0 0 5 0 5 20 25 Time
2. Stability Margin -method Stability marging method is experimental. Now we make a step response for the closed circuit, when the controller is in P control mode. The gain is increased until the process oscillates with constant amplitude and frequency.
2. Critical Gain Critical gain K kr = 9.8, Period of oscillation T kr =.2 2 Tank level.8.6.4.2 Level 0.8 0.6 0.4 0.2 0 0 5 0 5 20 25 Time
2. P-Control P-Control parameter: K p =0.5*K kr =0.5*9.8=9.9.5 Tank level Level 0.5 0 0 5 0 5 20 25 Time
2. PI-Control P = 0.45*9.8 = 8.9 Parameter I = 0.85* T kr = 0.85*.2 =.02 No permanent offset..5 Tank level Level 0.5 0 0 5 0 5 20 25 Time
Calculating the critical gain analytically: >> tau=;tau2=0.5;tau3=0.;w=fzero(@(x) atan(- tau*x)+atan(-tau2*x)+atan(-tau3*x)+pi,0.5) w = 5.6569 >> AR=/(sqrt(+w^2*tau^2)*sqrt(+w^2*tau2^2)*sqrt(+w^2* tau3^2)) AR = 0.0505 >> K_crit= /AR K_crit = 9.8000
Controller Tuning in Plants A plant might have hundrets PID control loops. Usually the PID tuning is made by using an automatic tuning program. Several program developers. For example: Proscon Tuner. Programs use (usually) a combination of several tuning methods to obtain the parameters. Still manual tuning is widely needed in many cases (old automation systems, process studies, simulation models, etc.).