Real-Time Application of Sliding Mode Controller for Coupled Tank Liquid Level System

Abstract: In this paper, real time application of a sliding mode control (SMC) is used for level control of experimental setup of liquid level system due to its properties such as robustness against large parameter variation and disturbances rejection. A well-tuned conventional proportional integral (PI) controller is also applied to the two coupled tank system for comparison with the SMC controller. Experimentation of the coupled tank system is realized in two different configurations, namely configuration #1 and configuration #2 respectively. In configuration #1, the water level in the top tank is controlled by a pump. In configuration #2, the water level in the bottom tank is controlled by the water flow coming out of the top tank. The performance of controllers is analysed according to their tracking performance and error elimination capability for different references applied to the system. Experimental results prove that the SMC shows better trajectory tracking performance than PI controller in that the plant transient responses to the desired output changes have shorter settling time and smaller magnitude overshot/undershoot. Robustness of the SMC with respect to water level variation and capability to eliminate external disturbances are also achieved.


Introduction
Liquid level control is one of the essential problems of process industry. In nuclear power plants, wastewater treatment plants, filling-disposal plants etc., high sensitive liquid level systems must be used to do complex and dangerous processes that are not done by humans. To achieve correct mixture ratio, adjust liquid flow between tanks precisely and to get high level performance from this systems, well-designed controllers must be also used. Due to their nonlinear system dynamics and can be effected disturbances easily, the control of liquid level systems are difficult. To overcome these difficulties and control this kind of systems in a desired efficiency, many control algorithms have been proposed by the researchers. Due to their simple structures, easy parameter adjustment and basic calculation knowledge needed P, PI, PID controllers are used to control liquid level of the tanks [1][2][3]. In the experimental application, classical P, PI, PID controllers are not sufficient for a precise control where sudden changes occur, parameter adjustment and fast response are needed. For these reasons, conventional P, PI and PID controllers are not a good choice for a nonlinear system. In control engineering and relevant areas, some nonlinear controllers have been developed to apply the systems that have nonlinear system dynamics. As an example, the backstepping controller has been presented to control the systems where system dynamics can be written in a lower triangular form [4][5][6][7]. Also, it has a recursive structure and its stability analysis can be proven based on Lyapunov stability theorem, the backstepping controller mostly preferred. On the other hand, the all states of the system must be measured and in complex systems, more mathematical processes are needed to calculate the control input signal. Moreover, fuzzy controller is proposed where the system is not well defined and does not have an exact mathematical model [8].
Apart from these advantages, the fuzzy controller is not good enough to stabilize the system where the quick response is needed and the controller's sensivity need to be very high. Also, it is a rule based controller and there is no theorem to proof its stability criteria. As an another solution, SMC is proposed to control nonlinear systems. The SMC is a type of nonlinear controller and preferred for the systems where the controller must be very robust to model uncertainties and external disturbances [9][10][11][12][13][14]. In addition to this advantages mentioned on SMC, it has a simple structure and its stability criteria can be proven using Lyapunov stability theorem. In this study, the liquid level control of coupled tank system is examined in experimental application using PI and SMC controllers for different reference inputs. Both controllers are compared in term of error elimination capability and robustness against to parameter uncertainty. The results prove that the SMC shows better trajectory tracking performance than PI controller. Also, the results show that SMC is really robust to model uncertainties occur in the system and good at eliminating the errors compared with the PI controller.

Single Tank Model (Configuration #1)
Single tank system which consisting of the top tank is shown in Fig. 1. It is reminded that in configuration #1, the pump feeds into tank 1 and that tank 2 is not considered at all. Therefore, the input to the process is the voltage to the pump and its output is the water level in tank 1. The model of the single tank system determined by relating the volumetric inflow rate 1 i f into tank and the outflow rate The volumetric inflow rate and the outflow rate to tank 1 can be expressed as [15] is the actual pump input voltage. The outflow velocity by using Bernoulli's equation where g is the gravitational constant on earth. As a remark, the cross-section area of tank 1 outlet hole can be calculated by, Moreover using the mass balance principle for tank 1, we obtain the following first-order differential equation in where, 1 t A is tank 1 inside cross-section area. Substituting Eq.
(1) and (2) into Eq. (6) and it can be rearranged in the following form for the tank 1 system,

Coupled Tank Model (Configuration #2)
A schematic of the coupled tank plant is depicted in Fig. 2. In configuration #2 the pump feeds into tank 1, which in turn feeds into tank 2. As far as tank 1 is concerned, the same equation as the ones previously developed in section (2.1) is applied. However, the water level equation of motion in tank 2 still needs to be derived. In the coupled tank, the system states are the level 1 L in tank 1 and the level 2 L in tank 2. The outflow rate from tank 2 can be expressed as; Tank 2 outflow velocity by using Bernoulli's equation As a remark, the cross-section area of tank 2 outlet hole can be calculated by, Using Eq. (9) and (10) the outflow rate from tank 2 given in Eq.
Using Eq. (5) the inflow rate to tank 2 is as follow Moreover using the mass balance principle for tank 2, we obtain the following first-order differential equation in substituting Eq. (12) and (11) into Eq. (13) and it can be rearranged in the following form for the tank 2 system,

Sliding Mode Controller Design for Tank 1
We assume that flow rates cannot be negative and we agree as follows, 0  f (15) Therefore, following equation must satisfy as the flow rate to be above, 2 1 L L  (16) Thus, the following equation can be written.
, , If writing to these assumptions in the dynamic model of the coupled tank system the following equations can be obtained.
The model of the coupled tank system dynamics model is nonlinear. Therefore the dynamics of the so called coupled tank system allow dynamic model subject to a transformation equation as follows. Let Equations are obtained. Then the dynamics of the coupled tank system can be rewritten as shown below.
Thus, the dynamics of the combined form of coupled tank system can be written as follows, where n is the order of the system to be controlled,  is a positive constant, e is the error. We take error as a reference and the measured difference and we obtained the following equation.
If we take the derivative of both sides of the Eq. (32) the following equation obtained.
Eq. (35) is employed as the expression written instead of the second order derivative of the error, following equations can be written, Ideally, we want to sliding surface to be equal to zero. If sliding surface is zero than derivative of the sliding surface will be zero as following equations.

Sliding Mode Controller Design for Tank 2
Considering the dynamic of equality for tank 2, the following equations are considered to control tank 2. If writing to these assumptions in place of the coupled tank system dynamic model equations are obtained from the following equation.
, and the transformation Thus, the dynamics of the combined form of coupled tank system can be written as follows, 2 1 x x   where, n is the order of the system to be controlled,  is a positive constant, e is the error. Error we take as a referencemeasured, and we have obtained the following equation.  ) ( Ideally, we want to sliding surface to be equal to zero. If sliding surface is zero than derivative of the sliding surface will be zero as following equations. where H is desired value from the system output. Hence, the output of both the tank will asymptotically converge to its desired value since s a is positive.

Experimental Results
In the first experiment of configuration #1, the step+sinusoidal reference signal is applied for PI and SMC controllers given in Fig. 3 and Fig. 4 respectively. For the step reference signal part, PI controller has more overshoot and has longer settling time compared with the SMC. The time varying part of the reference signal, both controllers show the same performance in term of tracking the reference signal, under/overshoot and error elimination capability etc. On the other hand, SMC is generated the pump voltage with more chattering phenomena than the pump voltage generated by PI controller. For the second experiment of configuration #1, the step+sawtooth reference signal is applied to show the responses and performance of both controllers shown in Fig. 5 and Fig. 7 respectively. The sawtooth reference signal is important due to consisting of the sudden and continuously changing part in the same period. For PI controller, it has more overshoot and longer settling time compared with SMC. Also, PI controller has continued to make overshoot through the continuously changing part of the sawtooth signal. Besides, SMC has no overshoot while tracking the step+sawtooth signal and has better performance in term of error elimination and robustness to parameter variations occur in the system.  The experimental results given for configuration #2, are realized using the step + trapezoidal reference signal for PI and SMC controllers shown in Fig. 6 and Fig. 8 respectively. In this section, the cascaded tank system is used to realize level control for different reference signals. For PI controller, it has longer rising and settling time. Also, PI controller has more overshoot than SMC controller. At the same time, SMC shows better performance for position tracking and also has given fast response the parameter variations.

Conclusion
In this study, SMC has been designed and applied to two tank liquid level system in order to maintain a stable reference tracking for different reference signals for both configurations. The experimental results indicate that the proposed controller has better performance in term of error elimination capability, good reference signal tracking, robustness to parameter variations. It can be also noticed from the results obtained that SMC is reasonably prior to the classical PI controller for the levels that required to be kept at a constant level and following time varying reference signals very well.