Abstract
Despite advances in modern control theory and artificial intelligence technology, current methods for tuning proportional-integral-derivative (PID) controller parameters based on the traditional particle swarm optimization (PSO) algorithm do not meet the requirements for controlling an unmanned surface vessel (USV) propulsion motor. To overcome the disadvantages of the PSO algorithm, such as low precision and easily falling into a local optimum, the beetle antennae search (BAS) algorithm can be introduced into the PSO algorithm by replacing particles with beetles, and effectively prevents the PSO algorithm from easily falling into the local optimum. At the same time, the BAS algorithm will no longer be limited to single objective parameterization. Herein, we propose a PID parameter optimization method based on the hybrid BAS-PSO algorithm for a USV propulsion motor. The PID parameter optimization of propulsion motor effectively becomes a beetle foraging problem with group optimization. Numerical results show that the method can effectively solve the problems of PSO and greatly improve convergence speed. Compared with the genetic algorithm and standard PSO algorithm, the BAS-PSO algorithm is superior for PID parameter tuning and can improve performance of USV propulsion system.
Keywords
Introduction
The operation of an unmanned surface vessel (USV) is greatly affected by the complex marine environment. In particular, currents, marine life, and noise in the underwater environment can affect the propulsive efficiency of the motor. Therefore, control of the propulsion motor remains a major challenge and an important focus in USV design. Owing to its simplicity, reliability, and clear physical meaning, proportional-integral-derivative (PID) control has been widely used in various control systems, including the propulsion control system of the USV. 1 Although the PID controller is classical control method, its nonlinear characteristics and complex motion coupling make it difficult to achieve accurate control. 2 Moreover, parameter tuning presents a key problem in PID control.
Parameters of the PID controller must be adjusted to ensure the system is in the optimal state to achieve robust control. Various optimization methods exist. In recent years, researchers have proposed the use of artificial intelligence algorithms for optimizing the parameters of PID controllers: Chen et al. 3 introduced an intelligent algorithm based on neural networks; Teng et al. 4 applied the genetic algorithm (GA); Zhang et al. 5 proposed the H∞ control method; Zhao et al. 6 suggested the use of the drosophila optimization algorithm to optimize PID controller parameters and achieved good results for a ring-shaped inverted pendulum control system; Kosari et al. 7 used fuzzy logic and GA optimization to realize PID tuning and optimal performance.
Despite significant advances, all of the algorithms mentioned above have shortcomings, which means that it is often difficult to achieve optimal results using a single control method. For example, although particle swarm optimization (PSO) provides a simple strategy, if one particle finds the current optimal position, other particles will quickly approach it. As a consequence, remaining particles are unable to continue searching the solution space and instead, fall into the local optimum, leading to premature convergence.
In this article, the PSO algorithm is optimized by introducing beetle antennae search (BAS) algorithm, and the PID parameter tuning is well adjusted, which can effectively control the performance of USV motor. The BAS algorithm can be introduced into the PSO algorithm by replacing particles with beetles, and effectively prevents the PSO algorithm from easily falling into the local optimum. The BAS algorithm is not affected by other factors and avoids interference caused by sharing of information between groups. The moving direction of beetle is determined only by the strength of food smell when searching for the optimal solution. At the same time, the BAS algorithm is no longer limited to single objective parameterization. By using this method, it can be proved that the hybrid PSO-BAS method enables simple and accurate PID control of USV propulsion motor to realize maximum efficiency and improve the performance of propulsion motor control system.
PID controller
A simplified model of the PID controller used to control the propulsion motor of the USV is presented in Figure 1.

Simplified model of PID control of propulsion motor of an USV. USV: unmanned surface vehicle; PID: proportional-integral-derivative.
Control is achieved by comparing the set value of USV motion with the actual output value. Then, the PID controller adjusts the motor speed via the speed limiting link to minimize deviation between the set value and output values, and finally, movement of USV is controlled by the servo structure. The typical PID control law can be expressed as
where u(t) is the output of the controller, that is, the signal sent to the controlled object; r(t) and y(t) are the input and output signals of the system; e(t) is the input to the controller, that is, the error of the system determined by r(t) and y(t), e(t) = y(t) − r(t).
Deviations are collected by sampling and used as feedback to control the system. At present, most computerized control systems require digital inputs; therefore, the continuous analog signals in equation (1) must be transformed using the following transfer function
where KD is the differential coefficient, KP is the proportional coefficient, and KI is the integral coefficient. The coefficients are related according to
where Ti represents integral time constant, Td represents the differential time constant, T is the sampling period, and de(k) is the error rate.
Based on equations (1) to (3), the PID controller of the motor operates according to three parameters: KP , KI , and KD . The three parameters represent changes in the proportional, integral, and differential functions of the PID controller, respectively, and have different functions in the controller: KP mainly affects the response time of the system; if KP is small, the response time is slow and the system is basically non-oscillatory. In contrast, if KP is large, the system will experience high-frequency oscillation. The main function of KI is to eliminate steady-state error and increase stability of the system; KD is mainly used to improve the dynamic performance of the system but can also prolong the time it takes for the system to adjust.
Particle swarm optimization
The PSO algorithm is an efficient global search algorithm first introduced by Kennedy and Eberhart, which they derived from the study of bird predation behavior. Each particle represents a potential optimal solution of the problem and possesses the characteristics of location, speed, and fitness value. As a particle moves in the solution space, its individual position is updated by tracking the individual extremum P best and the population extremum G best. Each time the algorithm updates, the fitness value is calculated only once. Then, through comparison, the location of the new individual extremum P best and the population extremum G best are determined. During each iteration, the positions and velocities of particles are updated according to the following equations
where
Beetle antennae search
The BAS is an intelligent optimization algorithm first proposed by Li and others in 2017 and has rapidly gained popularity. The biology-inspired algorithm has the advantages of relatively low computational cost, fast search speed, and global optimization ability. The fundamental principle can be described as follows: When foraging, a beetle does not know the precise location of food in advance. Therefore, the beetle must move its antenna back and forth frequently to determine the next direction to search for food based on smell. Beetles have two long antennae. If the odor intensity sensed by the left antennae is greater than the smell intensity detected by the right antenna, the beetle will fly to the left; otherwise, it will fly to the right. 8 This simple principle allows the beetle to find food easily and effectively.
The beetle foraging principle can be extrapolated: the smell of food is equivalent to a function of different values in three-dimensional space. 7 The beetle uses the point with the strongest smell to determine the location of food. In other words, the beetle searches for the global optimal value using smell intensity values collected by the left and right antennae. One reason the BAS is so easy to implement is that it can achieve efficient optimization and a solution without knowing the specific form of the function and gradient information. The algorithm only needs one individual, that is, a beetle, therefore, the number of calculations required is greatly reduced and the efficiency of the algorithm increases. By mimicking the behavior of a beetle, we can efficiently optimize the function.
Steps of the BAS algorithm are as follows: 1. A simplified model of a longicorn beetle, composed of the centroid, left antenna, and right antenna, is presented in Figure 2. To solve the n-dimensional optimization problem, x, xl
, and xr
are n-dimensional vectors, and the distance between two antennae is d
0.
Simplified model of the longicorn beetle.

2. Since the flying direction of the longicorn beetle is randomly selected, a random vector is used to represent the longicorn orientation and then normalized
where rands generates an n-dimensional random vector.
Thus, the left and right antennae can be expressed as
where t represents the number of iterations,
3. The odor intensity captured by the left and right antennae are defined by fitness function
where sign is the sign function and
After the longicorn beetle moves, the fitness value is calculated. The distance between the left and right antennae and the step size are
where
4. If the current results meet the termination conditions of the algorithm, stop the iteration; otherwise, return to step (2) and continue iterating until the termination conditions are met.
BAS-PSO algorithm
Building the model
During the optimization process, particles from groups and individuals interact with each other. However, the BAS prevents information sharing between particles to avoid falling into local optimum and local minimum. When the BAS algorithm is fused with PSO, the algorithm is no longer limited to single objective parameterization. More beetles can be introduced; therefore, the algorithm performs a much broader search of the solution space, which speeds up convergence.
The BAS and PSO algorithms were combined to build the model presented in Figure 3. In the BAS-PSO algorithm, every particle is replaced by a beetle and the particle swarm becomes a beetle swarm. During each iteration, the beetle updates its position based on the extremums of two fitness values: one is the optimal value searched by beetle itself, the other is the optimal value searched by the whole beetle group. In this way, an individual beetle will not blindly follow the population. Each movement of the beetle is determined by comparing fitness values of the left and right antennae; therefore, the movement of the entire beetle group will be the same.

Structure of PID control system based on BAS-PSO. PID: proportional-integral-derivative; BAS: beetle antennae search; PSO: particle swarm optimization.
Main steps of the optimization process
Set basic parameters to initialize the algorithm;
Randomly obtain the position and speed of each beetle, calculate the fitness value of each beetle, take the current position of each beetle as the individual optimal value, and find the global optimal value by comparing each individual optimal value;
Update the speed and position of each beetle according to the update rule, which is dominated by the particle swarm;
After the iteration, update the individual optimal solution and the global optimal solution and compare the current solutions with the previous values;
If the solutions meet requirements, end the search; otherwise, return to step (1).

Flowchart of hybrid BAS-PSO algorithm. BAS: beetle antennae search; PSO: particle swarm optimization.
Results and analysis
Selecting the propulsion motor parameters is a key step in the USV design process and has received a great deal of attention from ship designers. To date, studies have only investigated control parameters of the USV propulsion motor, despite large differences in the selection process due to the wide array of propulsion systems used in surface ships.
9
For different USV specifications, different types of propulsion motor are used. To facilitate this research, a second-order system was taken as the control object with transfer function
The results of several experiments were obtained: Figures 5 to 7 show the fitness curves obtained for different algorithms; Figure 8 presents the optimization curves of the proportional gain and derivative gain of the PID; Figure 9 is the step response of the system (red line represents the GA, black line represents the unmodified PSO algorithm, and green line represents the proposed BAS-PSO algorithm). The effect of the improved particle swarm can be clearly observed against the results of other optimization algorithms.

GA fitness curve. GA: genetic algorithm.

Standard PSO fitness curve. PSO: particle swarm optimization.

BAS-PSO fitness curve. BAS: beetle antennae search; PSO: particle swarm optimization.

KP and KD of PID optimization curves. PID: proportional-integral-derivative.

Step response of the system.
Conclusions
In this article, phenomena of the traditional PSO algorithm including easily falling into the local optimum and premature convergence were analyzed and an improved method was proposed. To combine the advantages of the BAS algorithm and PSO, an improved BAS-PSO model was constructed. The method was used to tune the PID parameters of an USV propulsion motor. The results of numerical experiments show that the BAS-PSO method improves the convergence speed and obtains a higher quality solution, including the PID controller settings, compared with the standard PSO algorithm. In addition, motion control of the USV was improved to a certain extent, thereby improving the performance of the USV. The proposed method has excellent application prospects as an USV motion control method and will contribute to further research and development of intelligent algorithms.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
