A PID controller is a feedback controller that combines three actions—proportional, integral, and derivative—to regulate a measured quantity. It compares a desired value, called the setpoint, with the actual process output and calculates a corrective command from the resulting error. Proportional action responds to the present error, integral action accumulates past error, and derivative action responds to how rapidly a signal is changing. Controllers using only proportional–integral action are called PI controllers; these are especially common where derivative action offers little benefit or measurements are noisy.
PID control is a central technique in control theory and industrial automation. It regulates temperature, pressure, flow, liquid level, motor speed, and many other variables. Its importance comes from the combination of a compact mathematical structure, relatively modest computational requirements, and useful performance across a wide range of processes. PID functions appear in standalone instruments, programmable logic controllers, distributed control systems, and embedded electronic devices.
A practical PID controller is more than a three-term equation. Its behavior depends on the chosen mathematical form, parameter tuning, measurement filtering, sampling, actuator limitations, and interactions with other control loops. Effective implementations therefore combine the basic control law with features such as output limiting, anti-windup, setpoint weighting, and controlled transfer between manual and automatic operation.
Historical development
PID control developed from efforts to mechanize the corrective behavior of skilled human operators. Long before electronic controllers, mechanical governors regulated the speed of engines by adjusting their energy input. The centrifugal governor associated with James Watt and the steam engine was an important predecessor, although it was not a modern three-term controller. Such devices established the practical importance of feedback while also exposing difficulties involving oscillation, friction, and changing operating conditions.
The mathematical treatment of governors advanced during the nineteenth century. James Clerk Maxwell’s 1868 paper “On Governors” analyzed the stability of governing mechanisms using differential equations. This work helped establish that a feedback mechanism could oscillate or become unstable even when each component appeared to act in the intended corrective direction. The distinction between providing corrective action and ensuring stable overall behavior became fundamental to later controller design.
Two developments in the early twentieth century are closely associated with three-term control. Nicolas Minorsky’s 1922 analysis of automatic ship steering described control actions related to heading error, its accumulation, and its rate of change. His work connected mathematical analysis with observations of human helmsmen. Independently, industrial process-control practice developed around pneumatic and mechanical instruments. These instruments translated pressure signals, bellows motion, restrictions, and mechanical linkages into proportional, reset, and rate actions—the industrial names historically associated with proportional, integral, and derivative behavior.
Commercial three-term pneumatic controllers became established during the 1930s. Their parameters were physical adjustments rather than software variables, and the controller’s mathematical form depended on the arrangement of its components. This history helps explain why several PID parameterizations remain in use. A setting described as “reset” may denote repeats per minute on one instrument and minutes per repeat on another; values cannot be transferred safely without understanding the convention.
In 1942, John G. Ziegler and Nathaniel B. Nichols published influential tuning methods based on process-response measurements and sustained closed-loop oscillation. These methods made controller adjustment more systematic, although their original settings can be aggressive for many processes. Electronic analog controllers subsequently supplemented pneumatic instruments, while digital control expanded with industrial computers, microprocessors, and distributed systems during the second half of the twentieth century. Digital implementation preserved the familiar three-term structure while making filtering, automatic tuning, diagnostics, and more elaborate handling of constraints easier to implement.
Control law and physical interpretation
The controller receives a setpoint and a measured process output . Their difference is the control error,
A common ideal, parallel-form PID law is
where is the controller output, is a bias, and , , and are the proportional, integral, and derivative gains. The output may represent a valve-opening command, heater power, motor torque reference, or another input to an actuator. The controlled equipment is conventionally called the plant or process.
Proportional action produces an immediate correction proportional to error. If the error doubles, the proportional contribution doubles. In a heating loop, a larger temperature deficit therefore produces a larger heating command. Proportional action alone commonly leaves a steady offset after a constant disturbance: some nonzero error is needed to sustain the corrective output. This is not universal, because a plant with its own integrating dynamics can have different steady-state properties.
Integral action changes the command for as long as an error persists. A small, sustained error can consequently produce a substantial correction. At a stable, reachable equilibrium, integral action can maintain a nonzero output while the error is zero, removing the offset that would otherwise be needed to sustain proportional action. Mathematically, the integral stores the accumulated error; physically, it gives the controller a memory. That memory also creates difficulties when the actuator cannot deliver the requested command.
Derivative action responds to the rate of change rather than merely the magnitude of the error. It can provide damping by reducing a command when the measured output is approaching the setpoint rapidly. The derivative is sometimes described as predictive, but it does not explicitly forecast disturbances or reconstruct a full process model. It extrapolates local signal behavior, and its usefulness depends strongly on measurement quality and process dynamics.
The gains have different dimensions. If is expressed as percent heater output and in kelvins, then has units of percent per kelvin, of percent per kelvin-second, and of percent-seconds per kelvin. Numerical gains therefore depend on signal scaling and time units. A controller using normalized signals can require very different numerical settings from one using engineering units even when the physical behavior is identical.
The sign convention also matters. The gains must be selected with the process direction in mind: opening a heating valve may raise temperature, whereas opening a cooling valve may lower it. Terms such as “direct acting” and “reverse acting” are used in industrial instruments, but their exact interpretation must be read together with the manufacturer’s error and output conventions.
Closed-loop dynamics and stability
PID control normally uses negative feedback: an increase in the measured output produces an action tending to oppose that increase. Nevertheless, negative feedback does not guarantee stability. Delays and dynamic lags can cause the corrective action to arrive too late, reinforcing rather than suppressing an oscillation. Controller design therefore concerns the behavior of the complete loop, including the process, actuator, sensor, filters, and communication delays.
For a linear time-invariant system, analysis commonly uses the Laplace transform. With zero initial conditions, the ideal PID controller has the transfer function
If the plant transfer function is , the open-loop transfer function under unity feedback is . The closed-loop response from setpoint to output is
The roots of the characteristic equation determine the closed-loop poles. For a finite-dimensional continuous-time rational model, asymptotic stability requires the relevant closed-loop poles to lie in the left half of the complex plane. Unstable hidden modes or cancellations require additional care beyond inspecting a reduced input–output expression.
The complementary relationship between tracking and disturbance rejection appears through the sensitivity function,
For an additive disturbance at the plant output, the disturbance-to-output response is . Large low-frequency loop gain can therefore reduce slowly varying disturbances. Integral action increases loop gain near zero frequency, explaining its ability to remove steady error to constant references or disturbances when the closed loop is stable and the required operating point is attainable.
The same settings that improve one feature may worsen another. Increasing proportional gain often makes the response faster, but can reduce stability margins. Increasing integral action removes offsets more quickly, but adds phase lag and may produce overshoot. Derivative action can add phase lead over a useful frequency range, although practical filtering limits its high-frequency behavior. These are tendencies, not universal rules: plant zeros, resonances, delays, and actuator dynamics can change the outcome.
A simple example is a first-order process,
controlled by . Its characteristic polynomial is
The equation shows directly how controller settings alter the closed-loop dynamics. Adding a transport delay changes the problem substantially because the delay contributes frequency-dependent phase lag. Bode plots and the Nyquist stability criterion help assess stability and robustness across frequencies. Practical tuning seeks adequate margins against modeling errors, not merely stability for one nominal model.
Controller forms and parameter conventions
The name “PID” does not identify a unique equation. Different instruments and software libraries implement different structures, and equivalent-looking parameter names may have different meanings. Three important distinctions concern parallel versus dependent gains, noninteracting versus interacting structures, and the treatment of setpoint changes. These distinctions are especially important when replacing a controller or transferring settings between platforms.
In the parallel form, the three gains are independent coefficients:
A widely used alternative is the ideal or dependent form,
For this particular unfiltered structure, the conversion is
Here is the integral time and is the derivative time. Increasing weakens integral action, whereas increasing strengthens it. Confusing integral time with integral gain therefore reverses the intended adjustment.
Older industrial controllers may express proportional action as a proportional band. With consistently normalized input and output spans, proportional band in percent is commonly related to dimensionless gain by
A smaller proportional band means stronger proportional action. Integral action may likewise be specified as reset rate, such as repeats per minute, rather than time per repeat. Unit conversion is essential: an integral time entered in seconds differs by a factor of 60 from the same numerical value entered in minutes.
An interacting or series-form controller can be written as
Expanding the product gives
The derivative-time adjustment therefore changes the effective proportional contribution as well. Copying , , and directly into a noninteracting controller generally does not reproduce the same response. Derivative filters introduce further differences between implementations.
Another variation is the two-degree-of-freedom controller, which weights setpoint changes separately from feedback:
The weights and affect the response to setpoint changes without altering the feedback terms acting on the measured output. A common choice is , placing derivative action only on the measurement. A value of can reduce proportional response to abrupt setpoint changes. P, PI, PD, and PID configurations are thus members of a broader family whose practical behavior depends on signal routing as well as gain values.
Tuning methods and performance criteria
Tuning is the selection of controller parameters to obtain an acceptable balance among tracking, disturbance rejection, stability, noise sensitivity, and actuator activity. There is no universally best setting. A furnace may prioritize low overshoot and restrained valve movement, whereas a motion-control system may prioritize fast tracking. Tuning also depends on whether the dominant operating requirement is following changing setpoints or maintaining a fixed operating point against disturbances.
The classical Ziegler–Nichols method includes a closed-loop procedure based on ultimate gain. With integral and derivative action disabled, proportional gain is increased until the loop exhibits sustained oscillation. The gain at that condition is , and the oscillation period is . One familiar set of classical PID settings, expressed in ideal-form parameters, is
These settings are historically important, but they often produce substantial overshoot and oscillatory behavior. Deliberately approaching sustained oscillation is also unsuitable for processes in which instability could damage equipment or compromise process safety.
Open-loop response methods instead identify process behavior from an input change. A common approximation is a first-order-plus-dead-time model,
where is process gain, is a time constant, and is effective delay. Tuning rules use these parameters to determine suitable gains. A process whose delay is large relative to its time constant generally permits less aggressive feedback than one with little delay. Model-based methods often include an explicit desired response time, providing a clearer adjustment between speed and robustness than a fixed tuning table.
Automatic tuning can estimate process dynamics through controlled excitation. Relay autotuning, associated with work by Karl Johan Åström and Tore Hägglund in the 1980s, temporarily replaces the linear controller with a switching element to induce an oscillation. For an ideal symmetric relay of amplitude , producing an approximately sinusoidal output oscillation of amplitude , a describing-function estimate gives . This is an approximation; hysteresis, asymmetry, disturbances, and nonlinear process behavior affect the estimate.
Performance can be assessed using rise time, settling time, overshoot, steady-state error, and stability margins. Integral measures are also common, including the integral of absolute error,
and the integral of time-weighted absolute error,
The second penalizes persistent late error more strongly. Numerical optimization can minimize such criteria, but minimizing tracking error alone may produce excessive control movement or inadequate robustness. Meaningful tuning therefore includes actuator limits, measurement noise, plausible process variation, and the expected disturbance pattern rather than relying on a single idealized step response.
Measurement noise, filtering, and derivative action
An ideal derivative has gain proportional to frequency. For a sinusoidal measurement component of angular frequency , derivative action multiplies its amplitude by . Small, rapidly varying measurement errors can therefore create large output fluctuations. This makes the ideal mathematical derivative unsuitable as a direct physical implementation and explains why derivative action is frequently omitted from noisy flow and pressure loops.
A practical derivative term uses a filter. One common form is
where is the filter time constant. At low frequencies the expression approximates a derivative, but at high frequencies its gain approaches the finite value . In an ideal-form PID, the denominator is often written , where specifies the ratio between derivative time and filter time. The value of and even its precise interpretation depend on the implementation.
Filtering creates a trade-off. Stronger filtering suppresses noise but introduces lag, reducing the useful phase lead supplied by derivative action. Filtering the entire measured signal also delays proportional and integral responses. Consequently, many controllers filter the derivative path separately, while using only as much general measurement filtering as the process requires. The appropriate arrangement depends on the signal’s signal-to-noise ratio, the desired control bandwidth, and the consequences of rapid actuator movement.
Applying derivative action to the error creates another problem: an abrupt setpoint step produces an impulsive derivative in the ideal equation. In a sampled, filtered controller, this appears as a large but finite output transient called derivative kick. Applying derivative action to the measured output avoids a kick caused solely by the setpoint change:
with practical filtering understood. This change preserves the derivative response to measured process motion while separating it from the reference jump.
Sensor placement can be as important as filtering. A temperature sensor far from a heater introduces transport delay; one too close may respond mainly to local heating rather than the temperature of the material being controlled. A pressure sensor connected through a long impulse line can introduce additional dynamics. Calibration establishes the relationship between indicated and physical values, but it does not eliminate lag, poor location, or dynamic distortion.
Quantization, intermittent updates, and isolated spikes also affect derivative estimates. A digitally reported position that changes in discrete increments may produce a noisy difference-based velocity estimate even when the actual motion is smooth. Better sensing, appropriately designed estimation, and suitable loop architecture can be more effective than increasing filtering indefinitely. PID tuning cannot recover physical information that the measurement system does not adequately capture.
Actuator limits, integral windup, and operating-mode changes
Real actuators have constraints. A valve cannot open beyond its travel limit, a heater cannot deliver negative power, and a motor drive has current and torque limits. Some devices also impose rate limits or contain dead zones and friction. The PID equation may request commands outside these physical capabilities, so the internal controller output and the actual plant input must be distinguished.
Integral windup occurs when integral action continues accumulating error while the actuator cannot supply the requested correction. Consider a heater operating at maximum power after a large temperature-setpoint increase. As long as the measured temperature remains below the target, an unrestricted integrator keeps increasing its contribution. When the temperature approaches the setpoint, the stored integral may still demand full heating, causing excessive overshoot and a slow recovery.
Clamping, also called conditional integration, is one anti-windup method. Integration is suspended when the output is saturated and the error would drive it farther into saturation, but remains active when it would help return the command to the usable range. Simply stopping all integration during saturation is less satisfactory because it can prevent the integral state from moving in the direction needed for recovery.
Back-calculation instead feeds the discrepancy between requested and available output into the integrator. If is the unrestricted controller output, is the limited output, and is the integral contribution, a common structure is
where is a tracking time constant. During saturation, the correction term pulls the integral state toward a value consistent with the achievable output. Its tuning matters: excessively fast tracking can interact poorly with other controller dynamics, while excessively slow tracking leaves substantial windup.
Output limiting is not the only source of windup. A downstream selector may choose another controller’s command; an actuator may be in manual mode; or a rate limiter may prevent the requested movement. External-reset feedback addresses such situations by tracking an appropriate downstream signal rather than merely the controller’s own internally limited output. The tracking signal must represent the relevant applied command and be integrated consistently with the system architecture.
Mode changes require related care. During manual operation, an operator directly sets the output. If automatic control resumes with an incompatible integral state, the output can jump. Bumpless transfer initializes or tracks controller states so that the automatic command initially matches the current operating command. With proportional and derivative contributions denoted and , an appropriate integral contribution at transfer is
This prevents a discontinuity caused solely by switching modes, although a deliberate setpoint change or pre-existing error may still cause subsequent movement. Reliable implementations handle manual operation, controller tracking, output limits, and startup initialization as parts of one consistent state-management scheme.
Digital implementation and numerical behavior
Most contemporary PID controllers execute as sampled algorithms. At sampling instant , software reads the measurement, calculates an error, updates internal states, and issues an output. The sampling interval becomes part of the controller’s dynamics. A continuous-time design cannot be transferred to software without considering numerical approximation, execution delay, and the way commands are held between updates.
A simple discrete integral update is
A trapezoidal approximation instead uses
These expressions approximate the same continuous integral but have different discrete-time frequency behavior. An unfiltered backward-difference derivative is
although a practical implementation normally includes filtering and often differentiates the measurement rather than the error.
For example, a filtered derivative on measurement can be approximated by
with
This follows from a backward-Euler approximation to the first-order filtered derivative. It illustrates how the previous derivative state, the new measurement increment, and the sampling interval jointly determine the result. Substituting an arbitrary smoothing coefficient without checking its relationship to changes the effective controller when the execution rate changes.
The positional form computes the full output from bias and the current P, I, and D contributions. The incremental or velocity form computes an output change, typically using differences among present and previous errors. Incremental forms can be convenient for some implementations, but they do not inherently eliminate windup. Saturation, state initialization, parameter changes, and output tracking still require explicit treatment.
Sampling should be fast enough to resolve the intended closed-loop dynamics, but there is no universal interval suitable for every process. Thermal systems may tolerate updates measured in seconds, whereas motor-current loops can require updates on a much shorter timescale. Excessively slow sampling adds delay and loses dynamic information. Faster sampling alone does not guarantee better control if measurements are stale, numerical differentiation is noisy, or the actuator cannot respond at the corresponding speed.
Timing determinism is also important. A controller task running under an operating system may experience scheduling jitter, and networked sensors may deliver delayed or irregular data. Designs can either maintain a well-controlled fixed period or account explicitly for elapsed time, with suitable treatment of state updates. Signal processing before sampling is needed to prevent high-frequency components from aliasing into the measured band; digital filtering cannot fully undo aliasing after it occurs. Numerical precision, overflow, output quantization, and invalid sensor values must likewise be addressed in the implementation rather than left to the ideal PID equation.
Cascade, feedforward, and industrial applications
PID controllers often operate as components within larger control structures. In cascade control, an outer controller sets the reference for an inner controller. The inner loop regulates a variable that responds more quickly or lies closer to the actuator. For example, an outer temperature controller may generate a steam-flow setpoint, while an inner flow controller adjusts a valve. A steam-supply disturbance can then be corrected by the flow loop before its full effect appears in the slower temperature measurement.
Cascade control depends on useful separation between loop dynamics. The inner loop must respond sufficiently faster than the outer loop for the outer controller to treat it as an effective subordinate system. Otherwise, the loops can interact strongly and provide little advantage. Inner-loop tuning, output limits, mode handling, and tracking behavior also affect the outer loop; saturation of the inner loop can require anti-windup measures in the outer controller.
Feedforward control adds action based on a measured reference or disturbance before the resulting output error develops. A furnace controller may adjust fuel input when material throughput changes, with PID feedback correcting modeling errors and unmeasured disturbances. Feedforward requires an estimate of how the measured disturbance affects the process and how the manipulated input can counteract it. It complements rather than replaces feedback because those estimates are imperfect.
In process control and chemical engineering, PI and PID loops regulate flow, pressure, vessel level, composition, and temperature. Flow loops often use PI control because they can be fast and measurement noise may make derivative action unattractive. Temperature loops may benefit from derivative action when they contain several significant lags and sufficiently clean measurements. Vessel-level control can deliberately be slow when the vessel is intended to absorb upstream flow variations rather than force immediate downstream compensation.
In electric motor drives and robotics, nested current, speed, and position loops are common. PI controllers frequently regulate motor currents, while outer loops generate torque, speed, or position references. Mechanical resonances, backlash, encoder resolution, and current limits strongly influence attainable performance. A seemingly simple position loop can therefore depend on substantial lower-level control and estimation.
Building systems apply PI or PID control to air-conditioning, heating, ventilation, and heat-pump equipment. Laboratories use it for ovens, environmental chambers, and experimental apparatus. Industrial plants may expose setpoints and measurements through supervisory control and data acquisition systems, but monitoring and supervisory communication are distinct from executing a fast feedback loop. Likewise, an ordinary process controller is not automatically a safety instrumented system; protective functions have separate architectural, reliability, and lifecycle requirements.
Operating-range limitations and advanced alternatives
PID control is most straightforward when a process can be adequately represented near an operating point by a stable or manageable dynamic model with one dominant manipulated input and one controlled output. Real processes often depart from these conditions. Their gain may change with production rate, fluid properties, temperature, or equipment configuration. A controller that is satisfactory in one regime can become sluggish or oscillatory in another even though its software and numerical settings remain unchanged.
Gain scheduling addresses predictable variation by changing controller parameters with measured operating conditions. A heating system may require different settings at low and high airflow, for example. Scheduling introduces its own design questions: transitions between parameter sets must avoid abrupt output changes, and the integral state may need adjustment to preserve continuity. Stable behavior at several fixed operating points does not by itself prove satisfactory behavior while the operating point changes.
Long delays impose a more fundamental limitation. If a corrective action takes substantial time to influence the measurement, the controller cannot obtain immediate feedback about its effect. Increasing gain to force a faster response may then create oscillation. Processes with inverse response present a related difficulty: the output initially moves opposite to its eventual direction after an input change. These characteristics constrain achievable feedback performance rather than merely indicating poor tuning.
Multiple-input, multiple-output systems introduce interactions that independent PID loops may not adequately manage. Adjusting one valve can change several pressures or compositions, while another controller acts on the same variables through a different path. Loop pairing, decoupling, and coordinated supervisory control can reduce these interactions. In demanding cases, model predictive control explicitly models coupled dynamics and calculates future control moves subject to constraints. Such systems often retain PI or PID controllers underneath them as fast, local regulatory loops.
Other limitations arise from the equipment rather than the control law. Valve stiction can create recurring cycles because the actuator fails to move until the command changes enough to overcome friction. Sensor drift can make the controller accurately regulate an incorrect indicated value. An undersized heater or pump cannot reach a setpoint beyond its capacity. Increasing integral action in these circumstances can worsen output saturation without correcting the underlying cause.
Evaluation therefore distinguishes tracking errors from hardware faults, disturbances, nonlinearities, and modeling errors. Useful operating records include the setpoint, measured output, requested command, actual actuator response, operating mode, and limit status. Tests across representative conditions reveal whether the dominant problem is insufficient damping, excessive delay, saturation, interaction, or measurement quality. For a loop involving hazardous equipment, such testing remains subject to the plant’s established operating procedures and protective systems; PID tuning does not substitute for independent safeguards.