Skip to content
You Start with one site
Amounts in Start with one site
Control Systems · Concept

PID control

One idea Intermediate 5 min read
Found this useful?

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.

Raise the gain?The gap becomes smaller and the loop starts to swing. It never closes.The P term
Add up the error?A term that keeps pushing until the error is exactly zero.The I term
Watch the rate?A brake that acts when the temperature moves fast.The D term

See it

Predict first

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?

See it: one step of the setpoint, three settings

Temperature after 20 minutes
Highest temperature
Highest heater output

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 = Kc × ( e + sum of e ÷ Ti + Td × rate of e )

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

The question

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
  1. Find the gain round the loop

    Controller gain × process gain = 8 × 0.5 = 4.

  2. Find the offset

    Offset = step ÷ (1 + loop gain) = 4 ÷ (1 + 4) = 0.80 °C. The tank settles at 49 − 0.80 = 48.2 °C.

  3. 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

More gain does not remove an offset. It makes the offset smaller, never zero, and it moves the loop toward swinging without end. Removing the offset is the job of the integral term.

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

Question 1

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?

Question 2

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?

Question 3

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.
Key points
  • 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.
Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.