Observability Analysis and Observer Design for a Nonlinear Three-Tank System: Theory and Experiments

This paper addresses the observability analysis and observer design for a nonlinear interacting three-tank system. The plant configuration is first described using the process and instrumentation diagram (P&ID) and a state–space realization is derived; some insights about the behavior of the nonlinear system, considering equilibrium points and the phase portrait are provided. Then, observability in the Hermann–Krener sense is analyzed. A high-gain observer (HGO) is then designed, using the equivalence of the original state–space realization with its observability canonical form, in order to guarantee convergence of the state estimation. The performance was validated through simulation and experiments in a multipurpose plant equipped with real sensors; the HGO response was compared to a Luenberger observer (for a linear approximation of the plant) and the Extended Kalman Filter (for which convergence is not guaranteed), considering nonlinearities, interaction, disturbances and noise. Theoretical and experimental results show that the HGO can provide robust estimation and disturbance rejection, despite the sensitivity of HGOs to noisy variables in processes such as level of liquids.


Introduction
Industrial processes show some characteristics that make difficult their regulation, for instance multivariable interactions between controlled and manipulated variables, non-measurable state variables, non-measurable disturbances, uncertain and time-varying parameters, restrictions in manipulated variables and nonlinearities, among others [1][2][3]. Modern control strategies involve the use of compensators that comprise a state feedback and an observer [4]. Observers are used to reconstruct the unmeasured state variables, since they are either unmeasurable (e.g., when they have no physical sense) or there is no technical and/or economical viability to use high-priced sensors, from the input-output behavior [5,6].
State observers and soft sensors are being used more often nowadays in control systems to achieve different objectives in several industries. For instance, Liu [7] presented a robust adaptive observer for multiple-input multiple-output nonlinear systems with unknown parameters, uncertain nonlinearities, disturbances and unmodeled dynamics; Ciccio et al. [8] proposed a new nonlinear observer-based controller for time-delay nonlinear systems; Fernandes et al. [9] proposed a motion control system for a underwater vehicle using a MIMO PID controller aided by a high-gain observer; Turki et al. [10] developed a backstepping control for a tank process based on adaptive observers; Aguilar-Garnica et al. [11] designed and applied a reset observer in order to provide on-line estimation of the concentration of Free Fatty Acids from temperature measurements within a continuous stirred tank reactor; Eleiwi and Laleg-Kirati [12] presented a nonlinear observer-based Lyapunov control for a membrane distillation process; Kleindienst et al. [13] used the measurement of temperature at one single point of a silicon wafer to estimate the remaining wafer temperature profile using a state observer; and Lisci et al. [14] developed a geometric observer to design a model-based soft sensor for the estimation of quality indexes in a bioreactor. Sheng et al. [15] went further and showed how smart soft sensors can be combined with machine learning techniques to significantly save human resources and improve performance under complex industrial conditions. Although there are several estimation techniques, as stated in [16], it is difficult to select the proper one for specific applications; hence, the authors performed a review of observers recently used in process control and classified them into six classes.
Several studies for control systems have been performed using tanks because of their reconfiguration possibilities and easiness to visualize variables [17,18]. Hou et al. [19] provided a method for designing nonlinear state observers that can be used to design observers for models of induction motors and three-tank systems. Hou et al. [20] performed the observability analysis and observer synthesis for a three-tank water process taking into account singularities of nonlinear observers. Pan et al. [21] addressed the nonlinear control design problem for a state-coupled two-tank liquid level system. Korbicz and Witczak [22] designed a bank of extended unknown input observers for fault diagnosis of a two-tank system. Zhou et al. [23] designed three receding horizon predictive control strategies for a three-tank system based on the structural characteristics of a hybrid pseudo-linear RBF-ARX model. Prajapati and Roy [24] used unknown input observers for fault detection and isolation in a three-coupled tank system. Li et al. [25] proposed and evaluated an energy-efficient data transmission scheme for remote state estimation in a two-tank system. More recently, Arasu and Prakash [26] designed and implemented predictor-corrector based control schemes for a single input-single output nonlinear lab-scale conical tank system. Patel and Shah [27] developed a fault-tolerant controller for nonlinear systems that was implemented and validated on a computer model of a three interconnected conical tank system. Zhao and Zhang [28] proposed an inverse tangent functional nonlinear feedback control and carried out a case study related to the water tank level control system. Most of the referenced works rely on two types of tanks: cascade tanks, where the input flow goes into the first tank, and the level of each tank depends on the level of the previous tank, such as the benchmark quadruple tank system [29][30][31], and interacting tanks, where the input flow additionally depends on the current level [32,33].
High-gain observers have been considered to estimate the state in processes with nonlinear dynamics because they have robust estimation properties and disturbance rejection capabilities [34][35][36][37][38]. Regarding process control using HGOs, some works have been reported in literature. For instance, Lafont et al. [39] designed an adaptive high-gain observer for wastewater treatment systems. Turki et al. [40] introduced an output-feedback control scheme that combines nonlinear backstepping control with an adaptive high-gain observer in a two-tank process. Banerjee and Jana [41] synthesized an estimator-based hybrid control scheme that consists of a high gain nonlinear observer and the extended generic model controller and tested it in reactive distillation column. Gouta et al. [42] reported the nonlinear control design for a state coupled two-tank liquid level system which combines a nonlinear generalized predictive controller with a high-gain observer. Ayadi et al. [43] implemented a high-gain observer which provides a full state estimation (position, velocity, temperatures and pressures) in an electropneumatic system. Wang et al. [44] proposed a sliding-mode dynamic surface control strategy based on a high-gain observer for glue mixing and dosing control in the particleboard process.
Although some reported works in the literature about observer design show plant tests in fixed lab rigs, just a few provide either the complete observability analysis or the use of robust industrial instruments. This work addresses the complete observability analysis, in the Herman-Krener sense, for a three-tank process that combines tanks in series, interaction and nonlinear weirs and the design and implementation of a high-gain observer that guarantees convergence of the state estimation. The validation and comparison to the Extended Kalman Filter, of this observer, was performed using both simulations and real tests in a multipurpose experimental station that uses industrial instrumentation and provides flexibility to change dynamics and nonlinear behavior, as briefly addressed in [18].
The organization of the paper is as follows. In Section 2, the plant is described and a state-space model is analyzed. Section 3 shows the observability analysis of the set-up using the notions in [45]. Section 4 contains the design of the high-gain observer. Numerical simulations are provided in Section 5. The experimental results for the multipurpose station are presented in Section 6. Finally, conclusions are presented in Section 7.

Process Modeling
As addressed in [18], the process comprises three tanks arranged as shown in Figure 1. The system consists of three tanks, T 1 , T 2 , and T 3 , and each tank is equipped with a real level transmitter (LT). The two interacting Tanks T 1 and T 2 are connected in series with the third Tank T 3 . An electrical pump (P-1) is used to provide water supply into the system through two different branches, namely main and secondary, and, to measure the flow through the branches, each branch is equipped with an electromagnetic flow transmitter (FIT). Flow regulation in the main branch is achieved with the help of a control valve (UV-UY), which allows the manipulation of input flow to Tank T 1 . Using a manual valve (HV) located in the secondary branch, disturbances to the system are injected at Tank T 3 . In this paper, the input to the system is the flow regulated by the control valve, whereas the output of the system is the level in Tank T 3 (see [46][47][48] for further details about the process). The mathematical model can be obtained performing a mass balance in each tank, which is given by [18]ṁ in (t) −ṁ out (t) =ṁ(t) (1) whereṁ in andṁ out are the input and output mass flows, respectively, andṁ denotes the accumulation of mass in the tank. Assuming environment conditions, the density of water (the fluid process) is constant; therefore, Equation (1) becomes where q in and q out are the input and output volumetric flows, respectively, A is the cross-section area andḣ is the level variation in that tank. Applying Equation (2) for Tanks T 1 , T 2 , and T 3 yields with q in the input flow to Tank T 1 and q i (h i ) the output flow from Tank T i , i ∈ {2, 3}, where A j > 0 and h j are the cross-section areas and water levels of Tank T j , j ∈ {1, 2, 3}, respectively, and k 12 > 0 is the coupling orifice constant. In Equation (3), | · | : R → [0, ∞) is the absolute value function and sgn : R → R is the sign function, that is, The output flow from Tank T 2 to Tank T 3 can be chosen according to the sharp crested weir type. The general formula for the weir [49] can be written as where k j is the coefficient of the weir for Tank T j and lb j is the distance from the bottom of the tank to the crest of the weir in Tank T j ; n j is the order of the weir, which depends on the shape; and H(·) is the Heaviside step function, that is, In addition, since the zeros of the sensors can be calibrated to match the lower boundary of each weir and the working space is always above this level, for each j ∈ {2, 3}, Equation (4) can be written as To get a state-space realization of the system, let us define the state vector as The water level in the three tanks is non-negative, i.e., h i ≥ 0, i ∈ {1, 2, 3}. Then, the state-space representation of the plant is given byẋ where the state vector x ∈ R 3 ≥0 and the scalar input u 1 > 0 is the input flow, i.e., u 1 = q in . The drift and control vector fields are given by In addition, recall that A 1 , A 2 , A 3 , k 12 , k 2 , k 3 , n 2 and n 3 are all known, nonzero positive constants and hence A and K are nonsingular matrices. Consequently, from Equation (6), the equilibrium points are given by those points where µ(·) vanishes, that is, Figure 1, it can be noticed that the level in the third tank only depends on the output flow of the second Tank T 2 . Therefore, the complete system can be seen as the interconnection of two systems in cascade: two interacting tanks and the lower tank. Hence, the phase portrait is used in order to analyze the behaviour of the two interacting Tanks T 1 and T 2 . To this end, Figure 2, R 1 , R 2 and R 3 , respectively, denote regions where the level in T 1 is greater than that of T 2 , the level in T 1 is lower than in T 2 and the levels in Tanks T 1 and T 2 are equal.  Figure 3 shows the phase portrait of the levels in Tanks T 1 and T 2 without the input. As it is shown, trajectories starting from different initial conditions in the regions R 1 and R 2 approach the equilibrium point (origin). Nevertheless, this depends on the value of k 12 , since a large value correspond to almost zero restriction between the two tanks, transforming the two tanks into a single one.

Observability Analysis
Consider a general nonlinear systemẋ defined on R n , where f is a smooth and complete vector field on R n , the input vector u takes values in a compact subset Ω of R r containing zero in its interior and the output function h : R n → R m has smooth components h 1 , . . . , h q . Two states x 1 , x 2 ∈ R n are indistinguishable for the system in Equation (9) if, for every admissible input u ∈ Ω, the solutions of Equation (9) satisfying the initial conditions x(0) = x 1 and x(0) = x 2 produce identical output-time histories. In other words, x 1 , x 2 ∈ R n are indistinguishable for the system in Equation (9), if and only if h (Φ u (t, x 1 )) = h (Φ u (t, x 2 )) for every t ≥ 0 and input u, where Φ u (t, x 0 ) denotes the solution of the system in Equation (9) at time t for the initial condition x 0 and the input u. Given x 0 ∈ R n , let us denote I(x 0 ) ⊆ R n as the set of all points that are indistinguishable from x 0 with respect to the system in (9).
The following definitions from [45] are used. The system in Equation (9) is observable at The system in Equation (9) is weakly observable at x 0 ∈ R n if x 0 is an isolated point of I(x 0 ). The system in Equation (9) is weakly observable if it is weakly observable at every x 0 ∈ R n . Clearly, observability implies weak observability.
The following assumptions are made: Let us assume that the plant operates in the region Assumption 2. The input flow u 1 ∈ R is bounded (above and below), i.e., 0 ≤ u 1 ≤ u max and enters into the plant through Tank T 1 , where u max is the maximum input flow.
The implications of Assumption 2 are the following. The maximum input flow u max ensures no water overflow from the tanks, which is true since the plant was designed to avoid liquid overtopping the tank's physical limit [46,47]. Additionally, water always flows from Tank T 1 to Tank T 2 and finally to Tank T 3 . Then, it is assumed that there are no disturbances, i.e., the only water input into the system is located at the first tank. In addition, it ensures that the level in each tank is bounded, that is Given x 0 ∈ χ, let I 0 (x 0 ) denote the set of indistinguishable states from the initial condition x 0 for the unactuated system in Equation (9). Our next result characterizes this set. Proposition 1. For the unactuated system in Equation (9) Proof. First, observe that, in this case, u ≡ 0. Consider x 0 = (x 10 , x 20 , x 30 ) = 0 ∈ χ and letx 0 := (x 10 ,x 20 , , where ∇ is the gradient operator. Using this, we have Hence Since A 3 > 0, the last equation implies that k 2x 3 30 , and substitutingx 30 = x 30 immediately implies thatx 20 = x 20 . Next, Sincex 20 = x 20 andx 30 = x 30 , the last equation becomes Simplifying yields x n 2 −1 20 . This implies that √x 10 −x 20 = √ x 10 − x 20 , and hencex 10 = x 10 . Thus, it has been shown thatx 0 ∈ I 0 (x 0 ) implies thatx 0 = x 0 . In other words, I 0 (x 0 ) ⊆ {x 0 }. This completes the proof. Proposition 1 implies that the unactuated system in Equation (9) is observable in the Herman-Krener sense. Given x 0 ∈ χ, let I 1 (x 0 ) denote the set of indistinguishable states from the initial condition x 0 for the actuated system in Equation (9). Clearly, I 1 (x 0 ) ⊆ I 0 (x 0 ) = {x 0 }. Consequently, I 1 (x 0 ) = {x 0 }, and hence the actuated system in Equation (9) is also observable in the sense of Herman-Krener. Thus, it has been shown that the three-tank system with the knowledge of the input and the water level in Tank T 3 is observable in the sense of Herman-Krener. A high-gain observer is proposed in the following section.

Observer Design
Consider the nonlinear system of the forṁ where x ∈ X ⊂ R n denotes the state vector, u : [0, T] → U ⊂ R r is the input vector, y ∈ Y ⊂ R m is the output vector, and ϕ : X × U → R n is of the form which is a globally Lipschitz nonlinear function that contains the nonlinearities of the system. Consider θ > 0 and let k ∈ R n be such that the matrix A − kC is Hurwitz. Referring to Besançon [50], for the system in Equation (10), the observer is given bẏ where ∆ θ def = diag(θ, . . . , θ n ) ∈ R n×n . This form of observer is called high-gain observer (HGO), and it has good robust estimation properties and disturbance rejection capabilities [51]. The idea is to use a high-gain constant in order to generate a fast response in the observer and reduce the effect of the nonlinear error. Nevertheless, due to the high gain, the observer is very sensitive to noise and the transient response, when the estimation is far from the true value, can cause peaks in the prediction. However, this drawback can be solved by filtering the output signal or introducing a saturation function in the feedback control law [52,53], making them a good solution for state estimation.
To obtain an observer of the form of Equation (11), the system in Equation (5) must be transformed into its observability canonical form. According to Besançon [54], any control affine system satisfying the observability rank condition can be turned into the form Equation (10) using a diffeomorphism z : R n → R n given by Thus, the control affine system is related to its observability canonical form. To design an observer for the original plant and to avoid the inverse transformation of the observer obtained for the canonical form, it is recalled the definition of system equivalence used in [50].
defined on R n i with input u i ∈ R m i , output y i ∈ R p and f i 's are smooth vector fields. The two systems Σ 1 and Σ 2 are (state-space) equivalent if there exists a diffeomorphism z : R n 1 → R n 2 such that (x 2 , u 2 ) = (z(x 1 ), (u 1 )).
In other words, if (x 1 (t), u(t)) is a trajectory of Σ 1 , then (z(x 1 (t)), u(t)) is a trajectory of Σ 2 , that is, Consider the systems Σ 1 and Σ 2 and suppose is an observer for the system Σ 2 . Then, is an observer for the system Σ 1 . Using the concept of system equivalence and by transforming the system into its observability canonical form, a HGO is proposed for the three-tank system.

Proposition 2.
Consider the three-tank system in Equation (5) and suppose that Assumption 1 holds. Define is an asymptotic observer for the system in Equation (5), where Proof. To check the observability rank condition, the Jacobian matrix of Φ(x) must be full rank. The Jacobian is given by is nonsingular if and only if α 1 α 3 = 0, which is true if and only if 0 < x 2 < x 1 . Under Assumption 1, it now follows that the Jacobian has full rank.
Applying the diffeomorphism z = Φ(x) to the observer in Equation (12) yieldṡ where c 0 = e 1 and y 2 = c T 0 z. According to Besançon [54], where ϕ( z, u 1 ) = [0, 0, ξ( z, u 1 )] T is Lipschitz with respect to z, that is, there exists a L ξ > 0 such that |ξ( z 1 , u 1 ) − ξ( z 2 , u 1 )| ≤ L ξ z 1 − z 2 for all z 1 , z 2 , and Using Equation (14) in Equation (13) yieldṡ . Then, the error dynamics is given bẏ whereφ(z, z, u 1 ) def = ϕ( z, u 1 ) − ϕ(z, u 1 ). Inspired by the work of Hann et al. [55], the following Lyapunov function is defined where P = P T 0 is such that with I n being the identity matrix of size n. This quadratic form was chosen in order to be positive definite and radially unbounded. Then,V =˙ T P + T P˙ .
Using Equation (15) in Equation (17) yieldṡ while substituting Equation (16) in the above yieldṡ where · is the Euclidean norm in R n . Since ϕ(z, u 1 ) is Lipschitz with respect to z, it follows that By selecting θ > 2L ξ P , it follows that theV < 0. This completes the proof.

Simulation Results
The first validation stage of the HGO was performed with simulations for full-state estimation in system. Such simulations were carried out using MATLAB ® , which is a high-performance language developed by MathWorks ® . To get similar behavior to the real plant, a sample period of 0.2 s was selected. Different nonlinearities were tested by selecting different kind of weirs that are available for the configuration of the plant: linear, v-notch, rectangular and circular (see Figure 4).  (Tables 1 and 2). The input flow was set to a constant value ofq in , and levels were measured for each steady-state condition. Then, the weirs' parameters were computed using the MATLAB ® fitting toolbox, Figure 5. For the simulation, sensor noise was implemented through a Gaussian distribution with 0.5 cm standard deviation. Additionally, a deviation of 5 % in all the parameters of the system was taken into account.   Step inputs of 25% of the total flow capacity were simulated every 50 s approximately. The gain k = [0.8, 0.17, 0.01] T was chosen such that A 0 − kc T 0 is Hurwitz and θ = 2 as the high-gain observer parameter. Two different sets of weirs were used at the outputs of Tanks T 2 and T 3 . The first set comprised a rectangular weir in the upper tank and a linear in the lower, and the second set comprised a v-notch weir in the upper tank and a circular in the lower. Figure 6 shows the estimation of the level in each tank for the first set of weirs. Figure 7 shows the estimation of the level in each tank for the second set of weirs. The same parameters were used in both simulations, but the observer's parameters changed according to the exponential and coefficient of each weir. The observer converges slowly to the desired value, since poles were placed near to the imaginary axis. In both simulations, level estimations are affected by noise, as expected for a HGO.

Experimental Results
The second stage of validation of the HGO was performed through full-state estimation in the real process. The experimental set-up is shown in Figure 8. This three-tank system has different control technologies: PLC, industrial controller and PC with LabVIEW ® . In this case, the PLC controller was used as the DAQ system, and is connected through Ethernet to a LabVIEW ® interface [48], in which the compensator (controller+observer) was implemented. Since the real plant is a complete experimental station, all variables were measured with real sensors, as indicated in Figure 1; hence, the state estimation can be compared to real measurements of the levels in all the tanks. The sample time for the PLC and LabVIEW ® program was set to 0.2 s. As in simulations, step inputs of 25% of the total flow capacity were manually performed every 50 s approximately. The gain k ∈ R 3 was again chosen such that A 0 − kc T 0 is Hurwitz and θ = 2 as the high-gain observer parameter. Two different sets of weirs were used at the outputs of Tanks T 2 and T 3 . The first set comprised a rectangular weir in the upper tank and a linear in the lower, and the second set comprised a v-notch weir in the upper tank and a circular in the lower one.

High-Gain Observer Performance
Figures 9 and 10 show the estimation of the level in each tank for the first and second set of weirs, respectively. As can be noticed, the observer converges to the measurements. In both experiments, level estimations are affected by noise, but the level estimation for Tank T 3 , considered as the output (controlled variable) behaves very similar to the real measurement. Noise in the real process is mainly caused by the configuration of the system, in which several waves are produced by the input flow (see Figure 8). Two more experiments were conducted using an HGO with higher gain, k = [1.2, 0.5, 0.1] T . Figures 11 and 12 show how the state estimation is affected in a more noticeable way.   After t = 200 s, the system enters into an unobservable zone of the state space, and the estimation provided by the HGO diverges. This happens because the level in Tank T 2 goes below the minimum height of the weir, and, therefore, there is not flow from Tank T 2 to Tank T 3 . A faster observer response can be achieved by increasing the gain k, which can result in a noisy estimation of the state, but it can still perform well when used in a complete compensator that includes the state feedback.

Robustness Analysis
To test the robustness of the observer, two different experiments were carried out. In the first experiment, a variation of 30% of all parameters was made (tanks areas and weir constants). In this scenario, the HGO was compared to the well-known Luenberger observer [56] and the Extended Kalman Filter (EKF) [57]. Table 3 shows the mean squared error for the three observers; as can be noticed, the HGO obtained the best performance in the real process for the complete range of the tank levels despite the 30% variation in the model parameters. Figures 13-15 show the estimation for all levels with each observer. The HGO shows better performance and robustness than the other two observers. For instance, it can be seen how, for the low-level section, the estimation provided by the HGO converges in less than 2 s while Luenberger and EKF estimations are deviated from the measurement and converge after more than 20 s. It is important to point out that asymptotic estimation has been proved for the HGO, which is not the case for the EKF.    In the second experiment, an unmeasured temporary input flow went into the first and second tanks. Figures 16 and 17 show the estimation of the level in each tank for a temporary input flow to the first and second tank, respectively. As was expected, the output of the system changed (level in Tank 3), and therefore the estimation should change. Recall that the level of tank i depends on the inflow of the previous tank, which depends on the level of such tank. Therefore, it can been seen in Figure 16 that the estimated level in Tank 2 is similar to the actual value, but higher for Tank 1. Now, when the perturbation was introduced in Tank 1, as was expected, the estimation converges to the real values of all levels (see Figure 17).

Conclusions
This paper addresses the design and implementation of a high-gain observer (HGO) for a nonlinear interacting level control process with a level measurement in one of the tanks. For this set-up, the observability analysis in the sense of Herman-Krener is presented. The observation space depends on the minimum level of each weir and the flow from Tank T 2 to Tank T 3 . The notion of system equivalence is used to design an observer by taking into account the nonlinear dynamics of the system. These nonlinear effects are mainly due to the weirs, the interaction between the first two tanks and the minimum level of each weir, which defines the observable part of the state space. Theoretical and experimental results show that the HGO can provide a good estimate of the level in each tank using only the measurement of the output, when compared to other well-known linear (Luenberger) and nonlinear (EKF) state estimators; recall that asymptotic estimation has been proved for the HGO, which is not the case for the EKF. However, such estimation can be affected by noise in the measurement, which can be physically filtered using attenuators for the input flow. A faster observer dynamics specification can increase the variability of the estimation.