Tools › Building Systems › Controls and Commissioning › Control Loop Tuning › Method

Control Loop Tuning: Method

Open the Control Loop Tuning tool

Control Loop Tuning

This page explains what the Control Loop Tuning tool computes: the process models it works with, how it reads a step response, where the ultimate gain comes from, the controller forms, each tuning rule as its source states it, the closed-loop simulation and its performance measures, the frequency-response margins, and the three building-services specifics (valve authority, the proportional thermostat and the sample time). Times are in minutes throughout; the process gain K is in process-variable units per unit of controller output.

Process models

A heating coil, a mixing damper, a chilled-water valve or a zone with its sensor behaves, for tuning purposes, like a gain, one or two lags and a transport delay:

G(s) = K e−θs / ((τs + 1)(τ2s + 1))

K is the steady-state change of the measured variable per unit change of the controller output; τ is the dominant time constant (63.2 % of the remaining change after the dead time); θ is the dead time (transport, sensor and actuator delays, which Ziegler and Nichols called the lag L); τ2 is an optional second lag (a coil plus a slow sensor, for example). With τ2 = 0 the model is the first-order-plus-dead-time (FOPDT) model that every classical rule assumes. The unit-step response is y(t) = K[1 − e−(t−θ)/τ] for t > θ in the first-order case and y(t) = K[1 − (τe−(t−θ)/τ − τ2e−(t−θ)/τ2)/(τ − τ2)] in the second-order case. A negative K (a reverse-acting process, such as a cooling valve on a space temperature) is allowed: the rules give a negative controller gain, which in practice is set as the controller's action.

Reading a step response

With the loop in manual, the controller output is stepped by Δu and the process variable is recorded. Three readings of that record are reported:

  • Two-point method (Smith 1972): K = (y∞ − y0)/Δu from the levels; t28.3 and t63.2 are the times at which 28.3 % and 63.2 % of the change are reached; τ = 1.5 (t63.2 − t28.3) and θ = t63.2 − τ. For an exact first-order record the two points sit at θ + 0.3326τ and θ + 0.9997τ, so the rounded constants recover τ within 0.07 %.
  • Ziegler–Nichols tangent (1942, p. 764): the reaction rate R is the steepest slope of the record, the lag L is where the tangent at that point meets the initial level, and the unit reaction rate is R1 = R/Δu. For a first-order model R1 = K/τ and L = θ exactly.
  • Least squares: the FOPDT (K, τ, θ) or SOPDT (K, τ, θ, τ2) parameters that minimise the sum of squared residuals of the model against the record, found by a Nelder–Mead simplex search started from the two-point estimate and a small grid around it, the lags kept positive through their logarithms and θ kept inside the record. The residual sum and its root mean square say how well each model fits; a clearly lower SOPDT residual is the sign of a second lag worth keeping.

The model selected under "Model To Use" is carried into the rules and the simulation. The final level y∞ is the mean of the last 5 % of the record, so the record should run until the process variable has settled.

Ultimate gain and period

Under proportional control the loop just sustains an oscillation at the ultimate gain Ku with the ultimate period Pu. For the model they follow from the phase crossover, the frequency ωu at which the process phase reaches −180°:

atan(ωuτ) + atan(ωuτ2) + ωuθ = π,   Ku = √(1 + (ωuτ)²) √(1 + (ωuτ2)²) / |K|,   Pu = 2π/ωu

The equation is solved by bisection. A first-order process without dead time, or two lags without dead time, never reaches −180° and has no ultimate gain; the rules that need one are then marked as not applicable. Values measured in a closed-loop or relay test may be entered instead, and the tool prints the model's own values beside them. Ziegler and Nichols (1942, p. 765) linked the two tests by the approximations L = Pu/4 and R1 = 8/(PuSu), which the tool prints as their process classification; for a first-order model with dead time the exact crossover gives a somewhat shorter period and a higher gain than those approximations.

Controller forms

Three forms of the same PID algorithm are in use and the settings must be converted between them:

  • Ideal (ISA, non-interacting): u = Kc[e + (1/Ti)∫e dt + Td de/dt], the form in which every rule here is tabulated. The reset rate 1/Ti in repeats per minute is Ziegler and Nichols' unit.
  • Parallel (independent gains): u = Kpe + Ki∫e dt + Kd de/dt with Kp = Kc, Ki = Kc/Ti, Kd = KcTd.
  • Series (interacting): C(s) = Kc′(1 + 1/(Ti′s))(1 + Td′s). From the ideal settings, F = [1 + √(1 − 4Td/Ti)]/2, Kc′ = FKc, Ti′ = FTi, Td′ = Td/F; the series form exists only when Ti ≥ 4Td. The reverse conversion is F = 1 + Td′/Ti′, Kc = FKc′, Ti = FTi′, Td = Td′/F. The Ziegler–Nichols PID settings have Ti = 4Td exactly, so their series equivalent is Kc/2 with Ti′ = Td′ = Pu/4.

In the simulation and the frequency response the derivative acts on the measurement, not on the error (no derivative kick on a setpoint step), through the first-order filter Tds/(1 + Tds/N) with N = 10 unless changed.

The tuning rules

All settings are in the ideal form; r = θ/τ, a = Kθ/τ = K R1L, and λ or τc is the desired closed-loop time constant.

RuleTypeKcTiTd
Ziegler–Nichols reaction curve (1942, pp. 764–765)P1/(R1L) = τ/(Kθ)––
PI0.9/(R1L)L/0.3 = 3.33θ (reset rate 0.3/L)–
PID1.2/(R1L)2L (reset rate 0.5/L)0.5L
Ziegler–Nichols ultimate gain (1942, pp. 761–763)P0.5Ku––
PI0.45KuPu/1.2–
PID0.6KuPu/2Pu/8
Cohen–Coon (1953)P(τ/(Kθ))(1 + r/3)––
PI(τ/(Kθ))(0.9 + r/12)θ(30 + 3r)/(9 + 20r)–
PID(τ/(Kθ))(4/3 + r/4)θ(32 + 6r)/(13 + 8r)4θ/(11 + 2r)
IMC, Rivera–Morari–Skogestad (1986)PIτ/(Kλ)τ–
PID(2τ + θ)/(2Kλ)τ + θ/2τθ/(2τ + θ)
SIMC, Skogestad (2003, eqs. 23–25)PIτ/(K(τc + θ))min(τ, 4(τc + θ))–
PIDsame, series formsameτ2 (series form)
Tyreus–Luyben (1992)PIKu/3.22.2Pu–
PIDKu/2.22.2PuPu/6.3

Ziegler and Nichols defined "optimum" as a quarter-amplitude decay (each swing a quarter of the one before) and said themselves that a lower gain is right where valve movement matters more than the deviation (p. 761). Their reaction-curve settings are written in sensitivity (psi of controller output per inch of pen travel) and reset rate (repeats per minute); the table above restates them in gain and integral time. In their worked case (p. 764) a 1.7 psi valve step gave R = 1.7 in/min and L = 0.2 min, hence a sensitivity of 1.7/(1.7 × 0.2) = 5 psi/in, which matched the 0.5 Su = 5 psi/in of their ultimate test (Su = 10 psi/in, Pu = 0.8 min).

Cohen and Coon fitted their formulas to the same quarter-decay criterion with the dead-time ratio kept explicit, which makes them better than the reaction-curve rule when θ is a large fraction of τ, and still aggressive.

IMC (internal model control) designs the controller so that the closed loop follows the setpoint like a first-order lag of time constant λ after the dead time; the PI rule treats the dead time as negligible against λ and the PID rule uses a first-order Padé approximation of it. Rivera, Morari and Skogestad recommend λ above 1.7θ for the PI rule and above 0.25θ for the PID rule.

SIMC ("simple" or "Skogestad IMC") keeps the IMC gain τ/(K(τc + θ)) and shortens the integral time to 4(τc + θ) when the process is lag-dominant (τ > 4(τc + θ)), because Ti = τ gives a very slow recovery from a load disturbance on such a process. With the recommended τc = θ the loop has a gain margin of 3.14, a phase margin of 61.4° and a sensitivity peak Ms = 1.59 for every first-order process with τ ≤ 8θ (Skogestad 2003, Table 2), and 2.96, 46.9° and 1.70 in the integrating limit. Derivative action is added only for a second-order model, as Td′ = τ2 in the series form (converted to the ideal form on the results page). A larger τc gives a slower, more robust loop; this is the rule the tool selects by default.

Tyreus and Luyben reduced the Ziegler–Nichols ultimate-gain settings for robustness (about a third of Ku and an integral time longer than two ultimate periods), which suits slow, noisy building loops.

Closed-loop simulation

The loop is simulated from rest with a setpoint step at t = 0 and a load step entering at the process input later. The lag states advance by their exact zero-order-hold solution over each step, the dead time is a buffer of an integer number of steps, the integral is accumulated by Euler's rule and the derivative filter by backward Euler; the step is chosen from the smallest time constant (about τ/200, θ/40, τ2/100 and Td/(20N)). Optional output limits saturate the controller with the integral held while saturated (conditional integration). The measures reported are:

  • overshoot as a percentage of the setpoint step, the time of the peak, the 10–90 % rise time, the settling time to within 2 % of the final value, and the decay ratio (second overshoot over the first; 0.25 is Ziegler and Nichols' quarter decay);
  • the steady-state offset, which is Δy/(1 + KcK) for a proportional-only controller and zero with integral action;
  • IAE = ∫|e|dt, ISE = ∫e²dt, ITAE = ∫t|e|dt over the setpoint segment, and the total variation of the controller output (the sum of all its moves, counting the first one), the usual measure of actuator wear;
  • for the load step: the peak deviation and its time, the IAE, the recovery time and the remaining offset.

The comparison table runs every rule's settings for the chosen controller type through the same simulation and the same margin calculation, so the rules can be compared on one process. The simulator was checked against the closed form of the open-loop step, against an independent Runge–Kutta integration, and against the integrated errors and output variations that Skogestad printed for his test processes (IAE 2.17 for a unit setpoint step and 2.0 for a unit load step on the first-order process with τ = 4θ under SIMC PI control).

Frequency response and margins

The open-loop transfer function L(jω) = C(jω)G(jω) is swept over frequency. The gain margin is 1/|L| at the phase crossover (the frequency at which the phase of L reaches −180°), the phase margin is 180° plus the phase of L at the gain crossover (|L| = 1), and the sensitivity peak Ms is the maximum of |1/(1 + L)|, the reciprocal of the loop locus's closest approach to the point −1. A loop with a gain margin below 1 or a negative phase margin is unstable. Skogestad's guidance is Ms below about 1.7 (which guarantees a gain margin above 2.4 and a phase margin above 34°) for a robust loop, with 1.2–2.0 the usual range; a proportional controller at exactly Ku has a gain margin of 1 and a phase margin of 0. The two Bode charts show |L| and |S| in decibels and the phase of L, with the crossovers marked.

Valve and damper authority

A control valve's inherent characteristic f(x) is its flow fraction against stem travel at constant pressure drop: linear f = x, equal-percentage f = Rx−1 with the rangeability R, quick-opening f = √x. Installed in a circuit whose other components take part of the pressure drop, the valve's share falls as it opens and the installed characteristic becomes

q(x) = f(x) / √(N + (1 − N) f(x)²),   N = Δpvalve, open / Δptotal

where the authority N is the fully open valve's drop over the whole circuit's drop at design flow (the drop the valve sees when closed). Low authority bends every characteristic toward quick opening: most of the flow change happens in the first part of the stroke, the installed gain dq/dx near closed is many times the gain near open, and a loop tuned at one flow hunts at another. The usual design advice is an authority of at least about 0.5 for linear valves and 0.25–0.5 for equal-percentage valves, whose inherent curve compensates part of the distortion; the same relation serves a mixing damper with its own inherent curve. The results page tabulates the inherent and installed gains at five stroke positions and draws both characteristics.

Proportional thermostat

A proportional-only thermostat or controller moves its output through the full span over the throttling range TR of the measured variable, so its gain is Kp = span/TR (for example 100 %/4 °F = 25 % per °F). Because the output can hold only one value at zero error, a sustained change of load that needs an output change Δu leaves the variable off the setpoint by Δu TR/span; Ziegler and Nichols (p. 761) show the same arithmetic as 2.8 psi of load change at 5 psi/in giving 0.56 in of offset. Only integral action removes the offset; a narrower throttling range reduces it at the cost of stability, exactly the trade-off the ultimate-gain rules settle.

Sample time

Digital controllers scan the loop at a sample time Ts. The common rules of thumb (Åström and Wittenmark; Seborg et al.) are Ts ≤ τ/10 for the dominant lag, Ts ≤ θ/4 for the dead time and Ts ≤ Pu/10 for the ultimate period, the smallest governing; the tool prints the three limits and, for an entered Ts, the ratio to the limit and the effective dead time θ + Ts/2 that Skogestad's half rule adds for a sampled controller, which can be entered as θ to retune for a slow scan.

Limits

The process is linear and time-invariant; real coils, valves and zones change gain with load (the installed-characteristic table shows one cause), so the settings are a starting point and the field procedure of NIST TN 2178 §2.2 (raise the gain to the edge of oscillation with the integral off, back off, add integral slowly, check with a setpoint step) finishes the job. Integrating processes (a tank level, a pressurised duct) are not fitted here; inverse-response and underdamped processes are not represented by the two-lag model; noise, quantisation and actuator hysteresis are not simulated; the relay (auto-tune) test is described by its result, Ku and Pu, which may be entered. No table or example from a copyrighted text is reproduced: the rules are the published formulas, the worked case is Ziegler and Nichols' own, and the simulator's acceptance values are Skogestad's printed performance figures and closed forms.