Override (selector) control
Two (or more) controllers share one valve through a high or low selector: the normal one, and one that holds a limit. Whichever asks for the safer output wins. The controller not in charge must track the valve, or it winds up and takes over late.
Theory
Most of the time a loop has one job, but it also has limits it must never cross: a maximum steam flow, a high tank level, a motor current. Override (selector) control gives each limit its own controller, all acting on the same valve:
The selector picks whichever is safer, so the limit controller takes the valve exactly when its variable reaches its limit, and hands it back when it doesn't need it.
Choosing max or min. Ask what the limit controller wants when its variable is past the limit.
- A steam flow limiter wants less opening: low select.
- A high-level override on an outlet valve wants more: high select.
Windup: the real design problem. The controller not in charge still sees an error and keeps integrating. Its output runs to a limit (0 or 100 %) and stays there. When it should take over, it first has to integrate all the way back. Meanwhile the other controller holds the valve in the wrong place.
External reset feedback fixes it. Every controller's integral follows the selected output through its own lag:
For the controller in charge this is exactly normal PI action. For the others, the output becomes "valve signal + my own P and D", so each one sits just its proportional action away from the valve, and takes over smoothly the moment its error says it should.
Linear analysis sees one loop at a time: the normal controller, and the override when it is in charge. The selector switches between them.
When it works, and when it breaks
Constraints that matter only sometimes: steam or fuel allowances, high/low levels, compressor surge and motor current, maximum tube-skin temperatures.
Start-up and shutdown, where a different variable should be in charge for a while.
Any "control this, unless that" requirement that would otherwise be a pile of IF statements.
No tracking: the idle controller winds up, takes over late, and hands back late (bumps both ways).
Selector direction wrong: the limit controller wins all the time, or never.
Limit controllers tuned like normal ones: once in charge they must act fast, or the limit is overshot.
Two overrides fighting near both limits at once: then the process genuinely can't meet both, and someone must decide which wins.
How to tune it
- Tune each controller on its own, as if it were the only one: the normal one for its job, the limit one for its variable.
- Make the limit controller tight. Once it has the valve, its job is to stop at the limit, not to be gentle.
- Set the limit with margin below the real constraint. The override acts only when the limit is reached, so expect some overshoot.
- Test a takeover and a hand-back with tracking on, and once with it off to see what tracking is saving you.
The tuning rules in the lab
Model-based, one tuning knob: the closed-loop time constant τc. τc = θ gives a fast, still robust loop (Ms ≈ 1.6); larger τc is smoother. The min() on Ti keeps lag-dominant and integrating processes from responding too slowly to load upsets. PID uses the second-order model: Td = τ2 in series form.
The process-industry favourite: choose λ, the closed-loop time constant, and the setpoint response is first-order with no overshoot. Ti = τ cancels the process pole, which makes load rejection slow on lag-dominant processes. λ = 1–3 × τ is typical for robustness.
Internal model control worked back into a PID (Rivera, Morari and Skogestad, 1986): the controller that makes the loop a first-order λ response, with the dead time replaced by its first-order Padé approximation. That approximation is what gives the derivative, and why Ti = τ + θ/2 rather than τ. Keep λ above about 0.8θ for the PID and 1.7θ for the PI, where the approximation stops holding. Like Lambda, it cancels the process lag, so load upsets on lag-dominant processes recover slowly. The IMC structure itself (the model running beside the plant) is the Smith predictor on the bench.
For integrating processes such as levels, from the ramp rate k′ (% of span per second, per % of output). λ is the arrest time: how long the level keeps moving after an inflow upset. For a step upset Δ (in % of output) the level swings about k′·Δ·λ/e before it turns round, so choose λ from the room the tank has. A long λ lets the tank absorb the upset and keeps the outflow smooth: averaging level control. P-only: Kc = 1/(k′λ), which leaves an offset that is harmless in a buffer.
The 1942 rules, aiming for a quarter-amplitude decay. Aggressive: Ms is often above 2, so the loop rings and is sensitive to model error. Worth knowing because so many loops in the field were tuned this way.
Like Ziegler–Nichols but corrected for dead time, so it copes better when θ/τ is large. Also aimed at quarter-amplitude decay, so also aggressive.
Derived by optimizing load rejection with a robustness limit (Ms ≈ 1.4) over a large test batch of processes. A safe modern default when you have no reason to choose a speed.
How to implement it
- Run every controller every cycle, then select: or .
- External reset: each controller's integral follows the selected output. Without an ER input, the classic workaround is to put the controllers not selected into tracking (manual with ManualValue = the selected output). It works, but they then lose their proportional "opinion".
- Show which controller has the valve on the faceplate, and log the switches: an override that is in charge a lot is telling you about the plant.
- Manual mode: all controllers track the manual output.
Siemens and elsewhere
- PID_Compact has no external-reset input. The usual pattern is two instances plus a MAX/MIN in SCL; the one not selected goes into manual (ManualEnable, ManualValue = the selected output) each cycle.
- The exported LL_PID has ExtResetEnable / ExtReset, which do the real thing: its integral follows the selected output through Ti.
- PID_Temp is the same in this respect.
- Put the selector logic in the same OB30 as the controllers, after both calls.
- DCS: high/low selector blocks (HSEL, LSEL, SIGSEL) with built-in back-calculation (BKCAL) to every input, so external reset is automatic.
- Rockwell: PIDE has a "track" input and the SEL / ESEL instructions.
- Model predictive control handles constraints in one optimization instead of a selector, at the cost of a model and a lot more engineering.
Interactive Controller Sandbox
Test and tune Override (selector) control live on a process, benchmark against baseline PI, and inspect the resulting code.
Interactive Gains (Primary Loop)
Drag sliders or nudge gains to observe the closed-loop transient responseClosed-Loop Response: Override vs Baseline PI
Simulating…// Loop Lab export: Steam heat exchanger, TIC-301
// TIA Portal SCL (S7-1200 / S7-1500). Generated code: review before use on a real plant.
FUNCTION_BLOCK "LL_PID"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
Setpoint : Real; // engineering units
Input : Real; // measurement, engineering units
ManualEnable : Bool; // TRUE = manual: Output follows ManualValue
ManualValue : Real; // %
Feedforward : Real; // %, added to the output (0 when unused)
HoldIntegral : Int; // +1 / -1: don't integrate up / down (a cascade slave is saturated)
ExtResetEnable : Bool; // override: this controller is not selected, so its integral follows ExtReset
ExtReset : Real; // %, the selected (valve) output, for external reset feedback
Cycle : Real := 0.5; // s, must match the cyclic interrupt the block is called from
END_VAR
VAR_OUTPUT
Output : Real; // %
AtLimit : Int; // +1 / -1 when the output is pinned high / low
END_VAR
VAR
Gain : Real := 1.5; // % output per % of span
Ti : Real := 29.0; // s, 0 = no integral action
Td : Real := 0.0; // s, 0 = no derivative action
PWeighting : Real := 1.0; // setpoint weight b on P
DWeighting : Real := 0.0; // setpoint weight c on D
TdFiltRatio : Real := 0.1; // derivative filter = TdFiltRatio * Td
InLow : Real := 0.0;
InHigh : Real := 120.0;
OutLow : Real := 0.0;
OutHigh : Real := 100.0;
Invert : Bool := FALSE;
Integral : Real; // integral term, in % output (so gain changes don't bump)
DTerm : Real;
LastED : Real;
END_VAR
VAR_TEMP
sp : Real;
pv : Real;
dir : Real;
e : Real;
eP : Real;
eD : Real;
p : Real;
tf : Real;
iNext : Real;
v : Real;
u : Real;
END_VAR
BEGIN
// Scale to % of span: the gains are then independent of engineering units.
#sp := (#Setpoint - #InLow) / (#InHigh - #InLow) * 100.0;
#pv := (#Input - #InLow) / (#InHigh - #InLow) * 100.0;
#dir := 1.0;
IF #Invert THEN
#dir := -1.0;
END_IF;
#e := #dir * (#sp - #pv);
#eP := #dir * (#PWeighting * #sp - #pv);
#eD := #dir * (#DWeighting * #sp - #pv);
#p := #Gain * #eP;
IF #ManualEnable THEN
// Track: preload the integral so switching to auto doesn't bump the output.
#u := LIMIT(MN := #OutLow, IN := #ManualValue, MX := #OutHigh);
#Integral := #u - #p - #Feedforward;
#DTerm := 0.0;
#LastED := #eD;
#Output := #u;
#AtLimit := 0;
RETURN;
END_IF;
// Derivative on c*SP - PV through a first-order filter (backward Euler).
IF #Td > 0.0 THEN
#tf := MAX(IN1 := #TdFiltRatio * #Td, IN2 := 1.0E-6);
#DTerm := #tf / (#tf + #Cycle) * #DTerm
+ #Gain * #Td / (#tf + #Cycle) * (#eD - #LastED);
ELSE
#DTerm := 0.0;
END_IF;
#LastED := #eD;
IF #ExtResetEnable AND #Ti > 0.0 THEN
// External reset feedback: the integral follows the selected output through a Ti lag,
// so this controller's output is the valve signal plus its own P and D.
#iNext := #Integral + #Cycle / MAX(IN1 := #Ti, IN2 := #Cycle) * (#ExtReset - #Integral);
ELSIF #Ti > 0.0 THEN
#iNext := #Integral + #Gain * #Cycle / #Ti * #e;
ELSE
#iNext := #Integral;
END_IF;
#v := #p + #iNext + #DTerm + #Feedforward;
#u := LIMIT(MN := #OutLow, IN := #v, MX := #OutHigh);
// A saturated slave asks its master to stop integrating in that direction.
IF #ExtResetEnable THEN
#Integral := #iNext;
ELSIF #Ti > 0.0 AND NOT ((#HoldIntegral > 0 AND #iNext > #Integral) OR (#HoldIntegral < 0 AND #iNext < #Integral)) THEN
// Conditional integration: stop integrating while the output is pinned and the error pushes it further.
IF NOT ((#v > #OutHigh AND #iNext > #Integral) OR (#v < #OutLow AND #iNext < #Integral)) THEN
#Integral := #iNext;
END_IF;
END_IF;
IF #v > #OutHigh THEN
#AtLimit := 1;
ELSIF #v < #OutLow THEN
#AtLimit := -1;
ELSE
#AtLimit := 0;
END_IF;
#Output := #u;
END_FUNCTION_BLOCK
// OB30 "Cyclic interrupt", cycle time 0.5 s (500 ms).
// "TT-301" is the scaled input (NORM_X/SCALE_X from the analog card), "FV-301" the output to scale back to 0-27648.
// Override: TIC-301 (normal) and a limit controller on FT-301 (steam flow) at 1000.0 kg/h; the lower output drives "FV-301".
// Give the limit controller its own tuning once at start-up (OB100): "TIC_301_Ovr_DB".Gain := 1.8; "TIC_301_Ovr_DB".Ti := 2.25; "TIC_301_Ovr_DB".Td := 0.0; "TIC_301_Ovr_DB".InLow := 0.0; "TIC_301_Ovr_DB".InHigh := 2000.0;
// External reset: whichever controller lost the selection last cycle has its integral follow the valve signal.
"TIC_301_DB"(Setpoint := "SP", Input := "TT-301", ManualEnable := "Manual", ManualValue := "ManualOut", ExtResetEnable := "OvrSelected", ExtReset := "Out");
"TIC_301_Ovr_DB"(Setpoint := 1000.0, Input := "FT-301", ManualEnable := "Manual", ManualValue := "ManualOut", ExtResetEnable := NOT "OvrSelected", ExtReset := "Out");
"Out" := MIN(IN1 := "TIC_301_DB".Output, IN2 := "TIC_301_Ovr_DB".Output);
"OvrSelected" := "TIC_301_Ovr_DB".Output < "TIC_301_DB".Output; // show it on the faceplate: which controller has the valve
"FV-301" := "Out";