An interactive PID controller loads here. It needs JavaScript; the sections below explain everything it shows.
The output moves in proportion to the error: a big error, a big correction; a small error, a small one. On its own, proportional control leaves a small permanent error, the offset, because it needs some error to keep any output at all. Turn the gain up and the offset shrinks, but too much gain makes the loop overshoot and oscillate.
The integral action adds up the error over time. As long as there is any error at all, it keeps moving the output a little further, until the error is gone. That removes the offset. Too much integral action makes the loop slow to settle and liable to overshoot.
The derivative action looks at how quickly the error is changing and acts against it, like easing off the throttle as you come up to the speed you want. It helps a slow process settle without overshoot. Because it reacts to rapid change, it also reacts to noise, so it is used carefully, often only on slow temperature loops.
You want to drive at 80 km/h. P: the further below 80 you are, the harder you press the pedal. I: if you are still a little slow after a while, you press a little harder, and keep doing so until you reach 80. D: as you approach 80 quickly, you ease off early so you do not shoot past it.
Each action has a setting, and choosing them is tuning. A well-tuned loop answers a change quickly, settles with little overshoot and holds steady. A badly tuned one hunts, swinging up and down around the set point, or is so sluggish it never quite gets there.
Tuning means choosing three numbers: the gain, the integral time and the derivative time. Each one trades speed against stability, and a slow process with a delay in it, like most temperature loops, needs gentle settings.
| Setting | Too little | Too much |
|---|---|---|
| Gain | Slow, with a large offset | Overshoot, then hunting up and down |
| Integral (a shorter integral time is more) | The offset takes a long time to go | Overshoot and slow swings |
| Derivative | More overshoot on a slow loop | Jumpy output that reacts to noise |
A loop that hunts, swinging steadily either side of the set point, usually has too much gain or too much integral action for the delay in the process. Before retuning, check the obvious: a sticking valve or a faulty sensor makes a well-tuned loop hunt too.