Second Order Sliding Mode Control of the Coupled Tanks System

Four classes of second order sliding mode controllers (2-SMC) have been successfully applied to regulate the liquid level in the second tank of a coupled tanks system.The robustness of these classes of 2-SMC is investigated and their performances are compared with a first order controller to show themerits of these controllers.The effectiveness of these controllers is verified through computer simulations. Comparison between the controllers is based on the time domain performance measures such as rise time, settling time, and the integral absolute error. Results showed that controllers are able to regulate the liquid level with small differences in their performance.


Introduction
The control of liquid level in multiple connected tanks by controlling the liquid flow is a typical nonlinear control problem in the field of process control.It is present in many industrial processes.Many researchers around the world have attempted the design and implementation of controllers for the liquid level of a coupled tanks system.Some of the controllers used to control coupled tanks systems include Proportional-Integral-Derivative (PID) type controllers [1], a parallel structure of fuzzy PID control systems [2], a nonlinear constrained predictive algorithms based on feedback linearization control [3], and fractional PID controller [4].
Sliding mode control is an efficient method for robust control of uncertain systems [5][6][7].The basic idea of the first order sliding mode control (1-SMC) is to let the system converge towards a selected surface and then to stay there in spite of uncertainties and disturbances.The 1-SMC method can be designed by performing two steps.The first step is to select an appropriate sliding surface to constrain the state trajectory on it.The second step includes designing of a discontinuous control law to force the system state to reach the designed surface preferably in finite time.1-SMC requires sliding variable relative degree (the relative degree is defined as the order of the derivative of the controlled variable, in which the control input appears explicitly) to be equal to one with respect to the control input which limits the choice of the sliding variable.The 1-SMC is also used to regulate the liquid level.An input-dependent sliding surface has been used in [8] to regulate the liquid level in a coupled tanks system.A sliding mode controller, which has a state varying sliding surface parameter, has been designed in [9].A neuro-fuzzysliding mode controller using nonlinear sliding surface has been proposed in [10].
In addition to the restriction regarding the relative degree, 1-SMC also has the drawback of chattering due to high switching frequency of the control.The drawbacks of 1-SMC can be successfully eliminated by the use of higher order sliding mode controllers (HOSMC).HOSMC force the sliding variable and its successive derivatives to zero.There is no restriction on the relative degrees.As the high frequency control switching is pushed in the higher derivative of the sliding variable, chattering is significantly reduced.Another feature of HOSMC is that the detailed mathematical model of the plant is not required.The most widely used HOSMC are second order sliding mode controllers (2-SMC).Examples of 2 Mathematical Problems in Engineering 2-SMC are widely used twisting controllers and its modified variant the super twisting controllers, the quasi-continuous controllers, the suboptimal control algorithm, and the control algorithm with prescribed convergence law.
Khan and Spurgeon [11] applied a second order sliding mode control idea to control a coupled tank system.
The super twisting and adaptive super twisting control algorithms are developed for the two-spacecraft formation flying system in [12].A 2-SMC is proposed for second order uncertain plants using equivalent control approach to improve the performance of control systems in [13].A discrete integral sliding mode controller based on composite nonlinear feedback method to improve the transient performance of uncertain systems is proposed in [14].A second order sliding mode controller using nonlinear sliding surface to guarantee stability as well as to enhance the transient performance of uncertain linear systems with parametric uncertainty has been proposed in [15].An adaptive second order sliding mode controller with a nonlinear sliding surface that consists of a gain matrix having a variable damping ratio has been presented in [16].A higher order sliding mode control algorithm is described for a class of uncertain multiinput multioutput nonlinear systems and the developed algorithm was applied on a hovercraft vessel control [17].
Despite the many existing publications related to the 2-SMC, there is a lack of articles that compare performance of different types of 2-SMC in water level of the second tank in the coupled tanks system from one side and between them and the first order controller from the other side.Moreover, to the best of authors' knowledge, there is no published work concerning the 2-SMC especially, which contains the detailed analysis of the time domain control measures and the tracking performance of the well-known controller.
In this paper, robustness of four classes of 2-SMC, namely, twisting (TA), the super twisting (STC), prescribed convergence law controller (PCL), and the quasi-continuous controller (QCC), to regulate the water level of the second tank in the coupled tanks system is introduced and their performances are compared.Moreover, the performances of the four controllers mentioned above are compared with a first order controller to show the merits of these controllers.
The remaining structure of this paper is as follows.In the next section, the dynamic model of the coupled tank system will be explained.Section 3 briefly provides the basics of the 1-SMC controller and the 2-SMC.In Section 4, 2-SMC will be described briefly.In Section 5, the simulation results from the application of the controller will be presented and discussed.Finally, Section 6 includes the concluding remarks based on the results obtained.

Mathematical Modeling of the Coupled Tanks System
Figure 1 shows a schematic diagram of the two-coupled tanks system.The tanks system consists of two connected tanks.A pump supplies the water into the first tank.The second tank is filled from the first tank via a connecting pipe.An outlet is located at the bottom of the second tank to change the output q q 1 q 2 h 1 h 2 flow  2 .The mathematical model of the coupled tanks system is nonlinear and can be derived as follows.
Applying the flow balance equation for Tanks 1 and 2, In ( 1)  1 and  2 are defined as where ℎ 1 and ℎ 2 are the water level in Tank 1 and Tank 2, respectively. is the inlet flow rate;  1 is the flow rate from Tank 1 to Tank 2.  is the cross section area for both tanks,  1 is the area of pipe connecting the two tanks,  2 is the area of the outlet, and  is the constant of gravity.If the inlet flow  is selected as input and the liquid level ℎ 2 in the second tank as output, the system can be considered as a single input single output system (SISO).The two tanks system can be modeled by the following two differential equations: The parameters  1 and  2 are defined by Note that  is always positive, which means that the pump can pump water into the tank ( ≥ 0).At equilibrium, for constant water level set point, the derivatives of the water levels with respect to time in the two tanks must be zero so that the following condition can be written: Therefore, using ( 6) in ( 3) and ( 4), the following algebraic relationships hold: The equilibrium flow rate  can be calculated as To satisfy the constraint on the input flow rate, the term  1 sign(ℎ 1 − ℎ 2 ) ≥ 0, which implies ℎ 1 ≥ ℎ 2 .Then the dynamics model can be written as Using the following transformation, (9) can be written as It can be easily checked that (, ) and (, ) in ( 11) have the following form:

Sliding Mode Control
3.1.1-SMC.The dynamics of a second order nonlinear system can be written as where () is the state and () is the control input vectors, respectively.(, ) and (, ) are unknown nonlinear functions of time and states.The functions () and () are not exactly known with upper bounded uncertainties.The control problem let the state  track a specified time-varying state   .The required sliding surface to control this system can be defined as =  −   is an error vector and  is a constant parameter, which dictated the slope of the sliding surface.Differentiating (16), and inserting (15), and then putting Ṡ = 0 and solving for  result in the following control law: and define the control law where  and  are strictly positive constant. can be selected high to cope with uncertainty.A sufficient condition for the convergence to a sliding mode is is a positive constant.Equation ( 18) is called reaching or sliding condition.The signum function in ( 17) is defined as Commonly in 1-SMC, to avoid chattering, the signum function is replaced by a smooth function to create a boundary layer around the sliding surface.For example, a saturation function can be used and is given by In ( 22)  is a positive constant which defines the thickness of the boundary layer.

2-SMC.
2-SMC control is a subset of HOSMC.It differs from the 1-SMC by including the first order derivative of the sliding variable while maintaining the same robustness and performance as that of the 1-SMC. ∈ R in an output of (15) to be exactly stabilized in finite time at  = 0,  ∈ R is the control input, and  ∈ R  is the state.If the output  has a fixed and known relative degree  ∈ R  , then, for the positive constants   ,   , and , the following inequalities hold globally: 2-SMC may be considered as controllers for the following differential inclusion [18]: 2-SM controllers allow solving the problem of finite-time stabilization of a black box system as shown in Figure 2. The only information needed from the system is the output.The required derivative can be obtained by using HOSMC arbitrary order differentiator [19].The real time differentiator has the general form as in the following set of equations.In (24) () represents signal to be differentiated,  − 1 times.Consider /(+1) sign ( 0 −  ()) A first order differentiator can be obtained by setting  = 1 and has the following form: where  0 and  1 are the estimation of () and ḟ (), respectively.The parameters  1 = 1.5 1/2 ,  0 = 1.1, and  are a positive constant to be selected via simulation as recommended in [19].

Controllers Design
4.1.1-SM.The procedure described in Section 3.1 will be applied to regulate the output ℎ 2 to a desired value  for the coupled tanks system.The sliding surface  is selected as By taking the time derivative of (25), ( 26) is obtained as follows: Substituting ( 10) and ( 11) in (26) yields On putting σ = 0 and solving for û, Finally using (18) the control law for ℎ 2 is computed as −  sign () . (29)

Twisting Controller.
Historically, the first proposed 2-SM controller was the twisting controller.It is defined by the following formula This controller guarantees the appearance of a 2-sliding mode  = σ = 0 attracting the trajectories of the sliding variable dynamics in finite time if  1 and  2 satisfy the following conditions: (31)

Super Twisting Controller.
The STC has the advantage over another algorithm in that it does not require the time derivatives of the sliding variables.The algorithm has been developed for the case of a system with relative degree one, in order to avoid chattering and its trajectories on the sliding plane are characterized by twisting around the origin.The merits of the STC are rejection of smooth disturbances of arbitrary shape, tracking of smooth references of arbitrary shape, and the finite-time convergence to the set point.A STC for system, which has relative degree of two, was proposed in [20].The control law () consists of two terms.The first term is its discontinuous time derivative and the second is a continuous function of the available sliding variable as given below As stated in [19] for   >  and a sufficiently large  the controller guarantees the appearance of a 2-SMC in system given in (23), which attracts the trajectories in finite time to zero.A sufficient condition for finite time convergence is as follows [19]:

Quasi-Continuous Controller (QCC).
The homogeneous quasi-continuous (QCC) controller [21] requires the first order derivative of the sliding surface .With the use of differentiator in (25), the second order quasi-continuous sliding mode controller can be written as The parameters  and  in (35) are positive constant to be selected via computer simulation.

Prescribed Convergence Law Controller.
The controller with prescribed convergence law [19] is defined as where () is a continuous function smooth everywhere except at  = 0.It is assumed that the solution of the differential equation σ+() = 0 converges to 0 in finite time.
Choosing () = || 1/2 sign() yields the controller A sufficient condition for convergence is given as

Simulation Results and Discussion
The characteristics of dynamic model of the coupled tanks system are presented in Table 1 [8].The control input is restricted to be between  min = 0 and  max = 50 [cm 3 /s].The computer simulations are performed using a time interval of [0 :150] s.The parameters of the controller are optimized using a step input with a final value of 6 cm for the water level.For the other tested water levels no more adjustment of the controllers parameters is performed.Through extensive simulation runs, the optimum controllers' parameters for the different controllers tested in this study are reported in Table 2.
Figure 3 shows the regulation performance for the tested controllers for a desired level of 6 cm.Based on the figure, it can be concluded that the controllers regulate the water   4 for the desired level of 6 cm.Based on the figure it can be seen that, in all cases, the controllers show typical sliding mode behavior; that is, the error reaches 0 in finite time and stays 0 afterwards.The derivative of error with respect to time is also shown for the TA, QCC, and PLC controllers.The error derivative also converges to zero.Note that in the case of the 1-SMC and STC the error derivatives are not shown because the error derivatives do not play a major role in the design of the controller.Figure 5 shows the control signal of the five controllers.The controllers have the same control signal until they reach the sliding surface.The difference between the signals of the 2-SM controllers is the increase of the on-off control in the order STC and TA, for the QCC and PCL, respectively.
To compare the performance of the controllers, the time domain performance measures such as the settling time, the rise time, the percentage overshoot, and the integral absolute error (IAE) are used.The settling time is defined as the time required for the response to settle within 1% of the steady state value.The rise time is defined as the time required for the output to change from 10% to 90% of its final value.The IAE is given by the following equation: The performance measures have been computed for three different specified levels of 3, 6, and 8 cm as listed in Table 3.It can be seen from the table that all the used controllers have approximately the same rise time in all the cases.The QCC controller has a slightly less settling, overshoot, and IAE.
The results of the tracking test of the five controllers using a square signal reference input are shown in Figure 6.Based on the figure, it can be observed that the tracking performance for the all the controller is good.In terms of the IAE, the values obtained are listed in Table 4. From the values given in the Table 4, it can be seen that the smallest IAE is for the 1-SM controller; the 2-SMC have approximately the same IAE.From the comparison, it can be reported that the 1-SM controller slightly outperforms the 2-SM controller in all aspects but the controller requires more information than the 2-SM controllers as can be observed from Section 4.

Conclusions
In this paper, four second order sliding mode controllers, namely, the twisting, the super twisting, the quasi-con-  tinuous, and the prescribed convergence law controller, have been successfully designed to regulate the water level in the second tank of a coupled tanks system.The efficacy and usability of the proposed controllers are verified through computer simulation tests.Comparison between the controllers is based on the time domain performance measures.
Results showed that all the controllers are able to regulate the water level without major differences in their performance.
Comparison of the 2-SM controllers against 1-SM controller showed that less information is required in the case of the 2-SM controller than the 1-SMC.

Figure 1 :
Figure 1: A schematic diagram of the two-coupled tanks system.

Figure 2 :
Figure 2: Block diagram of a black box controller.

Figure 3 :
Figure 3: Level tracking test for the different controllers.

Figure 4 :
Figure 4: Error and its derivative for the different controllers.

Figure 5 :
Figure 5: The control signals of the designed controllers.

Figure 6 :
Figure 6: Level tracking test for the different controllers.

Table 1 :
Characteristic of the coupled tanks system.

Table 3 :
Time domain performance measures for different  values.

Table 4 :
IAE for the different controllers from the tracking test.