A Complete Engineering Guide to PID Controllers
How proportional, integral and derivative control work, why industrial loops use PID, and how to choose Kp, Ki and Kd without guessing.
A PID controller is a feedback law that looks at the gap between where a process is and where it should be, then writes a manipulated variable that tries to close that gap. The three terms — proportional, integral and derivative — are three operations on the same error signal, each with a distinct job, a distinct unit, and a distinct way of making a loop better or worse. Most industrial regulatory loops still use some subset of this law because it is cheap to implement and powerful enough for first-order-plus-dead-time processes, mildly nonlinear valves, and noisy transmitters.
The algorithm is simple. The engineering around it is not. Gain in the wrong units, derivative on a noisy PV, integral left running against a saturated valve, or an undocumented conversion between ISA and parallel form: those are why a “textbook PID” fails on a real skid. The advice below is what to do with Kp, Ki and Kd when the process will not sit still.
What a PID loop actually is
A closed loop is a contract between four pieces of equipment. A sensor reports the process variable (PV). A setpoint (SP) is what an operator, a recipe, or a cascade master wants. A controller computes a manipulated variable (MV), also called controller output (CO). An actuator — usually a valve, VSD or heater — applies that MV to a plant that then produces a new PV. Without feeding PV back against SP you have sequencing, not regulation.
PID is the most common law used to compute MV from that comparison. It is not a model of the plant. It only knows error, the history of error, and the rate at which error is changing. The same structure covers flow, temperature, pressure, composition and many motion loops. Feedback is not feedforward: feedforward uses a measured disturbance to preempt the error; feedback waits until the error exists.
The four signals that matter
Keep the names consistent:
- SP — the target, in engineering units or in percent of span.
- PV — the measurement, on the same scale as SP if you want a sane error.
- e — the error,
SP − PVin the usual process-control convention. - MV / CO — the controller output, typically 0–100% to a valve or a scaled analog to a drive.
A fifth quantity sits in the background: the plant. For most process loops a useful working model is first-order-plus-dead-time (FOPDT): a gain K, a time constant τ, and a delay θ. If you cannot sketch K, τ and θ, you are turning knobs, not tuning.
Direct and reverse action
The sign of the loop is not optional. Reverse-acting means an increasing PV must produce a decreasing MV. Direct-acting means the opposite, as on many pressure and level loops with fail-closed valves. Get the action wrong and the loop runs away; no amount of Kp reduction will save you. Mixing a reverse flag and a negative Kp copied from a simulation is a classic commissioning defect.
Error is not a suggestion: e = SP − PV
Everything the PID does starts from the error:
e(t) = SP(t) − PV(t)That definition is a convention, not a law of physics. Motion-control literature sometimes writes e = PV − SP. Industrial process controllers almost always use SP − PV and then apply reverse or direct action as a separate choice. Mix the two conventions and the “same” gains invert the loop. Kp has units of (MV units) / (error units). A gain of 1.5 on a 0–100% loop is not the same object as a gain of 1.5 on a 0–500 kPa pressure loop writing 4–20 mA. Normalising SP and PV to 0–100% before the PID keeps Kp comparable across loops.
Units, scaling and the hidden gain
Transmitter ranging is a gain. Recrange a 0–10 bar transmitter to 0–16 bar and leave the PID in percent-of-span, and you have reduced the apparent process gain by 10/16. Valve characterisation is another: a quick-opening trim near the seat is a different K from the same valve at 70% travel. PID can only be tuned around one operating point. Cascade scaling is the same trap: if the master writes engineering units and the slave PID expects percent, the slave error is garbage. Scale first, then close the loop.
The proportional term
Proportional action is instantaneous gain on the present error:
u_P(t) = Kp · e(t)If the error doubles, the P contribution doubles, immediately. There is no memory and no preview. Increase Kp and the loop reacts harder; decrease it and the loop becomes polite, then lazy. Stability sets an upper bound. For a delay-dominant plant, too much Kp produces oscillation. For a lag-dominant plant you can often take more gain, but noise and valve resolution become the limit before the Nyquist plot does.
Proportional band versus Kp
Older analog and many DCS faceplates still show proportional band (PB) in percent:
PB (%) = 100 / Kpwhen Kp is defined on a 0–100% error and 0–100% output. A PB of 50% means Kp = 2. When you transcribe a tuning sheet, look at the unit, not just the number. P also includes, in many implementations, a bias or manual reset u0 — the output when error is zero. On a P-only loop that bias is how you place the valve for the normal load. On a PI or PID loop the integrator eventually supplies it.
Why P-only leaves a standing offset
A self-regulating process needs a particular steady MV to hold a particular PV against a particular load. At equilibrium, MV is not free; it is dictated by the energy or material balance. A pure P controller can only produce that MV if there is a matching error:
MV_ss = u0 + Kp · e_ssIf the required MV_ss is not equal to u0, then e_ss cannot be zero. That leftover error is offset or droop. Raising Kp shrinks it for a given load change, but never removes it unless the required MV happens to equal the bias. On a surge tank you want level to droop as throughput changes. On a temperature loop that must hold a spec, offset is a defect. Integral action exists to manufacture the required bias while driving e_ss to zero.
A P-only loop on a self-regulating plant will always sit off-setpoint after a load change, unless the bias was already the exact MV the new load requires. That is not a tuning error. It is the algebra of a memoryless controller.
The integral term
Integral action accumulates error over time and turns that accumulation into extra MV:
u_I(t) = Ki · ∫ e(τ) dτAs long as error has a consistent sign, the integral grows, and the output keeps moving. At a new steady state the error is zero, the integral is constant, and that constant is the bias the plant needs. Ki has units of (MV units) / (error units · time). A larger Ki eliminates offset faster and will overshoot if you are greedy. In the ISA form below, the same idea is integral time Ti. Small Ti is aggressive reset; large Ti is sluggish reset. Ki = 0 (or Ti → ∞) disables the term. Too much reset on a slow temperature loop is a standard complaint. Too little reset on a flow loop leaves a stubborn offset. Sometimes the valve is stuck or the integrator is winding against a stop.
Reset time and the meaning of Ki
Two parameterisations dominate vendor screens:
Ti = Kp / Ki
Ki = Kp / TiTi is a time: under a constant error, the time the ISA controller would take for the integral contribution to match the proportional contribution. Technicians still say “repeats per minute” or “minutes per repeat”. If your DCS shows Ti in minutes and your simulation uses Ki in 1/seconds, a factor of 60 will quietly destroy the loop. Convert deliberately. Repeats-per-minute is the reciprocal of minutes-per-repeat: 0.5 repeats/min is Ti = 2 min, not Ti = 0.5 min.
Integral windup
When the actuator is at a stop — valve fully open, heater at 100% — the plant cannot respond to further increases in MV. Error can persist, so the integrator keeps adding. When the error finally reverses, it must unwind all of that stored charge before the MV even begins to leave the stop. The loop looks dead, then suddenly slams. That is integral windup. It happens on start-up against a constraint, on a cascade master whose slave saturates, and on a temperature loop sitting against a fully open steam valve while the batch is still cold.
Anti-windup stops the integral from accumulating when the output is limited:
- Clamping — freeze the integrator while MV is at a limit and error would drive it further in.
- Back-calculation — a tracking loop pulls the integral back so the unsaturated PID matches the limited MV, with tracking time
Tt. - Conditional integration — integrate only when error and limited output agree in sign.
Back-calculation also handles external limits if you feed the actual applied MV back as the tracking signal. PID Solver 360 will at least let you see the wind-up signature: output pinned, PV still approaching, then a delayed overshoot when the load finally lets go.
The derivative term
Derivative action looks at how fast the error is changing:
u_D(t) = Kd · de/dtIf error is growing, D adds a kick in the correcting direction before the error gets large. If error is already shrinking, D eases off, which is why a well-judged Kd can cut overshoot on a laggy loop. On a noisy flow PV it amplifies transmitter hiss into valve chatter. Kd has units of (MV units · time) / (error units). In ISA form the same knob is derivative time Td, with Td = Kd / Kp. Td = 0 is PI. Many process loops should stay there.
Derivative kick
Suppose D is computed on e = SP − PV, and the operator steps the setpoint. de/dt contains an impulse. The derivative term fires a spike into the MV — derivative kick — even though the PV has not moved. The standard fix is to put derivative on PV only, or equivalently to use setpoint weighting γ = 0 on the D channel. Then SP steps affect P and I, not D. A load that slams the PV produces a real dPV/dt, and D should react. The pathology is differentiating a discontinuous SP.
Noise, filtering and why D is often left at zero
Differentiation amplifies high frequency. A PV with 0.2% peak-to-peak noise, sampled fast, can produce a derivative term that dominates the MV even when Kd looks modest. The engineering response is a derivative filter, usually a first-order lag with time constant Tf or a factor N where Tf = Td / N and N is typically 8 to 20. Too little filtering and D is unusable. Too much and you have delayed the derivative until it is just a laggy P. If you cannot see a clean PV slope on a trend at the scale of Td, leave Kd at zero and spend the effort on Kp and Ti.
Controller forms: parallel versus ISA
Vendors do not all implement the same equation. Two forms appear constantly, plus a series (interacting) form from older analog hardware.
Parallel (independent, academic) form:
u(t) = Kp · e + Ki · ∫ e dt + Kd · de/dtThe three gains are independent. Zeroing Kp does not kill I or D. This is convenient in optimisation and in simulation libraries.
Ideal / ISA (dependent) form:
u(t) = Kp [ e + (1/Ti) ∫ e dt + Td · de/dt ]Here Kp scales all three channels. Ti and Td are times you can relate to the process τ. Most DCS PID blocks are ISA or a close relative. Published Ziegler–Nichols, Cohen–Coon and many IMC tables assume this structure unless they say otherwise. The series (interacting) form is a PI in series with a PD and is not identical to ISA for the same numbers. “Non-interacting” on a sheet means ISA or parallel, not series.
Converting Kp, Ki, Kd to Kp, Ti, Td
For the parallel and ISA forms to represent the same linear law (no setpoint weights, no filter), the conversions are:
Ti = Kp / Ki
Td = Kd / Kpand the inverse:
Ki = Kp / Ti
Kd = Kp · TdThese identities assume Kp ≠ 0. Independent parallel form can run I-only (Kp = 0, Ki > 0) without dividing by zero. Never convert by eyeball. A loop with Kp = 1.2, Ki = 0.4 s⁻¹, Kd = 0.6 s is Ti = 3 s and Td = 0.5 s, not Ti = 0.4 and Td = 0.6. After conversion, simulate both forms. If the step responses disagree, you converted the wrong form or forgot the derivative filter.
If a tuning report lists three numbers and does not say whether they are
Kp, Ki, KdorKp, Ti, Td, and in which units, the report is incomplete. Do not commission from it.
A free browser calculator such as PID Solver 360 forces the form into the open: you see Kp, Ki, Kd together with the equivalent Ti and Td, and you can switch structure without doing the algebra during a shutdown.
Setpoint weighting (two degrees of freedom)
A one-degree-of-freedom PID treats SP and PV symmetrically: e = SP − PV feeds P, I and D. That is rarely what you want. Setpoint weighting, or 2DOF PID, uses:
e_P = β · SP − PV
e_I = SP − PV
e_D = γ · SP − PVTypical industrial choices are β between 0 and 1, and γ = 0 (derivative on PV). β < 1 reduces proportional kick on SP steps without weakening load rejection, because a load moves PV and e_P still sees it at full weight. Integral must keep β-independent error SP − PV or you reintroduce offset. Untouched β means β = 1.
Choosing the structure: P, PI, PD or PID
Use the simplest law that meets the specification. Extra terms are extra ways to detune the loop.
| Structure | Typical use | Offset | Watch-outs |
|---|---|---|---|
| P | Inner cascade slaves, surge level, some pressure | Yes, by design | Bias must be right; noise still hits MV |
| PI | Flow, liquid pressure, many temperatures | No | Windup; too-small Ti on slow plants |
| PD | Servo/motion, some fast heaters with no sustained load | Yes | Noise; rare in process plants |
| PID | Slow temperature, composition, lag-dominant quality loops | No | Derivative kick, filtering, extra knobs |
P is correct when offset is acceptable or useful. Surge tanks are the textbook case: the vessel is a buffer, not a spec. Tight P on a secondary flow loop in cascade is also common; the master integrator removes the slave’s offset.
PI is the default for most process loops. Flow loops are almost always PI: they are fast, delay is modest, and derivative on a noisy dP transmitter is a gift to the valve vendor. If the spec is “no offset, no drama”, stop at PI.
PD appears in motion control and in a few heaters with no sustained load. In a process plant with changing throughput, PD without I will droop.
PID earns its third letter when the plant has significant lag, the PV is clean enough to differentiate, and overshoot actually matters. Jacketed reactors and well-filtered composition loops are candidates. Adding D because a method’s table printed a Td is not engineering.
Integrating processes (pure level, some gas pressure) need care: PI on an integrator is enough to destabilise if Ti is too small. P-only or PI with a very long Ti is the usual advice.
Digital implementation and sampling
Almost every PID you will commission is discrete. The continuous equations above are approximated at a sample period Ts:
I[k] = I[k−1] + Ki · e[k] · Ts
D[k] ≈ Kd · (e[k] − e[k−1]) / TsBackward Euler for I is the usual workhorse. Derivative is often filtered and sometimes computed on PV. The approximation is accurate when Ts is small compared with Ti, Td and the plant τ. Sampling too slowly is equivalent to adding delay. Sampling too quickly on a noisy PV makes the discrete derivative explode: dividing a 1-bit flicker by a tiny Ts is a large number. Match Ts to the loop. Regulatory process loops often live at 0.2–1 s; heater loops can be slower.
Aliasing is real. If the PV has oscillation above the Nyquist frequency of the PID, the controller sees a lie. Analog damping belongs in front of the sampler. Bumpless transfer is a discrete-time problem: freeze the integral on auto-to-manual so the reconstructed PID output equals the manual MV, and do not dump a P kick on the return to auto. If the PID runs before the analog input is updated, you are using last cycle’s PV.
Failure modes that look like “bad tuning”
Before you cut Kp in half, ask whether the loop is allowed to work.
- Wrong action or inverted valve — PV runs away from SP. Tuning will not fix a sign error.
- SP or PV in different units — the loop saturates instantly or never moves. Check ranges, not gains.
- Saturated MV — valve at 100% with PV still below SP is a utility problem. Windup makes recovery ugly.
- Stiction and dead band — square-ish hunting with a jumping valve. Repair the valve; derivative makes it worse.
- Sensor lag or a damped transmitter — you tuned a delay you installed, then raised
Kpuntil the real plant was unstable. - Interacting loops — two temperatures sharing a header fight. Tune the fast loop tight and the slow loop slower, or decouple.
- Form mismatch — ISA times loaded as parallel
KiandKd. Convert, then test. - Too much D on noise — MV chatters. Set
Td = 0, add a filter, or fix the measurement. - Too much I on a slow plant — overshoot and a slow swing. Lengthen
Ti. Check whether MV hit a limit. - Cascade broken — master in auto, slave in manual, or slave SP clamped so the master integrator winds.
- Split-range characterisation — a dead zone or a reversed segment. Plot MV against the actual actuator.
These are not exotic. They are the first hour of any loop that “won’t tune”. A bump-test method that outputs Kp, Ti, Td assumes a linear, unconstrained, correctly signed SISO loop. If that assumption is false, the method is inapplicable.
A practical workflow that does not start with guessing
Guessing Kp until the trend looks OK trains you to stop at the first non-disastrous response. Use a sequence that produces numbers you can defend.
- Define the job. Regulatory (hold PV under load) or servo (track SP)? Allowed overshoot, settling band, and MV wear.
- Confirm the hardware. Action, fail position, ranges, valve travel, transmitter damping, scan time. Move MV in manual. If PV does not move, stop.
- Choose P, PI or PID from the table above. Decide setpoint weighting and derivative on PV before you pick a number.
- Get a model or a bump. Step MV around the operating point. Fit
K,τ,θ(gain = ΔPV/ΔMV, delay, time to 63%). If the plant is integrating, fit a ramp rate instead. - Compute an initial tune with a named method (IMC/lambda, Cohen–Coon, or Ziegler–Nichols from a model). Convert into the exact form your block uses.
- Simulate the closed loop: SP step, load step, MV limits, noise. Look at overshoot, settling, IAE/ISE/ITAE, and MV travel. If D only amplifies noise, drop it.
- Download conservatively. Start detuned (larger λ, or reduced
Kp). Make small SP steps. Watch for saturation and the wrong sign. - Disturb the plant on purpose, lightly. A pretty SP step with a poor load response is a failed tune.
- Document form, units, `Ts`, action, β, γ, filters, and the model.
Lambda / IMC is the least superstitious starting point for FOPDT plants: you pick a closed-loop time constant λ (often around θ to 2τ) and the formulae give Kp and Ti, with Td if you use a PID-on-FOPDT rule. Ziegler–Nichols and Cohen–Coon are more aggressive; treat them as bounds, not gifts. If the valve cannot move as the method assumes, the overshoot prediction is fiction. Ultimate-gain tests need a very good reason on a running plant. If you must, use a relay (Åström–Hägglund) experiment with a tight amplitude.
Why closed-loop simulation belongs in the workflow
A plant is a poor notebook. Every SP step on a live heater costs energy, product, and attention. Simulation is where you throw away the obviously bad tunings — an unusable Td on noisy samples, an inverted ISA-to-parallel conversion, an integrator that saturates because the valve is already at 85%.
What to look at in a simulator is the same as on a historian, only cheaper:
- SP step: rise time, overshoot, settling, whether MV is violent.
- Load step: offset (none with I), recovery time, whether D helps or chatters.
- Constraint: MV hitting 0 or 100, then a delayed overshoot — windup, not “too much Kp”.
- Noise: MV standard deviation. Ugly in simulation is uglier on a sticky valve.
- Form switch: parallel versus ISA with converted parameters should overlay.
PID Solver 360 is a free browser calculator and closed-loop simulator: enter a plant, choose P/PI/PID, work in Kp, Ki, Kd or the ISA times, and watch overshoot, settling and error integrals before anyone touches the DCS. Compare a conservative IMC tune with a livelier chart method on the same FOPDT model. See why P-only leaves offset and why Kd on a noisy PV is a bad trade. Then take the numbers that survive simulation, detune them one notch, and only then download.
Simulation cannot invent a process gain you did not measure. Garbage K, τ, θ produce garbage Kp, Ti, Td with impressive plots. Choose the structure on purpose, name the form, convert the units, respect saturation and noise, and use a model plus a simulator so that Kp, Ki and Kd are calculated quantities rather than folklore.
Put this into practice — model your process, auto-tune it and check the stability margins.
Launch PID Solver 360