Non-Linear Tank Level Control for Industrial Applications

Tank level control is ubiquitous in industry. The focus of this paper is on accurate liquid level control in single tank systems which can be actuated con-tinuously and modulation of the level setpoint is also required, for example in cascade control loops or supervisory Model Predictive Control (MPC) applications. To avoid common problems encountered when using fixed gain or adaptive/gain scheduled schemes, an accurate technique based around feedback linearization and Proportional Integral (PI) control is introduced. This simple controller can maintain linear performance over the full operating range of a uniform tank. As will be demonstrated, the implementation overhead compared to a regular PI controller is negligible, making it ideal for industrial implementation. Implementation details and parameter identification for adaptive implementation are discussed. Simulations coupled with experimental results using a large-scale laboratory level control system using com-mercial industrial control equipment validate the approach, and illustrate its effectiveness for both level tracking and disturbance rejection.


Motivation
Tank level control is one of the most commonly encountered applications in industry [1] [2] [3]. A range of level control systems and methods are commonly used in industry. The control of liquid levels, for example in process tanks, is an important function. Examples include hot water storage tanks where water is periodically removed, and the level needs to be restored ready for the next wash cycle, effluent treatment plants, reaction vessels and steam boilers. The focus of this paper is on accurate liquid level control in single tank systems, where actuation (typically through a pump or proportional valve) can be modulated continuously (c.f. on/off type control actions). Specifically, accurate level control of plant where modulation of the level setpoint is also required is considered; such situations commonly arise in cascade control loops [4], for example, or situations in which supervisory Model Predictive Control (MPC) is implemented [5].
Such schemes can often occur in practice when a level control system is integrated into a wider plant Distributed Control System (DCS) employing supervisory optimization schemes above the plant control interface levels [1] [3] [5].
A complication of level control in such situation arises due to the non-linear equations of the level dynamics themselves. The typical industrial solution for regulatory control is to use a Proportional-Integral (PI) or Proportional Integral-Derivative controller which is tuned around a particular (fixed) operating point (tank level), using a linear approximation of the dynamics for tuning purposes. Although the linear approximation is accurate around the chosen operating point, if the system is perturbed away from this operating point (for example due to a disturbance or setpoint change), performance deteriorates rapidly. This arises since the linear approximation employed to tune the PI controller becomes less accurate due to non-linearity, and a fixed gain controller is not able to adapt or re-schedule its gains to match the new process conditions. The focus of this research is to develop a simple but effective solution to this issue.

Previous Work
A variety of advanced control schemes have been proposed to improve performance in such situations (e.g. non-linear MPC, adaptive/predictive control, gain scheduling, fuzzy logic control [5]- [10]). Although adaptive and adaptive/predictive controls such as [6] and [7] can be effective for tracking and adapting to slowly varying process parameters, a drawback lies in the time taken to adjust to quickly varying parameters; as this would be the case for level control after a setpoint change or disturbance, performance would deteriorate. An additional drawback of adaptive schemes is the added implementation complexity of parameter estimation and adaptation schemes, which may render industrial implementation (e.g. on a Programmable Logic Controller (PLC)) difficult (or impossible) in some cases (although recent work has proposed efficient schemes to overcome this, see e.g. [8] [9]). The computational overheads of non-linear MPC are also prohibitive for PLC implementation [5]. Gain scheduling schemes based around PI/PID controls have been found to perform well and have a much simplified implementation over adaptive schemes, but require a significant and time-consuming effort at the design stage to correctly tune. This occurs due to the need to linearize the non-linear tank dynamics at numerous operating points over the working range of the controller, with controller tuning to meet a specification at each point then required [10]. Fuzzy logic design often aims to mimic the operation of gain-scheduled approaches, and hence require similar effort at design time, but have heavier implementation overheads than gain schedulers [8] [9].

Contributions
In this paper, a very accurate technique based around feedback linearization and PI control is employed, in order to create a simple controller which can maintain linear performance over the full operating range of a uniform tank. Unlike previous gain-scheduled approaches, there is no significant effort required at design time, and unlike adaptive or fuzzy schemes, the implementation overhead is negligible. Taken together, it is argued that the approach is ideally suited for industrial implementation, for example on a PLC which may be operating within the framework of a DCS. The paper includes a discussion on the use of (linear) parameter estimation techniques within an adaptive control framework, although this clearly increases the implementation overheads. A simulation study coupled with experimental tests on a large-scale laboratory level control system using industrial control equipment illustrates the effectiveness of the proposed approach for both tracking and disturbance rejection.

Structure
The remainder of the paper is organized as follows. Section II introduces the system model, and provides an insight into the non-linearity of the process under consideration. Section III develops the non-linear control strategy, presents tuning formulae, discusses how linear parameter estimation may be employed within an adaptive framework and also describes implementation aspects. Section IV provides simulation-based and experimental validation of the approach, while Section V concludes the paper.

One Tank System Model
A schematic of the main components of a single uniform cross sectional tank is as depicted in Figure 1. For this tank, the following differential equation is easily obtained: where A T represents the cross-sectional area of the tank and in out Q Q represents the input and output flows respectively. Assuming that the input control signal is represented by ( ) u t , the pump/valve has an effective flow gain v K , and the output flow is through an aperture of effective area O A , Equation (1) may be rewritten using Bernoulli's equation as follows:  Which can be re-written: This is clearly a non-linear dynamic equation since the tank outflow depends upon the square root of the current tank level ( ) Note that when ( ) 1 h t = , the parameter ( ) a t is equivalent to a′ , and hence a′ can be thought of as the nominal pole location for a unit level height. This pole location is effectively scaled by the reciprocal of the square root of the current level ( ) h t . Denoting "s" as the usual time derivative operator, a 1 st order time-varying "transfer function" is easily created from (4): So it is seen that both the static gain and effective time constant of this 1 st -order process are functions of the instantaneous level ( ) h t .

2-DOF PI Principle
Control of a first order system is easily achieved by the use of a PI controller. In order to maintain both tracking and regulation performance, to avoid the pres-ence of an additional transmission zero in the forward path it is common to use a 2-DOF controller (see e.g. [11] for a general description and tuning rules for such controllers) such as that depicted in Figure 2. This controller structure has the advantage of removing the controller zero from the closed loop dynamics if a regular error-activated PI controller was employed. It is advantageous in the current context as, with a simple modification, it produces linear closed-loop behavior for both tracking and regulation regardless of the current operating point ( ) h t . To see how this may be obtained, consider that for a first-order process, the closed loop dynamics when such a PI controller is employed is easily obtained through algebra and is given by: By setting ζω + = , one easily sees that (6) is simply the standard form of a unit-gain second-order transfer function. By comparing co-efficients, the controller is tuned for a desired damping ratio ζ and natural frequency n ω as follows:

Non-Linear Controller
Now, observe that only the model parameter b appears in (7b). Let us substitute for a our height-varying quantity ( ) a t into (7a) and manipulate further: Considering the required state feedback signal Separation of these two components with opposing signs gives the simple non-linear PI controller structure as shown in Figure 3. The controller is effectively a regular PI controller-giving the control signal ( ) u t ′ as in Figure 2, with the addition of an extra linearizing control signal where the latter signal is formed as the feedback gain l K applied to the square root of the current level ( ) h t . This controller is tuned to give the desired damping ratio ζ and natural frequency n ω for a (linear) second-order closed loop as follows: In order to select appropriate values for natural frequency and damping ratio from natural design specifications, the following relations hold for determining these two parameters from settling time t s (in seconds) and percent overshoot os Closer observation of the control procedure reveals that it is a form of feedback linearization non-linear control [12], with a state-feedback controller with forward path integrator forming the control. Substituting the non-linear state feedback term In other words, the non-linear state feedback cancels the effective pole and forces the process to behave as a weighted integrator of the control input term ( ) u t ′ . Designing the linear state feedback term p K and integrator term i K is then trivial to achieve the required closed loop damping and natural frequency/settling time.

Self-Tuning/Adaptive Control Action
In some situations, it will be useful to implement a self-tuning and/or adaptive version of the non-linear controller. Adaptive controllers can be implemented using either direct or indirect approaches [13]; the latter is most commonly encountered. In an indirect approach, an estimation algorithm is first used to estimate the parameters of the controlled system on-line, and these parameters are used to calculate the controller gains. A block diagram of the typical layout of a self-tuning indirect adaptive controller is as shown in Figure 4. The adaptive controller in this context is formed by combining the on-line Exponentially Weighted Recursive Least Squares (EW-RLS) algorithm with the control law as described in the previous Section, using Equations (10), (11) and (12) to implement the tuning rules and map the parameter estimates to the controller gains, incorporating the design specification.
In the adaptive controller, the EW-RLS estimator is used to estimate the value of the process model parameters in real-time, and is appropriate for use in embedded adaptive control applications in which the model dimension is not excessive [13] [14]. In the general case, the EW-RLS algorithm is defined by the following expressions:  being easy to calculate and its first derivative being obtainable numerically, e.g.
using the trapezoidal rule [1]. Hence, although the dynamics are non-linear, the unknown parameters can be identified using EW-RLS directly.

Evaluation
In this section, a number of studies are described which were carried out to evaluate the effectiveness of the proposed non-linear controller both in simulation and on a large-scale experimental laboratory process rig.

Simulation Study
A simulation-based experiment was carried out on a small simulated tank within the Matlab®/Simulink® environment. The tank dynamics were assumed to be as follows: The control design procedure as outlined in Section 3 was then applied to design a closed loop system with setting time of 13 seconds and 4.321% overshoot (natural frequency 0.5 n ω = and optimal damping 0.7071 ζ = ), to yield a closed-loop reference dynamics given by:

Experimental Study
In order to further evaluate the proposed control method described in the previous Section on real industrial hardware, a second experiment was carried out on an existing test facility at Teesside University, as shown in Figure 7. The configuration of the rig for the purposes of this paper was to control the level of water in the holding tank using an inverter-connected pump, with the drain outflow value to the sump set at 50% open. Level was instrumented using an accurate float sensor. Control signals to and from the rig were implemented by 4 -20 mA current loops to a local Schneider® PLC, with TIA-232 link to a local PC executing Simulink© for data acquisition purposes. The Modbus protocol allows setpoint, control signal and level sensor signals to be read/written in real-time from a Simulink® model executing within the Real-Time Windows Target environment. For generation of control code for embedded targets directly from Si-mulink© models, the interested reader is referred to [15], for example. The control cabinet and PLC are depicted in Figure 8, which also shows the inverter driving the pump motor, power supply/protection and analog interfaces. Previous experiments on System Identification have been carried out on this rig, and w.r.t. Equation (3), the following model parameters have been identified from a drain-and-fill test: Comparison of the model tank level with the real tank level during the drain-and-fill test is as shown in Figure 9. The calibrated model fits the data with accuracy > 90%, with the main deviation occurring with the tank being close to empty, away from the main operating points of the test rig.
The control design procedure as outlined in Section 3 was then applied to design a closed loop system with setting time 100 seconds and 4.     The settling time was chosen to be 100 seconds to prevent problems due to saturation of the pump, as values significantly shorter than this lead to saturation and integral action clamping. The controller was then implemented within the PLC, using a sample time of one second. A function block implementation was created, implementing Equations (16) and (17). Only a very small amount of instructions (analog read/write operations, addition, multiplication, square root and memory read/write operations) were required. An experiment was carried out in which two-level setpoints (0.5 m and 1.0 m) were applied at 0 seconds and 250 seconds. The total simulation time was 500 seconds. The results obtained are as shown in Figure 10.
The Figure shows the commanded setpoint level (black trace) versus time, and also the simulated actual level (red trace) also versus time. For this Figure, it can clearly be observed that linear behavior was achieved across the two commanded levels, with the required overshoot and settling time being (approximately) achieved in each case, despite the presence of some noise affecting the level measurement.

Summary
The focus of this paper has been upon accurate liquid level control in single tank systems which can be actuated continuously, and modulation of the level setpoint is also required. A simple but accurate technique based around feedback linearization and Proportional Integral (PI) control has been introduced. It has been shown that this simple controller can maintain linear performance over the full operating range of a uniform tank, using only parameters estimated from a simple fill-and-drain experimental test. Implementation details have been discussed. Simulation results and experimental results on a large-scale laboratory level control system implemented using an industrial PLC illustrate the effectiveness of the proposed approach for both level tracking and disturbance rejection. It is concluded that the proposed scheme can potentially benefit industrial level control applications, both for stand-alone operations and those implemented within a wider supervisory control scheme within a DCS. Future work will focus on the application of feedback linearization to multiple chained tank applications.