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:
- A sensor measures the process variable (temperature, speed, pressure, etc.).
- The controller subtracts the measured value from the setpoint to get the error signal.
- The PID algorithm computes a control output from the P, I, and D terms.
- That output drives an actuator (valve, motor, heater) to correct the process.
- The cycle repeats continuously.
Error signal calculation
The error signal is simply:
where is the setpoint and 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: . It provides the fastest initial response to a disturbance or setpoint change.
Proportional gain
The proportional gain sets how aggressively the controller reacts to error.
- High : Faster response and shorter rise time, but risks oscillation and instability.
- Low : 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 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 :
- Increasing reduces rise time (the system reaches the setpoint faster).
- But it also increases overshoot (the system overshoots the setpoint before settling).
Tuning 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: . Its primary job is eliminating steady-state error.
Integral gain
The integral gain controls how quickly the accumulated error drives the output.
- High : Eliminates steady-state error faster but can introduce oscillations and degrade stability.
- Low : Slower correction of offset but more stable behavior.
In practice, is usually set smaller than 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: . It acts as a brake, damping the system before the error gets worse.
Derivative gain
The derivative gain sets the strength of this damping action.
- High : More aggressive damping, but amplifies sensor noise.
- Low : Less noise sensitivity, but weaker damping effect.
is typically the smallest of the three gains.

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 is standard practice).
- Differentiate only the measured output rather than the error to avoid derivative kick on setpoint changes.
- Keep modest and tune carefully.
PID tuning methods
Tuning means selecting , , and 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:
- Set and .
- Increase until the system oscillates with a consistent amplitude (marginally stable).
- Back off slightly.
- Gradually increase to eliminate steady-state error.
- Add 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:
- Set and .
- Increase until the system exhibits sustained oscillations (neither growing nor decaying).
- Record the ultimate gain (the value at this point) and the ultimate period (the period of the oscillations).
- Calculate PID gains using the Ziegler-Nichols table:
| Controller | |||
|---|---|---|---|
| P | — | — | |
| PI | — | ||
| PID |
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 and time constant 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 , time constant , and dead time .
- It uses a set of algebraic formulas (different for P, PI, and PID) to compute the gains from , , and .
- 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:
Standard (ISA) form:
In the standard form, is the integral time and is the derivative time. The relationship to the parallel form is and . The standard form is convenient because changing scales all three actions together.
Discrete-time PID
Digital controllers sample the error at intervals of seconds. The continuous integrals and derivatives are approximated numerically.
Positional form (computes the total output at each step):
Velocity (incremental) form (computes the change in output):
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 and (typically between 0 and 1) so the proportional and derivative terms see a weighted version of the setpoint:
- Setting reduces overshoot on setpoint changes without affecting disturbance rejection.
- Setting (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.

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 (). 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 (). 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 and 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 must be fast enough relative to the process dynamics (a common rule of thumb is ). 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.