Can gain scheduling be used to improve PID level controller performance? What type of disturbances can be mitigated by surge control? Would every level controller benefit from surge control tuning?

Insights about PID controller level surge control
- Gain scheduling can be used to improve PID level controller performance. Low gain when the PV is close to SP (in the gap) limits the impact of disturbances to downstream processes while high gain when the PV wanders from SP can keep the level under control (outside the gap).
- The controller gain inside the gap cannot be zero, otherwise the controller will “ping-pong”, upsetting the downstream process continuously.
- Some levels are not candidates for surge control. Understand your process before implementing surge control.
Proportional-integral-derivative (PID) controller gain scheduling can be applied to integrating processes to improve performance in certain applications. Level surge control is by far the most common application for controller gain scheduling of integrating processes, therefore this article will focus on level control. However, any integrating process, whether liquid level, gas pressure or any thermal process, can be controlled using these techniques. The only requirement is that the controller is to ignore small deviations while still maintaining the process within limits.
Surge control objectives
The objective of level surge control is to ignore small changes in level caused by swings in inlet flow. The intent is to not pass these changes to the downstream process, because the best way to control upsets in the downstream process is to not feed it upsets to begin with. A smooth feed rate means a smooth process, which may improve product recovery and allow higher charge rates.
However, the controller must still respond to large changes in inlet flow to prevent the level from overflowing or allowing the vessel to run dry. This can have calamitous results and must be avoided.
Therefore, when controller gain scheduling is used, it is with low controller gain through the middle of the level range and a high gain at each end. This can use a fixed span, perhaps a low gain between 35% and 65% level with a high gain outside those levels. Or, more commonly, setpoint (SP) gap control is used because it is built into the control system. Either method works; the one selected depends more on which requires less work.
Will gain scheduling help my level and, thus, my process?
Levels, by their very nature, dampen rapid swings in inlet flow rate, and the larger the vessel the stronger the damping effect. Therefore, a candidate for surge level control should have an inlet flow with large and persistent inlet flow rate changes, but not so large that they cannot be contained within some reasonable distance from the controller setpoint.
Figure 1 illustrates how a smaller vessel (10 minute fill time) can dampen a relatively quick swing in the vessel inlet flow (±5% on a 2 minute interval). The level moves about 0.3% during each swing, which means that with default level tuning (K = 2.0, Ti = 20 minutes/repeat) the controller output (OP) moves 0.6%. If the controller output normally runs about 50%, a 0.6% swing in OP is a 1.2% swing in feed rate to the downstream unit. It would have to be an extremely sensitive process for anyone to spend extra effort to fix this.

Figure 1: PI controller response to input flow swings. Tuning constants are K = 2.0, Ti = 20 minutes/repeat, Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer
However, the slower ±5% inlet flow swing that starts at the 30 minute mark results in a much different response. The level now swings about 4.2% from peak to peak. With the controller gain of 2.0, the OP is now swinging 8.4%. Again, assuming a normal controller output of 50%, the 8.4% swing results in a persistent almost 17% swing in feed rate. No process unit is going to handle this well.
One of the problems with the control of integrating processes is slow swings can be amplified by controller tuning. This can be a serious problem if level controllers are chained together, as they often are in the complex distillation systems found in refineries and chemical processing plants. The obvious fix to this controller output swinging problem is to lower controller gain, preferably to zero within a gap large enough to contain the process variable (PV) swing. In this case it looks like a ±5% gap around the setpoint will work.
Figure 2 shows that indeed, setting an SP gap wider than the PV swing and setting the gap gain multiplier to zero does prevent the OP from moving because of the persistent input movement. Unfortunately, the fix is not this simple (if it were, this would be a very short article).

Figure 2: SP notch gap PI controller response to input flow swings. Tuning constants are K = 2.0, Ti = 20 minutes/repeat, Td = 0 minutes, SP gap = ±5%, gap gain multiplier = 0. Courtesy: Ed Bullerdiek, retired control engineer
If the SP gap gain is zero, the controller will eventually start to ping-pong between the upper and lower gap limits as seen in Figure 3. This will occur when there is a persistent gap between the input flow and the output flow as set by the controller output position. This has surprised more than one young professional (speaking from experience). Of course, the ping-pong effect changes the flow to the downstream unit, upsetting it at regular intervals. Fixing this is going to require a deeper analysis of PID control of integrating processes.

Figure 3: SP notch gap PI controller “ping-pong” response. Tuning constants are K = 2.0, Ti = 20 minutes/repeat, Td = 0 minutes , SP gap = ±5%, gap gain multiplier = 0. Courtesy: Ed Bullerdiek, retired control engineer
A review of tuning integrating processes
If a controller gain of zero creates an unacceptable “ping-pong” effect, how low can the controller gain go? And, outside the controller gain gap, how high can the controller gain go? We certainly need to have the controller output go fully closed before the vessel runs dry and fully open before the vessel overflows. Setting a gap with a low controller gain in the middle will require raising the controller gain outside the gap. Answering these questions requires a review of PID controller tuning basics for integrating processes.

Figure 4: Controller stability decreases as the fill time/deadtime ratio decreases, constraining the possible controller gain, which limits controller effectiveness. Below a 1:1 ratio effective control is no longer possible. Courtesy: Ed Bullerdiek, retired control engineer
Figure 4 is from PID spotlight, part 13, which covers the effect of fill time/deadtime ratio on PID controller stability. The ultimate gain/2 line is the maximum non-oscillatory controller gain that can be used based on the process’s fill time/deadtime (Tfill/Dt) ratio. If you are unfamiliar with how to calculate the Tfill/Dt ratio please read PID spotlight, part 14, on open loop tuning of an integrating process.

Figure 5: Integrating process PI controller tuning map. Kp = 0.2%/minute, T1, T2, T3 = 30 seconds, Dt = 0 seconds. Courtesy: Ed Bullerdiek, retired control engineer
Figure 5 is the PI controller tuning map for an integrating process with a roughly 6:1 fill time/deadtime ratio (not the process shown in Figures 1 through 3). When integrating processes were introduced in PID spotlight, part 11, one of the things covered was that there must be a minimum controller gain to prevent the controller from going unstable from unconstrained integral action. The green line in Figure 5 shows that as integral is slowed down controller gain can also be lowered but cannot go to zero. Surge control tuning for this process should have an integral setting of 20 minutes/repeat or higher and a controller gain of 1.0 or below. Lower is better for surge control; at an integral of 20 minutes/repeat controller gain could be set as low as 0.6, or as low as 0.25 when integral is set to 60 minutes/repeat.
The overall takeaway from Figures 4 and 5 is there will be a maximum controller gain and minimum controller gain that can be used for a gain scheduled level surge control application. What these are will depend on the process. (Also read PID spotlight, parts 31 through 34 on SP gap control and simple gain scheduling before proceeding.)
Planning an SP notch gap surge control application
If there are any concerns about the process, start with an open loop step test to determine the fill time and deadtime. Use Figure 4 to determine the highest controller gain that can be used; use the ultimate gain/2 line (non-oscillatory control line).
Do not attempt to create a version of Figure 5 for your process. This is very time consuming (and is best left to retired engineers with plenty of time and an excess of curiosity). Determining the minimum gain is best done using heuristic methods. The one thing you can count on is that the slower the integral constant is, the lower the controller gain can go.
An open loop step test of the process featured in Figures 1 through 3 yields:
Fill time (Tfill): 10 minutes
Deadtime (Dt): 0.48 minutes
The fill time/deadtime ratio is 20.7 to 1. The maximum non-oscillatory controller gain is about 15, well beyond any gain we would consider for control. Most level controllers should have a high fill time/deadtime ratio unless there is something unusual with the process (if a level has a low Tfill/Dt ratio check the instrumentation.)
Based on Figure 2, the minimum gap size could be ±5%, but we’ll start with ±10% to build in some excess capacity. The gap gain will start at 0.5, which will halve the impact of the swing size on the controller output movement. (Lower would be better, but this is a reasonably conservative starting point.)
Setting the controller gain outside the gap requires some decisions about how high/low the level will be permitted to go before the controller output reaches 100/0%. Visually this may look like Figure 6.

Figure 6: Notch gap gain setup: Controller gain (K) = 2.0, negative gap = 10%, positive gap = 10%, gap gain multiplier = 0.25. Courtesy: Ed Bullerdiek, retired control engineer
The notch gap gain planning chart in Figure 6 is based on a controller gain of 2.0 and a notch gap gain multiplier of 0.25, which results in a gain inside the gap of 0.5. The controller output line is created assuming the OP is at 50% when the process error is zero. This combination of gap gain and overall gain will ensure that the OP will be 0%/100% when the process error is ±32.5%. If the OP normally runs at a different value adjust your calculations accordingly.
Creating a chart like Figure 6 is not necessary. This is a reminder that a sanity check is required when designing an application. A quick calculation on a scratch pad will suffice. Also note that the chart doesn’t account for the effect of integral action, which will reduce the error relative to a simple gain only calculation.
How well does the SP notch gap gain controller work?
The first concern with setting up a gap controller is how well will the controller respond to changes in inlet flow. Will the response be slow and conservative to PV changes inside the gap and aggressive enough to maintain the PV within limits when large inlet flow changes occur?

Figure 7: SP notch gap PI controller response to small and large input flow step changes. Tuning constants are K = 2.0, Ti = 20 minutes/repeat, Td = 0 minutes , SP gap = ±10%, gap gain multiplier = 0.25. Courtesy: Ed Bullerdiek, retired control engineer
Figure 7 helps to answer the question of how the tuning shown in Figure 6 will work. The controller response to the 5% change in inlet flow at the 10 minute mark is reasonably restrained. It takes slightly over 23 minutes before the controller output rises 5%, matching the change in inlet flow. The OP peaks at 1.5% above inlet flow (6.5% above initial starting point) about 47 minutes after the flow change. This should permit the process after the level to absorb the flow change without too much trouble (and is certainly better than hitting it with an instant 5% change).
The 25% jump in inlet flow at the 2 hour mark presents the controller with a new challenge; keeping the level within the vessel. The controller’s initial response uses the 0.5 controller gain inside the gap. This only lasts a short time (about four and one half minutes) before the PV exceeds the gap limit. During this four minutes, the controller output only moves slightly more than 5%.
Once the PV exceeds the gap limit, the controller gain increases by a factor of 4 (K = 2.0), and the controller integral speeds up by a factor of four. This results in the controller output matching the inlet flow in a little over five and a half minutes after the PV crossed the gap limit. Both the higher controller gain and faster integral contributed to the response, and the faster integral resulted in significant OP overshoot (6%) at 20 minutes after the inlet flow changed. This is a fast response, and the PV peaked at 65.6%, slightly more than 10 minutes after the flow changed.
The downstream process would be upset by this sudden change. Heuristics would suggest that slowing down the integral could be in order depending on how long the PV could be permitted to remain off setpoint and, assuming sudden disturbances never exceed 25%, that controller gain might be lowered. This will not eliminate process upsets following large inlet flow changes, the vessel is much too small for this, but could mitigate them to the largest degree possible.
The second concern is how well the gap tuning manages a persistent inlet flow disturbance. Does it sufficiently manage the disturbance without passing it through, much less amplifying it, to the downstream process?

Figure 8: SP notch gap PI controller response to input flow swings with step changes. Tuning constants are K = 2.0, Ti = 20 minutes/repeat, Td = 0 minutes , SP gap = ±10%, gap gain multiplier = 0.25. Courtesy: Ed Bullerdiek, retired control engineer
Figure 8 provides an encouraging picture of how the controller tuning responds to the persistent inlet flow swing while still providing strong control of a large inlet flow disturbance. The 5% inlet flow disturbance at the 10 minute mark is barely noticeable against the 10% inlet flow swing. It shows up as the PV being pushed off the SP, which the controller’s integral action slowly corrects.
The 25% disturbance at the 2 hour mark is easily seen, and, as before, the controller fairly quickly catches it and turns the direction of the PV back towards the SP. Through a quirk of interaction between the inlet flow swings and the controller response, the controller output peaked at only 5% above the average inlet flow rate. This easily could have been higher. Regardless, the persistent swing did not interfere with the controller’s response to either the small or large inlet flow disturbances.
The 10% persistent inlet flow swing resulted in a 4.9% swing in the PV, which, through controller action, translated into a 2.5% swing in the controller output. Assuming the normal controller output is 50%, this would translate into a persistent 5% swing in flow to the downstream process. This is not ideal but is much better than the 20% (10% ÷ 0.5) swing that would occur if the inlet flow was sent directly to the process. (If the normal controller output is not 50%, substitute its normal value to calculate disturbance size.)
There appears to be room for improvement. Heuristics would suggest that the integral is too fast; the OP peaks slightly after the PV in response to the persistent inlet swings, and the OP does overshoot the PV perhaps more than necessary when a large disturbance occurs. Increasing the integral to 30 or even 40 minutes/repeat may improve response. There may also be room to lower the overall controller gain; perhaps to 1.5 if historical data doesn’t show some truly large inlet flow disturbances. These changes were tested (but not shown). The changes did incrementally change controller response in the desired direction, with the emphasis on incremental. The biggest change occurred from adding the gap control and using a consistent method to set the tuning constants.
(Take a moment to note how slow even a small vessel’s level responds to changes. This is the smallest sized vessel that would be designed for refinery operations, and it can take hours for typical surge control tuning to return the process variable to setpoint.)
Planning a V-notch gap surge control application
The V-notch gap gain calculation is used with the positional form of the classical PID controller calculation. Some systems offer different versions as part of their PID algorithm, but for this example the controller gain is calculated based on the error (PV – SP) as follows:
K = ABS(Error)*Kslope/10 + Knotch
Where:
Kslope is how fast the controller gain should increase per 10% error.
Knotch is the controller gain when the error is zero.
The setup is a little different than the notch gap algorithm because you set the lower control gain and then set the slope calculation for the higher gain.
Let’s start by setting up the V-notch tuning to mimic, as far as possible, the notch gap algorithm. Therefore Knotch will be set at 0.5 to match the notch gain in the example above. Kslope is a little more difficult because gain increases with error, rather than simply taking a step up when the error crosses 10%. Best guess is the controller gain should reach 2.0 when the error reaches 20%, therefore Kslope should equal:
K = ABS(Error)*Kslope/10 + Knotch
2.0 = ABS(20)*Kslope/10 + 0.5
Rearranging yields:
Kslope = 10*(2.0 – 0.5)/ABS(20)
Kslope = 0.75
How did we do?

Figure 9: SP V-notch gap PI controller response to input flow swings with step changes. Tuning constants are Knotch = 0.5, Kslope = 0.75 {10%error}-1, Ti = 20 minutes/repeat, Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer
Figure 9 is very similar to Figure 8 despite the change from an SP notch gap to an SP V-notch gap controller. Using tuning that mimics a notch gap controller appears to provide a good starting point. Regardless, the controller gain does increase as the PV swings around the setpoint. We should expect the controller output to swing more than in does with the notch gap controller, which it does. In this case the controller output is swinging 2.9%, whereas it the swing was 2.5% when using the notch gap controller.
As in the above example, there does appear to be room for improvement here. Following heuristic rules integral will be slowed down to 30 minutes/repeat. The minimum controller gain Knotch will be lowered to 0.25 to suppress controller output movement when the PV is close to SP while still preserving controller response to large PV changes.

Figure 10: SP V-notch gap PI controller response to input flow swings with step changes. Tuning constants are Knotch = 0.25, Kslope = 0.75 {10%error}-1, Ti = 30 minutes/repeat, Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer
The results of the two tuning changes are shown in Figure 10. Reducing Knotch did lower the effective controller gain throughout the controller’s operation, resulting in a smaller controller output swing of 1.9% (versus 2.9%) when the PV remains close to the SP. The controller response to the large inlet flow change at the 2 hour mark was still strong even if, as expected, the maximum controller gain is lower at 1.38 (versus 1.53 above).
The slower integral constant did slow down the return of the PV to the SP, which creates a problem. When the PV is far from SP, the controller output swings strongly because the controller gain is high. The slow return of the PV to SP allows this behavior to persist. Downstream process performance may be better served by using a faster integral constant. The downstream process will be upset by the fast controller response to the large inlet flow change; it would be best to get the PV back to SP faster to suppress the controller output swings associated with the inlet flow swings more quickly. This will allow the downstream process controls to line out the process faster.
Ordinary gain scheduling
It was mentioned at the beginning of this article that ordinary gain scheduling can be used instead of any of the SP gap gain scheduling algorithms. The SP gap scheduling methods were highlighted because they are often built into the control system and can be deployed quickly and easily. If your system doesn’t offer a built in SP gap algorithm, it will be easier to build an ordinary gain schedule. Nominal tuning should be a controller gain (K) in the range of 0.2 to 0.5 between 35-65% level, and between 1.5 to 2.5 outside that range. If your system uses the positional PID form, provide a continuous transition between the low and high control gain zones.
Other considerations: Setpoint, surge control
Clamp the setpoint. This is to ensure that the setpoint cannot be set so high (or low) that the controller output will not reach 100% (0%) should the level overfill (or run dry). It’s a simple thing, but it’s usually the simple mistakes that will get you in trouble.
Do not install any kind of surge control tuning if the process depends on tight level control. Two examples from refining are:
- Thermosiphon reboilers
- Mass balance distillation control schemes.
The heat transfer rate in a thermosiphon reboiler on a distillation tower is very dependent on liquid level in the bottom of the tower. A certain engineer early in his career set benzene, toluene and xylene towers swinging by installing surge level control tuning. All products remained off specification for a day or two while the towers swung constantly because the reboiler heat transfer rates swung with the bottom level. The old put-it-back-the-way-it-was trick solved the problem (why we keep loop tuning logs) followed by some research and more than one shame-faced explanation about how this mistake occurred and why it wouldn’t ever happen again.
High purity distillation columns frequently set distillate draw rate to control overhead product composition. The receiver level then sets the reflux rate in what is referred to as a “mass balance” control scheme. Tight level control is to make compensating changes to the reflux rate whenever the distillate draw rate is changed, which is ultimately what controls overhead composition. (This control scheme is used for controllability purposes when the reflux/distillate ratio exceeds 10:1.)
Working with operators
Do not be surprised by operator pushback when installing surge control tuning on a level controller. Depending on the local culture, operators may have been conditioned to expect tight control on all controllers, including levels. It may be considered a radical idea that a level could be off setpoint for several hours, and that being off for that time is actually a good thing. This is just a reminder; success in this job can depend more on our communication skills than our technical skills.
Ed Bullerdiek is a retired control engineer with 37 years of process control experience in petroleum refining and oil production. Send comments and questions to [email protected]. Edited by Mark T. Hoske, editor-in-chief, Control Engineering, Arrowfly Media, [email protected].
Keywords
Proportional-integral-derivative, PID tutorial
Learning objectives
- Know what type of flow disturbances can be damped by gain scheduled PID level control tuning.
- Understand the upper and lower gain limits for the gain schedule to avoid instability. Know how to avoid the “ping-pong” effect.
- Know how to set up SP notch-gap and V-notch gain schedules for PID level surge control. Understand the heuristics can be used to improve controller performance after initial tuning.
Consider this
Gain scheduling can greatly improve PID level controller operation, greatly damping incoming flow rate disturbances. However, care must be taken to understand what kind of disturbances can be mitigated by gain scheduling, how to set up the gain schedule to avoid instability or the “ping-pong” effect and understand that some levels are not candidates for surge level control.
You also might like
PID series from Ed Bullerdiek, retired control engineer
PID Spotlight, part 1: Three reasons to tune control loops: Safety, profit, energy efficiency
PID spotlight, part 2: Know these 13 terms, interactions
PID spotlight, part 3: How to select one of four process responses
PID spotlight, part 4: How to balance PID control for a self-limiting process
PID spotlight, part 5: What does good and bad controller tuning look like?
PID spotlight, part 6: Deadtime? How to boost controller performance anyway
PID spotlight, part 7: Open-loop tuning of a self-limiting process
PID spotlight, part 8: Closed-loop tuning for self-limiting processes
PID spotlight, part 9: Heuristic tuning for a self-limiting process (part A on heuristic tuning)
PID spotlight, part 10: Heuristic tuning in a self-limiting process
PID spotlight, part 11: How a PID controller works with an integrating process
PID spotlight, part 12: What does good and bad controller tuning look like?
PID spotlight, part 13: Deadtime: what’s the best that I can do?
PID spotlight, part 14: Open loop tuning of an integrating process
PID spotlight, part 15: Open loop tuning of near integrating processes
PID spotlight, part 16: Closed loop tuning of an integrating process
PID spotlight, part 17: Heuristic tuning of an integrating processes
PID spotlight, part 18: Identifying control valve performance problems
PID spotlight, part 19: PID controller tuning mechanics
PID spotlight, part 20: Tuning with bad valves
PID spotlight, part 21: Noise: Can I tune around it?
PID spotlight, part 22: Can I tune a noisy PID controller?
PID spotlight, part 23: Filtering noise for better PID control
PID spotlight: part 24: How do I tune PID controllers during a new unit startup?
PID spotlight, part 25: Navigating PID controller tuning
PID spotlight, part 26: How fast should I tune my PID controller?
PID spotlight, part 27: Navigating PID controller tuning
PID spotlight, part 28: How well will my PID controller work?
PID spotlight, part 29: How to shape PID controller response – part 1
PID spotlight, part 30: How to shape PID controller response – integrating processes
PID spotlight, part 31: What is PID gap control?
PID spotlight, part 32: Shaping controller response using setpoint gap action
PID spotlight, part 33: Managing noise using setpoint gap action
PID spotlight, part 34: PID controller gain scheduling
More on PID and advanced process control from Control Engineering