Model Optimal Control of the Four Tank System
Wael A. Altabey1, 2, *
1Southeast University, International Institute for Urban Systems Engineering, Nanjing, China
2Department of Mechanical Engineering, Faculty of Engineering, Alexandria University, Alexandria, Egypt
To cite this article:
Wael A. Altabey. Model Optimal Control of the Four Tank System. International Journal of Systems Science and Applied Mathematics. Vol. 1, No. 4, 2016, pp. 30-41. doi: 10.11648/j.ijssam.20160104.11
Received: September 10, 2016; Accepted: September 26, 2016; Published: October 15, 2016
Abstract: The four tank system is a widely used mechatronic laboratory system in control theory. This work is aimed to choose the best controller for the four tank system (4TS) with two input force. The optimal control is one of the best techniques in a sense of performance, and is demonstrated for the level control of 4TS. There are several controller systems in optimal control for this purpose which are Linear Quadratic Regulator (LQR), Linear Quadratic Gaussian Regulator (LQGR), H2, and H∞ controller system. These controllers will be applied to this important mechatronic system (4TS) separately, and compared the performance for disturbance rejection with each other to study the effect of these controller systems on the 4TS controlled state. On the other hand the performances of the optimal control systems are compared with other controller performances available in literatures for the same case study. The results indicate that the Linear Quadratic Regulator (LQR) provides significant improvement over completely controllers. The simulations were carried out in MATLAB-Simulink.
Keywords: Mechatronic System; Optimal Control; LQR; LQGR; H2 Method; H∞ Method
During last decades, liquid level control has become the major challenges concerning research due to increasing use in variety of applications, especially industrial applications and has somehow got extreme importance especially in petrochemical industries, pharmaceutical and food processing industries, chemical plants,卐tc. The basic task of controller is to provide proper output. Due to this reason when the level controller works well then final product will be error free and will be accurate, hence the quality of the final product depends on the accuracy of the level controller. Since the liquid level control has been the subjects of study for a large number of researchers. Moreover, the liquid level control is the most representative equipments in the tank systems. The tank systems may be classified into various types based on the system configurations, like single and double tank (Chianeh et al. 2011), three tank systems (3TS) (Skogestad and Postlethwaite 2001, Kovács et al. 2010, Iplikci 2010, Altinisik and Yildirim 2012) and (Sarailoo et al. 2015) or four tank systems (4TS) (Gatzke et al. 2000, Mercangoz et al. 2007, Drca 2007, Alvarado et al. 2011, Ruscio 2012, Balsemin and Picci 2013, Khalid et al. 2014, Gouta et al. 2015). The four tank system (4TS) design is one of the most widely used laboratory system in control theory. It is a well-known MIMO (Multi Input Multi Output) system suitable for analysis of various control schemes used in real-time which have nonlinear dynamics. There are different controllers that operate in the world for the purpose of liquid level control for 4TS, which are the proportional-integral-derivative (PID) controller, artificial neural network (ANN) controller, fuzzy logic controller, sliding mode control, model predictive control (MPC) and optimal control techniques. The optimal control is one of the best techniques in a sense of performance. The famous optimal controller for nonlinear MIMO systems has some remarkable properties due to the guaranteed nominal stability of the closed loop controlled system (under weak conditions such as the stabilizability of the system and the detectability of the system seen from the objective). On the other hand, these optimal controller techniques have not attained the position it deserves between researchers. One reason for this is probably that it has been difficult to compare the optimal controller with the other controller methods which have received a great deal of attention owing to its simplicity and its practical applications. This work deals with the control of the 4TS using modern control methods. More precisely, there are four methods in optimal control for this purpose which are: Linear Quadratic Regulator (LQR), Linear Quadratic Gaussian Regulator (LQGR), H2 method, and H∞ method, extended optimal control methods will be applied to the 4TS, known as disturbance rejection is applied, and the obtained results are compared with each other to find which of them gives the best response, and the performance of the best response for disturbance rejection is compared with other control configurations of the most common control techniques in the process industry, which are predictive control techniques by (Gatzke et al. 2000, Mercangoz et al. 2007).
2. The Four Tank System Model
The 4TS model used in this work is based on the system originally presented by Johansson and Nunes (1998). Similar systems were used for both traditional and advanced control research (Dai and Åstrӧm 1999). The specific experimental setup in this case study was previously used for model predictive control (MPC) by Gatzke et al. (2000), Drca (2007), Alvarado et al. (2011), Balsemin and Picci (2013), a distributed model predictive control (DMPC) by Mercangoz et al. (2007) and robust control applications by Vadigepalli et al. (2001). For the same case study, Gouta et al. (2015) was used model based predictive and back-stepping controllers to overcome the errors of MPC. A simple Linear Quadratic (LQ) optimal controller of the 4TS level velocity (incremental) form with approximately the same properties as a conventional PID controller of velocity form was presented by Ruscio (2012). The simulation model of a nonlinear artificial neural network (ANN) control design for the nonlinear coupled four tanks system was designed by Khalid et al. (2014). The level control of coupled tanks using sliding mode control (SMC) is presented by Abbas and Qamar (2012) and using the fuzzy logic controller by Wu et al. (2004).
The model is a 6th order, non-linear system with two inputs (two pumps) and two outputs presented in Fig. 1. The two pumps are used to transfer water from a basin into four overhead tanks. The two tanks at the upper level drain freely into the two tanks at the bottom level. A portion of the flow from one pump is directed into one of the lower level tanks and the rest is directed to the overhead tank that drains into the other lower level tank. By adjusting the bypass valves of the system, the proportion of the water pumped into different tanks can be changed to adjust the degree of interaction between the pump throughputs and the water levels.
2.1. Mathematical Modeling of the Four Tank System
The four tank process is consists of four connected tanks as shown in Fig. 1. Pump A extracts water from the basin below and pours it to tank 1 and 4, while pump B pours to tank 2 and 3. The relationship between the flows at each outlet pipe and the total flow from pump A and pump B depends on the flow parameters and as:
The resistance R for liquid flow in such a pipe or restriction is defined as the change in the level difference (the difference of the liquid levels of the two tanks) necessary to cause a unit change in flow rate; that is:
Since the relationship between the flow rate and level difference differs for the laminar flow and turbulent flow, we shall consider both cases in the following. The relationship between the steady-state flow rate and steady-state head at the level of the restriction is given by:
Where Q = steady-state liquid flow rate (m3/sec), K = coefficient (m2/sec) and h = steady-state head (m).
For laminar flow, the resistance Rl is obtained as:
After some mathematical processing we can be written the 6th order differential equations of the four tank system as:
In the simulation scenarios, nonlinear differential equations for the water mass balance in the tanks are used to represent the case study of this work, which are given in equation (2). In this model, Bernoulli’s law is used for the flows out of the tanks, Aiis the cross-sectional area of tank i, hiis the liquid level of tank i, and ai s the outlet hole cross-sectional area of tank i, the valve parameters, is the speed, kjthe corresponding gain, and is the portion of the flow that goes to the upper tank from pump j. In this case study, the system model is expanded to include the pump dynamics between the control signals uj and the actual speeds as a first order lag with unit gain and time constant . The valve parameters specify the flow into the tanks, i.e. the flow into tank 1 is and into tank 4 and respectively to tank 2 and tank 3. Where the estimated parameter values of the real plant are shown in Table 1 by Johansson and Nunes (1998).
2.2. The Linear Model
Some systems cannot be represented by a linear model and require the use of nonlinear models. The nonlinearity in 4TS is due to the square root term in mass flow relationship in equation (2), between flow and level of the tank. The nonlinear models create more difficulty in optimizing the system and also its performance becomes poor (Miaomiao ma et al. 2012).
The linearization of this type of system requires a stationary point around which the system operates. Taylor series expansion is one of the methods used for linearization which approximates the system at a given stationary point. Generally any system can be represented by state-space or Input-output model. Here it deals with the uses the former model where A, B, C and D of the state-space representation are obtained using Jacobian matrices (Xue et al. 2007).
The non-linear dynamics are in the form:
And linearization of the system about the nominal operating point, from Table 1, requires calculating the linear system:
, , and
From Table 1:
The linear approximation to the system is:
Where: , and .
The derivative of linearization is:
It is important to note that the states are rearranged so that the discrete states 1 correspond to physical quantities ,,,, and respectively.
The linear system matrices are found to be:
By substitute the partial derivative of equations (7-12) in linear system matrices we can get:
3. The Control System Design
Now we want to examine The Criteria of Our System, we mean Controllability, Observability and Stability should be checked before the Design of controller.
After system checked, we find that the system has Rank equal 6, this means our system fully controllable and fully observable, and the Eigen value:
, This means our system is stable.
3.1. Linear Quadratic Optimal Control Regulator LQR
Model linear quadratic optimal control regulator (LQR) is designed by the mathematical model of the plant. The model to be used in the control system design is taken to be a state-space model. By using a state-space model, the current information required for containing ahead is represented by the state variable at the current time.
The plant has 2 inputs (fluid flow rate qa and fluid flow rate qb), Also the number of outputs is 2 (height h1 level and height h2 level).
Introduce the following performance index for the optimal controller design:
Where Q and R are weighting matrices for the state variables and the input variables, respectively, and is the terminal time for control action, which means that the control action is in a finite time interval. is the weighting matrix for the terminal states. This optimal control problem is referred to as the linear quadratic (LQ) optimal control problem. To solve this LQ optimal control problem, let us first construct a Hamiltonian function.
When there is no constraint on the input signal, the optimal (in this case, the minimum) value can be solved by taking the derivative of with respect to u and then solving the following equation:
Denote by the optimal control signal. Then, can be explicitly written in the following form:
On the other hand, it can be shown that the Lagrangian multiplier can be written as, where is the symmetrical solution matrix of the well-known differential Riccati equation (DRE).
With its final value . So, the optimal control signal can also be written as:
It is interesting to note that the solution of the finite time LQ optimal control problem turns out to be a linear state feedback with a time varying gain matrix, which is equal to.
A MATLAB function provided in the Control Systems Toolbox can be used to design an LQR for a given system with given weighting matrices. The syntax of the function is where is the given state space model, and Q and R are the weighting matrices. K is the state feedback gain matrix, and P is the solution matrix for the DRE.
The performance of the system with the LQR controller is shown in Fig. 2 and Fig. 3. The final results of the LQR design are the state feedback matrix are:
Fig. 2 is presented a comparison between the state description of the state X1 and X5 for tank level h1 and h2 respectively and state X2 and X6 for tank level h3 and h4 respectively and state X3 and X4 for pump flow rate and respectively with different Q, R matrices. We put initially Q and R matrices as diagonal of ones in status X1 and X5 and the other is zero. Then we increase the first element in Q matrix which is related to first status h1 (water level in tank one) that we are want to control it. Then we decrease the first element in Q matrix which is related to first status h1 (water level in tank one) that we are want to control it. Then we are made another increase the fifth element in Q matrix which is related to fifth status h2 (water level in tank two) that we are want to control it. The Q and R matrices are presented in Table 2.
Fig. 3 is presented the final states we are selected from above comparison Fig. 2. The selection is depending on which state has the minimum shooting and minimum steady state time. The final Q and R matrices that given the best statand.
3.2. Linear Quadratic Gaussian Optimal Control Regulator LQGR
The performance of the system with the LQGR controller is depended on the final response of LQR controller in Fig. 3. The final response of LQGR controller is presented in Fig. 4.
3.3. Optimal H2 Controller Design
The performance of the system with the H2 controller is shown in Fig. 5 and Fig. 6. The final results of the H2 design are the Disturbance output matrix.
Fig. 5 is presented a comparison between the state description of the state X1 and X5 for tank level h1 & h2 respectively and state X2 and X6 for tank level h3 and h4 respectively and state X3 and X4 for pump flow rate and respectively with different Disturbance output matrix D. The D matrices are presented in Table 3.
Fig. 6 is presented the final states we are selected from above comparison Fig. 5. The selection is depending on which state has the minimum shooting and minimum steady state time. The final Disturbance output matrix D that given the best states .
3.4. Optimal H∞ Controller Design
The performance of the system with the H∞ controller is shown in Fig. 7 and Fig. 8. The final results of the H∞ design are the Disturbance output matrices.
Fig. 7 is presented a comparison between the state description of the state X1 and X5 for tank level h1 and h2 respectively and state X2 and X6 for tank level h3 and h4 respectively and state X3 and X4 for pump flow rate and respectively with different Disturbance output matrices D and C. The D and C matrices are presented in Table 4.
Fig. 8 is presented the final states we are selected from above comparison Fig. 7. The selection is depending on which state has the minimum shooting and minimum steady state time. The final Disturbance output matrices D and C that given the best states and .
The controller performances are presented in Fig. 9 and Fig. 10 and listed in Table 5. The performance of the different control strategies are compared in two ways of comparison based on the settling time for the six controlled state X1, X5, X2 and X6 for tank level h1, h2, h3 and h4 respectively and X3, and X4 for pump flow rate and respectively. The first way we will be compared the percentages of the settling time between the different optimal control methods only to choose the best performance of optimal control for the 4TS, and then repeat the comparison with compared the percentages of the settling time between all different control strategies, i.e. the optimal control in the current work and the different predictive control which study by Gatzke et al. (2000), Mercangoz et al. (2007), to see the effect of each of them on the system for disturbance rejection and show that the proposed optimal control methods can improve the performance of the different predictive control for the same case study.
Fig. 9 is presented a comparison between the final best states for the worst case disturbance; we are selected from the previous methods to select the better method which gives the minimum shooting and settling time. From Table 5 and Fig. 9, the results from the finally comparison is:
(1) The smallest settling time of the optimal control methods is LQR, since the states spend around (6, 1, 25, 30, 22 and 15) seconds and the highest one is H∞ , since the states spend around (80, 260, 105, 125, 75 and 50) seconds for h1, h2, h3, h4, υ1 and υ2 respectively, to reach its steady state response.
(2) The smallest settling time of the predictive control methods is Centralized model predictive control (MPC) (Gatzke et al. 2000), since the states spend around (700, 750, 750 and 650) seconds and the highest one is Fully decentralized MPC (Mercangoz et al. (2007)), since the states spend around (1750, 2100, 1900 and 1800) seconds for h1, h2, υ1 and υ2 respectively, to reach its steady state response.
(3) The LQR gives the best performance along all the controllers strategies, i.e. optimal and predictive control, since the states spend around (7.5, 5.8, 23, 24, 29 and 30) % for h1, h2, h3, h4, υ1 and υ2 respectively from total settling time of the highest one of the optimal control methods (H∞ method), and (0.34, 0.7, 1.2 and 0.83) % for h1, h2, υ1 and υ2 respectively from total settling time of the highest one of the predictive control methods (Fully decentralized MPC), with small values of overshooting. Challenge for the controlling process.
(4) In the LQGR an external of noise is added to the model which affected the result, but the controller is work correctly and the states reach the steady state in nearly (93, 38, 38, 64, 40 and 80) % for h1, h2, h3, h4, υ1 and υ2 respectively from total settling time of the highest one of the optimal control methods (H∞ method), and (4.3, 4.8, 1.6 and 2.2) % for h1, h2, υ1 and υ2 respectively from total settling time of the highest one of the predictive control methods (Fully decentralized MPC), and we can neglect from comparison because noise and high values of overshooting.
(5) The H2 controller takes a long time to reach the steady state nearly (56, 19, 33, 36, 33 and 60) % for h1, h2, h3, h4, υ1 and υ2 respectively from total settling time of the highest one of the optimal control methods (H∞ method), and (2.6, 2.4, 1.3 and 1.7) % for h1, h2, υ1 and υ2 respectively from total settling time of the highest one of the predictive control methods (Fully decentralized MPC), and this is not accepted.
From the previous comparison between the methods of controller design with different control strategies, we can be selected LQR method to be used in presented work, and the final best states of X1 and X5 for tank level h1 and h2 respectively and state X2 and X6 for tank level h3 and h4 respectively and state X3 and X4 for pump flow rate υ1 and υ2 respectively are shown in the Fig. 10.
a Gatzke et al. (2000), b Mercangoz et al. (2007)
In this paper the disturbance rejection optimal control using four different optimal control methods in for this purpose which are: Linear Quadratic Regulator (LQR), Linear Quadratic Gaussian Regulator (LQGR), H2 method, and H∞ method, these methods were applied on the 4TS separately, and the obtained results were compared with each other and with those obtained by the predictive control method by Mercangoz et al. (2007). The superiority of the Linear Quadratic Regulator (LQR) controller was demonstrated, namely which has small percentage of the settling time values obtained for the worst case disturbance.