Faculty of Mechanical and Power Engineering Dr inŝ. JANUSZ LICHOTA CONTROL SYSTEMS PID controllers, part I Wrocław 2007
CONTENTS Controller s classification PID controller what is it? Typical controller structures How works PID controller? Time-domain characteristics How works PID controller? Frequency-domain characteristics First attempt at controller tuning by a process of trial and error
CONTROLLERS Classification Construction: without additional energy with additional energy Energy source: elektronic pneumatic hydraulic Output range continuous impulse on - off 1 0-1 Dynamic properties proportional P integral I PI, PD, PID Basic rule classical PID neural networks fuzzy logic Process Obiekt Nastawnik Regulating unit Czujnik Siłownik Actuator Przetwornik u(t) e(t) Regulator controller Sensor Converter Zadajnik
CONTROLLERS Outer-to-Inner-Loop Hierarchy
CONTROLLERS Outer-to-Inner-Loop Hierarchy
CONTROLLERS Feedback and feedforward Set-point Feedback Feedforward Closed loop Market Driven Acts only when there are deviations Robust to model errors Risk for instability Open loop Planning Acts before deviations show up Not robust to model errors No risk for instability
CONTROLLERS Feedback Feedback + Reduce effects of process disturbances + Makes system insensitive to process variations + Stabilize an unstable system + Create well defined relations between output and reference - Risk for instability Set-point
PID CONTROLLER Now 95 % control loops worldwide uses PID controller as low-level feedback controller
PID CONTROLLER What is it? Obiekt Nastawnik Czujnik Siłownik controller u(t) e(t) Regulator Przetwornik Zadajnik Idea of Minorsky, 1922 Adjustable parameters t 1 u t k e t T e d T de ( t ) ( ) = p ( ) + ( τ ) τ + d i dt 0 Gain Coefficient Proportional gain Integral constant 1/T i = integral gain Derivative constant T d = derivative gain
PID CONTROLLER Typical structures Gain controller P Gain and integral controller PI Gain and derivative controller PD Gain, integral and derivative controller (ideal) PID Gain, integral and derivative controller (real) PID G r ( s ) = k p G r ( s ) = k p 1 + 1 T s i [ ] G r ( s ) = k p 1 + T d s 1 G r ( s ) = k p 1 + + Ts i T s d 1 1 + T d s G c ( s ) = K c 1 +. T T i s d s 1 +
PID CONTROLLER Typical structures There are two forms of PID controller -parallel -series 1 G r ( s ) = k p 1 + + T d s T i s = T T s + k T s + 2 d i p i T s i 1 G r ( s ) = k% p 1 + 1 + T % d s T % i s 1 ( ) T % i + T % d 1 = k% p + + T % d s T % i T % i s Relations between coefficients are T % i + T % d TT % % i d k p = k% p, T i = T % i + T % d, T d = T % T % + T % i i d We should know structure of a controller to use proper tuning method.
PID CONTROLLER Typical structures example 1 Structure of PID What type of controller is show in Fig.? What values do have controller tuning parameters? 1 G r ( s ) = k p 1 + + Ts i T s d a) b) 2 2 3s 3s 1/(4s) e(t) kp Ti u(t) How looks like response of a controller P, I, PD, PI, PID on input signal shown in fig.? Td a) b) x(t) x(t) t t
PID CONTROLLER Typical structures example 2 Structure of PID What type of controller is shown in Fig.? e(t) x(t) u(t) u(t) 10 e(t) kp Ti u(t) 5 5 Td 5 10 0-5 5 10 t t
PID CONTROLLER How it works? Time characteristics Process Output signal Disturbance PID error u(t) e(t) k p e ( t ) k T p d Proportional part acts on PRESENT control error PRESENT PAST FUTURE Integral part acts on sum of errors from a PAST Derivative part acts on possible FUTURE error k T p i t 0 e ( τ ) dτ t 1 u t k e t e d T d e ( t ) ( ) = p ( ) + ( ) + d T τ τ i d t 0 de ( t ) dt
PID CONTROLLER How it works? Time characteristics k p e ( t ) Wouldn t it be better if we limited ourselves to gain part? PRESENT PAST FUTURE z - Process Controller Equivalent transfer function G ( s ) G o ( s ) G o ( s ) = = 1 + G ( s ) G ( s ) 1 + k G ( s ) o r p o Let us check control error e(t) in steady-state.
PID CONTROLLER How it works? Time characteristics Let process be described by transfer function m m 1 b m s + b m 1 s +... + b 1 s + b 0 L ( s ) G o ( s) = = n n 1 s + a n 1 s +... + a 1 s + a 0 M ( s ) Then 1 L ( s ) / M ( s ) L ( s ) b 0 lim y ( t ) = lim sy ( s ) = lim s G ( s ) = lim = lim = s 1 + k L ( s ) / M ( s ) M ( s ) + k L ( s ) a + k t + s 0 s 0 s 0 s 0 p p 0 p Output signal will differ from zero (set-value). This is static deviation of an output signal (or offset).
PID CONTROLLER How it works? Time characteristics k p e ( t ) How to eliminate a static devation? We introduce integration of an error PAST PRESENT FUTURE t k p u ( t ) = k p e ( t ) + e ( τ ) d τ T In operating point control signal is constant u=u 0. Similarly error e=e 0. i 0 k T p i t e ( τ ) dτ t k p k p k p u 0 = k p e 0 + e 0 d k p e 0 e 0 t e 0 k p t T τ = + = + i T 0 i T i Error must fulfill a condition e 0 =0, if assumption about control signal is true. Proof is following 1 L ( s ) / M ( s ) T i sl ( s ) lim sy ( s ) = lim s G ( s ) = lim = lim = 0 s 0 s 0 s s 0 1 + k ( 1 1/ ) ( ) / ( ) s 0 p + T i s L s M s T i sm ( s ) + k p T i sl ( s ) + k p L 0
PID CONTROLLER How it works? Time characteristics Another proof of the amazing property of integral action...
PID CONTROLLER How it works? Time characteristics Disadvantage of integral is rising control signal u(t) if error e(t) is steady and differs from zero. E.g. Such situation is in control loop with electric actuator with steady velocity of moving part h (percentage of opening). z u 1 u 1 - u u Process Controller Actuator s characteristic limits possibility of static deviation reduction. Visible effect is h=100% opening through long time and increasing of control signal u above 100%. Such signal can be realized When error decreases it reaches 100% first and then it approaches to opening degree required in operating conditions.
PID CONTROLLER How it works? Time characteristics To prevent such unprofitable conditions we can limit integral value using a command e.g. in Delphi/Pascal if ei > 100 then ei := 100; or applying solution shown below Actuator model Actuator e(t) u k p u u 1 u 1/T i 1/s - 1/T i e I = u 1 -u If saturation error e I is not equal to zero, it means that actuator has saturation. Then in case of u > 100%, from integral part is subtracted surplus above 100%. Similarly in case of u < 0%. If 0<u<100%, then e I =0.
PID CONTROLLER How it works? Time characteristics Replace the error e(t) in proportional control with the predicted error [ ] G r ( s ) = k p 1 + T d s Prediction by linear extrapolation! More sophisticated controllers predicts using mathematical model of the process.
PID CONTROLLER How it works? Time characteristics k T p i PAST t k p e ( t ) e ( τ ) dτ PRESENT k T p d FUTURE de ( t ) dt Problems with derivative part : derivation of quicly changing input signals causes great changes in control signal u(t). E.g. if output signal is function then d y ( t ) d t y ( t ) = sin( ω t ) = ω co s( ω t ) If angular frequency is equalω=100 rad/s, then it is 100 times greater then signal y(t) at frequencyω=1 rad/s. 0
PID CONTROLLER How it works? Frequency characteristics Solution of the derivative part problem. Constant gain at large angular frequencies In industrial controllers it is uses derivative Filter. It is series connection of first order system and ideal derivative part. 1 T d s G r ( s ) = k p 1 + + T i s 1 + T d s / Fig. Bode plot for real derivative part G ( s ) = s 1 + 0.2 s Thus for small angular frequencies s=jω derivative part has ideal derivative properties, for large frequencies gain is constant and equal N. 20 log (0.2) = -13.97 db
PID CONTROLLER How it works? Frequency characteristics What does PID controller with one point on Nyquist curve? Let us consider open-loop control system. Controller P Process Gain part widens or shrinks curve (analogy to blowing in ballon ). Why? or G ( s ) = G o ( s ) G R ( s ) = k p G o ( s ) G ( s ) = k ( P + jq ) = k P + jk Q p p p P M ( ω ) e jφ ω ( ) Vector [P, Q] moves in new place [k p P, k p Q]. Of course P/Q = k p P/k p Q which means, that phase angleϕis not changing. Magnitude M has changed. Fig. Nyquist plot for second-order system connected in series with P controller
PID CONTROLLER How it works? Frequency characteristics What does PID controller with one point on Nyquist curve? Let us consider open-loop control system. P/T i ω Integral part rotates point about -90 Process G o ( s ) G o ( s ) G ( s ) = G o ( s ) G R ( s ) = = j I T i s Tω i Vector Controller I [P, Q] moves to new point [-jp, Q]/T i ω. Expression jp means segment with length P on positive (in case of shown point!) part of imaginary axis.thus [Q, -P]/T i ω (P and Q changed places). j Q jp G ( s ) = ( P + jq ) = + T ω T ω T ω i i i This means change of phase angleϕand magintude M. Q /T i ω α P α Q Fig. Nyquist plot for second-order system connected in series with P controller
PID CONTROLLER How it works? Frequency characteristics What does PID controller with one point on Nyquist curve? Let us consider open-loop control system. Controller D Process P QT d ω Derivative part rotates point about +90 G ( s ) = G ( s ) G ( s ) = T sg ( s ) = jω T G ( s ) o R d o d o Vector [P, Q] moves to new point [jp, -Q]T d ω. Expression jp means segment having length P on negative part of imaginary axis in case of shown point!) ). D Q PT d ω G ( s ) = jt ω ( P + jq ) = QT ω + jpt ω d d d This means change of phase angleϕand magintude M. Fig. Nyquist plot for second-order system connected in series with P controller
PID CONTROLLER How it works? Frequency characteristics What does PID controller with one point on Nyquist curve? Let us consider open-loop control system. Controller PID Process Justification for advanced in math. Derivative part has phase-shift equal +90 backwards between control signal u(t) and output signal y(t). E.g. if u ( t ) = sin( ω t ) then du ( t ) y ( t ) = = cos( ω t ) dt Another justification is Nyquist curve for basic transfer functions +j D +90 o I P D 0 -j I P -90 o Fig. Nyquist plot for second-order system connected in series with P controller
PID CONTROLLER How it works? Frequency characteristics 4th version of justification e 90o j Integral part has phase-shift,so point on circle must rotate 90 o left. Q=Im G(jω) (Why circle? Euler formula describes circle) (Why left? Because it is convention of characterizing motion on circle left means minus) P=Re G(jω) Derivative part has phase-shift e +90o j,so point on circle must rotate 90 o right Q=Im G(jω) P=Re G(jω)
PID CONTROLLER How it works? Frequency characteristics From considerations results that PID controller can move any point on Nyquist curve in any new position by choosing tuning parameters k p,t i,t d. But which new place is good? I P D Fig. Nyquist plot for second-order system connected in series with P controller
Properties classification of PID controllers
TYPICAL STRUCTURES OF PID Gain P Fig. Step response of P controller Fig. Frequency response (Nyquist plot) of PI controller
TYPICAL STRUCTURES OF PID Integral I Fig. Step response of I controller Fig. Frequency response (Nyquist plot) Integration time constant of PI controller
TYPICAL STRUCTURES OF PID Differential D (useless, not applied) Derivation time constant
TYPICAL STRUCTURES OF PID Gain and integral PI Fig. Step response of PI controller Fig. Frequency response (Nyquist plot) of PI controller
TYPICAL STRUCTURES OF PID Gain and derivative PD (ideal) Fig. Step response of PD controller Fig. Frequency response (Nyquist plot) of PD controller
TYPICAL STRUCTURES OF PID Gain and derivative PD (real) Serial connection of first order DE and PD controller. PID Controller with derivative filter Fig. Step response of PD controller Fig. Frequency response (Nyquist) of PD controller
TYPICAL STRUCTURES OF PID PID (ideal) Fig. Step response of PID controller Fig. Frequency response (Nyquist) of PID controller
TYPICAL STRUCTURES OF PID PID (Real) Fig. Step response of PID controller Fig. Frequency response of PID controller
First attempt at controller tuning by a process of trial and error
CONTROLLER TUNING Tuning parameter k p and transient response Transient response is stable k p =1, T i =1, T d =1 Transient response is unstable k p =5, T i =1, T d =1
CONTROLLER TUNING Tuning parameter T i, T d and transient response k p =1, T i =1, T d =1 kp=1, Ti=0.5, Td=1 k p =1, T i =1, T d =10 kp=1, Ti=1, Td=100
CONTROLLER TUNING Tuning parameters and transient response t 1 u t k e t T e d T de ( t ) ( ) = p ( ) + ( τ ) τ + d i dt 0 Signal u(t) Control loop stability k p increases increases decreases T i increases decreases increases T d increases increases Initially increases then decreases
CONTROLLERS Example speed control
CONTROLLERS Example speed control dω ( t ) J = u ( t ) dt
CONTROLLERS Example speed control P - controller
CONTROLLERS Example speed control, continued 2 d α ( t ) J = u ( t ) 2 dt
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Example speed control, continued
CONTROLLERS Problems with real systems
CONTROLLERS Problems with real systems
CONTROLLERS Problems with real systems
CONTROLLERS Problems with real systems
CONTROLLERS Example - cruise control Cruise control Block diagram of cruise control Process input or control variable: gas pedal (throttle) u Process output: velocity v Desired output or reference signal vr Disturbances: slope q Simplifying assumptions Essential dynamics relates velocity and force The force responds very fast to a change in the throttle Assume that all relations are linear (small perturbations)
CONTROLLERS Example - cruise control
CONTROLLERS Example - cruise control
CONTROLLERS Example - cruise control
CONTROLLERS Example - cruise control
Thank you for your attention