PID control
On this page
A driver holding 80 km/h presses harder the further the speed is below 80, presses a little more if the car has stayed slow for a while, and lifts the foot early if the speed is rising fast. PID control is those three corrections added together: one for the error now, one for the error that has added up, and one for how fast it is changing.
See it
The controller of a tank heater uses only the proportional term, with a gain of 8. The setpoint is 49 °C, and the tank has settled at 48.2 °C. To close the gap, the operator doubles the gain to 16. What happens?
At time zero the setpoint of a hot water tank is raised from 45 °C to 49 °C. The tank is slow: it shows nothing for the first 40 s, and needs about five minutes to show most of a change in heater power. Change one slider at a time. A shorter integral time is stronger integral action. A longer derivative time is stronger derivative action.
The idea
A PID controller works on the error of a feedback loop: the setpoint minus the measurement. It adds three terms, and each has one job.
The proportional term pushes in proportion to the error now. It is fast, but alone it leaves a gap, the offset, because it gives extra output only while an error remains.
The integral term adds up the error over time. It moves the output until the error is exactly zero, so it removes the offset. Too much of it gives overshoot and a slow swing.
The derivative term acts on how fast the measurement is changing. It is a brake, and with it the gain can be higher. It also multiplies any noise in the measurement, so most loops in industry run without it.
u is the controller output, e is the error, Kc is the gain, Ti is the integral time, Td is the derivative time
One worked number
In a hot water tank, each 1% of heater power adds 0.5 °C. A proportional controller gives 8% of power for each °C of error. The setpoint is raised by 4 °C, from 45 °C to 49 °C. Where does the tank settle?
Show the worked solution, 3 steps
- Find the gain round the loop
Controller gain × process gain = 8 × 0.5 = 4.
- Find the offset
Offset = step ÷ (1 + loop gain) = 4 ÷ (1 + 4) = 0.80 °C. The tank settles at 49 − 0.80 = 48.2 °C.
- Check it with the heater
An error of 0.80 °C gives 8 × 0.80 = 6.4% more power, and 6.4 × 0.5 = 3.2 °C. From 45 °C that is 48.2 °C. The figure opens on this case.
The mistake to avoid
A second trap: the integral setting can be a time in seconds, a time in minutes, or a gain. The same number is strong action on one controller and weak action on another, so never copy a setting without the manual. The lesson on the three terms of PID control gives the conversions.
Check yourself
On a booster pump, each 1% of speed adds 0.10 bar. Its controller has only the proportional term, with a gain of 10% of speed for each bar of error. The setpoint is raised from 4.0 bar to 4.5 bar. Where does the pressure settle?
A tank holds steady at 1 °C below its setpoint, hour after hour. The heater is at 55% of its power. Which change removes the gap?
A pump holds its pressure well, but its speed shakes up and down several times a second. The pressure signal carries a small, fast ripple. Which term is the most likely cause?
Where you meet it
- Temperature controllersOvens, hot water tanks and moulding machines are slow and have clean signals, so all three terms are used.
- Variable speed drivesMost drives have a controller built in to hold a pressure or a flow, and it runs with the P and I terms only.
- Engine governorsA generator holds its speed as load is switched on and off.
- P acts on the error now. Alone it leaves an offset.
- I acts on the error added up. It removes the offset, and too much gives overshoot.
- D acts on the rate of change. It adds a brake, and it multiplies noise.
- More gain never removes an offset. Integral action does.
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.