## July 2021

## Bonus Report: The Digital Plan

# Integral vs. proportional gap for averaging level control

In process plants, many instances of level control are required to keep the material balance of the plant from integrating to undesired operating conditions.

In process plants, many instances of level control are required to keep the material balance of the plant from integrating to undesired operating conditions. Level control of distillation column bottoms or reflux drums are good examples. Here, the column will overfill or de-inventorize if the average of the sum of the distillate and bottoms flow is not kept the same as the average feed to the column. While thifs condition must be met, the plant is simultaneously afforded the opportunity to let these levels drift away from setpoint (SP) to stabilize the flows that are manipulated to control the levels. If this is done correctly, a huge benefit can be achieved in terms of stability of downstream equipment. This is referred to as level buffering or averaging level control.

Some levels require very tight adherence to SP and averaging level control should not be applied. Examples of these systems include levels in knock-out pots where little volume is available to separate liquid and vapor streams. In these systems, vapor or liquid carryover into the wrong outlet can typically lead to severe process upsets or equipment damage; therefore, tight level control with aggressive tuning is applied.

If averaging level control is done incorrectly and the level controller’s process variable (PV) is allowed to stray too far from SP, process issues—such as pump cavitation or liquid carryover—can occur. These process conditions should normally be avoided by using alarms to warn the operator of impending issues, as well as trips to prevent such occurrences. Alarms or trips are undesired occurrences, and care should be taken when tuning averaging level controllers, as frequent alarms or trips will cause operators to lose faith in the control solution and find ways to circumvent it.^{1} This behavior sometimes influences process control engineers to forego the benefits of averaging level control altogether. Many instances can be found in industry where tight level control allows plant upsets to be propagated to downstream equipment, and often the effect of an upset is amplified rather than mitigated.

Many plants have feed drums and tuning these level controllers tightly essentially reduces a drum to nothing more than a pipe, wasting the initial capital outlay of installing the drum. In some instances, feed drums or tanks are used to ensure the availability of feed material during upstream process upsets—in these cases, levels are kept at a high SP, keeping the drum full in case of a disruption in feed flow. Additionally, a small amount of averaging level control can still provide substantial stabilizing benefits while keeping the level at a high average value.

Averaging level control methods can also be applied to integrating variables other than levels. A typical example is a gas/vapor pressure that is controlled by manipulating the gas flow into or out of a vessel or pipeline.

Many averaging level controllers are deployed using PI, gap or non-linear controllers and tuning rules exist to optimize their performance.^{1,2,3}

## Discussion

A typical PI controller equation that is commonly used in industrial distributed control systems (DCSs) is shown in Eq. 1:^{4}

(1)

where:

* δOP* = change in controller output* K _{c}* = controller gain, a tuning variable

*E*= PV error (PV-SP) at the current execution cycle

_{n}*E*= PV error at the previous execution cycle

_{n-1}*ts*= execution cycle time of the DCS

*T*= integral tuning constant.

_{i}When a level is subject to a disturbance, the PV will begin moving away from SP, causing PV error (*E _{n}*) to increase if the disturbance moves the PV upward. Eq. 1 shows that while the PV is moving away from SP, the proportional action (Eq. 2) and the integral action (Eq. 3) will have the same sign:

(2), (3)

While the PV is moving away from SP, both proportional and integral will work together to reject the disturbance.

When enough control action has been taken to reduce the rate of change of the level to zero, proportional action will have reduced to zero because (*E _{n}* –

*E*) will be zero. The integral action will keep manipulating the OP to reduce

_{n-1}*E*to zero.

_{n}Next, the level will begin returning to SP. During this phase, proportional and integral will oppose each other. Integral action will still attempt to reduce error (*E _{n}*) to zero, while proportional will react to the reduction in error (

*E*–

_{n}*E*will now be negative) by moving the OP in the opposite direction. It can be seen as integral driving the error to zero while proportional is applying the brakes to prevent the PV from overshootinfg SP.

_{n-1}The PI tuning should be such that during this phase the proportional control is strong enough to not permit the integral action to cause overshoot. If this is not done, a slow cycle in the level will result, negating the desired benefits of averaging control. In gap and non-linear controllers, this effect is made worse by the decrease in proportional tuning when the PV is close to SP.

When conducting averaging control, the dilemma is that weak proportional control is needed to allow the level to deviate from SP to minimize OP movement. However, the need to have the integral action weaker than proportional during the phase when the PV is returning to SP remains. Therefore, in averaging level control the integral action must be tuned very weakly to prevent the level from cycling.

Very weak integral action means that the level will take a very long time to return to SP. When using typical PI tuning for averaging level control,^{1,2,3} it will typically take more than six times longer to return the level to SP than the time it takes to turn the level after a disturbance, as can be seen in **FIG. 1**. Depending on the frequency of disturbances, this may be a problem as new disturbances may occur while the PV is still far away from SP.

To enable more aggressive tuning when the PV is close to limits while still allowing the controller to slow down the approach to SP enough to prevent overshoot, the integral gap controller (IGC) is proposed. Defining an integral gap as a set distance above and below SP where less integral control action is taken when the level is close to SP (error is small)—while taking more aggressive integral action when the level is farther from SP (error is large)—takes care of the potential overshoot when the level is returning to SP. This is done by changing the value of *T _{i}* in Eq. 1 from a larger number (

*T*) to a smaller number (

_{i in gap}*T*) when the PV moves outside the gap.

_{i outside gap}When this is done, a disturbance will start the level moving away from SP. Proportional control will counteract the increase in level while little integral action will be taken. Once the level moves outside of the defined gap, integral action will increase to assist the proportional in changing the direction of the level until the level will start moving back to SP. Proportional control will work in the same direction as integral, both attempting to turn the level back to SP.

Once the level has turned, the increased integral action will still be applied, increasing the rate at which the level will return to SP. At this stage, proportional control will start working against the integral action, attempting to slow down the return to SP. As the integral action is still tuned aggressively, it should overshadow the proportional, causing the level to quickly return to SP.

Once the level moves back into the gap, decreased integral action will decrease the effect of moving the PV back to SP. Proportional action will still react to the decrease in error, slowing the rate of change of the level and preventing overshoot or a possible cycle. If tuning is applied incorrectly, the proportional may overpower the decreased integral action in the gap to the point where the level will again not reach SP in the desired timeframe.

Tuning the IGC is done by setting:

- The width of the integral gap (how far the PV must be from SP before the integral action is increased)
- The tuning constant for the integral action when the PV is in the gap (
*T*)_{i in gap} - The tuning constant for the integral action when the PV is outside the gap (
*T*)._{i outside gap}

The tuning of the proportional gain (*K _{c}*) is done as for a typical PI controller.

By setting the gain, the integral tuning and the gap correctly, the IGC can:

- Avoid causing overshoot
- Aggressively return the PV to SP while the error is large
- Slow down the controller while the error is small.

## Simulation

To demonstrate the principle, a level was simulated and controlled using a typical DCS used in industry. The IGC was compared to a PI controller that was tuned to prohibit the level moving further than 20% from SP when the maximum disturbance of 5 m^{3}/hr occurs. To illustrate the outcome of using the IGC, the gap size as well as the amount of integral action taken inside and outside the gap were changed.

Control performance indicators like integrated absolute error (IAE) or integrated squared error (ISE) are typically not used when considering averaging level control, as the controller is only required to maintain the level between limits without minimizing the error between SP and the PV. With averaging level control, the performance indicators considered typically focus on minimizing the movement of the OP, like the variance of the OP derivative (VOD)^{5,6,7} as shown in Eq. 3 or the average of the absolute move of the OP (AAMO) shown in Eq. 4:

(3)

where:

* N* = number of execution cycles* OP* = controller output* µ* = mean of the OP for all execution cycles.

If the IGC is tuned aggressively, the controller will move the OP past the steady-state value and then change direction. To show this behavior, the AAMO metric (as shown in Eq. 4) was developed as an additional performance indicator.

(4)

where:

* N* = number of execution cycles* OP* = controller output.

As the advantage of the IGC is that it repositions the system quicker by bringing PV back to SP faster than a normal PI controller, it is worthwhile to also consider performance metrics that measure the control performance, such as integrated absolute error (IAE) and integrated squared error (ISE). Specifically, the ISE should be considered, as the IGC will aggressively counteract PV error when the PV is outside the integral gap while acting less aggressively when the PV is inside the gap. The ISE will provide a better indication of whether the IGC does this successfully.

The difference between a PI averaging level controller with typical tuning and an IGC is shown in **FIGS. 1** and **2**. Both controllers were tuned to reject a 5-m^{3}/hr step disturbance with a high limit set at 70%.

The IGC was tuned with a 10% gap on either side of SP: *T _{i outside gap}* = 96 and

*T*= 256.

_{i in gap}The IGC gap was set to 10% and **FIGS. 1** and **2** show how the more aggressive control action decreased when the PV returned to less than 60%. Studying the OP trajectory also shows how the proportional action that was increasing the OP on the return of the PV towards SP made larger OP moves than the decreased integral action that was still moving the OP downwards. This caused the PI controller to overtake the IGC and have less remaining PV error towards the end of the test.

Even though the intent of the IGC is to reach SP sooner than the traditional PI controller, tuning the IGC this way has merit as small disturbances that occur while the PV is close to SP will be rejected less aggressively, and return to SP will also be done slowly, leading to improved averaging level control on smaller disturbances.

**FIG. 2** also shows the obvious disadvantage that bringing the level back to SP sooner will require slightly larger OP moves. This disadvantage must be offset by the advantage of being ready for a subsequent disturbance sooner.

**TABLE 1** shows that the IGC performed better on the squared error metric, as it brought the PV closer to the SP in a shorter time. The VOD showed that the IGC was slightly gentler with the OP movements, while the AAMO penalized the IGC for overshooting the steady-state value more than the PI controller.

This could be a typical way of tuning the IGC controller that would quickly bring the PV back into the gap and then act less aggressively to prevent overshooting SP. This would also enable the controller to be gentler when smaller disturbances occur that do not push the PV outside the gap.

For the IGC to reach SP sooner than the PI controller, either the integral action in the gap can be increased or the size of the gap can be decreased.

**FIGS. 3 **and **4** compare the performance of the IGC with more aggressive integral action in the gap with the PI controller.

These figures show how the IGC was able to get to SP sooner but had to move its OP faster to do so.

In **TABLE 2**, the IAE and ISE both show the positive effect of the IGC bringing the PV back to SP much faster, while the VOD and the AAMO both show how it had to move the OP faster and overshoot the steady-state value more.

The PV can also be brought back to SP faster by decreasing the size of the gap, as shown in **FIGS. 5** and **6**. Because the controller will then apply the full effect of the integral action for a longer time, the integral action in and outside of the gap will also have to be adapted to prevent overshoot.

The smaller gap meant that the controller had less opportunity for the proportional action to counter the prolonged aggressive integral action outside the gap. Therefore, the integral action inside the gap had to be extremely weak to prevent overshoot.

Once again, the metrics (**TABLE 3**) show how the IGC managed to bring the PV back to SP at a small penalty in terms of increased OP movement.

## Takeaway and recommendation

When averaging level control is applied where concurrent disturbances may cause the level to go outside limits, the IGC will enable the process control engineer to return the PV to SP faster, without the risk of starting a cycle on the plant. This will be accompanied by a slight increase in OP movement.

While the PV is close to SP, the IGC will make small moves, minimizing OP variance.

The IGC can be used to return to SP as quickly as possible or to react slower to smaller disturbances. This is done by setting the size of the integral gap and correspondingly increasing or decreasing the integral tuning inside and outside the gap.

If PID-based averaging level control is done using a PI controller on a system where disturbances occur frequently, the level can be returned to SP much faster by deploying an IGC. If this is done, the level control is afforded the opportunity of recovering from the current disturbance before the next disturbance occurs, ensuring that the PV stays clear of alarm or trip limits.

The IGC should be tuned so that the proportional action is dominant while the PV is inside the gap and the integral action is dominant when the PV is outside the gap. By adjusting the tuning, the trade-off between minimizing OP movement and getting the PV back to SP in time for the next disturbance can be optimized.

If the level is subject to many smaller disturbances, the gap of the IGC can be increased for the controller to react slower to smaller disturbances. This will assist in minimizing OP variance. **HP**

**LITERATURE CITED**

- King, M.,
*Process control: A practical approach,*Wiley, 2011. - Shinskey, F. G., “Special rules for tuning level controllers,” Controls, 2005, online: www.controlglobal.com/articles
- Friedman, Y. Z., “Tuning of averaging level controllers,” Petrocontrol, 1994, online: http://www.petrocontrol.com/papers/1994_Level.pdf
- Honeywell, “Honeywell Experion control builder components theory—Volume 1,” pp. 406–410, 2005.
- Kelly, J. D., “Tuning digital PI controllers for minimal variance in manipulated input moves applied to imbalanced systems with delay,”
*The Canadian Journal of Chemical Engineering,*Vol. 76, Iss. 5, 1998. - Lindholm, A., “Buffer management strategies for improving plant availability,” Thesis, Lund University, 2009.
- Ogawa, S., B. Allison, G. Dumont and M. Davies, “A new approach to optimal averaging level control with state constraints,” 41st IEEE Conference on Decision and Control, Las Vegas, Nevada, December 2002.

## Comments