The PID controller ISTTOK real-time AC 7-10-2010 Summary Introduction to Control Systems PID Controller PID Tuning Discrete-time Implementation The PID controller 2 Introduction to Control Systems Some systems are inherently unstable (e.g. inverted pendulum, space rockets, airplanes in some particular conditions, nuclear reactor, your automobile) Equilibrium: (i) Stable, (ii) Unstable and (iii) Astable To stabilize we need an active/passive control system Type of control: Open-loop Closed-loop The PID controller 3 1
Open-loop control - The open loop control is usually based on a model. - It works as if no disturbances are present because there is no form of feedback in the system. In presence of disturbances it fails. - If the plant changes slightly, the output will no longer match the reference. Figure: A Mathematical Approach to Classical Control - Andrew D. Lewis The PID controller 4 Open-loop control Reference Controller output Perturbations Process variable Figure: A Mathematical Approach to Classical Control - Andrew D. Lewis The PID controller 5 Closed-loop control - The main difference between open-loop and the closed loop control is the presence of feedback in the closed-loop system. - If the controller is well projected, the plant output will converge to the desired reference even in presence of undesired disturbances d(t). Reference Feedback Figure: A Mathematical Approach to Classical Control - Andrew D. Lewis The PID controller 6 2
Open-loop Vs. Closed-loop Open-loop system: Closed-loop system: The PID controller 7 Examples of basic controllers Flyball governor, used to regulate the speed of a steam engine. This is an example of a mechanical proportional controller. Regular toilet, the float ball turns off the water valve when the deposit is almost full. This is an example of a mechanical on-off controller. The PID controller 8 Timing definitions Dead time Response time Lag or latency The PID controller 3
Proportional- Integrative- Derivative Controller K - Proportional Term T I - Integral time T D - Derivative time The PID controller PID analog circuit The PID controller 11 PID controller characteristics + Less Sensitive to perturbations + Less sensible to modifications in plant modifications + Does not require complex modeling + Two PID controllers can be used together - Be careful with sensor noise - Can be unstable (too much gain) - Generally they are not optimal controllers The PID controller 12 4
Effects of increasing a parameter independently The PID controller 13 Example Proportional only Figure: Control System Design - K.J. Astrom The PID controller 14 Example Proportional and Integral Figure: Control System Design - K.J. Astrom The PID controller 15 5
Proportional, Integral and Derivative Figure: Control System Design - K.J. Astrom The PID controller 16 Tunning issues Proportional Term: Gain too high-> unstable Integral Term Long period with errors->windup Derivative Term High-Frequency noise Derivative Kick The PID controller 17 Problem: Windup The actuators can saturate: Error continues to be accumulated If controller regains control the response could be exaggerated The PID controller 18 6
Problem: High frequency noise Problem: Sensor Noise is amplified by differential term Possible Solution: apply a low-pass filter before the derivative Consider the option of zeroing the derivative part PI controller The PID controller 19 Problem: Derivative kick Problem: When operator changes set-point cause a big variation on the derivative term Solution1: derivative action based on PV rather than error. Solution2: Apply a fraction of the set-point to the derivative calculation: D(t) = d/dt(β r(t) - y(t)) (0 β 1) The PID controller 20 Tunning methods Method Advantages Disadvantages Manual Software But needs knowhow Ziegler- Nichols Does not need Maths Consistent Tuning May include simulation Online of Offline Method Proved and Online Method Cost and Training Trial & Error Process is Perturbed Aggressive Other alternatives: Cohen-Coon, Chien-Hrones-Reswick. The PID controller 21 7
Ziegler-Nichols Method Pick a P Controler Begin with a low K Raise gradually K until the system becomes unstable(ku) Tipo K TI TD P (1/2)*Ku - - PI (9/20)*Ku (5/6)*Pu - PID (6/10)*Ku (1/2)*Pu (1/8)*Pu Measure the oscillation o period (Pu) Chose the constants correspondent with the type of controller One of the assumptions of the Ziegler-Nichols method is that the plant is Table: A Mathematical Approach to in the form of a transport lag (delay) and a single time constant. Classical Control - Andrew D. Lewis (Pag. 234) The PID controller 22 Digital system - Discrete Time Implementation Figure: Introduction to Digital Control - A. Cenedese The PID controller 23 Digital system May be obtained by discretizing the continuous time control system The bigger the sampling Frequency the BETTER the discrete system resembles the continuous time control system The control system only works on receiving a sample. Until next sample it works as an open-system The PID controller 24 8
Numerical Approximation uk = Pk + Ik + Dk The PID controller 25 PID Pseudo-code The PID controller 26 Numerical approximation derivative format Goal: Evaluate variation in control variable uk= uk-1 + u uk= uk-1 + Kp(ek - ek-1) + Kp Ts /Ti ek + Kp Td /Ts (ek - 2 ek-1 + ek-2) Arranging terms: Ts = Sampling Time uk= uk-1 + Kp [(1 + Ts /Ti + Td /Ts) ek - (1 + 2 Td /Ts ) ek-1 + Td /Ts ek-2] The PID controller 27 9
Pseudo-code derivative form The PID controller 28 Pratical example Remove integral and derivative action. Create a small disturbance in the loop by changing the set point. Adjust the proportional, increasing and/or decreasing, the gain until the oscillations have constant amplitude. Record the gain value (Ku) and period of oscillation (Pu). The PID controller Open Loop (Feed Forward Loop) Determine the dead time, time for the response to change, and the ultimate value that the response reaches at steady-state, Mu, for a step change of Xo. The PID controller 10
Bibliography Summary: http://en.wikipedia.org/wiki/pid_controller Books on control: Feedback Control of Dynamic Systems - G.F. Franklin, J. Powell, A. Emami-Naeini Control System Design Lecture Notes for ME 155A - K.J. Astrom The PID controller 31 11