Control

What do the P, I and D terms do in a PID controller?

Short answer

A PID controller's output is the sum of three terms. P (proportional) responds to the error right away. I (integral) accumulates the error over time and removes the steady offset. D (derivative) responds to how fast the error changes and reduces overshoot. Each term's effect is set by its own gain.

What each term does

A PID controller corrects the error e, the setpoint (SP) minus the process value (PV), in three ways: u = Kp·e + Ki·∫e dt + Kd·de/dt.

The proportional term (P) reacts in proportion to the error and acts quickly, but it does not drive the error to zero. The leftover error is called steady-state offset. The integral term (I) adds up the error over time and removes that offset, but if it is too strong it causes oscillation. The derivative term (D) looks at how fast the error is changing. It anticipates a rising error and reduces overshoot, but it also amplifies measurement noise, so it is usually filtered.

Example: a temperature loop

A furnace has a setpoint of 60 °C and a measured temperature of 55 °C (hypothetical). The error is e = 60 − 55 = 5 °C.

  • P term: with Kp = 2, 2 × 5 = 10 units
  • I term: with Ki = 0.5 (1/s), if the error stays at 5 °C for 4 seconds, ∫e dt = 5 × 4 = 20 °C·s, so 0.5 × 20 = 10 units
  • D term: the error is constant, so the derivative is zero, giving 0 units

The total change in output is 10 + 10 + 0 = 20 units. The I term keeps growing for as long as the error stays on one side of zero, so how long a constant error lasts sets how much the integral builds up.

Common mistakes

The first mistake is treating each term as an independent fix and raising all three together. A high Kp makes the loop oscillate, a high Ki increases overshoot and windup, and a high Kd passes noise to the output. The second mistake is using derivative without filtering. The third is letting the integral keep building while the output is saturated, for example with a fully open valve; anti-windup protection prevents this. Finally, raising the gain without knowing the process delay is risky. Measure the process response first with a step test.

Follow-up questions

Why not use D if PI is enough?

PI is a common, adequate structure for many pressure, level and flow loops. Their measurements are often noisy, and D would amplify that noise. On slow, delayed processes, such as some temperature loops, D can reduce overshoot. Decide with a loop test, not assumptions.

Where should the gain values start?

Methods such as Ziegler–Nichols give a starting point, but only that. Make adjustments at a safe operating point and in small steps. After each change, record the overshoot against a setpoint step, the settling time and the output movement.

Sources

Example numbers are hypothetical, not measured field results.

Related questions

All questions