Next Article in Journal
Experimental Study on UAV-Assisted Pollination in Hybrid Rice
Previous Article in Journal
Lightweight UAV Detection Method Based on IASL-YOLO
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Analysis of Unmanned Surface Vehicles Heading KF-Based PI-(1+PI) Controller Using Improved Spider Wasp Optimizer

1
Innovation and Research Institute of Hebei University of Technology in Shijiazhuang, Shijiazhuang 050299, China
2
Tianjin Key Laboratory of Electronic Materials and Devices, School of Electronics and Information Engineering, Hebei University of Technology, Tianjin 300401, China
*
Author to whom correspondence should be addressed.
Drones 2025, 9(5), 326; https://doi.org/10.3390/drones9050326
Submission received: 13 March 2025 / Revised: 9 April 2025 / Accepted: 17 April 2025 / Published: 23 April 2025

Abstract

:
This paper proposes a Kalman filter-based cascaded PI-(1+PI) controller, optimized using an Improved Spider Wasp Optimizer (ISWO), to address the challenges of USV heading control in dynamic marine environments. Traditional PID controllers struggle with nonlinearities and noise in USV systems while existing metaheuristic algorithms face limitations in balancing exploration and exploitation. To overcome these issues, the ISWO integrates dynamic adaptive grouping, perturbation dimension-symmetric distance optimization, and nonlinear time-varying weights, enhancing convergence speed and optimization accuracy. A transfer function model of the USV heading system is established using voyage data, with ISWO optimizing its parameters, achieving a 5.67% reduction in mean squared error (MSE) compared to the original Spider Wasp Optimizer and outperforming classical algorithms like Arithmetic Optimization Algorithm (AOA), Crayfish Optimization Algorithm (COA), and Marine Predators Algorithm (MPA). The proposed KF-PI(1+PI) controller incorporates a Kalman filter to suppress noise and a cascaded structure to improve gain and response speed, reducing integrated time absolute error (ITAE) by 84% relative to traditional PID controllers. The hardware-in-the-loop simulation experiments further validate the proposed controller’s robustness. The study demonstrates that ISWO-optimized control systems significantly enhance USV navigation precision and adaptability, offering a viable solution for autonomous marine operations.

1. Introduction

In the current advancing technological landscape, Unmanned Surface Vehicles (USVs) have emerged as autonomous platforms widely applied in ocean monitoring [1,2], maritime security [3], maritime search [3,4], marine ranching [5], and multivessel platforms [6,7]. Benefiting from advancements in artificial intelligence [8], autonomous navigation [9], and sensor technologies [10], USVs exhibit high levels of autonomy and adaptability, enabling efficient execution of complex tasks.
Effective heading control in complex marine environments is fundamental to precise ship motion management. Achieving autonomous navigation in USVs requires a well-designed motion control system, which includes control strategies, data processing, and sensor fusion techniques [11,12,13]. Research on USV heading control has progressed through three primary stages: PID control, adaptive control, and intelligent control. The main methodologies employed include traditional and enhanced PID controllers [14,15], the Lyapunov direct method [16], backstepping design [17], sliding mode control [18], adaptive control [19], and fuzzy control [20].
The PID control method was first introduced into the design of ship autopilot systems in the 1950s. Due to its simple structure and independence from prior knowledge, the PID controller has been widely applied in heading control. However, the navigation process of USVs is subject to various external disturbances, such as wind, waves, and currents, which significantly increase the system’s complexity. These environmental factors lead to a nonlinear ship model and introduce parameter uncertainties, resulting in the suboptimal performance of PID controllers [21].
In the 1970s, adaptive control methods, including model reference adaptive control [22] and minimum variance adaptive control [23], were applied to heading control. Adaptive control offers advantages in heading control processes. However, it lacks robustness when dealing with frequent heading changes and sudden external environmental disturbances encountered during actual navigation conditions.
In recent years, advancements in control technology have propelled ship heading control into the intelligent control stage. This stage primarily combines intelligent algorithms with traditional automatic control systems to achieve precise and efficient heading regulation. For instance, particle swarm optimization is employed to optimize PID controllers [24]. The entropy-maximizing TD3-based automatic PID tuning method improves sample efficiency in PID tuning for dynamic systems [25]. The adaptive mixed strategy whale optimization algorithm is introduced to adjust the parameters of fractional-order PID controllers [26]. However, notwithstanding these advancements, there remains a necessity for controllers that can achieve more rapid tracking and enhanced performance across diverse operational modes.
Several classical metaheuristic optimization algorithms have been developed, including the Marine Predators Algorithm (MPA) [27], Arithmetic Optimization Algorithm (AOA) [28], and Crayfish Optimization Algorithm (COA) [29], among others. Many researchers have tried various methods to improve the performance of metaheuristic algorithms. For instance, Zou et al. improve the MPA by integrating trigonometric functions, introducing dynamic updates for prey positions and step size control [30]. Barua et al. develop an enhanced energy management algorithm using the Levy Arithmetic Algorithm for hybrid solar–wind–diesel microgrids in off-grid communities [31]. Shikoun et al. introduce the Binary Crayfish Optimization Algorithm, which incorporates a refracted opposition-based learning strategy and a crisscross strategy to enhance feature selection [32].
Metaheuristic algorithms have been applied to USV navigation control. Zhang et al. proposed a fuzzy PID control framework based on beetle antennae search, particle swarm optimization, and simulated annealing (BAS-PSO-SA) to improve heading accuracy under complex sea states [33]. Long et al. introduced a simulated annealing-enhanced bacteria foraging optimization (SA-BFO) algorithm for efficient local path planning considering COLREGs and dynamic obstacles [34]. Bai et al. developed a plant growth-inspired route planning (PGR) algorithm combined with an improved dynamic window approach (G-DWA) for static and dynamic obstacle avoidance [35]. Sahal et al. designed a control system using a fuzzy-PID optimized by a genetic algorithm (PID-Fuzzy-GA) to enhance surge speed and yaw angle tracking [36].
The Spider Wasp Optimizer (SWO) is a nature-inspired metaheuristic based on the hunting, nesting, and mating behaviors of female spider wasps. It employs multiple strategies for exploration and exploitation, making it suitable for solving continuous optimization problems. Specifically, SWO achieves an overall effective percentage of 100% on real-world problems [37]. However, SWO has limitations in performance. Fixed parameter settings restrict its generalization across diverse problem types, and imbalances in different behaviors often cause premature convergence [38,39,40].
The key contributions of this paper are as follows:
  • This paper introduces an Improved Spider Wasp Optimization (ISWO) algorithm, enhancing the original SWO by integrating a dynamic adaptive grouping strategy, perturbation dimension-symmetric distance optimization and nonlinear time-varying weights. The improved algorithm is subsequently applied to practical problems and its performance is evaluated to verify its effectiveness. The improved algorithm was applied to both transfer function parameter identification and controller tuning and demonstrated the best optimization performance compared to the selected algorithm.
  • In this paper, an accurate transfer function model of an USV can be established using only the target angular rate and the actual angular rate from voyage logs, greatly reducing the cost and complexity. The ISWO algorithm is employed to fine-tune the model parameters, resulting in a highly accurate vessel model. Subsequently, a Kalman filter-based cascaded PI-(1+PI) controller was proposed to regulate the previously identified transfer function model. Compared to the traditional PID controller with an N-filter, the proposed controller exhibits superior performance and robustness.
  • In this paper, the performance of the proposed Kalman filter-based cascaded PI-(1+PI) controller was validated through hardware-in-the-loop simulation. Under identical navigation planning tasks, the proposed controller outperformed the traditional PID controller in terms of tracking accuracy and overall control performance.
The remainder of this paper is organized as follows:
Section 2 introduces the original SWO.
Section 3 presents the proposed improvements to SWO.
Section 4 establishes the USV heading system’s transfer function model and applies ISWO for parameter identification.
Section 5 designs a Kalman filter-based cascaded PI-(1+PI) controller and performs parameter tuning using ISWO.
Section 6 validates the proposed control system through hardware-in-the-loop simulation experiments.
Finally, Section 7 concludes the paper and outlines future research directions.

2. Spider Wasp Optimizer

The framework of SWO is shown in Figure 1.

2.1. Initialization

The algorithm begins by randomly generating N initial solutions in the search space, each represented as a D-dimensional vector.
S W i t = L + r ( H L )
where S W i t denotes the position of the “i-th” solution in the “t-th” generation; L and H represent the lower and upper bounds of the search space; r is a random vector uniformly distributed in [0,1].

2.2. Searching Behavior

The search phase simulates the random exploration of spider wasps in their environment:
S W i t + 1 = S W i t + μ 1 S W a t S W b t
where S W a t and S W b t are randomly selected solutions; μ 1 = r n r 1 , with r n being a normally distributed random number and r 1 a uniformly distributed random number.
If prey falls from its web, local exploration is performed:
S W i t + 1 = S W c t + μ 2 L + r 2 ( H L )
where μ 2 = ( 1 / 1 + e l ) cos ( 2 π l ) . A random switching mechanism is applied between the two exploration strategies:
S W i t + 1 =   Equation   ( 2 )     if   r 3 < r 4   Equation   ( 3 )     otherwise  

2.3. Chasing and Escaping Behavior

To model the dynamic interaction between predator and prey, the algorithm adjusts the distance based on relative speeds:
S W i t + 1 = S W i t + C 2 r 5 S W a t S W i t
where C = 2 2 ( t / t max ) r 6 , r 6 is a control factor that decreases over time. When the prey escapes, the algorithm incorporates a distance-increasing mechanism:
S W i t + 1 = S W i t v c
where v c is a normally distributed random vector between [ ( t / t max ) 1 , 1 ( t / t max ) ] . A trade-off between the two behaviors is implemented:
S W i t + 1 =   Equation   ( 5 )     if   r 3 < r 4   Equation   ( 6 )     otherwise  

2.4. Nesting Behavior

To simulate the nesting process, spider wasps determine the most suitable location for placing the paralyzed prey. The behavior is modeled as:
S W i t + 1 = S W * + cos ( 2 l ) S W * S W i t
where S W * denotes the best solution found so far. Then, random positioning is applied to ensure diversity:
S W i t + 1 = S W a t + r 3 S W a t S W i t + 1 r 3 U S W b t S W c t
where U is a binary mask that prevents overlapping of nests.

2.5. Mating Behavior

In the mating phase, new solutions are generated through a uniform crossover between male and female wasps:
S W i t + 1 = Crossover S W i t , S W m t , C R
where S W m t represents the male solution; CR is the crossover rate.

2.6. Population Reduction

To accelerate convergence and avoid local optima, the population size is reduced over generations:
N = N min + N N min 1 t t max

3. Proposed Improved Spider Wasp Optimizer

3.1. Dynamic Adaptive Grouping Strategy

Traditional fixed grouping cannot adjust group proportions dynamically across different optimization stages. This often leads to an imbalance between exploration and exploitation. As a result, algorithms often overemphasized exploration in the early stages, wasting computational resources, while failing to perform sufficient local exploitation in the later stages. This imbalance reduced search efficiency and weakened global optimization capabilities. Additionally, fixed grouping strategies struggled with adaptability in complex optimization problems, making them prone to premature convergence in local optima. With the introduction of dynamic adaptive grouping strategy, the algorithm dynamically adjusts group proportions, allocating more resources to global exploration during the early phases and gradually shifting focus to local exploitation in later stages.
During the search phase, the proposed strategy classifies individuals in the population based on their index within the population. Individuals with an index smaller than k × N/2 are assigned to group G1. Similarly, individuals with an index between k × N/2 and k × N are assigned to group G2. A weighting factor α t is introduced to adjust the grouping ratio dynamically for each generation. The formula is defined as
α t = E t i = 1 t E i
where Ei represents the exploitation performance of the population in the “i-th” generation and Et denotes the exploitation performance of the population in the “t-th” generation. The formula is defined as:
E t = 1 N n = 1 N F n t F ¯ t 2
where N represents the population size, F n t is the fitness value of the “n-th” individual in the “t-th” generation, and F ¯ t is the average fitness value of the population in the “t-th” generation. The grouping ratios are defined as
G 1 t = α t · G 1 G 2 t = ( 1 α t ) · G 2
The improved version of Equation (4) is as follows:
S W i t + 1 = Equation   ( 2 ) i < G 1 t Equation   ( 3 ) otherwise  

3.2. Perturbation Dimension-Symmetric Distance Optimization

The perturbation dimension-symmetric distance optimization is a critical enhancement designed to improve the efficiency of the exploitation phase in optimization algorithms. The core concept is to utilize geometric symmetry to generate new individual positions, thereby enhancing the population’s exploitation capability. Specifically, the strategy calculates the midpoint between the current individual and the best individual, the formula is defined as
F j = S W e , j t + S W best   , j t 2
where S W e , j t is the position of a randomly selected individual. Subsequently, a symmetric point S W g , j t is generated relative to the midpoint, the formula is defined as
S W g , j t = 2 F j S W i , j t + η · sin ( t )
where η is a coefficient controlling the intensity of perturbations and sin(t) is a sin-based perturbation that increases the diversity of the generated points. To further refine the algorithm, a distance-based selection criterion is employed, which compares the distances Di and Dg. The individual closer to the best solution is retained for the next iteration, ensuring a focus on improved exploitation. The improved version of Equation (9) is as follows:
S W i , j t + 1 = S W g , j t D g < D i S W i , j t   otherwise  
D i = S W i , j t S W best   , j t D g = S W g , j t S W best   , j t
This strategy enhances local exploitation by efficiently guiding individuals toward the optimal solution, thereby improving precision. Additionally, the combination of symmetric point generation and perturbations balances exploration and exploitation, ensuring population diversity while facilitating convergence.

3.3. Nonlinear Time-Varying Weights

The traditional linear weight “1 − (t/tmax)” lacks adaptability, often limiting global search in the early stages and reducing local precision later on. To overcome this, a nonlinear time-varying weight is proposed, offering better stage-wise balance. The addition of a random factor r7 enhances diversity and helps the algorithm escape local optima, improving overall performance.
w ( t ) = 1 t t max 2 r 7

4. The System Transfer Function Model for USVs

Reference [41] uses multi-output Gaussian process regression to model USV dynamics, offering strong capabilities in nonlinear fitting and capturing output couplings; however, its high computational cost limits real-time applicability. Reference [42] enhances disturbance modeling accuracy by integrating long short-term memory networks with a nominal model, but the approach involves complex training procedures, low interpretability, and significant computational demands. Reference [43] employs system identification to construct high-precision state-space models suitable for simulation-based training, yet the resulting model structure is relatively complex and less ideal for real-time controller deployment.
To overcome these limitations, this paper proposes a linear transfer function-based modeling method for USVs. It features a clear structure, fast identification, and good interpretability, making it well-suited for controller design and real-world applications on resource-constrained platforms. The method strikes a practical balance between modeling accuracy and implementation efficiency.
Figure 2 illustrates the original control flow diagram for regulating the heading rate of an USV.
The system receives the target turning angular rate as input and produces the actual angular rate as output. The abbreviation “FF” represents the feedforward control coefficient. The Hardware Abstraction Layer (HAL) and the steering servo (Servo) are integrated into a single control module, characterized by a transfer function denoted as K. The “limit” module is an amplitude-limiting component that constrains the angular rate within [−40,40] (°/min). According to Mason’s rule, the system’s transfer function G(s) is defined as
G ( s ) = ( 1 + F F ) K K P I D 1 + K K P I D
In this experiment, the USV performed path planning via the MP ground station and conducted directional cruising in the water area of Hebei University of Technology. The physical drawing of USV navigation is shown in Figure 3. The data for the target angular rate and the actual angular rate, as recorded in the voyage log, are shown in Figure 4. The initial settings for the USV in the experiment were as follows: FF was set to a constant value of 0.2, KP to 0.4, KI to 0.2, and KD to 0.
In this paper, the transfer function K is defined as a fourth-order Laplace function:
K = A s 3 + B s 2 + C s + D E s 4 + F s 3 + G s 2 + H s + I
The result of G(s) is as follows:
G ( s ) = 0.48 A s 4 + ( 0.24 A + 0.48 B ) s 3 + ( 0.24 B + 0.48 C ) s 2 + ( 0.24 C + 0.48 D ) s + 0.24 D E s 5 + ( 0.4 A + F ) s 4 + ( 0.2 A + 0.4 B + G ) s 3 + ( 0.2 B + 0.4 C + H ) s 2 + ( 0.2 C + 0.4 D + I ) s + 0.2 D
The ISWO algorithm is utilized to optimize the parameters A–I, thereby determining the transfer function G. During the optimization process, the target angular rate is input into G to generate the predicted angular rate. Then, the mean squared error (MSE) between the predicted and actual angular rate is calculated and multiple iterations are performed to minimize the MSE progressively.
M S E = 1 n i = 1 n ( y i y ^ i ) 2
To ensure reliable and reproducible results, each algorithm was independently run 20 times with different random seeds. The reported MSE values in Table 1 correspond to the average performance across these runs. Table 1 illustrates the outcomes of using various algorithms to optimize parameters A–I. The original SWO algorithm converged to an MSE of 13.0824, whereas the improved version reached 12.3403, corresponding to a 5.67% accuracy gain after convergence. In addition, the improved algorithm exhibits notably faster convergence in its early stages. Compared with other recent classical optimization algorithms—such as AOA, COA, and MPA—the ISWO algorithm offers accuracy improvements of 42.89%, 13.35%, and 6.64%, respectively. Overall, the proposed ISWO algorithm demonstrates the best performance in terms of optimization effectiveness.
This trend is further visualized in Figure 5, which shows that ISWO not only reaches the lowest MSE but also converges significantly faster than the other algorithms during the initial iterations. The early-stage convergence behavior indicates ISWO’s strong capability for global exploration and its effectiveness in avoiding premature convergence. These characteristics are particularly valuable for time-sensitive control applications where optimization time is limited.
Analysis of the actual angular rate output infers that the system likely experienced significant noise fluctuations due to external environmental variations between 10:31:44 and 10:31:49, as well as between 10:32:46 and 10:32:48. To simulate strong noise within the system, this paper employs sinusoidal functions and pulses. The noise function is defined as follows, with time normalization applied accordingly.
N ( t ) = 6 × sin ( 3 π t / 4 + π / 4 ) t [ 10 : 31 : 44 , 10 : 31 : 47 ) 13 × sin ( π t ) t [ 10 : 31 : 47 , 10 : 31 : 49 ] 15 t [ 10 : 32 : 46 , 10 : 32 : 47 ) 22 × sin ( π t ) t [ 10 : 32 : 47 , 10 : 32 : 48 ]
Figure 6 illustrates the predicted angular rate after the introduction of strong noise, in which the model’s MSE is 5.9689. The improved match between the predicted and actual outputs, especially during the previously mismatched intervals, confirms that the discrepancy was caused by unmodeled disturbances. This result highlights the importance of incorporating noise modeling into system identification processes, especially for autonomous vehicles operating in dynamic and unpredictable environments.

5. USV Heading Control System Applying KF-PI(1+PI) Controller

In conventional PID controllers, the derivative term is highly sensitive to noise in the system, leading to the accumulation of noise. Therefore, most PID controllers incorporate a low-pass filter in the derivative path to attenuate the noise. However, in the frequency domain, the derivative term amplifies high-frequency components. When the noise is significant, particularly high-frequency or transient noise, these components are further amplified in the derivative channel, causing large oscillations in the control output and potentially leading to instability or excessive control effort. As optimization algorithms aim to minimize a cost function, they often reduce KD or N—sometimes to zero—if the derivative term increases control effort or introduces oscillations caused by noise (shown in Table 2). As a result, when the system simultaneously experiences “strong noise” and “ideal differentiation”, the optimization algorithm will naturally decide to eliminate the derivative term in order to balance these factors. Additionally, since the main frequency components of the control input closely overlap with those of the noise, it becomes ineffective to filter out the noise solely by adjusting the cutoff frequency of the filter. Setting the cutoff frequency to attenuate noise simultaneously removes valuable information from the system.
In summary, this paper proposes a Kalman filter-based cascaded PI-(1+PI) controller. By incorporating the Kalman filter at the input of the PI controller, the system can effectively filter out noise while mostly preserving the original control input. Considering the involvement of the filter, a (1+PI) controller is added at the output of the original PI controller to ensure the system’s gain and response speed. The structure of Proposed KF-based cascaded PI-(1+PI) controller is shown in Figure 7.
The Kalman filter estimates the system state using Bayesian theory, combining prediction and update steps while accounting for process and measurement noise. It is known for its high estimation accuracy and efficiency. The state equation and measurement equation of the Kalman filter are represented as follows:
  • State Equation
x k = A x k 1 + B u k + ω k
where x k is the state vector at the current time step, A is the state transition matrix, which describes the state evolution from time step k − 1 to time step k, B is the control input influence matrix, representing the effect of control inputs on the state, u k is the control input, and w k is the process noise, assumed to be zero-mean Gaussian white noise with covariance Q.
2.
Measurement Equation
z k = H x k + v k
where z k is the measurement at the current time step, H is the measurement matrix, which describes how the measurement is related to the state variables, and v k is the measurement noise, assumed to be zero-mean Gaussian white noise with covariance R.
The Kalman model describes the evolution of the system state over time and how measurements are obtained from the state. The process noise and measurement noise are quantified by Q and R, and it is assumed that these noises are Gaussian white noise.
In this study, the Kalman filter is applied to a single-variable estimation problem, where both the system state and observation are scalar values. Accordingly, Q and R are defined as scalar values rather than full matrices. The initial values of Q and R were not manually predefined but instead treated as tunable parameters within a bounded search space. The ISWO was employed to jointly optimize these parameters along with the controller gains. This automated tuning ensures that the filter configuration is tailored to the system dynamics and actual noise characteristics observed in the voyage data.
The state transition matrix A, control input influence matrix B, and observation matrix H are set to 1, 0, and 1, respectively. Simultaneously, the improved ISWO algorithm is applied to optimize the parameters of the PI-(1+PI) controller to ensure the control accuracy of the system. Utilizing integrated time and absolute error (ITAE) as an objective function,
I T A E = 0 t t | e ( t ) | d t
The block diagram of USV heading control system with proposed controller and ISWO is shown in Figure 8. The ranges of gains in proposed and other controllers are shown in Table 3.
The results of optimizing the KF-based cascaded PI-(1+PI) controller using different algorithms are shown in Table 4, where ISWO demonstrates the best performance with a 42.3% improvement over the original algorithm, and 50%, 39.5%, and 39% over AOA, COA, and MPA, respectively. The ISWO-optimized KF-PI(1+PI) controller improves performance by 84% compared to the ISWO-optimized traditional PID controller, and the noise suppression and the system tracking performance are significantly improved, which verifies the superiority of the method proposed in this paper in USV heading control. The ITAE values of different algorithms with proposed controller are shown in Figure 9 and the output results for different controllers are shown in Figure 10.

6. Hardware-in-the-Loop Simulation Verification

This paper is conducted based on the unmanned system measurement and control platform at the Innovation and Research Institute of Hebei University of Technology in Shijiazhuang, employing an integrated simulation approach using MATLAB 2023a alongside Q Ground Control V4.4.4 (QGC) and Unreal Engine 5 (UE). The experimental platform establishes a dynamic model of an USV and uses UE for environmental visualization.
Figure 11 illustrates the architecture of the hardware-in-loop simulation platform, in which only the Pixhawk 4 flight controller module is physical, while all other components are virtual. The motion simulation model shown in the diagram includes control input interfaces, dynamic modeling, environmental interaction, and sensor data generation modules.
The core dynamics of the USV are described by the Force and Moment Model, which converts the PWM control signals into corresponding propeller thrust and control surface-induced forces and moments. These outputs are then passed to the 6-degree-of-freedom (6-DOF) rigid-body dynamics subsystem, which employs the Newton–Euler equations to numerically integrate the translational and rotational motion of the USV. The resulting states, including position, velocity, attitude, and angular rates, are organized and transmitted via the 6DOF Bus.
To realistically emulate the operating environment, an Environment Model is integrated into the system. This module includes a geometric altitude estimation component based on a standard atmospheric model using a temperature lapse rate and a configurable wind disturbance generator. Temperatures are converted from Celsius to Kelvin for compatibility with physical formulas, while air pressure and density are computed using barometric equations. Wind disturbances are produced using pseudo-random signal generation, modulated by adjustable gain parameters and logical switches, allowing the simulation of realistic and flexible environmental perturbations.
Finally, a dedicated Sensor Model uses the computed dynamic states and environmental parameters to generate synthetic onboard sensor outputs, accurately emulating typical sensor behaviors observed in real-world conditions.
Predefined functions generate fixed cruise commands that are subsequently executed through comparative experiments using a traditional PID controller and an ISWO-optimized KF-based PI-(1+PI) controller, with their respective cruise tracking performances systematically evaluated. The navigation protocol initially commands the USV to execute straight-line motion for a specified duration, followed by reciprocating harmonic oscillations. The mathematical representations of these motion patterns are defined as:
x ( t ) , v x ( t ) , y ( t ) , v y ( t ) = ( 0 , 0 , 0 , 0 ) t < t 0 x 0 , 0 , y 0 , 0 t 0 t < t 1 ( x 0 + r [ cos ( α ) 1 ] , r ( π / 20 ) sin ( α ) , y 0 + r [ sin ( α ) α ] , r ( π / 20 ) [ cos ( α ) 1 ] ) t t 1
where α = π (t − t1)/20, x0 = 10, y0 = 10, r = 10, t0 = 30.5, t1 = 40. The initial position and radius parameters are seamlessly converted into georeferenced coordinates within QGC through a dedicated communication protocol. The simulation duration is configured for 180 s. In the first experiment, the traditional PID controller remains operational throughout the entire period following the initial time. The second experiment employs the traditional PID controller from t0 to 65 s, during which the ISWO iteratively refines parameters. Subsequently, the ISWO-optimized KF-based PI-(1+PI) controller is activated post-65s to execute trajectory tracking. A comparative analysis systematically evaluates the path-following performance for both experimental configurations. The USV simulation experiment is shown in Figure 12. The USV navigational chart on UE interface is shown in Figure 13.
An analysis of flight logs through Flight Review reveals critical performance contrasts, as illustrated in Figure 14. The USV employing traditional PID control demonstrates progressive performance degradation, ultimately deviating from the prescribed trajectory after the sustained operation. Conversely, the ISWO-optimized KF-based PI-(1+PI) controller activated post 65 s phase maintains operational stability, achieving satisfactory path-tracking fidelity aligned with reference routing commands. These empirical observations are further corroborated by hardware-in-the-loop simulation results, conclusively validating the enhanced robustness of the ISWO-optimized KF-based PI-(1+PI) control architecture.

7. Conclusions and Future Research Directions

This paper presents an improved spider wasp optimizer applied to the heading control system of an USV. By optimizing a fourth-order transfer function model, ISWO achieves a 5.67% reduction in MSE compared to the original SWO and outperforms classical algorithms such as AOA, COA, and MPA. Furthermore, a cascaded KF-based PI-(1+PI) controller is designed and tuned using ISWO, yielding an 84% reduction in ITAE compared to traditional PID control. The effectiveness of the proposed approach is validated through hardware-in-the-loop simulation, demonstrating robust trajectory tracking performance under dynamic marine conditions.
While the proposed framework shows clear advantages in terms of optimization accuracy, response speed, and noise suppression, it is not without limitations. The ISWO algorithm may encounter difficulties in environments characterized by extreme conditions or highly dynamic and unpredictable disturbances, where the optimization landscape shifts rapidly over time. Additionally, the fixed structure of the controller and the reliance on offline-tuned parameters can limit adaptability in real-time scenarios, particularly when facing rapidly changing wave patterns or wind conditions.
To address these challenges, future research should consider more adaptive and intelligent enhancements to the current control framework. One promising direction involves the integration of adaptive filtering methods, such as adaptive Kalman filters or unscented Kalman filters, which can dynamically estimate and adjust process and measurement noise covariances to better suit changing environments.
Moreover, machine learning techniques can be explored to enhance the real-time adaptability and generalization of the control system. For instance, reinforcement learning could be utilized to fine-tune controller gains online or to adaptively modify ISWO parameters during runtime to improve convergence in time-varying optimization landscapes. Alternatively, neural network-based models may be employed to learn residual dynamics not captured by the transfer function model, providing compensation signals to further improve tracking accuracy.

Author Contributions

Conceptualization, X.Z.; methodology, X.L.; software, X.L.; validation, J.W.; formal analysis, B.F.; investigation, X.L.; data curation, J.W.; writing—original draft preparation, X.L.; writing—review and editing, X.Z.; supervision, X.Z.; project administration, Q.L.; funding acquisition, Q.L.; literature research, Q.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Science and Technology Cooperation Special Project of Shijiazhuang grant number SJZZXC23007.

Data Availability Statement

Some or all data, models, or code that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Lewicka, O.; Specht, M.; Stateczny, A.; Specht, C.; Dardanelli, G.; Brčić, D.; Szostak, B.; Halicki, A.; Stateczny, M.; Widźgowski, S. Integration data model of the bathymetric monitoring system for shallow waterbodies using UAV and USV platforms. Remote Sens. 2022, 14, 4075. [Google Scholar] [CrossRef]
  2. Kassuba, Z.; Goldenbogen, M.; Jannetta, C.; Vicent, X.; Sarda, E.I. Development of a Water Quality Monitoring System on a USV. In Proceedings of the OCEANS 2024-Halifax, Halifax, NS, Canada, 23–26 September 2024; pp. 1–8. [Google Scholar] [CrossRef]
  3. Li, J.; Zhang, G.; Jiang, C.; Zhang, W. A survey of maritime unmanned search system: Theory, applications and future directions. Ocean. Eng. 2023, 285, 115359. [Google Scholar] [CrossRef]
  4. Wang, X.; Yin, Y.; Jing, Q. Maritime search path planning method of an unmanned surface vehicle based on an improved bug algorithm. J. Mar. Sci. Eng. 2023, 11, 2320. [Google Scholar] [CrossRef]
  5. Zhang, G.; Yin, S.; Huang, C.; Zhang, W.; Li, J. Structure synchronized dynamic event-triggered control for marine ranching AMVs via the multi-task switching guidance. IEEE Trans. Intell. Transp. Syst. 2024, 25, 20295–20308. [Google Scholar] [CrossRef]
  6. Du, Z.; Li, W.; Shi, G. Multi-USV collaborative obstacle avoidance based on improved velocity obstacle method. ASCE-ASME J. Risk Uncertain. Eng. Syst. Part A Civ. Eng. 2024, 10, 04023049. [Google Scholar] [CrossRef]
  7. Cao, J.; Dou, J.; Liu, J.; Wei, X.; Guo, Z. Multi-agent deep reinforcement learning framework strategized by unmanned aerial vehicles for multi-vessel full communication connection. Remote Sens. 2023, 15, 4059. [Google Scholar] [CrossRef]
  8. Fan, Y.; Sun, Z.; Wang, G. A novel intelligent collision avoidance algorithm based on deep reinforcement learning approach for USV. Ocean. Eng. 2023, 287, 115649. [Google Scholar] [CrossRef]
  9. Zhao, Y.; Han, F.; Han, D.; Peng, X.; Zhao, W. Decision-making for the autonomous navigation of USVs based on deep reinforcement learning under IALA maritime buoyage system. Ocean. Eng. 2022, 266, 112557. [Google Scholar] [CrossRef]
  10. Sathish, K.; Venkata, R.C.; Anbazhagan, R.; Pau, G. Review of localization and clustering in USV and AUV for underwater wireless sensor networks. Telecom 2023, 4, 43–64. [Google Scholar] [CrossRef]
  11. Er, M.J.; Ma, C.; Liu, T.; Gong, H. Intelligent motion control of unmanned surface vehicles: A critical review. Ocean. Eng. 2023, 280, 114562. [Google Scholar] [CrossRef]
  12. Liu, W.; Liu, Y.; Bucknall, R. Filtering based multi-sensor data fusion algorithm for a reliable unmanned surface vehicle navigation. J. Mar. Eng. Technol. 2023, 22, 67–83. [Google Scholar] [CrossRef]
  13. Cahyadi, M.N.; Asfihani, T.; Mardiyanto, R.; Erfianti, R. Performance of GPS and IMU sensor fusion using unscented Kalman filter for precise i-Boat navigation in infinite wide waters. Geod. Geodyn. 2023, 14, 265–274. [Google Scholar] [CrossRef]
  14. Shamsuzzoha, M.; Lee, M. Design of advanced PID controller for enhanced disturbance rejection of second-order processes with time delay. AIChE J. 2008, 54, 1526–1536. [Google Scholar] [CrossRef]
  15. Miao, R.; Dong, Z.; Wan, L.; Zeng, J. Heading control system design for a micro-USV based on an adaptive expert S-PID algorithm. Pol. Marit. Res. 2018, 25, 6–13. [Google Scholar] [CrossRef]
  16. Wang, H.L.; Yin, C.Y.; Lu, L.; Wang, D.; Peng, Z. Cooperative path following control of UAV and USV cluster for maritime search and rescue. Chin. J. Ship Res. 2022, 17, 157–165. [Google Scholar] [CrossRef]
  17. Peng, L.; Bai, W.; Zhang, W. Course Tracking Control of USV Based on Optimal Backstepping Method Via Reinforcement Learning. In Proceedings of the 2024 International Annual Conference on Complex Systems and Intelligent Science (CSIS-IAC), Guangzhou, China, 20–22 September 2024; pp. 234–239. [Google Scholar] [CrossRef]
  18. Dong, Z.; Qi, S.; Yu, M.; Zhang, Z.; Zhang, H.; Li, J.; Liu, Y. An improved dynamic surface sliding mode method for autonomous cooperative formation control of underactuated USVs with complex marine environment disturbances. Pol. Marit. Res. 2022, 29, 47–60. [Google Scholar] [CrossRef]
  19. Karnani, C.; Raza, S.A.; Asif, M.; Ilyas, M. Adaptive control algorithm for trajectory tracking of underactuated unmanned surface vehicle (UUSV). J. Robot. 2023, 2023, 4820479. [Google Scholar] [CrossRef]
  20. Li, J.; Zhang, G.; Shan, Q.; Zhang, W. A novel cooperative design for USV–UAV systems: 3-D mapping guidance and adaptive fuzzy control. IEEE Trans. Control. Netw. Syst. 2022, 10, 564–574. [Google Scholar] [CrossRef]
  21. Fossen, T.I. A survey on nonlinear ship control: From theory to practice. In Proceedings of the 5th IFAC Conference on Manoeuvring and Control of Marine Craft, Aalborg, Denmark, 23–25 August 2000; Volume 5, pp. 1–16. [Google Scholar] [CrossRef]
  22. Amerongen, J.V.; Udink Cate, A.L. Model reference adaptive autopilots for ships. Automatica 1975, 11, 441–450. [Google Scholar] [CrossRef]
  23. Kallstrom, C.G.; Astrom, K.J. Adaptive autopilots for tanker. Automatica 1979, 15, 241–254. [Google Scholar] [CrossRef]
  24. Goud, H.; Sharma, P.C.; Nisar, K.; Brahim, A.A.A.; Haque, M.R.; Yadav, N.S.; Swarnkar, P.; Gupta, M.; Chand, L. PSO Based Multi-Objective Approach for Controlling PID Controller. Comput. Mater. Contin. 2022, 71, 4409–4423. [Google Scholar] [CrossRef]
  25. Chowdhury, M.A.; Al-Wahaibi, S.S.S.; Lu, Q. Entropy-maximizing TD3-based reinforcement learning for adaptive PID control of dynamical systems. Comput. Chem. Eng. 2023, 178, 108393. [Google Scholar] [CrossRef]
  26. Zhang, Y.; Lu, Q. Fractional Order PID Control Based on Improved Whale Optimization Algorithm. In Proceedings of the 2024 IEEE 6th Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC), Chongqing, China, 24 May 2024; Volume 6, pp. 1676–1682. [Google Scholar] [CrossRef]
  27. Faramarzi, A.; Heidarinejad, M.; Mirjalili, S.; Gandomi, A.H. Marine Predators Algorithm: A nature-inspired metaheuristic. Expert Syst. Appl. 2020, 152, 113377. [Google Scholar] [CrossRef]
  28. Abualigah, L.; Diabat, A.; Mirjalili, S.; Elaziz, M.A.; Gandomi, A.H. The arithmetic optimization algorithm. Comput. Methods Appl. Mech. Eng. 2021, 376, 113609. [Google Scholar] [CrossRef]
  29. Jia, H.; Rao, H.; Wen, C.; Mirjalili, S. Crayfish optimization algorithm. Artif. Intell. Rev. 2023, 56 (Suppl. 2), 1919–1979. [Google Scholar] [CrossRef]
  30. Zou, X.; Li, J. Marine Predators Algorithm Based on Trigonometric Function. In Proceedings of the 2022 IEEE 5th International Conference on Computer and Communication Engineering Technology (CCET), Beijing, China, 19–21 August 2022; pp. 13–17. [Google Scholar] [CrossRef]
  31. Barua, S.; Merabet, A.; Al-Durra, A.; El-Fouly, T.; El-Saadany, E.F. Lévy arithmetic optimization for energy management of solar wind microgrid with multiple diesel generators for off-grid communities. Appl. Energy 2024, 371, 123736. [Google Scholar] [CrossRef]
  32. Shikoun, N.H.; Al-Eraqi, A.S.; Fathi, I.S. BinCOA: An efficient binary crayfish optimization algorithm for feature selection. IEEE Access 2024, 12, 28621–28635. [Google Scholar] [CrossRef]
  33. Zhang, H.; Zhao, Z.; Wei, Y.; Liu, Y.; Wu, W. A Self-Tuning Variable Universe Fuzzy PID Control Framework with Hybrid BAS-PSO-SA Optimization for Unmanned Surface Vehicles. J. Mar. Sci. Eng. 2025, 13, 558. [Google Scholar] [CrossRef]
  34. Long, Y.; Liu, S.; Qiu, D.; Li, C.; Guo, X.; Shi, B.; AbouOmar, M.S. Local path planning with multiple constraints for USV based on improved bacterial foraging optimization algorithm. J. Mar. Sci. Eng. 2023, 11, 489. [Google Scholar] [CrossRef]
  35. Bai, X.; Li, B.; Xu, X.; Xiao, Y. USV path planning algorithm based on plant growth. Ocean. Eng. 2023, 273, 113965. [Google Scholar] [CrossRef]
  36. Sahal, M.; Gamayanti, N.; Cendikiarani, M.T. Surge Speed and Yaw Angle Control System Design on Unmanned Surface Vehicle (USV) Using PID-Fuzzy-Genetic Algorithm. In Proceedings of the 2024 International Seminar on Intelligent Technology and Its Applications (ISITIA), Mataram, Indonesia, 10–12 July 2024; pp. 571–576. [Google Scholar] [CrossRef]
  37. Abdel-Basset, M.; Mohamed, R.; Jameel, M.; Abouhawwash, M. Spider wasp optimizer: A novel meta-heuristic optimization algorithm. Artif. Intell. Rev. 2023, 56, 11675–11738. [Google Scholar] [CrossRef]
  38. Mohamed, E.A.; Braik, M.S.; Al-Betar, M.A.; Awadallah, M.A. Boosted spider wasp optimizer for high-dimensional feature selection. J. Bionic Eng. 2024, 21, 2424–2459. [Google Scholar] [CrossRef]
  39. Sui, J.; Tian, Z.; Wang, Z. Multiple strategies improved spider wasp optimization for engineering optimization problem solving. Sci. Rep. 2024, 14, 29048. [Google Scholar] [CrossRef] [PubMed]
  40. Gao, Y.; Li, Z.; Wang, H.; Hu, Y.; Jiang, H.; Jiang, X.; Chen, D. An Improved Spider-Wasp Optimizer for Obstacle Avoidance Path Planning in Mobile Robots. Mathematics 2024, 12, 2604. [Google Scholar] [CrossRef]
  41. Hong, Z.; Wang, X.; Li, M.; Gu, Y.; Zhao, J.; Cao, X. Identification of USV Maneuvering Model Based on Multi-Output Gaussian Process Regression. In Proceedings of the 2023 China Automation Congress (CAC), Chongqing, China, 17–19 November 2023; pp. 6300–6305. [Google Scholar] [CrossRef]
  42. Cheng, M.; Yao, J.; Ren, Q. A Model Predictive Control Approach for USV Autonomous Cruising via Disturbance Learning. In Proceedings of the 2024 IEEE 18th International Conference on Control & Automation (ICCA), Reykjavík, Iceland, 18–21 June 2024; pp. 988–993. [Google Scholar] [CrossRef]
  43. Song, R.; Gao, S.; Li, Y. Sim-to-Real in Unmanned Surface Vehicle Control: A System Identification-Based Approach for Enhanced Training Environments. In Proceedings of the 2024 9th International Conference on Electronic Technology and Information Science (ICETIS), Hangzhou, China, 17–19 May 2024; pp. 563–570. [Google Scholar] [CrossRef]
Figure 1. The framework of SWO.
Figure 1. The framework of SWO.
Drones 09 00326 g001
Figure 2. Original USV heading control diagram.
Figure 2. Original USV heading control diagram.
Drones 09 00326 g002
Figure 3. Physical drawing of USV navigation.
Figure 3. Physical drawing of USV navigation.
Drones 09 00326 g003
Figure 4. Target angular rate and actual angular rate from voyage log.
Figure 4. Target angular rate and actual angular rate from voyage log.
Drones 09 00326 g004
Figure 5. MSE values of different algorithms.
Figure 5. MSE values of different algorithms.
Drones 09 00326 g005
Figure 6. Predicted angular rate with strong noise.
Figure 6. Predicted angular rate with strong noise.
Drones 09 00326 g006
Figure 7. Proposed KF-based cascaded PI-(1+PI) controller structure.
Figure 7. Proposed KF-based cascaded PI-(1+PI) controller structure.
Drones 09 00326 g007
Figure 8. Block diagram of USV heading control system with proposed controller and ISWO.
Figure 8. Block diagram of USV heading control system with proposed controller and ISWO.
Drones 09 00326 g008
Figure 9. ITAE values of different algorithms with proposed controller.
Figure 9. ITAE values of different algorithms with proposed controller.
Drones 09 00326 g009
Figure 10. Output results for different controllers.
Figure 10. Output results for different controllers.
Drones 09 00326 g010
Figure 11. The architecture of the hardware-in-loop simulation platform.
Figure 11. The architecture of the hardware-in-loop simulation platform.
Drones 09 00326 g011
Figure 12. USV simulation experiment. (a,c): USV cruise command dynamics; (b,d): Actual trajectory of USV.
Figure 12. USV simulation experiment. (a,c): USV cruise command dynamics; (b,d): Actual trajectory of USV.
Drones 09 00326 g012
Figure 13. USV navigational chart on UE interface.
Figure 13. USV navigational chart on UE interface.
Drones 09 00326 g013
Figure 14. Results of navigation routes. (a) Using traditional PID controller; (b) using ISWO-optimized KF-based PI-(1+PI) controller.
Figure 14. Results of navigation routes. (a) Using traditional PID controller; (b) using ISWO-optimized KF-based PI-(1+PI) controller.
Drones 09 00326 g014
Table 1. Results of parameter optimization of the proposed and other algorithms.
Table 1. Results of parameter optimization of the proposed and other algorithms.
AlgorithmsABCDEFGHIMSE
AOA0.3653−0.0534−0.12980.05513.29000.0948−0.06360.00400.050621.6096
COA0.347114.90635.6802−4.99230.05934.398518.096142.1631−17.002213.9872
MPA29.1350−18.340348.8925−2.30846.460333.684825.421341.922249.999713.2185
SWO21.1367−22.414038.31440.36744.725122.66077.992220.044549.593813.0824
ISWO0.38893.538519.38075.68650.03371.88895.698342.37482.036312.3403
Table 2. Results of different algorithms to optimize PIDN controller.
Table 2. Results of different algorithms to optimize PIDN controller.
AlgorithmsKPKIKDNITAE
AOA83.14655005000244.0278
COA83.140350035.49790244.0278
MPA83.1404500249.97380244.0278
SWO76.8290499.9972219.99800.0028244.0285
ISWO82.86845000494.2768244.8782
Table 3. Ranges of gains in proposed and other controllers.
Table 3. Ranges of gains in proposed and other controllers.
GainsKPKIKDKPPKIINQR
Min00000000
Max50050050050050050055
Table 4. Results of different algorithms to optimize KF-based PI-(1+PI) controller.
Table 4. Results of different algorithms to optimize KF-based PI-(1+PI) controller.
AlgorithmsKPKIKPPKIIQRITAE
AOA54.4844500072.47910.11574.764478.2803
COA0.653751.4096134.47960.83064.50110.727064.7241
MPA29.26310.003820,118242.01660.63650.10064.1399
SWO37.967479.07341.3544197.30034.20452.375767.8528
ISWO8.7167499.99806.1584495.85480.08480.008539.1001
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.

Share and Cite

MDPI and ACS Style

Li, X.; Zeng, X.; Wang, J.; Li, Q.; Fan, B.; Zeng, Q. Analysis of Unmanned Surface Vehicles Heading KF-Based PI-(1+PI) Controller Using Improved Spider Wasp Optimizer. Drones 2025, 9, 326. https://doi.org/10.3390/drones9050326

AMA Style

Li X, Zeng X, Wang J, Li Q, Fan B, Zeng Q. Analysis of Unmanned Surface Vehicles Heading KF-Based PI-(1+PI) Controller Using Improved Spider Wasp Optimizer. Drones. 2025; 9(5):326. https://doi.org/10.3390/drones9050326

Chicago/Turabian Style

Li, Xiaoyu, Xiangye Zeng, Jingyi Wang, Qi Li, Baoshuo Fan, and Qi Zeng. 2025. "Analysis of Unmanned Surface Vehicles Heading KF-Based PI-(1+PI) Controller Using Improved Spider Wasp Optimizer" Drones 9, no. 5: 326. https://doi.org/10.3390/drones9050326

APA Style

Li, X., Zeng, X., Wang, J., Li, Q., Fan, B., & Zeng, Q. (2025). Analysis of Unmanned Surface Vehicles Heading KF-Based PI-(1+PI) Controller Using Improved Spider Wasp Optimizer. Drones, 9(5), 326. https://doi.org/10.3390/drones9050326

Article Metrics

Back to TopTop