P vs PI vs PID Control: Steady-State Error, Overshoot and Tuning

All three are feedback controllers that decide the manipulated variable from the error e between the setpoint and the controlled variable; they differ in how many terms they use. P control outputs an action proportional to the error, PI control adds the integral of the error, and PID control also adds the derivative of the error. P (proportional) handles speed of response, I (integral) removes steady-state error and D (derivative) suppresses overshoot and oscillation. For a plant without an integrator, P control alone leaves an error. PI control removes it, but the added phase lag makes oscillation more likely, and adding D helps suppress that oscillation.

AspectP controlPI controlPID control
Control lawu = Kp·eu = Kp·e + Ki∫e dtu = Kp·e + Ki∫e dt + Kd·de/dt
Steady-state error for a step setpoint (plant without an integrator)Remains: 1/(1 + K·Kp) for a first-order plant K/(Ts + 1)Becomes 0Becomes 0
Speed of responseFaster as Kp is raisedRaising the integral gain Ki speeds up the rise but increases overshootD adds damping, making it easier to raise the gain while keeping overshoot down
Overshoot and oscillationToo high a Kp makes the response oscillatory, and unstable for plants with large lagsThe integral adds 90° of phase lag, so it oscillates more easily than P controlThe derivative anticipates changes in the error and reduces oscillation
Simulator example (first-order plant with dead time, K = 1, T = 10 s, L = 2 s, Kp = 4)Steady-state error 0.2, overshoot about 30%With Ki = 0.4: steady-state error 0, overshoot about 30%Adding Kd = 4: steady-state error 0, overshoot about 7%
Noise sensitivityNoise is also multiplied by KpThe high-frequency gain is Kp, about the same as P controlThe derivative amplifies higher frequencies more, so it amplifies noise; it is combined with a low-pass filter (filtered derivative)
Actuator saturationNo integrator, so nothing winds up while the output is at its limitThe integral keeps accumulating while the output is held at its limit (integral windup); countermeasures such as stopping the integration are neededNeeds windup countermeasures like PI control; also watch for derivative kick when the setpoint changes suddenly
Tuning parameters and Ziegler-Nichols ultimate-gain starting valuesOne parameter, Kp: Kp = 0.5KuTwo, Kp and Ti (or Ki): Kp = 0.45Ku, Ti ≈ 0.83TuThree, Kp, Ti and Td: Kp = 0.6Ku, Ti = 0.5Tu, Td = 0.125Tu
Typical usesControl that tolerates a small error, and position control of plants that contain an integrator (no error remains for a step)Temperature, flow, pressure, motor speed and supply voltage; in practice, many control loops use PI without DTemperature and position control with large lags where overshoot must be kept down

Figures are typical orders of magnitude and vary by process generation and product.

When to use which

P control
When the plant contains an integrator (such as a motor's position) or a small steady-state error is acceptable. It is the simplest, with only Kp to tune.
PI control
When the steady-state error for constant setpoints and disturbances must be 0. It is robust to noise and easy to tune, so it is the standard choice in many loops for temperature, flow, speed and supply voltage.
PID control
When dead time or lags are large and PI control gives too much overshoot or oscillation. Put a low-pass filter on the derivative, and keep the D gain modest when the sensor is noisy.

FAQ

Why does P control alone leave a steady-state error?

Because the action is proportional to the error, an error must remain for the controller to keep outputting an action. Under P control with unity feedback, a first-order plant K/(Ts + 1) settles at K·Kp/(1 + K·Kp) with an error of 1/(1 + K·Kp); with K = 1 and Kp = 4, the final value is 0.8 and the error is 0.2. Raising Kp makes the error smaller but never 0, and raising it too far causes oscillation.

Why does PI control bring the steady-state error to 0?

The integral term keeps changing as long as any error remains, so it can only settle where the error is 0. Even with zero error, the value accumulated in the integral term keeps supplying the needed action. In exchange, the integral adds 90° of phase lag, so making it too strong (the integral time Ti too short) increases overshoot and oscillation.

What should I watch out for when adding D (derivative)?

The derivative amplifies higher-frequency components more, so it amplifies sensor noise. It is therefore implemented as a filtered derivative with a first-order low-pass filter that limits the high-frequency gain to about N times (N is often around 8 to 20). To prevent derivative kick, the jump in the action at the moment the setpoint steps, the derivative is also often applied only to the measurement rather than the error (PI-D control).

In what order should the gains be tuned?

The basic procedure is to raise Kp with P control alone until just before oscillation starts, then add I to remove the steady-state error, and add D if the overshoot is large. If the gain Ku at which proportional control sustains oscillation and the period Tu are known, the Ziegler-Nichols ultimate-gain method (for PID, Kp = 0.6Ku, Ti = 0.5Tu, Td = 0.125Tu) gives a starting point, but the resulting response is oscillatory, so the gains are then lowered from there.

Check your understanding

In a unity-feedback system the forward transfer function is G(s) = 9/(1 + 2s). Which of the following is the steady-state error for a step setpoint of size 1?

  1. A0
  2. B0.1
  3. CAbout 0.11
Show answer and explanation

Answer: B. 0.1

For a unity-feedback system, the steady-state error to a step is 1/(1 + Kp), where Kp = G(0) is called the position error constant. Here Kp = 9, so the steady-state error is 1/(1 + 9) = 0.1. In a system whose forward path has no integrator (a type 0 system), raising the gain makes the error smaller but not zero. To bring the error to zero, an integrator is added, for example with PI control.

A plant that contains no integrator (a type 0 system) is under proportional (P) control. Which of the following correctly describes the general change when the proportional gain Kp is increased?

  1. AThe steady-state error becomes smaller but not zero, and too large a gain makes the response oscillatory or unstable
  2. BThe steady-state error becomes exactly zero, and the response always stays stable without any oscillation, however large the gain is made
  3. CThe speed of response does not change, and only the steady-state error grows
Show answer and explanation

Answer: A. The steady-state error becomes smaller but not zero, and too large a gain makes the response oscillatory or unstable

Proportional control is the most basic control, producing a manipulated variable proportional to the error. Increasing Kp makes the response faster and reduces the steady-state error to a step, 1/(1 + Kp·K) where K is the steady-state gain of the plant, but with no error the manipulated variable would also be zero, so the error does not reach zero (offset). Raising the gain also reduces the phase margin and increases the overshoot, and a plant with a large lag becomes unstable. Integral action is added to remove the steady-state error.

Which of the following is the correct pair of the main purpose of adding integral (I) action in PI control and its side effect?

  1. AThe purpose is to remove high-frequency noise, and the side effect is a larger steady-state error
  2. BThe purpose is to remove the steady-state error to a constant setpoint or disturbance, and the side effect is a phase lag that makes the loop more prone to oscillation
  3. CThe purpose is to anticipate changes in the error, speeding up the response and suppressing overshoot, and the side effect is strong amplification of high-frequency noise
Show answer and explanation

Answer: B. The purpose is to remove the steady-state error to a constant setpoint or disturbance, and the side effect is a phase lag that makes the loop more prone to oscillation

Integral action accumulates the error over time into the manipulated variable, so it keeps changing the manipulated variable as long as any error remains and finally brings the steady-state error to zero. On the other hand, an integrator delays the phase by 90°, which reduces the phase margin and makes overshoot and oscillation more likely. The integral time Ti is therefore tuned so that it is not too short. Speeding up the response, suppressing overshoot and tending to amplify noise are features of derivative action.

  1. Which of the following is the correct pair of a property of derivative (D) action in PID control and a measure taken when implementing it?
  2. In PID control, which of the following prevents the manipulated variable from jumping sharply at the instant the setpoint is changed as a step (derivative kick)?
  3. In the Ziegler–Nichols ultimate sensitivity method, the gain is raised under proportional control alone until a sustained oscillation appears, and from that gain Ku and the period of oscillation Tu the PID parameters are set to Kp = 0.6Ku, Ti = 0.5Tu and Td = 0.125Tu. Which of the following are the values for Ku = 8 and Tu = 2 s?

Practice Control Engineering Basics questions

Key terms explained

PID control
Feedback control that sets the manipulated variable by adding a term proportional to the error e (P), a term proportional to the integral of the error (I) and a term proportional to the derivative of the error (D). It is written u = Kp(e + (1/Ti)∫e dt + Td·de/dt), where Kp is the proportional gain, Ti the integral time and Td the derivative time. The proportional term provides speed, the integral term removes the steady-state error and the derivative term suppresses oscillation. Its structure is simple, and it is used in most industrial control loops, for temperature, motors, power supplies, chemical processes and more.
Steady-state error
The difference between the setpoint and the controlled variable that remains after the response of a control system has settled; it is also called offset. In a unity-feedback system it is 1/(1 + Kp) for a step setpoint, where Kp = G(0) is the position error constant, and it does not become zero in a system with no integrator in the forward path (type 0). In a type 1 system, with one integrator, the steady-state error to a step is zero, and an error of 1/Kv (Kv is the velocity error constant) remains for a ramp setpoint. The integral action of PI control is used to remove this error.
Overshoot
The output going past its final value in a step response or similar, and also the maximum amount by which it does so. In control engineering it is expressed as a percentage of the final value; for a second-order system without zeros it is exp(−πζ/√(1 − ζ²)), determined by the damping ratio ζ alone. In feedback control systems, the smaller the phase margin, the larger the overshoot. In electronic circuits, the same word is used when a signal or voltage waveform temporarily exceeds its final level because of wiring inductance or reflections.
Integral windup
A phenomenon in which the integral term of a PID controller keeps accumulating the error and grows excessively while the manipulated variable is saturated at an upper or lower limit of the actuator. Even after the error changes sign, the manipulated variable stays saturated until the accumulated integral comes down, causing a large overshoot and a long oscillation. It is prevented by anti-windup measures such as conditional integration (clamping), which stops integrating during saturation, back-calculation, which feeds the difference between the values before and after limiting back into the integrator, and the use of the velocity form of PID.
Settling time
The time from applying a step input until the output enters a specified band around its final value (such as ±2% or ±5%) and stays within it. It describes the speed and the settling of a response together; for a second-order system the ±2% settling time is estimated at about 4/(ζωn) and the ±5% one at about 3/(ζωn). The ±2% settling time of a first-order system is about 3.9T, where T is the time constant. In specifications for A/D converters and op-amps, the time for the output to settle to a specified accuracy is also called the settling time.
First-order system
A system whose transfer function is G(s) = K/(1 + Ts), where K is the steady-state gain and T the time constant. Its output for a step input is K(1 − e^(−t/T)), reaching about 63.2% of the final value at t = T, about 95% at 3T and about 99.3% at 5T, with no overshoot. Many familiar systems, such as RC circuits, thermal systems and liquid-level systems, can be approximated in this form. In the frequency response, the gain falls at −20 dB/dec above the corner angular frequency 1/T.
Feedback control
Control that measures the controlled variable with a sensor, compares it with the setpoint and changes the manipulated variable to reduce the difference (the error). Because the signal goes around a loop, it is also called closed-loop control. It corrects deviations in the result whatever their cause, so it is robust to disturbances and plant changes, but it corrects only after an error appears, so there is a delay, and too high a gain leads to oscillation or instability. PID control is the typical example, widely used to control temperature, speed, voltage, position and more.

Related comparisons