Tank level control is one of the most commonly encountered applications in industry   . 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 , for example, or situations in which supervisory Model Predictive Control (MPC) is implemented . 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   .
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.
1.2. 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  - ). Although adaptive and adaptive/predictive controls such as  and  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.  ). The computational overheads of non-linear MPC are also prohibitive for PLC implementation . 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 . 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  .
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.
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.
2. 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 AT represents the cross-sectional area of the tank and represents the input and output flows respectively. Assuming that the input control signal is represented by , the pump/valve has an effective flow gain , and the output flow is through an aperture of effective area , Equation (1) may be rewritten using Bernoulli’s equation as follows:
Figure 1. Schematic of the single tank system.
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 . However since , a simple change of variables in (3) enables it to be put into the form of a linear equation, with a time-varying parameter which is a function of the parameter and the current level :
Note that when , the parameter is equivalent to , and hence 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 . Denoting “s” as the usual time derivative operator, a 1st 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 1st-order process are functions of the instantaneous level .
3. Non-Linear PI Control Strategy
3.1. 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 presence of an additional transmission zero in the forward path it is common to use a 2-DOF controller (see e.g.  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 . 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 and , 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 as follows:
3.2. Non-Linear Controller
Now, observe that only the model parameter b appears in (7b). Let us substitute for a our height-varying quantity into (7a) and manipulate further:
Considering the required state feedback signal appearing at the summing junction to form in Figure 2, and again using the identity this signal may be written as the combination of two sub-components:
Figure 2. 2-DOF Linear PI Controller.
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 as in Figure 2, with the addition of an extra linearizing control signal where the latter signal is formed as the feedback gain applied to the square root of the current level . This controller is tuned to give the desired damping ratio and natural frequency 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 ts (in seconds) and percent overshoot os (in %) for an underdamped second order system :
Closer observation of the control procedure reveals that it is a form of feedback linearization non-linear control , with a state-feedback controller with forward path integrator forming the control. Substituting the non-linear state feedback term into Equation (3) and using illustrates the method of loop linearization:
Figure 3. 2-DOF Non-linear PI Controller.
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 . Designing the linear state feedback term and integrator term is then trivial to achieve the required closed loop damping and natural frequency/settling time.
3.3. 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 ; 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  . In the general case, the EW-RLS algorithm is defined by the following expressions:
Figure 4. Indirect adaptive control scheme.
where is the vector of estimated parameters of the system, is the current measured output of the system under consideration, is a vector of shifted previous input and output measurements of the system (regression variables), is the estimator gain vector, is the covariance matrix, is the prior residual error and λ is the forgetting factor. In the context of this paper, only two parameters are required to be estimated, yielding a trivial implementation. From Equation (3), the two unknown parameters and b are linear in the measurements of and , with the square of the latter being easy to calculate and its first derivative being obtainable numerically, e.g. using the trapezoidal rule . Hence, although the dynamics are non-linear, the unknown parameters can be identified using EW-RLS directly.
Equations (10), (11) and (12) above result in very simple design formulae to achieve the specified (linear) closed-loop behavior for the non-linear plant. In terms of a digital control implementation (e.g. on a PLC, microcontroller or within a DCS framework), several implementations are possible; the simplest is as follows. Applying Euler integration to the integral action of the controller, the following recursive equations result and can be employed for implementation:
where integer represents discrete time index, is the reference at step , is the measured height at step , is the integral of error at step and is the sample time (in seconds). The gains , and are as given in Equations (10), (11) and (12). In terms of choice of sample time, given that the dynamics of most industrial level control applications are slow-moving, then multiples of one second will normally suffice, without causing undue computational burden. As with all physical control implementations, reset windup can be protected against by clamping the integrator output when the calculated control signal reaches an upper or lower saturation limit. For details of the implementation of the EW-RLS algorithm, an efficient implementation for model structures such as Equation (3a) is given in reference .
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.
4.1. 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 and optimal damping ), to yield a closed-loop reference dynamics given by:
A Simulink model of the proposed controller and tank is as shown as Figure5. In the simulation, a series of three setpoints (50 mm, 100 mm and 150 mm) were successively applied at 0 seconds, 50 seconds and 100 seconds respectively. In addition, three small alternating disturbance flows were also introduced at 25 seconds, 75 seconds and 125 seconds. The total simulation time was 150 seconds. The results obtained are as shown in Figure6. The Figureshows 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 behaviors are achieved across the range of commanded levels, with the required overshoot and setline time being achieved in each case. Disturbance rejection is quick, effective and uniform at each of the three operating levels.
Figure 5. Matlab®/Simulink® model of the controller.
Figure 6. Simulated tracking and disturbance rejection.
4.2. 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 Simulink© models, the interested reader is referred to , 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.321% overshoot (natural frequency and optimal damping ), to yield a closed-loop reference dynamics given by:
Figure 7. Experimental test rig.
Figure 8. Experimental test rig control cabinet.
Figure 9. Model level comparison to real level.
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 Figureshows 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.
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.
Figure 10. Experimental tracking of level setpoint.
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.
 Smith, R.S. and Doyle, J. (1988) The Two Tank Experiment: A Benchmark Control Problem. Proceedings of the American Control Conference, Atlanta, 15-17 June 1988, 403-415.
 Short, M. and Abugchem, F. (2017) A Microcontroller-Based Adaptive Model Predictive Control Platform for Process Control Applications. Electronics, 6, 88.
 Sislin, R., Da Silva, F.V., Gedrite, R., Jokinen, H. and Rajan, D.K. (2016) Mathematical Modeling and Development of a Low Cost Fuzzy Gain Schedule Neutralization Control System. Engineering Letters, 26, 353-357.
 Wang, M. and Crusca, F. (2002) Design and Implementation of a Gain Scheduling Controllerfor s Water Level Control System. ISA Transactions, 41, 323-331.
 Kamiyama, T., Tamura, M., Soeda, T., Yoo, M. and Yokoyama, T. (2012) An Embedded Control Software Development Environment with Simulink Models and UML Models. IAENG International Journal of Computer Science, 39, 261-268.