PID Controllers

Design and tune PID controllers for desired system performance.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

PID action

A parallel ideal PID controller has C(s) = Kp + Ki/s + Kd s and acts on error e = r − y. Proportional action responds to present error, integral action accumulates error and derivative action responds to its rate. Their effects depend on the plant and loop; increasing a gain does not guarantee better performance. A realizable derivative commonly uses Kd s/(1 + Tf s), Tf > 0. Derivative on measurement avoids derivative kick from an abrupt reference step, and filtering limits high-frequency noise amplification.

Integral action and saturation

Integral action can remove constant steady-state error when the resulting loop is stable and not constrained by saturation. During actuator saturation, a naive integrator may continue accumulating error. Anti-windup methods such as conditional integration or back-calculation reduce this problem.

Worked example

For plant G(s) = 1/(s + 1) with unity negative feedback and PI controller C(s) = 2 + 1/s, loop transfer is (2s + 1)/[s(s + 1)]. The characteristic polynomial is s² + 3s + 1. Poles are (−3 ± √5)/2 = −0.382 and −2.618, both stable. For a unit-step reference, E(s) = (s + 1)/(s² + 3s + 1). The final-value theorem gives ess = lim sE(s) = 0 because its required pole condition holds. This is a zero-initial-condition linear calculation without actuator saturation.

Tuning approach

Start from a plant model or safe identification data, choose a target response and robustness, and test disturbances, noise, limits and uncertainty. Empirical tuning rules are starting points and may create aggressive responses; they are not permission to drive equipment into unsafe oscillation.

Quick check

  1. Which term removes constant offset in a suitable stable loop? Integral action.
  2. Which term is especially noise sensitive? Derivative action.
  3. Why use anti-windup? To handle accumulated integral action during actuator saturation.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?