1 / 31 Systems Engineering/Process control L9 The PID controller The algorithm Frequency analysis Practical modifications Tuning methods Reading: Systems Engineering and Process Control: 9.1 9.6
2 / 31 The PID controller Based on a survey of over eleven thousand controllers in the refining, chemicals and pulp and paper industries, 97% of regulatory controllers utilize PID feedback. [Desborough and Miller, 22] School-book form : t u(t)=k (e(t)+ 1Ti ) de(t) e(τ)dτ+t d dt Transfer function: G c (s)=k ( 1+ 1 ) +st d st i
3 / 31 The P part P controller: u=k(r y)+u =Ke+u u u max u u min e e e Proportionalband u can be chosen to eliminate stationary error at setpoint
4 / 31 Example: P control ofg p (s)=(s+1) 3 Output 1 K=5 K=1 K=2 1 2 6 4 K=5 Input 2 K=2 K=1 2 1 2 Time
5 / 31 The I part Introduce automatic/online/dynamic selection ofu : u 1 1+sT i Ke u 1 U(s)=KE(s)+ U(s) 1+sT i ( U(s)=K 1+ 1 ) E(s) st i Assume stationarity: How doesuandu relate? What ise?
6 / 31 Example: PI control ofg p (s)=(s+1) 3 (K=1) Output 1 T i =2 T i=1 T i = T i =5 1 2 Input 2 T i =1 T i =2 T i =5 T i = 1 2 Time
7 / 31 The D part A P controller gives the same control in both these cases: Control error e e p e p Predicted error: PD controller: t t+t d Time e p (t+t d ) e(t)+t d de(t) dt u(t)=k ( ) de(t) e(t)+t d dt
8 / 31 Example: PD control ofg p (s)=(s+1) 3 (K=5) Output 1 T d =.1 T d =.5 T d =2 1 2 Input 6 4 2 2 T d =.1 T d =.5 T d =2 1 2 Time
9 / 31 Parallel and serial form PID controller on standard form (parallel form): G c (s)=k+ K st i +skt d K e K T i s Σ u KT d s PID controller on serial form (common in industry): G c(s)=k ( 1+ 1 st i) (1+sT d ) e K 1+ 1 T i s 1+T d s u
1 / 31 Parallel and serial form Transformation parallel form serial form: ( K=K T i +T d T i K = K 2 1+ ( T i =T i +T d T i = T i 2 1+ T d = T i T d T i +T d T d = T i 2 1 4T d T i ) 1 4T d T i ) ( ) 1 1 4T d T i Identical parameters for PI and PD controller Parallel serial only possible ift i 4T d Parallel form more general
11 / 31 Frequency analysis of PID controller Frequency function for PID controller on serial form: G c K (iω)= iωt (1+iωT i )(1+iωT d ) i For low frequencies (small ω ): G c(iω) K ωt i argg c(iω) 9 Zero ats= 1/T i bends amplitude curve up and increases phase with9 around ω=1/t i The same holds for the zero ats= 1/T d
12 / 31 Frequency analysis of PID controller 1 1 Gain 1 K 1/T i 1/T d 1-2 1-1 1 1 1 1 5 Phase -5-1 1-2 1-1 1 1 1 Frequency [rad/s]
Repetition: Amplitude and phase margin 1 1 Förstärkning 1 1/A m 1-1 ω c 1-2 1-1 1-5 -1 Fas -15 ϕ m -2 ω o -25 1-1 1 Frekvens [rad/s] 13 / 31
14 / 31 Frequency analysis of PID controller The P part: Affects gain at all frequencies Higher gain faster system but worse margins The I part: Increases gain and reduces phase for low frequencies Eliminates low frequency (constant) control errors but gives worse phase margin The D part: Increases gain and phase at high frequencies Gives better phase margin (to a limit) but amplifies noise
15 / 31 Practical modifications of PID controllers School-book form: Modifications: e(t)=r(t) y(t) u(t)=ke(t) + K t de(t) e(τ)dτ+kt }{{} d T i P(t) }{{}}{{ dt } I(t) D(t) The P part: reference weighting The I part: anti-windup The D part: reference weighting and limited gain
16 / 31 Modification of P part Introduce reference weighting β: P(t)=K ( βr(t) y(t) ), β 1 Can be used to limit overshoot after reference changes (moves a zero in closed-loop system) Note! Works only if also I part used
Example: Reference weighting with PI control (reference change at t =, load disturbance at t = 25): 1 β=1 Input Output 5 2 β=1 β=.5 β= β=.5 β= 5 Time 17 / 31
18 / 31 Modification of I part Input is always limited in practice (u min u u max ) Letvbe the input the controller wants to use Letube the input the controller can use u u max u min v Integrator windup: I part keeps growing when signal saturated
Example: PI control with integrator windup G p (s)=1/s, K=T i =1,.3 u.3: 2 Output 1 1 2 2 v Input 1 I u 1 2 Time 19 / 31
2 / 31 I(t)= t PI controller with anti-windup: Anti-windup ( K e(τ)+ 1 ) ( ) u(τ) v(τ) dτ T i T t Actuator (or model) e v u K K 1 T i s I + 1 T t Rule of thumb for constantt t : PI controller:t t =.5T i PID controller:t t = T i T d
Example: PI control with anti-windup Same example as before, but with anti-windup (T t =.5): 2 Output 1 1 2 1 v Input u I 1 2 Time 21 / 31
Modification of D part Reference weighting: derivate only measurement, not reference D(t)= KT d dy(t) dt Limit gain with low-pass filter (extra pole): ( fuskderivata ) D(s)= skt d 1+sT d /N Y(s) Maximal derivative gainntypically chosen in interval 5 2 22 / 31
23 / 31 Example: Limited derivative gain y(t)=sint+.1sin1t, T d =1, N=5 Brusfri signal Brusfri derivata Brusig signal y Derivatan av y Brusig signal y Fuskderivatan av y
Summary: Practical modifications y 1 skt d 1+sT d /N Actuator (or model) β K v u r K 1 T i s + 1 T t (More to think about: bumpless transfer between manual/automatic control, bumpless parameter changes, sampling filters, sampling,... ) 24 / 31
25 / 31 Tuning methods for PID controllers Manual tuning (lab 1) Ziegler Nichols methods The Lambda method Arresttidstrimning (project) Model-based tuning (lab 2) Relay methods Optimization-based methods...
26 / 31 Ziegler Nichols step response method Experiment on open-loop system, readaandb in step response: y b a t Controller K T i T d P 1/a PI.9/a 3b PID 1.2/a 2b.5b
27 / 31 Ziegler Nichols frequency method (Ziegler Nichols ultimate-sensitivity method) Experiment on closed-loop system 1. Disconnect I and D parts in PID controller 2. IncreaseK until oscillations with constant amplitude. This K=K. 3. Measure period timet for oscillations. Controller K T i T d P.5K PI.45K T /1.2 PID.6K T /2 T /8 (Note thatt =2π/ω, where ω is frequency that gives 18 phase shift)
Ziegler Nichols methods warning Ziegler Nichols methods give aggressive control with bad damping Recommendation:Klowered with 3 5 % for better robustness Example: PID control ofg p (s)=1/(s+1) 4 : Output 1 Step response method Ultimate sensitivity method Ultimate sensitivity, 4% lower gain 25 5 Input 2 25 5 Time 28 / 31
29 / 31 Lambda method 1. Read deadtimel, time constantt and static gaink p = y u : Process output 63% y Control signal L T u
3 / 31 Lambda-method 2. Choose λ = desired time constant for closed-loop system λ=t common choice λ=2t a bit slower for more robustness 3. PI controller: K= 1 K p T L+ λ, T i=t PID controller (in serial form): K = 1 K p T L/2+λ, T i =T, T d =L 2
31 / 31 Model based tuning (Lab 2) 1. Find process transfer functiong p (s) 2. Choose controller typeg c (s) 3. Compute closed-loop system transfer function: G(s)= G p(s)g c (s) 1+G p (s)g c (s) 4. Choose controller parameters to place poles for G(s) to achieve desired behavior (pole placement)