1-833-888-0091contact@hvacengineering.ca

PID control loops and tuning

Learn what each term in a PID loop does, how to spot hunting and sluggish loops in BAS trends, and a practical procedure for tuning HVAC control loops in the field.

Server BACnet/IP Controller FC-2 FC-3 Sensor Actuator Valve VFD Trend Setpoint Measured °C t
Controls and building automation

Almost every modulating device in a building automation system, from chilled water valves and VAV dampers to fan drives and humidifiers, is driven by a feedback control loop. Most of those loops use some form of PID (proportional, integral, derivative) control. When loops are well tuned, the building quietly holds its setpoints. When they are not, valves and dampers hunt back and forth, actuators wear out, energy is wasted, and occupants complain.

This guide explains how PID control works in practical terms, how to recognize problem loops, and how to tune them in the field.

The feedback loop

A feedback loop has four parts:

  • Process variable: the measured value, such as supply air temperature
  • Setpoint: the desired value
  • Error: the difference between setpoint and process variable
  • Output: the command sent to the controlled device, usually 0 to 100 percent

The controller calculates the output from the error, sends it to the device, and watches how the process variable responds. The challenge is that HVAC processes have delays: a valve opens, water travels to the coil, the coil changes temperature, and the air carries that change to the sensor. A controller that reacts too aggressively overshoots; one that reacts too gently never catches up.

The three terms

Proportional

The proportional term produces an output in proportion to the current error. Larger error, larger correction. It is defined by a gain or, in many HVAC controllers, a proportional band: the range of error over which the output moves from 0 to 100 percent. A narrow band (high gain) responds strongly; a wide band (low gain) responds gently.

Proportional-only control leaves a steady offset from setpoint, because some error is always needed to produce a non-zero output.

Integral

The integral term adds up error over time and keeps adjusting the output until the error is eliminated. It removes the offset left by proportional control. Integral action is defined by an integral gain or an integral time (reset time). Too much integral action causes slow oscillation and overshoot; too little leaves the loop slow to settle.

Derivative

The derivative term reacts to the rate of change of the error, damping fast changes. It can improve response on processes with long delays, but it amplifies sensor noise. Most HVAC loops run as PI controllers with derivative set to zero, and that is usually the right choice.

TermResponds toToo muchToo little
ProportionalPresent errorFast oscillation, huntingSluggish response, large offset
IntegralAccumulated errorSlow oscillation, overshootPersistent offset, slow settling
DerivativeRate of changeNoisy, jumpy outputLittle effect in most HVAC loops

Recognizing poorly tuned loops

BAS trends are the best diagnostic tool. Trend the setpoint, process variable and output at a short interval, often 1 to 5 seconds for fast loops like static pressure and 30 to 60 seconds for slower temperature loops. See trend logging and using BAS data.

Signs of trouble:

  • Hunting: the output swings continuously between high and low, and the process variable oscillates around setpoint
  • Sluggish response: after a setpoint change or load change, the process variable takes a very long time to return
  • Persistent offset: the process variable settles away from setpoint
  • Windup: after the system is off or saturated, the output sits at 0 or 100 percent too long, then overshoots

Not every oscillation is a tuning problem. Before tuning, check for oversized valves with poor authority, sticky actuators, slipping linkages, poorly located sensors and interacting loops. Tuning cannot fix a valve that controls the full flow in its first 10 percent of stroke. See control valve selection and authority.

Common HVAC loops

LoopTypical speedNotes
Duct static pressureFast, secondsSensitive to noise; filter the signal
Building or space pressureFast, secondsGusts cause noise; use averaging
Supply air temperatureModerate, tens of seconds to minutesTransport delay from coil to sensor
Mixed air temperatureModerateStratification affects reading
Chilled and hot water supply temperatureSlow, minutesPlant thermal mass
Space temperatureSlow, many minutesLarge thermal mass, often cascaded to airflow
VAV airflowFastLow velocity pressure signals are noisy at minimum flow

A practical tuning procedure

Formal methods such as Ziegler-Nichols and lambda tuning exist, but most HVAC loops can be tuned with a disciplined manual approach:

  1. Check the hardware first. Confirm sensor accuracy, actuator stroke, valve or damper action and correct direct or reverse acting configuration.
  2. Set up trends. Trend setpoint, process variable and output at a suitable interval.
  3. Start conservative. Set derivative to zero, integral action low (long integral time) and a moderate proportional gain.
  4. Increase proportional gain in steps while making small setpoint changes, until the loop begins to oscillate, then back off to roughly half that gain.
  5. Add integral action gradually until offset is eliminated within a reasonable time without sustained overshoot.
  6. Test under different loads. A loop tuned at light load may hunt at full load, or vice versa. Repeat with a setpoint change and a disturbance.
  7. Document final parameters and save them in the controller and project records.

A good target for most HVAC loops is a response that settles with little or no overshoot, sometimes described as a quarter decay ratio or better. Stability and actuator life matter more than speed.

Practical features that help

  • Anti-windup: limits integral accumulation when the output is saturated or the loop is disabled. Essential for loops that start and stop.
  • Output rate limits: slow the output change rate to protect equipment and avoid sudden swings.
  • Signal filtering: averaging or filtering noisy inputs such as static pressure.
  • Deadband: a small band around setpoint where the output does not change, reducing actuator wear.
  • Gain scheduling: different tuning at different operating conditions for nonlinear processes.
  • Bumpless transfer: smooth handover between manual and automatic, or between control modes.

Interacting loops

Loops can fight each other. Static pressure control and VAV box airflow loops interact, as do supply air temperature and space temperature loops. Common practice is to tune inner (fast) loops first, then outer (slow) loops, and to keep outer loops significantly slower. Split-range sequences must have deadbands to prevent simultaneous heating and cooling.

Loop tuning is a routine part of our control system verification work, and many retro-commissioning projects find hunting loops wasting energy and wearing out actuators.

Key takeaways

  • Proportional responds to present error, integral removes offset, and derivative is rarely needed in HVAC.
  • BAS trends at an appropriate interval are the best way to identify hunting, sluggish or offset loops.
  • Fix hardware problems such as oversized valves, sticky actuators and poor sensors before tuning.
  • Tune conservatively, test at different loads, and document parameters.
  • Use anti-windup, filtering and deadbands, and tune inner loops before outer loops.

Talk to an engineer

Have a project or a problem this guide touches on? Tell us about the building and we’ll be in touch within one hour.