Skip to content
You Start with one site
Amounts in Start with one site
Control, Measurement & Energy · Course

PID Control: What Each Term Does

Lesson 6 of 11 25 min read
Found this useful?

A controller shows three settings, and the water in the tank still sits one degree below the setpoint all day. Someone doubles the first number and the temperature begins to swing. Someone else copies the settings from another controller, which uses a different form of the same equation, and the loop becomes slow. Most loops that run badly have nothing wrong with the equipment: the three settings were changed without knowing what each one does. This lesson gives each term one clear job, shows its cost, and proves both on a simulated tank. #PIDControl #IntegralAction #ControllerSettings

Learning Objectives

By the end of this lesson, you will be able to:

  1. Explain what the proportional, integral and derivative terms each do to the controller output, and what each costs
  2. Calculate the steady offset that P-only control leaves on a self-regulating process
  3. Convert controller settings between ISA standard form and parallel form, and between gain and proportional band
  4. Describe controller action, bumpless change from manual to automatic, and derivative on measurement
  5. Decide when a PI controller is enough and when derivative action earns its place

Real-World System Problem: A Hot Water Tank That Stops Short of Its Setpoint



A wash line needs water at a steady temperature. An electric heater warms a tank, a sensor in the outlet pipe measures the temperature , and a controller sets the heater power between 0 and 100 percent. The process is slow: the temperature needs about five minutes to show most of the effect of a change in power, and the sensor sees nothing at all for the first 40 seconds.

PIDheater +tankeuyr(+)outlet-temperature[ temperature sensor ]
The temperature loop of the hot water tank

With a simple proportional controller the operator sets 49 °C and the tank settles at 48.2 °C. The controller is not broken: to hold the extra temperature the heater needs extra power, and a proportional controller gives extra power only while an error remains.

The operator could accept the offset, raise the setpoint to cheat it, or raise the gain until the offset is small and the loop nearly hunts. None is right. The right answer is a second term whose only job is to remove the offset, used with knowledge of its cost, and a third term that gives back some speed. Those three terms are the PID controller.

Fundamental Theory: The Three Terms of a PID Controller



One equation, three jobs

The controller works on the error , the setpoint minus the measured process variable . In ISA standard form the controller output is

where is the controller gain (in percent of output per unit of the process variable), is the integral time in seconds and is the derivative time in seconds. This course uses the ISA form unless it says otherwise.

D: rate of eI: sum of eP: e nowe(+)[xKc]u
Three terms act on the same error and are added

A short way to hold the three in mind: the P term acts on the error now, the I term acts on the error that has added up in the past, and the D term acts on where the error is going.

Proportional: push in proportion to the error

With the P term alone,

where is the bias, the output the controller gives when the error is zero. A larger error gives a larger push. A larger gives a larger push for the same error, so the loop responds faster.

The P term has one weakness. On a self-regulating process such as the tank, a new setpoint needs a new steady output. But the P term gives an output different from only while is not zero. So the loop settles where the remaining error is just large enough to hold the output that the new temperature needs. That remaining error is the offset.

Offset of P-only control

For a self-regulating process with process gain , after a setpoint step of size :

The offset shrinks as rises but never reaches zero, and the gain cannot rise without limit because the loop becomes unstable first.

A steady disturbance leaves an offset in the same way. An integrating process, such as a tank level, is different: it has no offset for a setpoint step under P-only control.

Proportional band

Many controllers do not show the gain. They show the proportional band, PB, in percent:

The proportional band is the change in the process variable, as a percentage of the transmitter span, that moves the output through its full range. A narrow band is a high gain. The common mistake is to treat the two as the same direction: raising PB lowers the gain.

To use the formula, first make the gain dimensionless. If the tank transmitter has a span of 0 to 100 °C, a gain of 8 percent per °C is 8 percent of output per 1 percent of span, so percent. An error of 12.5 °C moves the heater from 0 to 100 percent.

Integral: add up the error until it is gone

The I term adds up the error over time. While any error remains it keeps moving the output; it stops only when the error is exactly zero, and then holds the output it has reached. That removes the offset: at rest, the I term alone supplies the output the process needs, and the P term supplies nothing. Think of a leaking tank: while the level is below the mark you open the tap a little more, and at the mark you stop turning and leave the tap open.

The integral time has a direct meaning. Hold the error constant: the P term gives a step of , and the I term adds one more every seconds. A short is strong integral action. A long is weak integral action.

uI ramp: adds anotherKc x e every Ti secondsP step: Kc x eterror steps here
Output after a step of error: P jumps, then I ramps

The cost is stability. The integral responds late: it is still pushing because of old error when the process variable has already reached the setpoint. In frequency terms it adds phase lag to the loop. Integral action that is too strong (a short ) gives overshoot and a slow oscillation. A safe first value for a lag-dominant process is close to the process time constant .

Derivative: act on the rate of change

The D term gives an output in proportion to how fast the error is changing. When the process variable moves quickly toward the setpoint, the D term reduces the output before it arrives, like a driver who brakes on the approach to a stop line. This damping lets the gain be higher than it could be without it.

The derivative time also has a direct meaning: the P and D terms together act on a straight-line prediction of the error seconds ahead.

The cost is noise. Measurement noise is small but fast, and the D term multiplies fast changes: a pressure ripple that the P term barely passes can make the output shake. So every real controller filters the derivative, and many loops run with .

Derivative on measurement

A setpoint step changes the error instantly. The rate of change of a step is very large, so a D term that acts on the error sends a sharp spike to the final element at every setpoint change. This is called derivative kick.

Since and the setpoint is constant between changes, the rate of the error equals minus the rate of the measurement. Let the D term act on in place of :

P and ITd x rate of yr(+)e(+)u--y
Derivative on measurement: the D term never sees r

The response to a disturbance is the same as before, because a disturbance moves and not . Only the kick is removed. Most industrial controllers work this way by default, and the simulations in this lesson do too.

ISA form against parallel form

The same controller can be written with three independent gains. This is the parallel form, common in drives and in software libraries:

Settings: , , . The gain multiplies all three terms. Changing makes the whole controller stronger or weaker and leaves the two times as they are. Most process controllers and most tuning rules use this form.

Conversion between the two forms

Example: the ISA settings percent per °C, , are, in parallel form, percent per °C, percent per °C per second, and percent second per °C.

The common mistake is to copy numbers from one form into the other. Typing into a field that expects makes the integral action about 13,000 times too strong.

Controller action

The sign of the controller must match the process. On the tank, more heater power raises the temperature, so when the temperature rises above the setpoint the output must fall. This is reverse action, and with and a positive the equation above is already reverse acting. A cooling loop is direct acting: when the temperature rises the compressor output must rise, and the controller uses .

With the wrong action the feedback is positive: the output does not oscillate but runs to 0 or 100 percent and stays there. Confirm the action before a loop is first put in automatic.

Bumpless change from manual to automatic

In manual the operator sets the output directly. At the moment of the change to automatic, the controller output should begin from the value the operator left, with no jump. A controller does this by setting its integral term at the moment of the change:

The output then starts at and moves smoothly from there. Many controllers also set the setpoint equal to the process variable while in manual (setpoint tracking), so the error is zero at the change. A P-only controller has no integral term, so its bias must be set to the manual output in the same way.

When PI is enough and when D helps

Most loops in industry are PI. Pump, flow and pressure loops are fast, their signals carry ripple, and their response is already quick enough, so a D term adds wear at the final element and little else. Derivative earns its place on slow processes with a clean measurement, where a lag of minutes makes the loop sluggish. Slow temperature loops are the usual case. Even there, derivative helps less as the dead time becomes large against the time constant, because no prediction from the present rate can see through a long dead time.

Application 1: P, PI and PID on the Hot Water Tank



Step 1: Compute the P-only offset by hand

Click to reveal the offset calculation
  1. At rest the process gives and the controller gives , where means a change from the operating point. The error is . ✅

  2. Combine the three: , so

    The loop gain is 4, so one fifth of the step remains as offset. ✅

  3. The tank settles at . ✅

  4. Check with the heater: the output at rest is percent. The extra 6.4 percent raises the temperature by , from 45 to 48.2 °C. The two sides agree. ✅

Step 2: Confirm that the output does not saturate

Click to reveal the output check
  1. With derivative on measurement there is no kick, so at the instant of the step the output moves by the P term only: . ✅

  2. P: percent. PI: percent. PID: percent. ✅

  3. The integral term continues to raise the output during the 40 s of dead time, while the error is still the full 4 °C. The simulation gives the true peaks: 72.0, 67.2 and 84.5 percent. ✅

  4. All three stay inside 0 to 100 percent, so the linear behaviour of each controller is what the test shows. A step of 6 °C with the PID settings would begin at percent and saturate. ✅

Step 3: Simulate the loop with its dead time

Click to reveal how the simulation works
  1. Choose the time step. It must be small against the dead time: 0.5 s is 80 steps inside . ✅

  2. Model the dead time as a delay buffer: a list of 80 past output values. At each step the newest output goes in at one end, and the value that left the controller 40 s ago comes out at the other end and acts on the process. ✅

  3. Advance the first-order lag by one step with its exact solution: the temperature moves a fraction of the way toward the value that the delayed output would finally give. ✅

  4. Compute the controller each step: add to the integral term, compute the D term from the change in since the last step, add the three, and limit the result to 0 to 100 percent. ✅

  5. Start the integral term at 40 percent so that the output begins at the operating point (bumpless start). ✅

Step 4: Read the results

Click to reveal the measured response of each controller
  1. Results from the script in the next section:

    ControllerFinal value (°C)Offset (°C)Overshoot (percent)Settling time (s)Peak output (percent)
    P48.200.808.4213.572.0
    PI49.000.000.1216.567.2
    PID49.000.000.5125.084.5

    All three loops are stable and the three responses are clearly different. ✅

  2. P: the simulated offset is 0.80 °C, equal to the hand value. The response is quick but ends in the wrong place. ✅

  3. PI: the offset is gone. The gain had to come down from 8 to 6 to keep the response smooth, and the loop needs about the same time as P to settle. ✅

  4. PID: no offset, almost no overshoot, and a settling time of 125 s against 216.5 s for PI. The first heater move is 40 percent against 24 percent. ✅

Step 5: Check what the derivative term did

Click to reveal the check
  1. Run the PID settings again with , that is a PI controller with and . ✅

  2. Result: overshoot 14.7 percent and settling time 327.5 s. Without the D term the higher gain makes the loop ring. ✅

  3. So the speed of the PID response has two parts: the higher gain gives the speed, and the D term supplies the damping that makes the higher gain usable. ✅

  4. Check the final heater output. To hold 49 °C the tank needs percent. With zero error the P and D terms are zero, so the integral term alone holds 48 percent. The simulated output of the PI and PID runs ends at 48.0 percent. ✅

Application 2: Reading a Drive’s Parallel Gains on the Booster Pump



Step 1: Convert to ISA form

Click to reveal the conversion
  1. Gain: percent per bar. ✅

  2. Integral time:

    This equals the process time constant, a sensible value for a PI controller. ✅

  3. Derivative time:

    This is small against the dead time of 0.5 s. ✅

  4. Proportional band: 1 bar is 10 percent of the 10 bar span, so the dimensionless gain is and percent. ✅

Step 2: Say what each term does

Click to reveal the effect of each term
  1. P alone. The loop gain is . The offset for the 0.5 bar step is

    The pressure would settle at 4.27 bar, not 4.5 bar. ✅

  2. P and I. The integral removes the offset. The simulation gives no overshoot and a settling time of 8.1 s (band of bar). The speed rises from 60 percent to a final 65 percent, with a peak of 67 percent. ✅

  3. P, I and D. The simulation gives a settling time of 7.8 s, a gain of 0.3 s. The D term changes almost nothing in the response. ✅

  4. D and the ripple. A ripple of bar at 5 Hz has a peak rate of bar per second. The D term turns it into percent of speed. The P term passes only percent. ✅

  5. Conclusion: set . The D term triples the ripple in the speed reference and returns 0.3 s. ✅

Step 3: Check the gain against the stability limit

Click to reveal the check
  1. The exact ultimate gain of this pump under proportional control is 100.7 percent per bar. ✅

  2. The gain in use is 12 percent per bar, a factor of about 8 below that limit for the P term alone. The integral term reduces the margin somewhat, but the smooth simulated response with no overshoot confirms that the loop is far from hunting. ✅

Verify It in Python



The script simulates both loops with a delay buffer for the dead time and prints every number used above. It saves a plot of the temperature and the heater output for the four tank runs.

pid_terms_compare.py
import numpy as np
import matplotlib.pyplot as plt
def simulate(plant, r_new, Kc, Ti, Td, dt, t_end):
"""Closed loop of an FOPDT process with an ISA form PID controller.
Reverse acting, derivative on measurement, output limited 0 to 100.
Ti = None switches the integral off. Returns t, y, u."""
K, tau, theta, y0, u0 = plant
n = int(round(t_end / dt))
n_delay = int(round(theta / dt))
pipe = [u0] * n_delay # delay buffer: output still on its way
a = np.exp(-dt / tau) # exact step of the first-order lag
y, y_prev = y0, y0
integral = u0 # bumpless start: output begins at u0
t_log, y_log, u_log = [], [], []
for k in range(n):
e = r_new - y
if Ti is not None:
integral += Kc * e * dt / Ti
d_term = -Kc * Td * (y - y_prev) / dt
u = Kc * e + integral + d_term
u = min(100.0, max(0.0, u)) # output limits
y_prev = y
t_log.append(k * dt); y_log.append(y); u_log.append(u)
pipe.append(u)
u_delayed = pipe.pop(0) # output that acts on the process now
y = y0 + a * (y - y0) + (1 - a) * K * (u_delayed - u0)
return np.array(t_log), np.array(y_log), np.array(u_log)
def measures(t, y, u, y0, r_new):
step = r_new - y0
y_final = y[-200:].mean()
offset = round(r_new - y_final, 3) + 0.0
overshoot = 100 * max(0.0, y.max() - y_final) / (y_final - y0)
outside = np.where(np.abs(y - y_final) > 0.02 * step)[0]
t_settle = t[outside[-1] + 1]
return y_final, offset, overshoot, t_settle, u.max(), u.min()
def report(title, unit, plant, r_new, cases, dt, t_end):
print(title)
print(f"case final offset overshoot settle u max u min")
print(f" {unit:<7} {unit:<7} percent s percent")
runs = []
for name, Kc, Ti, Td in cases:
t, y, u = simulate(plant, r_new, Kc, Ti, Td, dt, t_end)
yf, off, os_, ts, umax, umin = measures(t, y, u, plant[3], r_new)
print(f"{name:<11} {yf:6.3f} {off:6.3f} {os_:7.1f} {ts:7.2f} "
f"{umax:5.1f} {umin:5.1f}")
runs.append((name, t, y, u))
return runs
# Plant A: hot water tank. K (degC per percent), tau (s), theta (s),
# then the operating point: 40 percent holds 45 degC.
tank = (0.5, 300.0, 40.0, 45.0, 40.0)
print(f"Tank, P-only offset by hand: {4.0 / (1 + 0.5 * 8.0):.3f} degC")
tank_runs = report("Application 1: tank, setpoint 45 to 49 degC", "degC",
tank, 49.0,
[("P", 8.0, None, 0.0),
("PI", 6.0, 300.0, 0.0),
("PID", 10.0, 360.0, 12.0),
("PI gain 10", 10.0, 360.0, 0.0)],
dt=0.5, t_end=3000.0)
# Plant B: booster pump. K (bar per percent), tau (s), theta (s),
# then the operating point: 60 percent speed holds 4.0 bar.
pump = (0.10, 3.0, 0.5, 4.0, 60.0)
Kp, Ki, Kd = 12.0, 4.0, 1.2 # parallel form gains from the drive
Kc, Ti, Td = Kp, Kp / Ki, Kd / Kp # the same controller in ISA form
print(f"\nDrive in ISA form: Kc = {Kc:.1f} %/bar, Ti = {Ti:.2f} s, "
f"Td = {Td:.2f} s")
print(f"Pump, P-only offset by hand: {0.5 / (1 + 0.10 * Kc):.3f} bar")
report("Application 2: pump, setpoint 4.0 to 4.5 bar", "bar",
pump, 4.5,
[("P", Kc, None, 0.0),
("PI", Kc, Ti, 0.0),
("PID", Kc, Ti, Td)],
dt=0.01, t_end=40.0)
ripple, f = 0.02, 5.0 # bar, Hz: pressure ripple at the sensor
print(f"Output ripple from P: {Kp * ripple:.2f} percent, "
f"from D: {Kd * 2 * np.pi * f * ripple:.2f} percent")
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(8, 7), sharex=True)
for name, t, y, u in tank_runs:
style = "--" if name == "PI gain 10" else "-"
ax1.plot(t, y, style, label=name)
ax2.plot(t, u, style, label=name)
ax1.axhline(49.0, color="gray", linewidth=0.8)
ax1.set_ylabel("Temperature (degC)")
ax1.set_title("Hot water tank: setpoint step from 45 to 49 degC")
ax1.legend(); ax1.grid(True, alpha=0.3)
ax2.set_ylabel("Heater output (percent)")
ax2.set_xlabel("Time (s)")
ax2.set_xlim(0, 1200); ax2.grid(True, alpha=0.3)
fig.tight_layout()
fig.savefig("pid_terms_compare.png", dpi=120)
print("\nSaved pid_terms_compare.png")

Expected output

Tank, P-only offset by hand: 0.800 degC
Application 1: tank, setpoint 45 to 49 degC
case final offset overshoot settle u max u min
degC degC percent s percent
P 48.200 0.800 8.4 213.50 72.0 44.3
PI 49.000 0.000 0.1 216.50 67.2 48.0
PID 49.000 0.000 0.5 125.00 84.5 47.8
PI gain 10 49.000 0.000 14.7 327.50 84.5 41.6
Drive in ISA form: Kc = 12.0 %/bar, Ti = 3.00 s, Td = 0.10 s
Pump, P-only offset by hand: 0.227 bar
Application 2: pump, setpoint 4.0 to 4.5 bar
case final offset overshoot settle u max u min
bar bar percent s percent
P 4.273 0.227 0.0 3.93 66.0 62.7
PI 4.500 0.000 0.0 8.12 67.0 65.0
PID 4.500 0.000 0.1 7.77 67.0 65.0
Output ripple from P: 0.24 percent, from D: 0.75 percent
Saved pid_terms_compare.png

The u min column is the lowest output after the first move. The simulation uses an unfiltered derivative on a noise-free signal. A real controller filters the derivative, which changes these numbers slightly.

Common Mistakes



  • Raising the gain to remove an offset. The offset becomes smaller but never zero, and the loop moves toward instability. Offset is the job of the integral term.
  • Copying settings between controllers without checking the form. A in seconds, a in minutes, a rate in repeats per minute and a parallel gain are four different numbers for the same action.
  • Reading proportional band as gain. A wider band is a lower gain. A band of 200 percent is a gain of 0.5.
  • Adding derivative to a fast, noisy loop. On pressure and flow loops it mostly sends the measurement noise to the final element.
  • Letting the derivative act on the error. Every setpoint change then kicks the output. Select derivative on measurement where the controller offers it.
  • Changing a loop to automatic without checking controller action. With the wrong action the output runs to a limit and stays there.

Summary



  • The P term pushes in proportion to the present error. Alone, on a self-regulating process, it leaves an offset of .
  • The I term adds up the error and stops only when the error is zero, so it removes offset. It costs stability, and a short gives overshoot.
  • The D term acts on the rate of change. It adds damping, which permits a higher gain, and it amplifies noise.
  • ISA form uses , , and parallel form uses , , . Convert with and before entering any number.
  • On the tank, PI removed an offset of 0.8 °C and PID cut the settling time from 216.5 s to 125 s. On the pump, the D term returned 0.3 s and tripled the ripple in the output, so PI is the right choice.

Exercises



1. The booster pump ( bar per percent) is under P-only control with percent per bar. The setpoint rises from 4.0 to 4.5 bar. Find the offset and the final pressure.

Answer

bar. The pressure settles at 4.25 bar.

2. A tank controller has ISA settings percent per °C and , with no derivative. Give the parallel form gains. Then say what happens to if is doubled in the ISA controller.

Answer

percent per °C and percent per °C per second. Doubling to 12 with unchanged doubles to 0.04, because in ISA form the gain multiplies every term.

3. A temperature transmitter has a span of 0 to 100 °C. (a) What proportional band equals a gain of 8 percent per °C? (b) What gain in percent per °C equals a proportional band of 50 percent?

Answer

(a) The gain is already 8 percent of output per percent of span, so percent. (b) percent per °C.

4. A PI controller with percent per °C and sees a constant error of 2 °C (the process does not respond, for example because the heater has tripped). By how much has the output changed after 100 s? After how long has the I term added as much as the P term?

Answer

P term: percent at once. I term after 100 s: percent. Total change 16 percent. The I term equals the P term after one integral time, 300 s.

5. A tank loop is in manual at 55 percent output. The temperature is 47 °C and the setpoint is 49 °C. The controller is PI with percent per °C. What value must the integral term take at the change to automatic for the change to be bumpless?

Answer

The P term will be percent. The integral term must be percent, so that the output begins at 55 percent.

6. A PID controller has percent per °C and . (a) The temperature rises at a steady 0.05 °C per second. What does the D term contribute? (b) The controller is digital with a sample time of 0.5 s and its derivative acts on the error. What does the D term ask for in the sample after a setpoint step of 4 °C?

Answer

(a) percent: the D term takes 6 percent off the output while the temperature rises. (b) The error changes by 4 °C in 0.5 s, a rate of 8 °C per second, so the D term asks for percent. The output saturates at 100 percent for that sample. This is derivative kick, and derivative on measurement removes it.

References



  • K. J. Åström and T. Hägglund, Advanced PID Control, ISA, 2006.
  • D. E. Seborg, T. F. Edgar, D. A. Mellichamp and F. J. Doyle, Process Dynamics and Control, 4th edition, Wiley, 2016.
  • K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, 2nd edition, Princeton University Press, 2021.


© 2021-2026 SiliconWit®. All rights reserved.
Predict first

The tank has a proportional controller with a gain of 8 percent per °C. After a setpoint step of 4 °C the water rests 0.8 °C below the setpoint. The operator doubles the gain to 16. What happens to the gap?

See it: three terms on one loop
The lesson's settings

Steady offset
Overshoot
Settling time (2 percent)
Integrated absolute error, up to the load
Largest output after the step
Lowest value after the load

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. The tank is at rest at its new setpoint of 49 °C under PI control. The heater output is steady at 48 percent. Which term of the controller supplies that output?

2. The PID settings Kc = 10 percent per °C, Ti = 360 s, Td = 12 s settle the tank in 125 s with 0.5 percent overshoot. The derivative time is now set to 0 and nothing else is changed. What happens?

3. The tank is under P-only control with a gain of 8 percent per °C and rests at 48.2 °C. A cold draw now removes heat equal to 10 percent of heater power, and it continues. Process gain: 0.5 °C per percent. Where does the temperature rest?

setpoint leak error left:open more no error:hold the tap Integral removes the offset
setpoint without D: overshoots with D: brakes early
Watch it build: P, then I, then D on the hot water tank
45 49 °C 0 900 s Setpoint: 45 °C to 49 °C P: 0.80 °C short PI: offset gone stronger PI: 14.7 % over add D: 0.5 % over settled at 125 s
  1. The tank setpoint steps from 45 °C to 49 °C. The heater starts at 40 percent.
  2. P only, Kc 8: the tank rests at 48.2 °C, an offset of 4 ÷ (1 + 0.5 × 8) = 0.80 °C.
  3. PI, Kc 6 and Ti 300 s: the integral keeps pushing until the offset is zero.
  4. A stronger PI, Kc 10 and Ti 360 s, is faster but overshoots by 14.7 percent.
  5. The same with Td = 12 s: the D term brakes the approach, 0.5 percent over, settled in 125 s.
PID Heater and tank r e u y, outlet temperature Temperature sensor − +
The temperature loop of the hot water tank
e P: e now I: sum of e D: rate of e + + + × Kc u
Three terms act on the same error and are added
u, percent 40 64 88 +24 % Ti = 300 s P step: Kc × e = 24 % I ramp: adds another Kc × e every Ti seconds 0 100 200 300 t, s error steps here, to 4 °C
Output after a step of error: P jumps, then I ramps (Kc 6, Ti 300 s)
P and I r e u + − + − Td × rate of y y
Derivative on measurement: the D term never sees r
Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.