Enhancing Liquid Level Control Performance Using Mass Balance Techniques in Linear and Nonlinear Tanks
Abstract:
Liquid level control plays a crucial role in process industries, where accurate and stable regulation is required to ensure operational safety and process efficiency. In practice, nonlinear tank dynamics and wide operating ranges often degrade the performance of conventional proportional-integral-derivative (PID)-based control strategies, leading to excessive overshoot, oscillations, and prolonged settling times. Although various advanced control techniques have been proposed, many of them rely on complex tuning procedures or heuristic design, which limits their practical applicability. This paper proposes a mass-balance-based liquid level control strategy that directly exploits the physical relationship between inflow, outflow, and liquid level. The proposed method introduces a mode-switching mechanism that distinguishes between transient and steady-state operating conditions. During transient operation, the control valve is driven to its saturation limits to accelerate level correction, while steady-state regulation is achieved by balancing inflow and outflow to maintain mass equilibrium. Unlike conventional PID controllers, the proposed approach does not require parameter tuning, system identification, or optimization procedures. Simulation studies are conducted on nonlinear tank systems to evaluate the effectiveness of the proposed strategy. The results demonstrate that the proposed method achieves fast setpoint tracking with zero overshoot and reduced settling time compared with conventional proportional (P), proportional-integral (PI), and PID, and cascade control schemes. Quantitative performance comparisons further confirm the robustness and practical advantages of the proposed control strategy for nonlinear liquid level control applications.1. Introduction
Liquid level control is a fundamental task in many process industries, including chemical processing, oil and gas production, food and beverage manufacturing, and agricultural systems [1], [2], [3], [4]. Accurate regulation of liquid level is essential to ensure process safety, product quality, and operational efficiency. Deviations from the desired level may lead to overflow, pump cavitation, process instability, or safety hazards, particularly in large-scale or safety-critical plants [5].
In industrial practice, liquid level control systems typically consist of a level sensor, a controller, and a final control element such as a control valve or pump. Conventional feedback control strategies, especially proportional-integral (PI) and proportional-integral-derivative (PID) controllers, remain the most widely adopted solutions due to their simple structure and ease of implementation [6], [7], [8]. For tanks with approximately linear dynamics, such as cylindrical tanks operating around a fixed operating point, PI/PID controllers can provide acceptable steady-state performance.
However, significant challenges arise when PI/PID controllers are applied to systems with nonlinear dynamics or wide operating ranges. In nonlinear tanks, such as spherical tanks, the relationship between liquid level and stored volume varies significantly with height, leading to operating-point-dependent dynamics [9], [10], [11], [12], [13]. Under these conditions, fixed-gain PI/PID controllers often suffer from excessive overshoot, slow transient response, or oscillatory behavior, particularly during large setpoint changes [14], [15], [16], [17], [18]. Moreover, achieving satisfactory performance across the entire operating range typically requires repeated tuning or gain scheduling, which is time-consuming and heavily dependent on expert knowledge.
To address these limitations, numerous advanced control strategies have been proposed, including fuzzy logic control, neural networks, adaptive and hybrid controllers, and model predictive control [10], [13], [19], [20], [21]. While these approaches can improve performance in nonlinear systems, they introduce additional complexity in controller design, parameter tuning, rule-base construction, or model identification. As a result, their industrial adoption remains limited, especially in applications where simplicity, transparency, and reliability are critical.
Despite the extensive literature on level control, an important gap remains between physically interpretable control strategies and practical industrial implementation margins. Many existing methods rely on heuristic rules or optimized parameters rather than explicitly enforcing fundamental physical constraints. In particular, the principle of mass conservation—although central to the modeling of liquid level systems is rarely used as the primary basis for control law formulation. Instead, it is typically embedded implicitly within the process model rather than directly exploited for control decision-making.
Motivated by this observation, this paper proposes a mass-balance-based, tuning-free control strategy for liquid level regulation in both linear and nonlinear tanks. The proposed approach operates entirely in the time domain and directly enforces flow equilibrium conditions derived from the conservation of mass. Unlike conventional PI/PID controllers, the method does not require gain tuning, integral action, heuristic rule sets, or optimization procedures. Furthermore, the same control law is applied uniformly to both cylindrical and spherical tanks, without linearization or structural modification.
The main contributions of this paper can be summarized as follows:
A novel liquid level control strategy derived explicitly from mass conservation principles, providing a clear physical interpretation.
A tuning-free control formulation that eliminates overshoot and integral windup without relying on heuristic or adaptive mechanisms.
A unified control framework applicable to both linear and nonlinear tank geometries.
A comprehensive comparative evaluation against conventional PI/PID and cascade control strategies using quantitative performance indices.
The remainder of this paper is organized as follows. Section 2 presents the mathematical models of linear and nonlinear tank systems. Section 3 describes the proposed control strategy and its theoretical foundation. Section 4 reports simulation results and quantitative performance comparisons. Finally, Section 5 concludes the paper and discusses practical implications and future research directions. From an industrial perspective, the proposed strategy significantly reduces controller commissioning time and eliminates repeated gain tuning, while ensuring safe valve operation.
2. Mathematical Model of Liquid Level in Linear and Nonlinear Tanks
Mass-conservative theory is a fundamental principle used in various fields, including fluid dynamics and control systems. In the context of liquid level control, it focuses on the conservation of mass within a system, ensuring that the amount of liquid in a tank is accurately accounted for and managed over time. The dynamic volume balance for a cylindrical tank is represented by a linear ordinary differential equation involving the variables liquid height ($H$), the flow rate of liquid entering the tank ($F_\text {in}$), and the flow rate of liquid leaving the tank ($F_\text {out}$) as shown in Figure 1. This relationship can be expressed as:

where, $\rho A \frac{d H}{d t}$ represents the rate of change of liquid height in the tank over time, $A$ is the cross-sectional area of the tank (assuming to be constant for a cylindrical or rectangular tank). $\rho$ is the liquid density, $F_{\text {in}}$ means the mass flow rate of liquid entering the tank, $F_{\text {out}}$ is the mass flow rate of liquid leaving the tank.
Considering energy transformation from point 1 to point 2, Bernoulli’s principle provides critical insights into fluid behavior and is foundational for understanding fluid dynamics. It illustrates how pressure, velocity, and elevation interact in flowing fluids and has significant implications across various scientific and engineering disciplines. Bernoulli’s equation [22], [23], [24], [25], [26] can be expressed as:
where, $P_1$ and $P_2$ are static pressure at point 1 and point 2, respectively, $v_1$ is liquid flow at point 1, which is very small when compared with $v_2$ at point 2, $h_1$ and $h_2$ are liquid height at point 1 and point 2 , respectively.
Therefore, the liquid velocity at point 2 can be defined as:
A flowrate at point 2 is computed as:
where, $d_{\text {pipe}}$ is denotes the diameter of the output pipe. The mathematic model of the cylindrical tank (linear tank) is expressed as:
Next, the behavior of liquid levels in nonlinear tanks is characterized by nonlinearities in the governing equations. For example, as the height of the liquid changes, the area of the cross-section may vary in non-linear ways (e.g., in tanks that taper or have irregular shapes). Spherical tanks are a type of storage vessel characterized by their round shape, which allows for efficient storage of liquids and gases. Due to their geometric properties, spherical tanks in Figure 2 are widely used in various industries, including chemical processing, water storage, oil and gas, and food processing. The law of conservation of mass states that:

where, $V$ is the volume of liquid in a spherical tank that can be computed based on the height of liquid ($H$), and $R$ is the radius of the tank [9]. Spherical tanks are an essential part of various industrial processes, offering unique advantages in terms of structural integrity, space efficiency, and maintenance. Understanding their dynamics and implementing effective control strategies is crucial for optimizing their use in storing and managing liquids.
3. Design of Control Strategy
In this paper, Control Valve (CV) denotes the control valve opening percentage, and the terms valve and control valve are used interchangeably for clarity. The outlet flow rate is denoted as $F_{\text {out}}$ and may also be referred to as outflow in descriptive contexts. The control valve regulates the outlet flow to maintain the desired liquid level. The following section discusses the theoretical foundations behind the design of the analyzed control strategies, including the considerations and parameters taken into account during development. The principle of mass balancing is founded on the first law of thermodynamics, which asserts that matter (mass and energy) cannot be created or destroyed during any physical transformation process. The mass balance law states that the change in mass within a system is equal to the mass flow rate entering the system minus the mass flow rate leaving the system. When inflow exceeds outflow, the mass (and thus the liquid volume) in the tank increases, causing the liquid level to rise. Conversely, when outflow exceeds inflow, the mass in the tank decreases, leading to a drop in liquid level. Consequently, the algorithm for stabilizing level control is divided into two components: steady-state conditions and transient conditions. In transient conditions, the inflow rate is fully open when the liquid level is below the set point, while the outflow rate is completely closed when the liquid level is above the set point. On the other hand, under steady-state conditions, the inflow and outflow rates are constant, the inflow rate is adjusted to match the outflow rate. From Figure 1 and Figure 2, the inflow is regulated by CV, whereas the outflow is monitored using a flow transmitter. This algorithm shown in Figure 3 is very simple yet highly effective for both linear and nonlinear tanks, and it does not require tuning. The control decision logic of the proposed strategy is summarized in Table 1.

Operating Mode | Condition | Control Valve (CV) | Description |
|---|---|---|---|
Transient mode | $|e(t)| > \varepsilon$ and CV = 100%, $e(t) > 0$ | Fully opened | Rapidly increase liquid level |
Transient mode | $|e(t)| > \varepsilon$ and CV = 0%, $e(t) < 0$ | Fully closed | Prevent further level increase |
Steady-state mode | $|e(t)| \leq \varepsilon$ | CV = $(F_{\text{out}} \div F_{\text{max}}) \times 100$ | Adjusted to maintain mass balance |
The proposed control strategy is derived directly from the principle of mass conservation, which states that the rate of change of liquid mass within a tank is equal to the difference between the inflow and outflow rates. Unlike conventional feedback controllers that rely on gain tuning or heuristic rules, the present method enforces this physical constraint explicitly in the time domain.
Let the liquid level error be defined as:
where, $H_{s p}$ is the desired liquid level setpoint and $H(t)$ is the measured liquid level. The control objective is to regulate the inflow rate such that the mass balance condition is satisfied while ensuring rapid convergence to the setpoint without overshoot.
The control logic is divided into two operating modes: transient mode and steady-state mode. This separation is motivated by the different physical requirements during large level deviations and near-equilibrium conditions.
When the absolute level error exceeds a predefined tolerance ($\varepsilon$), the system is considered to be operating under transient conditions.
In this mode, the control objective is to eliminate the level deviation as quickly as possible. Based on the mass balance principle, the inflow rate is driven to its extreme values depending on the sign of the error.
This strategy guarantees a monotonic change in the liquid level toward the setpoint. Because the inflow decision is directly linked to the sign of the error rather than its magnitude, the controller avoids aggressive gain amplification and eliminates the risk of overshoot commonly observed in tuned PI/PID controllers.
When the liquid level approaches the setpoint within the tolerance band ($\varepsilon$).
The system transitions into steady-state mode. In this regime, the control objective shifts from rapid correction to equilibrium maintenance. The inflow rate is adjusted to match the measured outflow rate.
This condition enforces a zero net mass accumulation in the tank, ensuring steady-state stability without integral action. As a result, the proposed method inherently avoids integral windup and does not require controller parameter tuning.
The proposed control strategy is independent of tank geometry and relies solely on flow balance rather than explicit plant linearization. Therefore, it is applicable to both linear tanks with constant cross-sectional areas and nonlinear tanks, such as spherical tanks, where the cross-sectional area varies with liquid height. The same control law is used in both cases, with differences arising only from the underlying tank dynamics.
4. Simulation Results and Discussion
This section presents the simulation results of liquid level control in cylindrical and spherical tanks. The study utilizes the mathematical models presented in Eq. (5) and Eq. (6) to evaluate the performance of the proposed mass-balance-based control strategy under conditions that reflect real-world scenarios.
To provide an objective evaluation, the proposed method is compared with conventional P, PI, PID, and cascade control strategies. Standard performance indices, including rise time ($T_r$), settling time ($T_s$), percentage overshoot ($M_p$), and steady-state error ($e_{s s}$), are employed to quantify transient response, stability, and steady-state accuracy.
The simulations were conducted using MATLAB Simulink in a discrete-time framework. The system parameters for the cylindrical tank are detailed in Table 2. To ensure a fair comparison, the conventional PID controllers were tuned using both the Ziegler-Nichols (ZN) method and an expert trial-and-error approach.
Parameter | Area (m$\boldsymbol{^2}$) | Gain | Time Constant |
|---|---|---|---|
Tank | 0.0298 | - | - |
Flowout Pipe | 0.0000785 | - | - |
Control Valve (CV) | - | 0.000003125 m$^3$/s/% | 1.32 s |
Level Transmitter | - | 250 %/m | 0.792 s |
Flow Transmitter | - | 325000 %/m$^3$/s | 0 s |
The open-loop tuning parameters of the P, PI, and PID controllers used for performance comparison are summarized in Table 3.
Controller Type | $\boldsymbol{K_p}$ | $\boldsymbol{T_i}$ (s) | $\boldsymbol{T_d}$ (s) |
|---|---|---|---|
P | 1.0 | - | - |
PI | 0.9 | 100 | - |
PID | 1.2 | 200 | 50 |
For comparison purposes, the corresponding closed-loop PID tuning parameters are provided in Table 4.
Controller Type | $\boldsymbol{K_p}$ | $\boldsymbol{T_i}$ (s) | $\boldsymbol{T_d}$ (s) |
|---|---|---|---|
P | 0.6 | - | - |
PI | 0.3 | 160 | - |
PID | 0.4 | 100 | 80 |
To enhance reproducibility and clarify the implementation details of the MATLAB Simulink environment, the key simulation settings and practical actuator, sensor assumptions are summarized in Table 5. These settings were kept identical for all compared control methods to ensure a fair and unbiased evaluation.
Category | Parameter | Value | Description |
|---|---|---|---|
Simulation | Simulation type | Discrete-time | MATLAB Simulink discrete-time framework |
Simulation | Sampling time, $T_s$ | Constant (discrete) | Same sampling time for all controllers |
Simulation | Simulation duration | 1000 s | Based on the time horizon of all reported results |
Reference | Setpoints tested | 30%, 50%, 80% | Identical scenarios for all methods |
Actuator (CV) | Output limits (CV) | 0–100% | Valve saturation constraint |
Actuator (CV) | Rate limiter | Not considered | No explicit rate-limiting block |
Actuator (CV) | Deadband, backlash | Not considered | Ideal valve assumption |
Sensor | Level measurement | Ideal | No sensor dynamics modeled |
Sensor | Measurement noise | Not considered | Noise-free assumption |
Plant | Initial liquid level | 0% | Same initial condition |
Plant | Flow constraints | Consistent with Table 2 | Based on physical parameters |
Nonlinear tank | Level computation | Numerical (bisection) | Implemented via Bisection algorithm |
Comparison fairness | Baseline tuning | ZN + trial and error | Industrial-standard practice |
All parameters listed in Table 5 were kept unchanged across the proposed controller and the baseline PID and cascade PID controllers. Consequently, the observed performance differences are attributed solely to the control strategies rather than simulation configuration or implementation details.
The transient response of the cylindrical tank was evaluated under step changes. Figure 4 presents a comparison of the proposed strategy with the Open-Loop PID and Cascade control. The mathematical model of the cylindrical tank implemented in MATLAB Simulink is illustrated in Figure 5.


As observed in Figure 6, conventional PI and PID controllers exhibit noticeable overshoot and sluggish response. In contrast, the proposed control strategy exhibits a rapid rise toward the desired level without overshoot. This behavior is attributed to the Transient Mode control action, where the valve is driven to saturation limits to quickly reduce large deviations.

Next, the proposed method was compared with the closed-loop PID tuning method (Figure 7) and the trial-and-error tuning method (Figure 8).


While the trial-and-error method (Figure 8) improved the response speed compared to ZN tuning, it still carries the risk of instability if not tuned by an expert. The proposed method, however, transitions smoothly to Steady-State Mode once the level reaches the tolerance band ($\varepsilon$). In this mode, the inflow rate is matched to the outflow rate, enforcing mass balance and ensuring negligible steady-state error with minimal oscillation.
To evaluate performance under nonlinear dynamics, the control strategy was applied to a spherical tank. The mathematical model is derived from Eq. (6). Since the liquid level ($H$) cannot be solved directly from the volume ($V$) in a spherical geometry (Eq. (12)), a numerical solution is required.
The Bisection Method was employed as a robust root-finding algorithm to compute the level at each time step. The algorithm is detailed in Table 6, and the Simulink model is shown in Figure 9. The bisection iteration is terminated when the interval width becomes smaller than a predefined tolerance $\varepsilon$. The performance was tested at setpoints of 30%, 50%, and 80% of the tank height, as shown in Figure 10.
| Item | Description |
|---|---|
| Objective | Compute the liquid level ($H$) from a given volume ($V$) by solving $(f(H)=0)$ |
| Method | Bisection method (root-finding) |
| Lower bound | $({{H}_{L}})$: minimum feasible liquid level |
| Upper bound | $({{H}_{H}})$: maximum feasible liquid level |
| Midpoint | ${{H}_{C}}=({{H}_{L}}+{{H}_{H}})/2$ |
| Interval selection | Choose the subinterval based on the sign of $f({{H}_{L}})\cdot f({{H}_{C}})$ |
| Update rule | If $f({{H}_{L}})f({{H}_{C}})<0$, set ${{H}_{H}}={{H}_{C}}$; otherwise set ${{H}_{L}}={{H}_{C}}$ |
| Stopping criterion | Iteration terminates when $({{H}_{H}}-{{H}_{L}})<\varepsilon $ |
| Final estimate | $H=({{H}_{L}}+{{H}_{H}})/2$ |


The results indicate that:
At 30% Setpoint: All controllers reached the target, but the cascade controller was the slowest.
At 50% and 80% Setpoints: The nonlinearity of the spherical tank caused significant performance degradation for the fixed-gain PID and Cascade controllers, resulting in overshoots of up to 30%.
Proposed Method: Remarkably, the proposed method maintained consistent performance with zero overshoot across all setpoints, demonstrating its robustness against geometric nonlinearities.
To summarize the comparative analysis, Table 7 presents the quantitative performance indices extracted from the simulation results. While Table 7 presents a quantitative comparison based on standard performance indices, Table 8 provides a qualitative ranking of each control method to highlight their practical differences in terms of robustness, tuning effort, and control smoothness.
Method | SP | $\boldsymbol{T_r}$ (s) | $\boldsymbol{T_s}$ (s) | $\boldsymbol{M_p}$ (%) | $\boldsymbol{e_{ss}}$ | $\boldsymbol{T_v}$ (MV) | Control Effort |
|---|---|---|---|---|---|---|---|
PID | 30 | 12.0 | 45.0 | 18.0 | 0.40 | 5.0 $\times$ 10$^4$ | 8.0 $\times$ 10$^4$ |
Cascade-PID | 30 | 10.5 | 36.0 | 9.0 | 0.30 | 4.2 $\times$ 10$^4$ | 6.9 $\times$ 10$^4$ |
Proposed | 30 | 9.8 | 25.0 | 0.0 | 0.05 | 2.0 $\times$ 10$^4$ | 3.5 $\times$ 10$^4$ |
PID | 50 | 14.0 | 55.0 | 20.0 | 0.50 | 6.5 $\times$ 10$^4$ | 1.0 $\times$ 10$^5$ |
Cascade-PID | 50 | 12.5 | 42.0 | 11.0 | 0.35 | 5.5 $\times$ 10$^4$ | 8.5 $\times$ 10$^4$ |
Proposed | 50 | 10.5 | 28.0 | 0.0 | 0.06 | 2.2 $\times$ 10$^4$ | 4.0 $\times$ 10$^4$ |
PID | 80 | 17.0 | 62.0 | 27.0 | 0.60 | 9.0 $\times$ 10$^4$ | 1.4 $\times$ 10$^5$ |
Cascade-PID | 80 | 15.0 | 48.0 | 13.0 | 0.40 | 8.0 $\times$ 10$^4$ | 1.1 $\times$ 10$^5$ |
Proposed | 80 | 12.0 | 30.0 | 0.25 | 0.07 | 2.5 $\times$ 10$^4$ | 4.5 $\times$ 10$^4$ |
| Metric | PID | Cascade PID | Proposed |
|---|---|---|---|
| Overshoot | High | Medium | None |
| Settling time | Long | Medium | Short |
| Rise time | Medium | Short | Shortest |
| Steady-state error | Medium | Low | Negligible |
| Control smoothness (MV) | Poor | Fair | Excellent |
| Tuning effort | High | Medium | None |
As shown in Table 8, the proposed controller exhibits no overshoot and the shortest settling time among the evaluated methods. Furthermore, the total variation of the manipulated variable is significantly reduced, indicating smoother control action and reduced actuator stress compared with PID-based controllers.
The simulation results confirm that the proposed mass-balance-based strategy delivers a superior balance between response speed and stability. Unlike conventional PID controllers that struggle with the varying cross-sectional area of spherical tanks, the proposed method leverages the fundamental physics of flow equilibrium. This results in a “tuning-free” solution that effectively eliminates the trade-off between rise time and overshoot, making it highly suitable for industrial applications where process safety and efficiency are paramount.
The tolerance band ($\varepsilon$) determines when the controller transitions from rapid correction to equilibrium maintenance. A smaller tolerance results in tighter regulation but may increase valve activity near the setpoint, whereas a larger tolerance reduces control effort at the expense of longer settling time.
In this study, a tolerance of 0.5% was selected as a practical compromise between fast convergence and smooth actuator behavior. This choice reflects typical industrial preferences, where excessive valve motion is avoided while maintaining acceptable tracking accuracy. Importantly, the proposed control strategy remains effective over a range of tolerance values, allowing $\varepsilon$ to be adjusted based on sensor resolution and process requirements without modifying the control structure.
The proposed control strategy is designed with practical industrial constraints in mind. Actuator saturation is inherently accommodated, as the control action explicitly respects the physical valve limits during transient operation. Measurement noise and small fluctuations near the setpoint can potentially induce unnecessary switching in control systems. In the proposed method, the tolerance band ($\varepsilon$) mitigates this issue by preventing mode transitions caused by minor measurement perturbations. In the present simulations, measurement noise and valve deadband were not explicitly modeled; however, the steady-state operation based on flow balance ensures physically consistent behavior even in the presence of mild non-idealities. If required in real applications, standard industrial practices such as signal filtering, minimum valve movement thresholds, or actuator characterization can be incorporated as implementation-level enhancements without altering the fundamental control logic. These characteristics make the proposed strategy suitable for practical deployment in industrial liquid-level control systems.
5. Conclusions
This paper presented a mass-balance-based tuning-free control strategy aimed at achieving fast setpoint tracking with minimal overshoot and smooth control action over a wide operating range. The proposed controller was evaluated through simulation and compared with conventional PID and cascade PID controllers under multiple setpoint conditions.
The results demonstrated that the proposed approach consistently achieves zero or near-zero overshoot, shorter settling times, and negligible steady-state error. In addition, the controller significantly reduces manipulated variable variation and control energy, indicating improved control smoothness and actuator friendliness.
Overall, the proposed controller offers a well-balanced solution for industrial process control systems with varying operating conditions. Future work will focus on hardware-in-the-loop validation and real-time implementation to further assess its practical applicability.
Conceptualization, N.K. and W.W.; methodology, N.K. and W.W.; validation, N.K., W.W., T.S., and N.T.; formal analysis, N.K.; investigation, N.K. and W.W.; resources, W.W., T.S., and N.T.; data curation, N.K.; original draft preparation, N.K.; writing—review and editing, N.K., W.W., T.S., and N.T.; visualization, N.K.; supervision, W.W., T.S., and N.T.; project administration, W.W. All authors have read and agreed to the published version of the manuscript.
The data used to support the findings of this study are available from the corresponding author upon request.
This research was supported through equipment provided by the Center of Excellence on Instrumentation Technology and Automation (CEITA), Department of Instrumentation and Electrical Energy Engineering, Faculty of Engineering, King Mongkut’s University of Technology North Bangkok, Thailand.
The authors declare no conflicts of interest.
