Optimized Liquid Level Control in Near-Infrared Spectroscopy-Based Liquid Phase Detection Equipment Using a PSSA-PID Approach
Abstract:
To address the time-delay and nonlinear characteristics of liquid level control in near-infrared spectroscopy-based liquid phase detection equipment, as well as the pipeline cavitation issues caused by improper sample pump speed settings during sample delivery—which may result in air bubble retention within the cuvette and subsequently degrade spectral data quality—a dual-buffer bottle sample delivery system model was established. A Proportional-Integral-Derivative (PID) controller was designed, and an enhanced hybrid algorithm integrating the Particle Swarm Optimization (PSO) algorithm and the Sparrow Search Algorithm (SSA) was proposed. The hybrid algorithm, referred to as the Adaptive Chaotic Mapping Particle Swarm Sparrow Algorithm (ACM-PSSA), incorporates Tent chaotic mapping for population initialization, a nonlinear cosine-based adaptive sparrow classification strategy, and a master–slave optimization mechanism wherein SSA performs global exploration and PSO executes local exploitation to optimize PID parameters. Simulation results demonstrate that ACM-PSSA outperforms traditional SSA and PSO across six benchmark test functions in terms of convergence speed, accuracy, and stability. When applied to the liquid level control of the dual-buffer bottle system, the optimized controller achieved a rise time of 0.188 seconds, a settling time of 1.211 seconds, and an overshoot reduced to 20.98%. By leveraging chaotic mapping, adaptive classification, and a master–slave optimization framework, ACM-PSSA effectively overcomes the limitations of conventional SSA and PSO, significantly enhancing the efficiency of PID parameter optimization and the overall control performance of the dual-buffer bottle sample delivery system.
1. Introduction
Liquid level is a critical control target in near-infrared spectroscopy-based liquid phase detection equipment. However, inherent time-delay and nonlinear dynamics in liquid level control present significant challenges. The precision and response speed of liquid level control directly affect both detection efficiency and spectral data quality [1], [2]. Currently, PID controllers are widely adopted for feedback control in such systems, with parameter optimization remaining a persistent area of research interest. Traditional methods for PID parameter optimization include the Ziegler-Nichols (Z–N) method and trial-and-error techniques [3], [4], [5], [6].
Nevertheless, the systems developed using conventional PID parameter optimization methods have increasingly failed to meet the evolving performance demands of liquid level control in high-precision detection environments [7], [8]. Ekinci et al. [9] proposed a Modified Gazelle Optimization (MGO) algorithm to optimize PID parameters for a three-tank liquid level system. Experimental results demonstrated that the MGO-optimized system achieved a rise time of 11.0424 seconds and a settling time of 60.6037 seconds. Compared with the Grey Wolf Optimizer (GWO) and PSO, MGO exhibited superior performance. Furthermore, the introduction of a new performance index, ZLG, highlighted the adaptability and robustness of MGO in dynamic system control. In another study, Benaouicha et al. [10] employed the Nelder–Mead algorithm to design a fractional-order PID controller for a three-tank system. This method minimized the error between the desired and actual liquid levels to optimize the controller parameters, thereby achieving enhanced control performance. In comparison with earlier designs based on the Prairie Dog Optimization (PDO) algorithm, the Nelder–Mead approach demonstrated improved control accuracy and faster response times.
In the studies [11], [12], a PID controller was optimized by integrating SSA with PSO, with the goal of improving the precision and response speed of liquid level control in near-infrared spectroscopy-based liquid phase detection equipment. SSA is known for its strong global search capability due to its dynamic exploration mechanism; however, this advantage may also result in excessively large solution steps during the search process, which can impair search ability. In contrast, PSO is characterized by effective local search behavior, as its particles explore the solution space based on both individual experience and information exchanged with neighboring particles. Nonetheless, PSO may become trapped in local optima [13], [14]. To leverage the strengths of both algorithms while mitigating their limitations, SSA was employed as the primary global optimizer, while PSO was introduced as the secondary local optimizer. Furthermore, a nonlinear cosine-based adaptive sparrow classification strategy was incorporated and Tent chaotic mapping was used to initialize the population, thereby improving the search performance of the hybrid algorithm. By optimizing PID controller parameters in this way, the performance of the near-infrared spectroscopy-based liquid phase detection equipment was ultimately enhanced.
2. Materials and Methods
The subject of this study is the near-infrared spectroscopy-based liquid phase detection equipment developed in-house for laboratory research applications. The core of the equipment’s control system is the STM32F103ZET6 microcontroller, which has been configured to coordinate and regulate the entire detection process. Two liquid level sensors continuously monitor the sample liquid level and provide real-time analog feedback signals to the microcontroller. A schematic of the liquid buffer bottle and the associated level sensors is shown in Figure 1. An intelligently optimized PID controller has been implemented to enable precise control of the sample delivery system. This allows for consistent sample volumes to be introduced prior to spectral acquisition, while also preventing cavitation within the pipelines and the retention of air bubbles within the cuvette, thereby ensuring system stability during both sample delivery and data acquisition. The system operates in a coordinated mode between an upper-level computer and a lower-level embedded controller, which facilitates parameter setting and data acquisition. This highly automated and intelligent architecture has significantly improved detection efficiency while ensuring data consistency and repeatability. A physical representation of the near-infrared spectroscopy-based liquid phase detection equipment is shown in Figure 2.


Among various liquid level control strategies, the PID controller remains the most widely applied approach. Its mathematical expression is given in Eq. (1):
The three parameters of $K_P$, $K_i$, and $K_d$ were tuned based on the step response characteristics of the controlled object, as optimal control performance can only be achieved when the parameters are configured appropriately.
The liquid level signal from the measured buffer bottle was transmitted to the analog input channel of the STM32 control unit. After data processing and computation, a corresponding pulse-width modulation (PWM) signal was sent to the PWM module to adjust the rotational speed of the sample delivery pump. The STM32 control unit was connected to a personal computer via an RS485 interface configured with the Modbus communication protocol. The acquired liquid level data were uploaded in real time to a serial port monitor. Under steady-state conditions, $h(\infty)=140 \mathrm{~mm}$. Subsequently, the recorded data were fitted using MATLAB 2021b, and the resulting curve is shown in Figure 3.

The liquid level control system consists primarily of a PWM controller, a sample delivery pump, and liquid level sensors. Based on a predefined reference liquid level, the liquid level sensors continuously measure the deviation between the actual and target levels. This deviation is transmitted to the microcontroller unit (MCU), which calculates the desired level and generates the corresponding pulse signal for the PWM controller, thereby controlling the rotational speed of the sample delivery pump. The system architecture of the near-infrared spectroscopy-based liquid phase detection equipment is illustrated in Figure 4.

A schematic diagram of the dual-buffer bottle sample delivery system is presented in Figure 5. When the input variable undergoes a change of $\Delta Q 1$, the output response—represented by the curve $\Delta H 1$ in Figure 6—exhibits an S-shaped profile rather than a linear response typical of an initial function [15]. This behavior arises due to the inclusion of an additional buffer bottle, which introduces a time-delay effect in the system's step response. A tangent drawn at the inflection point of the response curve intersects the time axis at a specific point. The time interval from the origin to this intersection point characterizes the delay induced by the buffer bottle, referred to as the capacity delay, and is denoted by the symbol $\tau$.


Based on the dynamic equilibrium relationship and the time-delay characteristics of the transmission components, the transfer function was derived as follows:
In this transfer function, $K=R 3, T 1=R 1 P 1$, and $T 2=R 3 P 2$, where $R 1, R 2, R 3$, and $R 4$ denote the fluid resistances of variable-diameter pipelines $V 1, V 2, V 3$, and $V 4$, respectively; and $P 1$ and $P 2$ represent the capacity coefficients of the upper and lower buffer bottles. The parameters $K, T 1$, and $T 2$ were obtained from the system's step response curve. Accordingly, the asymptotic line representing the steady-state value of $h_2(t)$, denoted as $h_2(\infty)$, was obtained. The point $A$ on the response curve was identified at the moment when $h_2(t) \mid t=t_1=0.4 h_2(\infty)$, corresponding to the time $t_1$. Similarly, point $B$ was determined at $h_2(t) \mid t=t_1=0.8 h_2(\infty)$, corresponding to the time $t_2$. Then $K, T 1$, and $T 2$ were subsequently calculated.
From Eq. (4), $T l=8.0370$ and $T 2=4.9631$ were obtained. Additionally, according to Eq. (5), $K=140$ and $\tau=25$ were obtained. Accordingly, the system model was established as:
Common performance indices for error include the Integral of Squared Error (ISE) and the Integral of Time-weighted Absolute Error (ITAE). To quantify the deviation between the actual tracking trajectory and the reference trajectory, the ITAE index was selected as the fitness function for ACM-PSSA. This index reflects the time-weighted integral of the absolute error. The objective function is defined as:
3. ACM-PSSA
In the conventional SSA, the search space is divided into D dimensions. Each sparrow occupies a position within this space, denoted as $X_{i, j}=\left(X_{i, 1}, X_{i, 2}, \ldots, X_{i, D}\right)$, with $i$=1,2,…,$N$, where $i$ represents the index of the sparrow, and $j$ indicates the corresponding dimension. The population is categorized into three roles: discoverers, followers, and sentinels. Each role updates its position differently during the iterative search process [16], [17], [18], [19].
Discoverers are responsible for exploring the search space and identifying potential optimal solutions. The position update mechanism for discoverers is governed by Eq. (8):
where, $iter_{\max }$ denotes the maximum number of iterations; $\alpha$ is a random variable that follows a normal distribution in the range (0,1]; $L$ is a matrix of dimension 1×Dim; $R$ is an alert indicator within the interval [0,1]; and ST is a safety threshold ranging between 0.5 and 1. When $R$ is less than $ST$, the environment is regarded as relatively safe, implying no significant threat from predators. However, when $R$ is equal to or exceeds $ST$, it is assumed that one or more sparrows have detected potential danger and issued an alarm to the rest of the population.
When a follower observes that a discoverer has identified a superior solution, it abandons its current position and moves rapidly to compete for the newly discovered optimum. This behavior is modeled in SSA to accelerate convergence toward high-quality solutions. The position update mechanism for followers is defined by Eq. (9):
where, $X_B^{t+1}$ represents the position of the best-performing discoverer in generation $t+1 ; X_{{worst }}^t$ denotes the global worst position in generation $t ; A$ is a $1 \times$ Dim matrix, which meets the requirements of $A^{+}=A^T\left(A A^T\right)^{-1} ; t / 2$ marks the population fitness median. Individuals with lower fitness need to relocate in pursuit of improved positions, thereby enhancing their survival potential.
Sentinels are responsible for monitoring the environment and issuing warnings to both discoverers and followers when necessary. The position update formula for sentinels is expressed in Eq. (10):
where, $X_{{best }}^t$ denotes the global best position in generation $t ; \beta$ is a step-size control variable drawn from a normal distribution; $k$ is a random number within the range $[-1,1]; f_{{worst }}, f_i$, and $f_k$ represent the worst fitness value, the current individual's fitness, and the global best fitness value, respectively; and $\varepsilon$ is a constant used to prevent division by zero during computation. When $f_i>f_k$, it indicates that the sparrow is located at the edge of the population and is therefore more vulnerable to predation. Conversely, when $f_i=f_k$, it suggests that a potential threat has been detected, prompting the sparrow to move closer to the center of the swarm to enhance safety.
In the PSO algorithm, each particle represents a solution. The core mechanism of the algorithm lies in updating a particle’s position based on both its own historical best solution and that of neighboring particles. Optimal solutions are searched by iteratively updating both position and velocity [20], [21], [22], [23]. The update rules for each particle are defined by the following equations:
where, $t$ represents the current iteration index; $X_{i d}^t$ denotes the position of the $i$-th particle in the $d$-th dimension at iteration $t ; V_{i d}^t$ denotes the corresponding velocity; $\omega$ is the inertia weight, which balances the particle's current velocity with its historical velocity; $c_1$ and $c_2$ are learning factors that control the influence of the individual best and the global best positions, respectively; $r_1$ and $r_2$ are random values sampled from the interval $(0,1)$, introducing stochasticity to enhance the algorithm's exploration capability; $P_{i d}$ is the best historical position found by the $i$-th particle in dimension $d$; and $P_g$ is the global best position discovered across all particles in the $d$-th dimension.
The initial distribution of population positions plays a critical role in determining the search efficiency and convergence speed of the algorithm. Non-uniform population distribution can significantly hinder the search capability. To address this issue, Tent chaotic mapping was introduced to initialize the positions of sparrows in the algorithm, thereby enhancing its global optimization performance [24], [25]. The mathematical formulation of Tent mapping is given in Eq. (13):
When $\mu=0.5$, a standard Tent chaotic sequence is generated, which possesses a uniform distribution characteristic. The distribution density of each parameter is also relatively uniform. The standard Tent mapping formula is expressed as follows:
It has been observed that unstable periodic points may exist within Tent chaotic sequences. To prevent the sequence from becoming trapped in such unstable states, while preserving the randomness, ergodicity, and deterministic characteristics of the chaotic variables, an improved formulation was developed by introducing a random perturbation term into the standard Tent mapping equation. The improved equation by $\operatorname{rand}(0,1) \times 1 / N_p$ is defined in Eq. (15):
where, $N_p$ denotes the number of individuals in the chaotic population sequence, and $rand(0,1)$ represents a random number uniformly distributed in the interval $[0,1]$.
The ratio of each sparrow type significantly influences the balance between global exploration and local exploitation in the standard SSA. A nonlinear cosine-based adaptive classification strategy was proposed [26]. This strategy dynamically adjusts the number of sparrows by iteration count. Specifically, the proportion of discoverers is gradually reduced using a nonlinear cosine function as iterations progress, thereby strengthening local search ability and improving convergence performance. The mathematical formulation of the improved sparrow proportion is given by:
where, $t$ denotes the current iteration number; $iter$$_{\text {max }}$ is the maximum number of iterations; $P D_{(t)}$ represents the proportion of discoverers at iteration $t ; P_{initial }$ is the initial proportion of discoverers; $P_{finall }$ is the final proportion of discoverers at the end of the iterations; and $F D_{(t)}$ denotes the proportion of followers at iteration $t$.
In the conventional SSA, the search capability relies primarily on the exploratory behavior of discoverers. However, followers merely converge toward the positions of discoverers without performing independent optimization, which may result in missed opportunities to locate the global optimum. Furthermore, the use of a fixed proportion of discoverers limits the algorithm’s adaptability, often leading to insufficient early-stage exploration and premature convergence to local optima, or inadequate exploitation in later stages, thereby slowing down convergence. Traditional PSO algorithms optimize candidate solutions based on a combination of individual and neighborhood experience. Nonetheless, due to limited global search capabilities and a convergence mechanism based on gradual approximation, PSO often suffers from slow convergence and a tendency to become trapped in local optima. Moreover, the initialization of populations using purely random strategies frequently leads to uneven population distributions. As a result, individuals may become concentrated in limited regions of the search space, increasing the risk of local stagnation and further weakening global search performance.
To address the limitations outlined above, ACM-PSSA was developed. This hybrid algorithm introduces a nonlinear cosine-based adaptive strategy, in which the proportion of discoverers is dynamically adjusted over the course of iterations. By enhancing exploration in the early stages and concentrating exploitation in the later stages, a more balanced trade-off between global search and local refinement is achieved, thereby improving both convergence speed and solution accuracy. Tent chaotic mapping was employed for population initialization, leveraging its ergodicity and stochasticity to generate a uniformly distributed and diverse initial population. This approach enhances global search capability and reduces the risk of premature convergence to local optima. A dual-phase optimization mechanism was adopted. First, an improved SSA was utilized for global exploration to obtain a relatively optimal solution. Subsequently, the PSO algorithm was applied within the local neighborhood for refined exploitation and solution update. This hybrid mechanism effectively addresses the passive movement limitations of followers in the traditional SSA, which often leads to unexplored regions in the search space. As a result, the global exploration capacity of the algorithm is significantly enhanced. The mathematical formulations for position updates in the hybrid population are provided as follows:
The pseudo-code of ACM-PSSA is presented in Table 1.
Input: Population size np, maximum number of iterations MaxIter, initial discoverer ratio $P_i$, final discoverer ratio $\mathrm{P} \_\mathrm{f}$, sentinel ratio SD , alert threshold ST , inertia weight W , self-learning factor C 1 , social learning factor C 2 , velocity V , chaos coefficient r , parameter search range |
Output: Updated best solution |
1. Parameters of PSSA were set: $\mathrm{P} \_\mathrm{i}=0.6, \mathrm{P} \_\mathrm{f}=0.1, \mathrm{SD}=0.1, \mathrm{ST}=0.6, \mathrm{~W}=1.8, \mathrm{C} 1=1.0, \mathrm{C} 2=1.8$, $\mathrm{V}=0.5, \mathrm{r}=1.8$ |
2. The population positions X were initialized using the Tent chaotic sequence, and fitness values were calculated |
3. The best-performing sparrow was selected as the best individual zg_best |
4. While K $<$ MaxIter |
5. PD and FD were calculated using Eqs. (9) and (10) |
6. Dfor the number of discoverers (PDNumber) |
7. The discoverer's position (X_new) was updated using Eq. (11) |
8. end |
9. for the number of followers (FDNumber) |
10. The follower's position (X_new) was updated using Eq. (12) |
11. end |
12. for the number of sentinels (SDNumber) |
13. The sentinel's position (X_new) was updated using Eq. (10) |
14. end |
15. for population quantity (np) |
16. The best individual was updated using the fitness function; the individual with the minimum fitness value was selected |
17. if Fitness(zg_best) $>$ Fitness (sparrow) |
18 zg_best = sparrow |
19. end end |
20.for population quantity (np) |
21. Particle velocity (V) was updated using Eq. (11) |
22.Particle position (X_new) was updated using Eq. (12) |
23. end |
24. for population quantity (np) |
25.The best individual was updated using the fitness function; the particle with the minimum fitness value was selected |
26. if Fitness (zg_best) $>$ Fitness (particle) |
27. zg_best = particle |
28. end end |
29. The best solution was updated |
30. end |
4. Results and Analysis
The optimization performance of the proposed ACM-PSSA was evaluated in terms of accuracy, stability, and convergence speed. Comparative simulation experiments were conducted using six benchmark test functions, with the standard SSA, the standard PSO algorithm, and the proposed ACM-PSSA hybrid algorithm. For all three algorithms, the population size was set to 100, the maximum number of iterations was set to 30, and each algorithm was independently executed 20 times. Table 2 shows the testing algorithm.
Function | Mathematical Expression | Search Interval | Global Optimum |
F1 | $f(x)=\sum_n^{i=1} x_i^2$ | [-5.12, 5.12] | 0 |
F2 | $f(x)=\sum_{n-1}^{i=1}\left(100\left(x_{i+1}-x_i^2\right)^2+\left(1-x_i\right)^2\right)$ | [-5, 5] | 0 |
F3 | $f\left(x_1, x_2\right)=2 x_1^2-1.05 x_1^4+\frac{1}{6} x_1^6+x_1 x_2+x_2^2$ | [-5, 5] | 0 |
F4 | $f(x)=-a \exp \left(-b \sqrt{\frac{1}{d} \sum_d^{i=1} x_i^2}\right)-\exp \left(\frac{1}{d} \sum_d^{i=1} \cos \left(c x_i\right)\right)+a+e$ | [-32.768, 2.768] | 0 |
F5 | $f(x)=10 n+\sum_n^{i=1}\left[x_i^2-10 \cos \left(2 \pi x_i\right)\right]$ | [-5.12, 5.12] | 0 |
F6 | $f(x)=\frac{1}{4000} \sum_n^{i=1} x_i^2-\prod_n^{i=1} \cos \left(\frac{x_i}{\sqrt{i}}\right)+1$ | [-600, 600] | 0 |
The mean value was used as the reference metric to evaluate the accuracy of each algorithm. Across all benchmark functions, the ACM-PSSA hybrid algorithm exhibited superior convergence performance compared to both the standard SSA and PSO algorithms. This outcome reflects the effectiveness of the proposed hybridization strategy, demonstrating that combining the strengths of both algorithms leads to significant improvements in convergence accuracy. Notably, for functions F1 and F3, ACM-PSSA achieved dramatically better performance than the other two algorithms. The results are presented in Table 3.
Function | PSO | SSA | ACM-PSSA |
F1 | 3.21E-06 | 2.85E-27 | 6.56E-79 |
F2 | 2.02E-04 | 4.49E-03 | 8.04E-13 |
F3 | 1.86E-08 | 2.70E-24 | 2.24E-66 |
F4 | 1.34E-04 | 5.36E-12 | 1.39E-15 |
F5 | 5.19E+00 | 1.70E-14 | 1.22E-16 |
F6 | 9.01E+02 | 9.75E-10 | 5.11E-15 |
The standard deviation was adopted as the reference metric for evaluating algorithmic stability. Across all benchmark test functions, the ACM-PSSA hybrid algorithm achieved superior performance compared to both the standard SSA and standard PSO algorithms, thereby demonstrating enhanced stability. The results are presented in Table 4.
Function | PSO | SSA | ACM-PSSA |
F1 | 3.08E-06 | 1.28E-26 | 2.93E-78 |
F2 | 6.18E-04 | 3.45E-03 | 2.16E-13 |
F3 | 3.45E-08 | 2.69E-25 | 3.16E-66 |
F4 | 4.18E-05 | 4.35E-12 | 1.03E-15 |
F5 | 3.49E+00 | 3.25E-14 | 1.63E-16 |
F6 | 0.00E+00 | 7.15E-10 | 4.04E-15 |
To evaluate the convergence speed of each algorithm, optimization convergence curves were plotted using the test functions. As illustrated in Figure 7, ACM-PSSA consistently required fewer iterations to reach the optimal value compared to the standard SSA and PSO algorithms. This outcome verifies the superior convergence rate of the proposed ACM-PSSA.

In summary, among the test functions, ACM-PSSA—constructed by integrating the respective advantages of SSA and PSO—exhibited significantly faster convergence than the standard PSO algorithm and demonstrated superior convergence precision and stability relative to the standard SSA algorithm. Furthermore, ACM-PSSA was less prone to being trapped in local optima.
ACM-PSSA was employed to optimize the parameters of the PID controller. The block diagram of the controller is presented in Figure 8.

To validate the feasibility of ACM-PSSA in optimizing PID controller parameters and to assess its generalization capability in other PID optimization scenarios, comparative simulation experiments were conducted. The experiments involved the proposed dual-buffer bottle sample delivery system and the direct current (DC) motor speed PID controller proposed by Aykut Fatih Güven et al. [27]. Five algorithms were used for comparison: Wild Horse Optimization (WHO), Genetic Algorithm (GA), standard SSA, standard PSO, and ACM-PSSA. The optimization ranges for the PID controller parameters $K_p, K_i$, and $K_d$ in the dual-buffer bottle sample delivery system were set to $[ 0,100]$, while those for the DC motor speed PID controller were set to [0,300]. For all algorithms, the number of iterations was fixed at 30 , and the maximum population size was set to 100 . The transfer function of the dual-buffer bottle sample delivery system is defined in Eq. (20), while the transfer function of the DC motor speed PID controller is provided in Eq. (21):
The unit step response convergence curves for the PID controllers of both the dual-buffer bottle sample delivery system and the DC motor speed control system, as optimized by WHO, GA, standard SSA, standard PSO, and the proposed ACM-PSSA, are illustrated in Figure 9. A comparative analysis of the PID parameter optimization results for the dual-buffer bottle sample delivery system is presented in Table 5, while the results for the DC motor speed PID controller are summarized in Table 6.

Based on the data in Table 5, it can be observed that the proposed ACM-PSSA achieved superior performance in optimizing the PID controller of the dual-buffer bottle sample delivery system compared to the other four algorithms. Although the PID controller optimized via the GA exhibited comparable performance to ACM-PSSA in terms of rise time and overshoot, a significantly longer settling time was recorded.
Method | Rise time (s) | Settling time (s) | Overshoot (%) |
WHO | 0.237 | 2.578 | 26.05 |
GA | 0.189 | 2.488 | 20.99 |
PSO | 0.212 | 2.621 | 25.41 |
SSA | 0.199 | 2.524 | 22.98 |
ACM-PSSA | 0.188 | 1.211 | 20.98 |
As shown in Table 6, no overshoot was observed across all tested algorithms. Among the evaluated approaches, ACM-PSSA achieved the best performance in terms of both rise time and settling time.
Method | Rise time (s) | Settling time (s) | Overshoot (%) |
WHO | 1.237 | 2.183 | 0 |
GA | 1.000 | 1.737 | 0 |
PSO | 1.253 | 2.220 | 0 |
SSA | 1.175 | 2.097 | 0 |
ACM-PSSA | 0.706 | 1.262 | 0 |
Due to the global search capability of SSA and the local exploitation strength of PSO, the hybrid ACM-PSSA delivered superior performance in the PID controller parameter optimization simulations.
5. Discussion
To address the time delay, nonlinearity, and pipeline cavitation challenges encountered in liquid level control for near-infrared spectroscopic liquid-phase detection equipment, a dual-buffer bottle sample delivery system was developed, and a PID controller was designed. ACM-PSSA was proposed and applied to optimize the PID controller parameters, leading to substantial improvements in system performance. Simulation results demonstrated that the optimized system achieved a reduced rise time of 0.188 seconds, a shortened settling time of 1.211 seconds, and a decreased overshoot of 20.98%. Superior convergence speed, precision, and stability were consistently exhibited by ACM-PSSA across all six benchmark functions. When applied to the detection equipment, the algorithm not only enhanced the responsiveness and stability of liquid level control but also effectively mitigated pipeline cavitation and air bubble retention in the cuvette, thereby improving the reliability of spectral data acquisition. These outcomes are of significant relevance to fields such as chemical analysis and industrial quality control. By integrating SSA, PSO, Tent chaotic mapping, and a nonlinear cosine-based adaptive mechanism, ACM-PSSA provides an innovative approach for optimizing complex control systems.
During the implementation of ACM-PSSA and the dual-buffer bottle sampling system, several considerations must be addressed: a) the liquid level sensor must be precisely calibrated to provide reliable feedback signals; b) algorithm parameters should be adjusted in accordance with system characteristics to enhance search efficiency; c) dynamic system responses must be continuously monitored, and PID parameters must be adaptively adjusted to accommodate operational condition changes; d) it must be verified whether simulation outcomes are transferable to hardware environments in order to mitigate potential impacts from sensor noise or hardware limitations. Future studies should aim to evaluate the performance of ACM-PSSA in other real-world systems and explore its applicability to control tasks involving variables such as temperature or pressure. This hybrid optimization approach presents a novel direction for control system optimization and holds promise for broader deployment across a wide range of industrial applications.
6. Conclusion
An innovative hybrid optimization strategy was proposed by integrating SSA with PSO and introducing Tent chaotic mapping for population initialization and the adaptive dynamic adjustment of sparrow role proportions, achieving a balance between global exploration and local exploitation. This approach effectively addressed the excessive solution span observed in conventional SSA and the tendency of PSO to become trapped in local optima. As a result, highly efficient optimization of PID controller parameters was accomplished. ACM-PSSA demonstrated superior performance over individual algorithms in both theoretical benchmark testing and practical liquid-level control tasks. In simulation modeling, the PID controller optimized by ACM-PSSA exhibited significant improvements in rise time, settling time, and overshoot when compared with those optimized by standard SSA and PSO algorithms. When applied to near-infrared spectroscopic liquid-phase detection equipment, the PID controller optimized via ACM-PSSA led to a marked improvement in liquid-level control performance and a substantial reduction in pipeline cavitation during sample delivery. Moreover, the issue of bubble retention in the cuvette was effectively mitigated, thereby enhancing the reliability of spectral data acquisition.
The data used to support the research findings are available from the corresponding author upon request.
The authors declare no conflict of interest.
