The feedback loop

A PID controller continuously compares the process variable (PV) — measured temperature, pressure, flow, or level — with the setpoint (SP). The difference is the error. The controller computes an output (CV) that drives the final control element, typically a valve or a drive, to reduce the error.

The output is the sum of three terms: proportional, integral, and derivative. Each term responds to a different aspect of the error.

Proportional: the present

The proportional term produces an output proportional to the current error:

P = Kp × error

If the PV is 5 units below the setpoint and Kp is 2, the output moves 10 units in the corrective direction. The larger Kp, the more aggressively the controller reacts. A purely proportional controller, however, almost never lands exactly on the setpoint — at steady state it needs a persistent error to hold the valve at a non-zero position. That residual difference is called offset.

Integral: the past

The integral term accumulates error over time:

I = Ki × ∫ error dt

It keeps "pushing" as long as an error exists, which eliminates offset. This is why every process loop needs integral action: it is the term that eventually drives the PV to the setpoint. The trade-off is that integral action can overshoot and, if too strong, cause slow oscillation or "integral windup" when the actuator saturates.

Derivative: the future

The derivative term responds to the rate of change of the error:

D = Kd × (d error / dt)

It acts like a brake: when the error is closing quickly, derivative reduces the output to prevent overshoot. In practice, derivative is used sparingly — it amplifies measurement noise, so it is often disabled on noisy or slow process variables.

Tuning and practical limits

Tuning is the process of choosing Kp, Ki, and Kd. There are systematic methods — Ziegler–Nichols, Cohen–Coon, and model-based tuning — but the mental model matters more than the formula:

  • Raise Kp for a faster response, watch for oscillation.
  • Raise Ki to remove offset, watch for overshoot and windup.
  • Raise Kd to damp overshoot, watch for noise amplification.

Every loop is a compromise between speed and stability. A well-tuned loop holds setpoint with minimal oscillation; an over-tuned loop oscillates forever; an under-tuned loop responds sluggishly.

Key point: Integral action removes offset, proportional gives responsiveness, derivative dampens overshoot. Most real loops run P + I; D is only added where the signal is clean.