Fiveable

🎛️Control Theory Unit 3 Review

QR code for Control Theory practice questions

3.4 PID controllers

3.4 PID controllers

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🎛️Control Theory
Unit & Topic Study Guides

PID controller overview

PID controllers combine three control actions to keep a process variable at a desired setpoint. The controller continuously calculates the error (the difference between the setpoint and the measured variable) and outputs a correction based on proportional, integral, and derivative terms. They're the most common controller type in industrial settings because they balance fast response, stability, and accuracy without requiring a detailed mathematical model of the plant.

Proportional, integral, and derivative terms

Each term addresses a different aspect of the error:

  • Proportional (P): Produces an output proportional to the current error. The bigger the error right now, the stronger the correction.
  • Integral (I): Accumulates past error over time. This eliminates steady-state offset that proportional control alone can't fix.
  • Derivative (D): Responds to the rate of change of the error, effectively predicting where the error is headed. This reduces overshoot and improves settling time.

Together, P handles the present, I handles the past, and D anticipates the future.

Feedback control loop

The PID controller sits inside a closed-loop feedback system. The loop works like this:

  1. A sensor measures the process variable (temperature, speed, pressure, etc.).
  2. The controller subtracts the measured value from the setpoint to get the error signal.
  3. The PID algorithm computes a control output from the P, I, and D terms.
  4. That output drives an actuator (valve, motor, heater) to correct the process.
  5. The cycle repeats continuously.

Error signal calculation

The error signal is simply:

e(t)=r(t)y(t)e(t) = r(t) - y(t)

where r(t)r(t) is the setpoint and y(t)y(t) is the measured process variable. A positive error means the process variable is below the setpoint; a negative error means it's above. This signal is the sole input the PID controller uses to decide its control action.

Proportional control

Proportional control scales the output in direct proportion to the error: uP(t)=Kpe(t)u_P(t) = K_p \, e(t). It provides the fastest initial response to a disturbance or setpoint change.

Proportional gain

The proportional gain KpK_p sets how aggressively the controller reacts to error.

  • High KpK_p: Faster response and shorter rise time, but risks oscillation and instability.
  • Low KpK_p: Sluggish response, large steady-state error, but more stable.

Think of it as a volume knob for the controller's reaction. Turning it up makes the system more responsive but also more prone to ringing.

Steady-state error

Proportional control alone almost always leaves a residual offset between the setpoint and the actual value. Why? As the error shrinks, the proportional output shrinks too, so there's eventually not enough corrective force to close the remaining gap. Increasing KpK_p reduces this offset but can never fully eliminate it. That's the main motivation for adding integral action.

Rise time vs. overshoot

There's a fundamental trade-off with KpK_p:

  • Increasing KpK_p reduces rise time (the system reaches the setpoint faster).
  • But it also increases overshoot (the system overshoots the setpoint before settling).

Tuning KpK_p is about finding the right balance between speed and stability for your specific application.

Integral control

Integral control adds a term proportional to the accumulated error over time: uI(t)=Ki0te(τ)dτu_I(t) = K_i \int_0^t e(\tau)\,d\tau. Its primary job is eliminating steady-state error.

Integral gain

The integral gain KiK_i controls how quickly the accumulated error drives the output.

  • High KiK_i: Eliminates steady-state error faster but can introduce oscillations and degrade stability.
  • Low KiK_i: Slower correction of offset but more stable behavior.

In practice, KiK_i is usually set smaller than KpK_p to avoid destabilizing the loop.

Eliminating steady-state error

Even a tiny persistent error keeps getting integrated over time, so the integral term grows until the controller output is large enough to drive the error to zero. This is why integral action guarantees zero steady-state error for constant setpoints and step disturbances in a stable loop.

Windup phenomenon

Integral windup happens when the actuator saturates (hits its physical limit) but the integral term keeps accumulating error. When the system finally comes out of saturation, the bloated integral term causes large overshoots and slow recovery.

Common anti-windup strategies:

  • Clamping: Stop integrating once the output hits the actuator limits.
  • Conditional integration: Pause integration when certain conditions are met (e.g., actuator is saturated).
  • Back-calculation: Reduce the integral term based on the difference between the desired and actual actuator output.

Derivative control

Derivative control produces an output proportional to the rate of change of the error: uD(t)=Kdde(t)dtu_D(t) = K_d \frac{de(t)}{dt}. It acts as a brake, damping the system before the error gets worse.

Derivative gain

The derivative gain KdK_d sets the strength of this damping action.

  • High KdK_d: More aggressive damping, but amplifies sensor noise.
  • Low KdK_d: Less noise sensitivity, but weaker damping effect.

KdK_d is typically the smallest of the three gains.

Proportional, integral, derivative terms, PID controller - Wikipedia

Improving transient response

Derivative action shines during transients. When the error is changing rapidly (e.g., right after a setpoint change), the derivative term provides a strong corrective push that reduces overshoot and helps the system settle faster. It's especially valuable in systems with significant inertia or time delays, where the process tends to coast past the setpoint.

Noise amplification

The derivative of a noisy signal is even noisier. This is the biggest practical drawback of derivative control. A small amount of high-frequency sensor noise gets amplified into large, erratic control signals.

Mitigation approaches:

  • Apply a low-pass filter to the derivative term (a filtered derivative with time constant TfT_f is standard practice).
  • Differentiate only the measured output y(t)y(t) rather than the error e(t)e(t) to avoid derivative kick on setpoint changes.
  • Keep KdK_d modest and tune carefully.

PID tuning methods

Tuning means selecting KpK_p, KiK_i, and KdK_d so the closed-loop system meets your performance specs (rise time, overshoot, settling time, steady-state error). Several systematic methods exist.

Manual tuning

A common manual procedure:

  1. Set Ki=0K_i = 0 and Kd=0K_d = 0.
  2. Increase KpK_p until the system oscillates with a consistent amplitude (marginally stable).
  3. Back off KpK_p slightly.
  4. Gradually increase KiK_i to eliminate steady-state error.
  5. Add KdK_d if needed to reduce overshoot and improve settling.

This requires experience and patience. It works for simple systems or as a starting point before applying a more systematic method.

Ziegler-Nichols method

The Ziegler-Nichols ultimate gain method is one of the most widely taught tuning procedures:

  1. Set Ki=0K_i = 0 and Kd=0K_d = 0.
  2. Increase KpK_p until the system exhibits sustained oscillations (neither growing nor decaying).
  3. Record the ultimate gain KuK_u (the KpK_p value at this point) and the ultimate period TuT_u (the period of the oscillations).
  4. Calculate PID gains using the Ziegler-Nichols table:
ControllerKpK_pTiT_iTdT_d
P0.5Ku0.5 K_u
PI0.45Ku0.45 K_uTu/1.2T_u / 1.2
PID0.6Ku0.6 K_uTu/2T_u / 2Tu/8T_u / 8

These values tend to produce an aggressive response (quarter-decay ratio) and usually need further fine-tuning. The Ziegler-Nichols method also has an open-loop variant based on the process reaction curve (step response), where you extract the delay LL and time constant TT from the S-shaped response.

Cohen-Coon method

The Cohen-Coon method is based on fitting the open-loop step response to a first-order plus dead time (FOPDT) model with parameters: process gain KK, time constant τ\tau, and dead time θ\theta.

  • It uses a set of algebraic formulas (different for P, PI, and PID) to compute the gains from KK, τ\tau, and θ\theta.
  • It accounts for the dead-time-to-time-constant ratio, making it more suitable than Ziegler-Nichols for processes with moderate dead time.
  • It generally produces more conservative (less oscillatory) tuning than Ziegler-Nichols.

PID controller design

Continuous-time PID

The continuous-time PID controller has two common forms:

Parallel (ideal) form:

u(t)=Kpe(t)+Ki0te(τ)dτ+Kdde(t)dtu(t) = K_p \, e(t) + K_i \int_0^t e(\tau)\,d\tau + K_d \frac{de(t)}{dt}

Standard (ISA) form:

u(t)=Kp(e(t)+1Ti0te(τ)dτ+Tdde(t)dt)u(t) = K_p \left( e(t) + \frac{1}{T_i} \int_0^t e(\tau)\,d\tau + T_d \frac{de(t)}{dt} \right)

In the standard form, TiT_i is the integral time and TdT_d is the derivative time. The relationship to the parallel form is Ki=Kp/TiK_i = K_p / T_i and Kd=KpTdK_d = K_p \cdot T_d. The standard form is convenient because changing KpK_p scales all three actions together.

Discrete-time PID

Digital controllers sample the error at intervals of TsT_s seconds. The continuous integrals and derivatives are approximated numerically.

Positional form (computes the total output at each step):

u(k)=Kpe(k)+KiTsj=0ke(j)+KdTs(e(k)e(k1))u(k) = K_p \, e(k) + K_i T_s \sum_{j=0}^{k} e(j) + \frac{K_d}{T_s} \big(e(k) - e(k-1)\big)

Velocity (incremental) form (computes the change in output):

Δu(k)=Kp(e(k)e(k1))+KiTse(k)+KdTs(e(k)2e(k1)+e(k2))\Delta u(k) = K_p \big(e(k) - e(k-1)\big) + K_i T_s \, e(k) + \frac{K_d}{T_s} \big(e(k) - 2e(k-1) + e(k-2)\big)

The velocity form is preferred in practice because it avoids integral windup naturally and makes bumpless transfer between manual and automatic modes straightforward.

Setpoint weighting

Standard PID applies the full setpoint to all three terms. Setpoint weighting introduces factors bb and cc (typically between 0 and 1) so the proportional and derivative terms see a weighted version of the setpoint:

u(t)=Kp(br(t)y(t))+Ki0t(r(t)y(t))dτ+Kdddt(cr(t)y(t))u(t) = K_p \big(b\,r(t) - y(t)\big) + K_i \int_0^t \big(r(t) - y(t)\big)\,d\tau + K_d \frac{d}{dt}\big(c\,r(t) - y(t)\big)

  • Setting b<1b < 1 reduces overshoot on setpoint changes without affecting disturbance rejection.
  • Setting c=0c = 0 (common practice) eliminates derivative kick when the setpoint steps.
  • The integral term always uses the full error to ensure zero steady-state error.

This gives you two degrees of freedom: one for setpoint tracking, one for disturbance rejection.

PID controller limitations

Nonlinear systems

PID controllers are based on linear control theory. They work well near a single operating point, but nonlinear systems (with varying gains, dead zones, or saturation) can cause the fixed PID gains to perform poorly across the full operating range. Workarounds include gain scheduling (switching PID parameters based on operating conditions), adaptive PID, or switching to a nonlinear control strategy entirely.

Time-delay systems

Significant dead time (transport delay) between the control action and the process response introduces phase lag that degrades PID performance. Large delays relative to the process time constant make the system prone to oscillation. Specialized techniques like the Smith predictor effectively remove the dead time from the feedback loop, allowing more aggressive tuning.

Proportional, integral, derivative terms, Proportional–integral–derivative controller - Wikipedia

Noise sensitivity

As discussed under derivative control, sensor noise is a persistent practical issue. The derivative term amplifies high-frequency noise, and even the proportional term can produce jittery output if the measurement is noisy. Derivative filtering, proper sensor selection, and signal conditioning are all part of a robust PID implementation.

PID controller applications

Industrial process control

PID controllers regulate temperature, pressure, flow rate, and level in chemical reactors, distillation columns, heat exchangers, and similar equipment. For example, a PID loop on a heat exchanger adjusts the steam valve position to maintain the outlet temperature at a specified setpoint despite varying inlet conditions.

Motor speed control

PID controllers maintain constant motor speed under varying loads. In a DC motor drive, the controller adjusts the armature voltage based on the difference between the desired and measured speed. This is standard in robotics, CNC machine tools, conveyor systems, and electric vehicles.

Temperature regulation

HVAC systems, industrial ovens, furnaces, and laboratory incubators all rely on PID temperature control. The controller modulates heating or cooling elements to hold a stable setpoint, which is critical in processes like semiconductor fabrication or food processing where tight temperature tolerances matter.

PID controller variations

PI controller

A PI controller drops the derivative term (Kd=0K_d = 0). This avoids noise amplification while still eliminating steady-state error. PI control is the most common configuration in process industries, where dynamics are relatively slow and noise on the measurement signal is a concern.

PD controller

A PD controller drops the integral term (Ki=0K_i = 0). It provides fast response and good damping but accepts a steady-state offset. PD control is common in motion control and position servos, where the system naturally integrates (a motor's position is the integral of its velocity), so the plant itself provides the integral action.

Two-degree-of-freedom PID

A 2DOF PID controller separates the setpoint-tracking and disturbance-rejection objectives. It introduces extra parameters (like the setpoint weights bb and cc discussed earlier, or entirely separate filter paths for the reference signal) so you can tune the response to setpoint changes independently from the response to load disturbances. This is particularly useful when you want tight disturbance rejection but smooth, low-overshoot setpoint tracking.

PID controller implementation

Analog PID controllers

Analog PID controllers use op-amp circuits with resistors and capacitors to realize each control action. The proportional gain is set by a resistor ratio, the integral by an RC integrator, and the derivative by an RC differentiator. These provide truly continuous control with very low latency, but parameter changes require physical component adjustments.

Digital PID controllers

Digital PID controllers run the PID algorithm in software on a microprocessor, microcontroller, or DSP. The sampling period TsT_s must be fast enough relative to the process dynamics (a common rule of thumb is TsTu/10T_s \leq T_u / 10). Digital implementation offers easy parameter tuning, data logging, and communication with supervisory systems, making it the dominant approach today.

PLC-based PID control

Most modern PLCs include built-in PID function blocks. You configure the gains, setpoint, and I/O connections within the PLC programming environment. This integrates naturally with the rest of the plant's automation logic (sequencing, interlocks, alarms). PLC-based PID is standard in factory and process automation because of its reliability, scalability, and ease of maintenance.