PID Level Surge Control: Gap Gain Tuning With a Worked Example

Short answer: Tune a surge level controller with a low gain while the level is near setpoint and a high gain when it moves far away. In Ed Bullerdiek's 2026 Control Engineering example, a PI controller with gain 2.0 and integral 20 minutes per repeat uses a setpoint gap of ±10% with a gap gain multiplier of 0.25, so the gain inside the gap is 0.5. [1] The gain inside the gap must not be zero, or the level will "ping-pong" between the gap limits and upset the downstream unit anyway. [1] Do not use surge tuning where the process depends on tight level control, such as thermosiphon reboilers. [1]
What level surge control is for
The objective is to ignore small level changes caused by swings in inlet flow, so that those swings are not passed to the downstream process. A smooth feed means a smooth downstream process. [1] The controller must still respond to large inlet changes, so the vessel neither overflows nor runs dry. [1]
That is why surge tuning is a form of gain scheduling: low gain through the middle of the level range and high gain at each end. [1] The same approach works for any integrating process, such as gas pressure or some thermal processes, as long as the controller may ignore small deviations while keeping the process within limits. [1]
This is a different problem from compressor surge, where the control system protects the machine. The tuning advice here applies only to levels and other integrating variables.
Does your level need it?
A vessel already damps fast inlet swings. In the article's example (a vessel with a 10 minute fill time), a ±5% inlet swing on a 2 minute interval moves the level only about 0.3%, and default tuning (gain 2.0, integral 20 minutes per repeat) moves the output about 0.6%. [1] That is not worth extra effort.
A slower ±5% swing in the same example moves the level about 4.2% peak to peak, and the output swings 8.4%. With the output normally near 50%, that is an almost 17% swing in feed rate to the downstream unit. [1] Slow swings are where ordinary level tuning amplifies the disturbance, and the problem grows when level controllers are chained, as in many distillation trains. [1]
So a good candidate has large, persistent inlet flow changes that can still be contained within a reasonable distance from setpoint. [1]
Why the gap gain cannot be zero
Setting the gap wider than the level swing and the gap gain to zero stops the output from following the swing. [1] But when there is a persistent mismatch between inlet flow and outlet flow, the level drifts to one gap limit, the controller reacts with full gain, and the level crosses to the other limit. The result is a regular "ping-pong" that upsets the downstream unit at fixed intervals. [1]
Integrating processes need a minimum controller gain to avoid instability from unconstrained integral action, and the slower the integral, the lower that gain can go. [1] For a process with a fill time to deadtime ratio of about 6 to 1, the article's tuning map suggests an integral of 20 minutes per repeat or slower with a gain of 1.0 or below; the gain could go as low as 0.6 at 20 minutes per repeat, or 0.25 at 60 minutes per repeat. [1] There is also a maximum: the ultimate gain divided by two is the highest non-oscillatory gain for a given fill time to deadtime ratio. [1]
Planning an SP notch gap application
The article's planning steps for the 10 minute vessel: [1]
- Step test if in doubt. An open loop step test gave a fill time of 10 minutes and a deadtime of 0.48 minutes, a ratio of 20.7 to 1. The maximum non-oscillatory gain is about 15, well above any gain worth using. If a level shows a low ratio, check the instrumentation.
- Set the gap. The swing suggested ±5%; the example uses ±10% for spare capacity.
- Set the gap gain. A multiplier of 0.25 on a gain of 2.0 gives 0.5 inside the gap. The article treats 0.5 as a conservative start; lower would be better.
- Check the output reaches its limits in time. With the output at 50% at zero error, this combination drives the output to 0% or 100% at an error of ±32.5%. A scratch pad calculation is enough, and integral action will reduce the error further.
With these settings, a persistent 10% inlet swing moved the level 4.9% and the output 2.5%: about a 5% swing in downstream feed instead of the 20% that would reach it if the inlet flow were sent straight through. [1] Slowing the integral to 30 or 40 minutes per repeat and lowering the gain to about 1.5 improved the response only incrementally; the biggest gain came from adding the gap and setting tuning by a consistent method. [1]
A check you can reproduce
We simulated the article's vessel to see whether its numbers follow from the stated settings: an integrating level with a 10 minute fill time and 0.48 minute deadtime, a PI controller in velocity form with gain 2.0 and integral 20 minutes per repeat, and a ±10% gap with a 0.25 gain multiplier. The inlet steps up 5% at 10 minutes and 25% more at 2 hours.
| Result | Article [1] | Our simulation |
|---|---|---|
| Time for the output to rise 5% after the 5% step | slightly over 23 min | 23.5 min |
| Output peak after the 5% step | 1.5% above inlet, about 47 min | 1.55% above inlet, 47.4 min |
| Time until the level leaves the gap after the 25% step | about 4.5 min | 4.7 min |
| Level peak after the 25% step | 65.6%, slightly more than 10 min | 65.6%, 11.1 min |
| Output overshoot after the 25% step | 6%, at 20 min | 6.0%, at 20.0 min |
The same simulation without the gap (plain PI, gain 2.0) shows the trade. After the 5% step the plain controller passes the change downstream in 8.9 minutes instead of 23.5, with a peak output rate of 1.03% per minute instead of 0.26%. After the 25% step it holds the level peak to 59.5% instead of 65.6%. The gap trades level room for a smoother outlet, which is the purpose of a surge vessel.
The V-notch alternative
Some systems offer a V-notch gap, where the gain rises with the size of the error: K = |error| × K_slope / 10 + K_notch, where error is PV minus SP, K_slope the gain increase per 10% error and K_notch the gain at zero error. [1] To mimic the notch gap example, the article sets K_notch = 0.5 and K_slope = 0.75, so the gain reaches 2.0 at a 20% error. The output swing to the persistent inlet swing is 2.9%, against 2.5% with the notch gap. [1]
Lowering K_notch to 0.25 and slowing the integral to 30 minutes per repeat cut that swing to 1.9% and lowered the peak gain during the large step to 1.38 (from 1.53). [1] The slower integral also kept the level away from setpoint longer, where the gain is high and the output swings more, so a faster integral may serve the downstream unit better. [1]
If your control system has no built-in gap function, an ordinary gain schedule works: a gain of about 0.2 to 0.5 between 35% and 65% level, and 1.5 to 2.5 outside that range. With the positional PID form, make the transition between zones continuous. [1]
Configuration checks before you compare tuning
The numbers above only transfer if the controller block interprets them the same way. In a 2026 Control Global column, Greg McMillan and Erik Cornelsen list differences between vendors' PID blocks that change the response for apparently identical settings: [2]
- Form. Dependent and independent forms use different tuning parameters and defaults. [2]
- Units. Whether error is in percent of span or engineering units changes the effective loop gain. A typical flow loop gain of 0.2 would need to be 0.002 on a 0 to 10,000 pph scale in engineering units. [2]
- Action. Reverse and direct action, and default settings, differ between platforms. [2]
- Limits. Watch for a saturated controller output, and enable integral anti windup. [2]
- Mechanics first. Valve stiction, backlash and sensor lags cannot be fixed with PID settings and should be removed before tuning. [2]
Greg McMillan adds that a process whose main time constant is more than four times the total loop deadtime should be tuned as a near integrating process, and that integral action can cause very slow oscillations in integrating loops. [2] For loops that already oscillate, see troubleshooting PID oscillations before retuning the loop. For windup and deadtime limits, see PID tuning with transport delay, stability margins and windup.
When not to use surge tuning
- Thermosiphon reboilers. Heat transfer depends strongly on the bottom level. The article describes a case where surge tuning on such a level kept benzene, toluene and xylene towers swinging and off specification for a day or two. [1]
- Mass balance distillation schemes. When the receiver level sets reflux and the distillate draw controls composition, tight level control is what makes the compensating reflux changes. [1]
- Clamp the setpoint. Keep the setpoint where the output can still reach 100% or 0% before the vessel overfills or runs dry. [1]
- Talk to operators. Expect pushback when a level is allowed to wander. With surge tuning, even a small vessel can take hours to return to setpoint. [1]
For the general method of scheduling gains across operating ranges, see PID gain scheduling: practical tuning and multi-loop verification.
Limits
- The worked numbers come from one simulated vessel in the article (10 minute fill time) and one example tuning map (fill time to deadtime ratio of about 6 to 1). Your minimum and maximum gains depend on your process. [1]
- The article is part 1 of a series; operator practice and further cases are outside this post.
- Our reproduction uses a simple integrating model and a velocity form PI; it matches the article's reported numbers but is not a plant validation.
- A qualified engineer still has to review any tuning before it runs on real equipment.
Key takeaways
- Use a low gain near setpoint and a high gain far from it, so the vessel absorbs swings and still stays within limits. [1]
- Keep the gap gain above zero to avoid ping-pong between the gap limits. [1]
- Check that the output can reach full travel before the level reaches an unsafe point, and clamp the setpoint. [1]
- Confirm PID form, units and action before transferring any tuning numbers. [2]
- Do not apply surge tuning to levels that need tight control, such as thermosiphon reboilers. [1]
Frequently asked questions
What is PID level surge control?
It is level tuning that lets a vessel absorb inlet flow swings instead of passing them downstream. The controller ignores small level changes and responds strongly only to large ones, usually through a setpoint gap or another gain schedule. [1]
Why can't the gain inside the gap be zero?
With zero gain, any persistent mismatch between inlet and outlet flow drifts the level to a gap limit, where full gain takes over and pushes it to the other limit. The resulting ping-pong upsets the downstream unit at regular intervals. [1]
What gap and gap gain should I start with?
The Control Engineering example starts with a gap of ±10% around setpoint and a gap gain of 0.5 (0.25 times a gain of 2.0), with an integral of 20 minutes per repeat. Then check that the output reaches full travel before the level reaches a limit. [1]
Which levels should not use surge tuning?
Levels that the process depends on, such as the bottom level feeding a thermosiphon reboiler and the receiver level in a mass balance distillation scheme. [1]
Sources
- Bullerdiek, E. "PID spotlight, part 35: PID level surge control part 1." Control Engineering, 1 December 2026. https://www.controleng.com/pid-spotlight-part-35-pid-level-surge-control-part-1/
- McMillan, G., with Cornelsen, E. "Keys to successful PID block performance." Control Global, 1 December 2026. https://www.controlglobal.com/control-talk-column/article/55422232/keys-to-successful-proportional-intergral-derivative-block-performance
If you have a model or IO data for one of your own loops, LabCD's guided workflow lets you tune and test a controller on your first model for free, with a qualified engineer approving every controller.
Want to try this on your own plant model?
Try LabCD free with your first model