CONTROLLING WATER LEVEL BY USING MODIFIED MODEL FREE ADAPTIVE CONTROLLER

: This paper investigates a simple mathematical model for a water level system, which consists of a DC motor (water pump), and a Speed to Height transformation block, that relates the speed of the motor, to the height of the water level. The input signal is the applied voltage to the armature of the DC motor, while the output signal is the rotational speed of the shaft. A simple modified model-free adaptive controller is suggested, to control the level of water, by adjusting the rate of the incoming water flow to the container, by changing the speed of the water pump, that fills the container. The suggested controller consists of a conventional model free adaptive controller, combined with the proportional integral derivative controller. The parameters of the controller are tuned using two methods. The overall controlled water level system is simulated through MATLAB R2015a software. The results show the efficiency of the suggested controller, when compared to the tuned PID and the MFAC, due to its least fluctuation peak, fast response with a small settling time, and zero steady-state error.


Introduction
Recently, different applications require the control liquid level in a defined container.The liquid, whether chemical, water, or oil, must be kept at a certain level.This can be accomplished by using a suitable controller.The conventional Proportional Integral Derivative (PID) is commonly used to control the liquid level, but the parameters of this controller require a suitable tuning method [1,2].Some of the studies that use the PID, to control the level of tank water are presented in [3][4][5][6][7].On the other hand, Data-Driven Control (DDC) [8] guarantees the stability of the controlled systems, robustness, and convergence under specific assumptions.This method depends on offline and online input and output data of the controlled systems, instead of depending on accurate mathematical models [9].The Model-Free Adaptive Controller (MFAC) is a DDC method [10], which is proposed to control unknown nonlinear systems.This controller is successfully used for many industrial control systems [11].One of these systems is the water level system as suggested by Yang et al. [9] and Kadri et al. [12].
In this paper, the PID controller is combined with the conventional MFAC, to form a Modified Model Free Adaptive Controller (MMFAC), to enhance the performance of the PID and MFAC, in controlling the water level of the tank container, by regulating the rate flow of the incoming water flow.The control parameters of the PID are determined by two tuning methods.
The rest of this paper is organized as follows: Section two presents the mathematical model of the water level system.Section three explains the design of the suggested MMFAC.Section four illustrates the tuning methods of the PID controller, while Section five shows the simulation results of the PID, MFAC, and the suggested MMFAC.The main conclusions are addressed in Section Six.

The Overall Water Level System Model
The Water Level System (WLS) [13], which is considered in this paper, includes a DC motor water pump, that pumps the water to a single tank container (Figure .(1)).The variables of the tank container are defined in Table (1).The difference between the input and the output flow rates, which represents the summation of mass in the tank is given by Pratama et al. [14] and Getu [15]: The flow of leaving water and the height is related to a linear flow resistance (Rf [in s/m 2 ]) via the following equation [14,15]: Substitute Eq. (2) into Eq.(1), Eq. ( 1) becomes [14]: By applying the Laplace transform to Eq. (3): The DC motor runs the water pump, that fills the water tank container, and the rate of water flow to the tank container is determined by the rotational speed (rad/sec.) of the motor shaft.The relation between the motor speed and the flow rate (the water level h (t)) can be represented by the Speed to Height Transformation (STH) block.The relation between the motor speed and the tank incoming flow rate is assumed linear and given by Getu [15]:

m2
Rate of the water through an inlet pipe.
----m3/s qo Rate of the water leaving from the outlet pipe. - where   is the field constant and the Laplace Transform of Eq. ( 5) is: The transfer function can be determined by substituting Eq. ( 4) into Eq.( 6) and simplifying the result to form Gt(s) as [15]: with Rf =0.5 s/m 2 and Kf =1, Eq. ( 7) becomes: 8) The relation between the motor input voltage () and the output rotational speed () is defined by Getu [15]: Table (2) defines the parameters of Eq. ( 8), with these parameters, Eq. ( 9) becomes:

Design of Modified Model Free Adaptive Controller (MMFAC)
The block diagram of the suggested MMFAC is shown in Figure (2).The control law of this controller consists of two controllers ( 1 (),  2 (s)) as: where  1 () is an ideal PID, which is described by Aliaa et al. [16] and Ekhlas et al. [17]: where e(s) is the difference between the desired hd(t), and the actual water level h(t).The parameters (kp, ki, and kd) are the proportional, integral, and derivative gains respectively.The second controller  2 () is a simple MFAC.The general equation of this controller is [18,19]: where  is the step factor, the cost function to estimate the parameters is chosen as: The estimation of () parameter is obtained as follows: The (, ) form the step size, which generally ∈ (0, 1), (, ) are weighting factors [18,19].In this paper, to improve the performance of the MFAC, the difference term in Eq.( 13) (ℎ  ( − 1) − ℎ()) is replaced by (() + ()), hence this equation is modified to: The e(t) is the error signal (e(t)= hd(t)h(t)) and () is the derivative of the error.

PID Tuning Methods
Several tuned methods can be used to determine the PID parameters (kp, ki, and kd).Only two of these methods are used in this paper.These methods are Pole-Zero Cancelation (PZC) and Particle Swarm Optimization (PSO).

PZC Method
In order to drive the PID controller parameters (kp, ki, kd) by this method in a simple manner, the order of the water level system must be reduced to second order.A simple reduction method is used.This method includes the following steps: According to the previous steps, the secondorder equation is: 2.5  2 +4,26+5.05(17) With this method, the PID control parameters (kp, ki, and kd) can be determined from the reduced linear transfer function Eq. ( 17

PSO Method
The PSO was invented as one of the stochastic techniques, developed by Dr. Ebhart and Dr. Keendy in 1995.It was initially inspired by the social behavior of fish schooling or bird flocks.The PSO, like other population-based algorithms, uses initial random solutions called (particles), and hence the best solution in the search space is developed by update generations.The fly particles follow the obtained optimum particle through the solution search space [20].Let   be the population size (particles), each one is described by three vectors; current position (   ), velocity (   ), and the best personal position (    ) with Ddimensional vectors (1≤  ≤D), where i is the  ℎ particle with (1 ≤  ≤   ), while t is the  ℎ iteration index.The three vectors (   ,    , and    ) describe the characteristics of each particle.
At each  ℎ iteration, the best personal particle according to fitness function F(   ) is called the global best particle (  ).The update steps for velocity and position vectors are: where  1  and  2  are uniformly distributed numbers between [0, 1],  1 and  2 are the acceleration coefficients,   is the inertia weight, which is less than one [20,21].The Ddimensional search space for the PID controller is 3-D, which represents the (kp, ki, and kd) parameters.The PSO steps used to tune the parameters of the PID controller are illustrated by Arain et al. [22].In this paper, the fitness function, which is used to evaluate the output response of the water level system, is Integral Time Absolute Error (ITAE):

Simulation Results and Discussion
Matlab (version R2015a) is used to simulate the results, and the efficiency of the suggested MMFAC is higher, when compared to the PID controller (based on PZC and PSO methods) and MFAC (as shown in Fig.The parameters of the PSO algorithm are addressed in Table (3).The obtained optimal tuned PID parameters are kp=5, ki=5, and kd= 0.6690.First, the performance of the WLS controlled by PID controller (based on PZC and PSO) and the MFAC tested by the step input (hd(t)=1.5m)are evaluated.Figure (4) shows the response of the actual water level to the control signal with these controllers, while Figure (5) shows the simulation results for the WLS controlled by the MMFAC1 (PID-PSO combined with the MFAC) and the MMFAC2 (PID-PZC combined with the MFAC).The performance evaluation for the WLS with the PID, MFAC, and MMFAC is illustrated in Table (4).These results show the efficiency of the PID-PSO, PID-PZC, and RDBC-MRBF, especially the suggested MMFAC in the flow of the desired water level signal, with small Mp, tp, fast ts, es.s, us.s, which provides an acceptable control rotational speed ω(t) signal.

Conclusions
In this paper, the performance of the PID and the MFAC is improved, by merging the two methods to perform a simple MMFAC scheme, which is used to control the water level the This system consists of a water (DC motor) and an STH block, that relates the motor speed to the water flow rate.Two tunning (PZC and PSO) methods are used, to determine the optimal parameters of the PID.The overall control system is implemented using the Matlab Simulink.The simulation results show that the output response of the WLS, with all controllers (PID-PSO, PID-PZC, MFAC, and MMFAC) follows the desired input, with zero steady-state error (es.s(t)=0), smaller ts, and very small Mp, especially with the MMFAC.The simulation results also show that the tuned PSO method is better than the PZC method since it provides a more accurate response to the water level system.

Figure 2 .
Figure 2. Block diagram of the suggested MMFAC for WLS.
), by comparing the denominator of this equation to the numerator of the control equation  = (  +    +   ) =    2 +  +   as This is illustrated by the following step:  2 + 4.26 + 5.05 =    2 +    +   (18) From this comparison,   = 1,   = 4.26, and   = 5.05 (3)).The efficiency is evaluated by calculating the (maximum peak Mp, peak time tp, settling time ts, steady state error es.s, steady-state control signal us.s) at the output response.

Figure 3 .
Figure 3. Matlab connection of WLS and the suggested MMFAC.

Table 1 .
The definition of tank variable.

Table 3 .
The selected parameters of the PSO algorithm.