Improved Coupled Tank Liquid Levels System Based on Swarm Adaptive Tuning of Hybrid Proportional-Integral Neural Network Controller

Problem statement: Accuracy and stability of many systems in chemical and process industries which has Two-Input Two-Output (TITO) is one of the key factors of process which have cross coupling between process input and output. Approach: Unlike traditional neural network weight adaptation using gradient descent method, Particles Swarm Optimization (PSO) technique was utilized for adaptive tuning of neural network weights adjus tment and fine tuning the controller’s parameters. Design approach for controlling liquid levels of Co upled Tank TITO system by using hybrid PI-Neural Network (hybrid PI-NN) controllers. Results: Tuning method for parameters of improved hybrid PI NN controller was also discussed. Conclusion: Performances of proposed method also compared with PID-NN controllers, it was shown that hybrid PI-NN controller exhibited better performance in terms of transient response analysis.


INTRODUCTION
Liquid tank systems play important role in industrial application such as in food processing, beverage, dairy, filtration, effluent treatment, pharmaceutical industry, water purification system, industrial chemical processing and spray coating. A typical situation is one that requires fluid to be supplied to a chemical reactor at a constant rate. An upper tank can be used for filtering the variations in the upstream supply flow. Many times the liquid will be processed by chemical or mixing treatment in the tanks, but always the level of the fluid in the tanks must be controlled. Vital industries where liquid level and flow control are essential include petrochemical industries, paper making industries, water treatment industries [1] .
In order to achieve high performance, feedback control system is adopted. Classical PID controller is widely applied in industry control such as temperature control, speed control, position control, but it is difficult for PID regulation to reach the aim of high speed and short transition time and small overshoot [2] . Advanced control methods also have been proposed by several researchers such as sliding mode control [3] and nonlinear back stepping control [4] , tuning methods based on optimization approaches with the aim of ensuring good stability robustness have received attention in the literature [5,6] .
Accurate model and its parameters which capture the characteristic of the coupled tank system is required for designing its controller for achieving a good performance. The specific point tackled in the study is about the advantages of using a new hybrid PI-NN instead of a PID-NN controller, consisting of PSO, Neural Network (NN) and PI controller. From a generic tuning rule the optimum settings from an Integral Squared Error criterion point of view are derived. The validation result shows that hybrid PI-NN controller much faster than PID-NN and also good robustness and small overshoot.

Process plant description:
The schematic diagram of the coupled tank system considered in this study is shown in Fig. 1 where Q i = {Q i1 , Q i2 } are the inlet flow rate to tank 1 and 2, Q 12 is the liquid flow rate from tank 1 to tank 2 through orifice, Q o = {Q o1 , Q o2 } are the outlet flow rate of tank 1 and 2 and h = {h 1 , h 2 } denotes the liquid level of tank 1 and 2, respectively. In this simulation, the target is to control the level in two tanks by the inlet liquid flow from two pumps. The process input are u = {u 1 (t), u 2 (t)} (voltage input to pumps) and the output are h = {h 1 (t), h 2 (t)} liquid level in tank 1 and 2 respectively.
Where: A = The cross sectional area of tank 1 and 2 (cm 2 ) a = The cross sectional area of outlet hole of tank 1, 2 and the cross sectional area of jointed opening between tank 1 and 2 (cm 2 ) β 1 = The valve ratio at the outlet of tank 1 β 2 = The valve ratio at the outlet of tank 2 β x = The valve ratio between tank 1 and 2, 1 2 h , h are the steady-state water level of tank 1 and 2 g = The gravity (cm 2 sec − 1) k 1 , k 2 = The gain of pump 1 and pump 2 (cm 3 Vsec −1 ), respectively From the linear plant Eq. 1, it can be transformed to yield a nominal block transfer function of the form (2): provided that T 1 is the time constant of tank 1, T 2 is the time constant of tank 2 and T x is the time constant interaction between tank 1 and 2. According to transfer matrix G ij (s) in (2) and (3), the transfer functions of coupled-tank process are second order form which have cross coupling between process input and outputs. The decoupling controllers are required for minimizing the effects from cross coupling and transform TITO plant transfer function into SISO form. This is where neural network structure is introduced at which can be functioning as the decoupler controller.
PID neural network controller: A control structure for controlling the liquid level tank using PID neural network controller as shown in Fig. 2 where it has an input s j and an output θ j . The property of a neuron is decided by the input-output activation function (f) whereby the P-neuron, I-neuron and D-neuron are representing the Proportional (P) function, Integral (I) function and Derivatives (D) function, respectively.
For any neuron (namely the jth neuron) in the network which has n-1 inputs, at any t time, the input of the neuron is given by: Where: x i (t) = The outputs of n-1 connected neurons in foregoing layer and w ij = The connected weights The output of this neuron will depend on its activation function which can be Proportional (P), Integral (I) or Derivative (D) functions. The neuron's output for each function is shown in Table 1.
As a rule, a basic PID-NN consists of two input neurons and one output neurons whereby the hidden layer of this network structure is made of three neurons which each representing P, I and D activation function respectively. The basic PID-NN is as shown in Fig. 3.
Through connective weight adaptation between layers, the PID-NN is actually acting as a conventional PID controller. Since PID controllers have been widely used in industry, that is to say there are much experience to choose P, I and D parameters in order to suit the system's stability without changing one's plant.
The control system for controlling the coupled tank level system consists of several basic PID-NN whereby every basic PID-NN is a sub-net. The multi PID-NN control system is shown in Fig. 4.
The structure of multi PID-NN is special. If suitable connective weights are obtained, each sub-net of PID-NN is comparatively equal to a PID controller. By referring to Fig. 3 of the basic PID-NN, let say that: w 1j = +1, w 2j = −1, w' 1o = K P , w' 2o = K I , w' 3o = K D  Meanwhile, the network output (depending on the type of neuron) of the hidden layer for each neuron is obtained as: Therefore, we derived the total output for the basic PID-NN as shown in Fig. 3 as: At any rate, the manipulated variable signals injected into the plant as shown in Fig. 4 is obtained as:

Hybrid
PI-neural network controller: A combinational PI controller with neural network structure for controlling the liquid level system of the coupled tank as follows.
Proportional-Integral (PI) controller is a feedback controller which drives the plant to be controlled with a weighted sum of error (difference between output and desired response) and the integral of that value. The general model for a PI controller is given in Eq. 9: Where: H k = The process variable E k = The difference between the output and the desired response K Pk and K Ik = The proportional and integral gains respectively The hybrid PI-NN is constructed by series cascading the PI controllers with a neural network structure as shown in Fig. 5 Throughout the network, the linear activation function is used in all neurons. Figure 5 shows the plant transfer function G ij (s) that has the cross coupling between process inputs and outputs. Because of interaction between processes, the neural network structures will basically act as a decoupler controller for minimizing the cross coupling effects via its connective weight adaptation.
In contrast to the PID-NN, the manipulated variable signals injected into the plant for the hybrid PI-NN is obtained as:  [8] , PSO, like other evolutionary computations, can typically initialize a pool of particles with random bird positions (called agent) in two-dimensional space [9] where each is represented by a point in the X-Y coordinates and the velocity is similarly defined. Bird flocking is assumed to optimize a certain fitness function. Each agent knows its best value so far (pbest) and its current position. This information is an analogy of personal experience of an agent. Each agent tries to modify its position using the concept of velocity. The velocity of each agent can be updated by the following equation: The following weighting function is normally used in Eq. 11: Where: At some iteration, the position of the agent based on Eq. 13 might be flying-off from the initial limit. Hence, a fly-back algorithm is implemented to bring back the agent to within the limit. The fly-back pseudocode used in the program is presented below: If Ω i k+1 less than Ω min Ω i k+1 = Ω min +(Ω max -Ω min)X r and else if Ω i k+1 more than Ω max Ω i k+1 = Ω min +(Ω max -Ω min )X r and end Model reference adaptive tuning using PSO: In both PID-NN and hybrid PI-NN control systems; the aim of the controllers' algorithm is to minimize the following fitness function (f t ): Where: R k = The desired set-points and H k = The outputs of the system as shown in Fig. 4 and 5 Meanwhile, q (=1,2,…,n) is the serial number. G ref is the first order model reference transfer function and is represented as: where, τ the time constant for shaping the output transient responses to be as desired.
The connective weights of PID-NN and hybrid PI-NN as well as the PI parameters are changed and optimized on each iteration k of the PSO. Before beginning the optimization, a population size (i.e., number of particles) N and a maximum number of iterations iter max are chosen. The computation flow of PSO technique can be described in the following steps: Step 1: Randomly initialize the population: select the Step 2: Evaluate the fitness function values by f t (Ω i ) assigning each Ω i as the neural network weights and the controller's parameters.
Step 3: Assign the global and local best positions: Set the local best position for each particle using pbest i = Ω i and compare the evaluated fitness values and find the global best position gbest i = Ω i , for some 1≤ J ≤ N, such that Step 4: Search for minimum value of f t : • Update the particle velocities Ψ I according to Eq. 11 Step 5: Repeat Step. 4 until a goal is reached or the number of iterations is surpassed.

RESULTS AND DISCUSSION
The parameters of the coupled tank system are taken as follows: Cross sectional area of tank 1and 2, A = 66.25 (cm 2 ) Height of each tank H = 18.5 (cm) Area of the coupling orifice, a = 0.1963 (cm 2 ) Valve ratio at the outlet of tank 1, β 1 = 0.35903 Valve ratio at the outlet of tank 2, β 2 = 0.345848 Valve ration of the outlet between tank 1 and 2, β x = 0.38705 Gravitational rate g = 981 cm sec −12 The liquid levels of the coupled tank system are required to follow step responses within the range of 0~300 cm (0-100%). System responses namely the liquid level for both tank 1 and 2 are observed. The minimum and maximum values of the controlled manipulated variables are capped to u min = 0 volt and u max = 5 V.
In the training stage, initialize the parameters of PSO as following.
For hybrid PI-NN, there are additional K P's and K I's for the PI controllers. Population size = 20, inertia weight factor ω is set according to (20)   In the mean time, PID-NN produces settling time and rise of 209 and 24 sec whereas the hybrid PI-NN produces settling time and rise time of 39.7 and 22.2 sec for the liquid level in tank 2. It shows that the PID-NN results in a slower response as compared to hybrid PI-NN. It can be said that with higher number of connective weights of neural network structure, the complexity to compute the required manipulated variables will increase and affect the speed of the response.
In term of integral square error for liquid level in tank 1, the hybrid PI-NN results in twice less of ISE as compared to the PID-NN with the value of 1.145×10 5 and 2.567×10 5 respectively. Similarly for liquid level in tank 2, the ISE of hybrid PI-NN and PID-NN were obtained as 1.209×10 5 and 2.567×10 5 , respectively. The comparative assessment of both controllers is shown in Table 2 Figure 8 and 9 shows the liquid level responses in tank 1 and 2, respectively, with a step disturbance of 40 cm injected into the process variable of tank 1 during the steady-state response. Noted that the PID-NN controller produced maximum percentage overshoots of 35 and 41% for liquid level in tank 1 and 2 whereas hybrid PI-NN produces 27 and 18%, respectively. Furthermore, it could be seen that hybrid PI-NN produce minimum oscillation as compared to PID-NN in response to disturbance injection. It is proven that the hybrid PI-NN controller results in faster settling time and minimum overshoot. Besides that hybrid PI-NN also exhibits good robustness in minimizing the cross-coupling effect between two tanks.

CONCLUSION
This study introduces an improved hybrid PI-NN controller for the coupled system. The NN weights connective and controller parameters are optimized by utilizing the PSO algorithm via model reference adaptation. The proposed method provides a better performance with respect to PID-NN controller even under disturbance injection. The simulations for both PID-NN and hybrid PI-NN controllers are also performed and compared. Based on the results, it can be concluded that hybrid PI-NN is more robust and can provide more stable responses than PID-NN.