I am frequently asked to visit offshore production platforms to sort out problems with the oil export or the produced water quality where the ultimate issue is not poor control in the export or water-handling systems but due to over-aggressive level control at the reception end of the process. One of the tools available to decouple the front and back ends of the production train is error squared control and this technique will often provide sufficient improvement in the overall process stability to allow more in-depth analysis of the downstream systems. This article describes the error squared algorithm and provides a few notes on the tuning of these controllers.
The equation for a standard ideal PI controller is:
where e is the error i.e. (desired value – actual value)
Kp is the proportional gain
Ti is the integral time in minutes/repeat
s is the Laplace operator
When a fluid slug enters a separator, the oil level moves away from the desired level i.e. error e increases. The proportional term Kp.e transfers this deviation directly onto the controller output causing the level control valve to move proportionally to the error, thereby changing the oil outlet flow by a similar percentage. This is clearly shown in the left-hand half of the trend in Figure 1, the upper pen indicating the oil level and the lower pen the control valve. The control valve is ‘chasing’ every single change in the level and the overall effect is to pass the level disturbance directly onto the downstream process. This particular offshore facility had experienced major difficulties in metering the oil export due to the instability in the flow.
The effect of slugging on the separator outlet flow is minimised by changing the controller algorithm to a weighted error-squared controller:
where Kw is a weighting factor and |e| is the modulus of the error
This error-squared controller is a non-linear function whose control action increases with magnitude of the error. The effect is shown in the right-hand side of Figure 1. Small deviations from the setpoint result in very little change to the valve leaving the outlet flow almost unchanged. Large deviations are opposed by much stronger control action due to the larger error, thereby preventing the level from rising too high in the vessel.
Overall, this modified controller has the benefit of more steady downstream flowrates under normal operation with improved response to major throughput changes. Note that much of the instability in the level has also been removed due to the controller not fighting to maintain tight control. After implementation of this solution, the accuracy of the flow metering was much improved.
The error squared algorithm can be readily implemented in many DCS and PLCs: the trend in Figure 1 was the result of installing error squared on a Moore controller. A variation on the above scheme is available in the Honeywell TDC3000 control system in the form of the gain squared algorithm:
Like the error squared type, the gain squared algorithm increases the gain with respect to magnitude of the error. The integral term is not modified, but always retains its full effect. Without careful selection of the integral time (and the weighting factor not shown in the equation), this can result in a continuous oscillation of the controller output.
Due to the non-linear nature of the control algorithm, error squared controllers can not be tuned using conventional techniques. Anyway, since error squared is usually used to reduce slugging effects, conventional tuning techniques would be difficult to setup: the next slug always arrives just as the manual step test is underway! Actually, this is not often an issue for U-Tune  as long as the time delay and the curvature of the response are identifiable on the trend data.
My tuning method is based on the principle that by the time the vessel level has risen to a maximum allowable point the error squared controller must have allowed as much oil to pass as the conventional controller. Simple maths shows that gain calculated by the error squared controller at this maximum level must be about 50% higher than gain of the conventional controller. A little bit of arithmetic then gives the gain to punch in to the controller. I usually repeat the calculation for the minimum allowable level and initially select the higher of the two gains.
1. U-Tune is available from www.contek-systems.co.uk
Figure 1. Trend of a separator level controller before and after initiating error squared