# Closed-Loop Stability of a Non-Minimum Phase Quadruple Tank System Using a Nonlinear Model Predictive Controller with EKF

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Theoretical Framework

_{1}and h

_{2}). The setup, though very simple, can be used to illustrate interesting multivariable nonlinear phenomena. The positions of the valves are denoted as γ1 and γ2. Tank 3 and tank 4 were placed above tank 1 and tank 2 to drain water directly by the action of gravity. The flow from each of the pumps was split into two by using a three-way valve (flow splitter or flow divider). The output of pump 1 is split between tank 1 and tank 4, whereas that of pump 2 is also split between tank 2 and tank 3. As a result, the flow to each pump’s output tanks—a lower and an upper diagonal tank—is regulated by the valve position, shown by the symbol γ. At the bottom of each tank was a discharge valve that allowed liquid to flow into the tank beneath it. The reservoir tank at the bottom receives discharge from tanks 1 and 2. It is an MIMO system because of the interactions and strong connection between the tanks. Figure 1a depicts a schematic of the quadruple tank system.

#### 2.2. Dynamic Model Development of the System

#### 2.3. Non-Minimum Phase Characteristics

#### 2.4. Control Algorithms

#### 2.4.1. Linear Model Predictive Control (LMPC)

_{1}and h

_{2}); ${q}_{1\text{}}\text{}and\text{}{q}_{2}$ are the input variables representing pump 1 and pump 2, respectively.

#### 2.4.2. Validation of Operating Phases

#### 2.4.3. Constrained NMPC Formulation

#### 2.4.4. State Prediction Model

_{c}< N

_{p}, the last set of control values $q\text{}\left(k+{N}_{c}-1\text{|}k\right)$ in the control sequence is maintained for the remaining (N

_{p}–N

_{c}) time steps, where, N

_{c}is the control horizon. Note that in the formulation of the NMPC, N

_{c}is always set to be either less than or equal to N

_{p}. Equations (11)–(15) demonstrate this. The sequence of control inputs and the expected state trajectory can be represented in vector form as follows:

#### 2.4.5. Output Prediction Model

#### 2.4.6. Cost Function

_{𝑝}, is varied within a finite range of values. An infinitely long prediction horizon would be the ideal choice, which would provide perfect performance. However, practically, it is impossible to implement an infinitely long prediction horizon. It is desirable to use a large but finite horizon. In addition, the controller performance decreased when the control horizon was set to high values. It is worth noting, however, that choosing a long prediction horizon implies that more variables must be solved in the optimization problem. This makes solving the problem complex.

#### 2.5. Optimal Control Problem (OCP)

#### 2.6. Discretization of OCP

#### 2.6.1. Linear Approximation of Nonlinear State Estimation

#### 2.6.2. EKF-Based NMPC Algorithm

- Time-update equations:$${J}_{f}={\nabla}_{x\text{}}f\left(x,q\left(k-1\right)\right)$$$${\widehat{x}}^{-}\left(k\right)=f\left(\widehat{x}\left(k-1\right),\text{}q\left(k-1\right)\right)$$$${P}_{x}^{-}=\varnothing \text{}{J}_{f}{P}_{x}\left(k-1\right){J}_{f}^{T}+{R}_{w}$$
- Measurement-update equations:$${J}_{f}={\nabla}_{x\text{}}h\left(x\right)$$$$K\left(k\right)={P}_{x}^{-}\left(k\right)\text{}{J}_{h}^{T}\text{}{\left[{J}_{h}{P}_{x}^{-}\left(k\right){J}_{h}^{T}+{R}_{v}\right]}^{-1}\text{}$$$${\widehat{y}}_{k}^{-}=h\left({\widehat{x}}^{-}\left(k\right)\right)$$$$\widehat{x}\left(k\right)={\widehat{x}}^{-}\left(k\right)+K\left(k\right)\left[y\left(k\right)-{\widehat{y}}_{k}^{-}\right]$$$${P}_{x}=\left[I-K\left(k\right){J}_{h}\right]{P}_{x}^{-}\left(k\right)$$

- ${A}_{i}$= internal area of the tanks (cm
^{2}), where i = 1, 2, 3, 4 for Tanks 1, 2, 3, and 4, respectively. - ${a}_{i}$ = cross-sectional area of the outlet orifice from the tank $i$ = 1, 2, 3, and 4.
- ${\alpha}_{i}$ = dimensionless constant of proportionality for outlets from the respective tanks.
- $g$ = acceleration due to gravity (cm s
^{−2}). - ${h}_{i}$= height of water in the respective tanks (cm).
- ${k}_{j}$= pump constants for pump j, where j = 1,2 represents pumps 1 and 2, respectively.
- ${q}_{j}$= pump flow rate (cm
^{3}s^{−1}). - $\gamma $ = flow ratio.

## 3. Results and Discussion

_{1}and h

_{2}) in addition to their respective manipulated variables, q

_{1}and q

_{2}. The control scheme used for this closed loop simulation time of 2000 s is LMPC in a non-minimum phase.

_{1}and q

_{2}) are shown as well.

#### 3.1. Real-Time Experimental Results

_{1}) that even though it tracked the setpoint before and after it was stepped, no inverse response was observed.

#### 3.2. Controllers’ Performance Indices

## 4. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Appendix A

Parameters | Values | Units |
---|---|---|

${q}_{{1}_{0}}$ | $170$ | ${\mathrm{cm}}^{3}/\mathrm{s}$ |

${q}_{{2}_{0}}$ | $170$ | ${\mathrm{cm}}^{3}/\mathrm{s}$ |

${h}_{{1}_{0}}$ | $10.57$ | $\mathrm{cm}$ |

${h}_{{2}_{0}}$ | $9.02$ | $\mathrm{cm}$ |

${h}_{{3}_{0}}$ | $1.46$ | $\mathrm{cm}$ |

${h}_{{4}_{0}}$ | $3.63$ | $\mathrm{cm}$ |

${A}_{1}=\text{}{A}_{3}\text{}$ | $35$ | ${\mathrm{cm}}^{2}$ |

${A}_{2}=\text{}{A}_{4}$ | $39$ | ${\mathrm{cm}}^{2}$ |

$a1=\text{}a3$ | $2.9928$ | ${\mathrm{cm}}^{2}$ |

$a2=\text{}a4$ | $1.9949$ | ${\mathrm{cm}}^{2}$ |

$k1=k2$ | $1$ | $-$ |

$g$ | $981$ | $\mathrm{cm}/{\mathrm{s}}^{2}$ |

${\alpha}_{1}$ | $0.4856$ | $-$ |

${\alpha}_{2}$ | $0.4926$ | $-$ |

${\alpha}_{3}$ | $0.8215$ | $-$ |

${\alpha}_{4}$ | $0.5496$ | $-$ |

${\gamma}_{1}$ | $0.456$ | $-$ |

$\text{}{\gamma}_{2}$ | $0.225$ | $-$ |

## References

- Johansson, K.H.; Nunes, J.L.R. A Multivariable Laboratory Process with an Adjustable Zero. Proc. Am. Conf.
**1998**, 4, 2045–2049. [Google Scholar] - Grune, L.; Pannek, J. Nonlinear Model Predictive Control: Theory and Algorithms; Springer: New York, NY, USA, 2011. [Google Scholar]
- Qin, S.J.; Badgwell, T.A. A survey of industrial model predictive control technology. Control. Eng. Pract.
**2003**, 11, 733–764. [Google Scholar] [CrossRef] - Van der Merwe, R. Sigma—Point Kalman Filters for Probabilistic Inference in Dynamic State—Space Models. Ph.D. Thesis, OGI School of Science and Engineering, Oregon Health and Science University, Portland, OR, USA, April 2004. [Google Scholar]
- Osunleke, A.S.; Deng, M.; Inoue, A.-A. CAGPC Controller Design for Systems with Input Windupand Disturbances. Int. J. Innov. Comput. Inf. Control.
**2009**, 5, 3517–3526. [Google Scholar] - Bitmead, R.R.; Gevers, M.; Petersen, I.R.; Kaye, R.J. Monotonicity and stabilizability properties of solutions of the riccati difference equation: Propositions, lemmas, theorems, fallacious conjectures and counterexamples. Syst. Control. Lett.
**1985**, 5, 309–315. [Google Scholar] [CrossRef] - Raff, T.; Huber, S.; Nagy, Z.K.; Allgower, F. Nonlinear Model Predictive Control of a Four Tank System: An Experimental Stability Study. In Proceedings of the 2006 IEEE International Conference on Control Applications, Munich, Germany, 4–6 October 2006. [Google Scholar]
- Johansson, K.H. The Quadruple-tank Process: A Multivariable Laboratory Process with an Adjustable Zero. IEEE Trans. Control. Syst. Technol.
**2000**, 8, 456–465. [Google Scholar] [CrossRef] - Danica, R.M. Robust Control of Quadruple-tank Process. Inst. Control. Ind. Inform.
**2008**, 2, 231–238. [Google Scholar] - Qamar, S.; Vali, U.; Reza, K. Multivariable Predictive PID for Quadruple Tank. World Acad. Sci. Eng. Technol.
**2010**, 43, 861–866. [Google Scholar] - Bequette, W.B. Non-linear Model Predictive Control: A Personal Retrospective. Can. J. Chem. Eng.
**2007**, 85, 408–415. [Google Scholar] [CrossRef]

**Figure 1.**(

**a**) Schematic diagram of QTS. (

**b**) QTS experimental rig in Simulation and Computational Laboratory, OAU Ile-Ife.

Tank | Pump1 | Pump2 |
---|---|---|

1 | ${k}_{1}{q}_{1}{\gamma}_{1}$ | - |

2 | - | ${k}_{2}{q}_{2}{\gamma}_{2}$ |

3 | - | ${k}_{2}{q}_{2}\left(1-{\gamma}_{2}\right)$ |

4 | ${k}_{1}{q}_{1}(1-{\gamma}_{1})$ | - |

Parameters | Variable | Value |
---|---|---|

Prediction Horizon | ${N}_{p}$ | 100 |

Control Horizon | ${N}_{c}$ | 1 |

Sampling time | ${T}_{s}$ | 1 |

Simulation time | ${T}_{sim}$ | 2000 |

Weight on input | ${W}_{q}$ | 0 |

Weight on input rate | ${W}_{dq}$ | 1 |

Weight on output | ${W}_{y}$ | 1 |

Index | LMPC | NMPC | NMPC-EKF | |||
---|---|---|---|---|---|---|

Tank1 | Tank2 | Tank1 | Tank2 | Tank1 | Tank2 | |

IAE | 66.74 | 40.13 | 259.1 | 218.2 | 222.5 | 215.2 |

Simulation ISE | 326.4 | 47.6 | 1087 | 511.7 | 852 | 495.5 |

Rise Time | 0 | 0 | 0 | 0 | 4.21 | 4.22 |

IAE | 2691 | 1935 | 4091 | 1561 | 1375 | 2076 |

Real-Time ISE | 7512 | 4990 | 18210 | 3893 | 4773 | 6705 |

Rise Time | 11.89 | 12.78 | 13.77 | 14.41 | 14.62 | 14.88 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Oyehan, I.A.; Osunleke, A.S.; Ajani, O.O.
Closed-Loop Stability of a Non-Minimum Phase Quadruple Tank System Using a Nonlinear Model Predictive Controller with EKF. *ChemEngineering* **2023**, *7*, 74.
https://doi.org/10.3390/chemengineering7040074

**AMA Style**

Oyehan IA, Osunleke AS, Ajani OO.
Closed-Loop Stability of a Non-Minimum Phase Quadruple Tank System Using a Nonlinear Model Predictive Controller with EKF. *ChemEngineering*. 2023; 7(4):74.
https://doi.org/10.3390/chemengineering7040074

**Chicago/Turabian Style**

Oyehan, Ismaila A., Ajiboye S. Osunleke, and Olanrewaju O. Ajani.
2023. "Closed-Loop Stability of a Non-Minimum Phase Quadruple Tank System Using a Nonlinear Model Predictive Controller with EKF" *ChemEngineering* 7, no. 4: 74.
https://doi.org/10.3390/chemengineering7040074