Three-Dimensional Path Planning for AUVs Based on Standard Particle Swarm Optimization Algorithm

: This paper proposes an improved standard particle swarm optimization 2011 for autonomous underwater vehicles (AUVs). A mutation operator with a threshold is introduced to solve the problem of particles falling into the local extreme, and a nonlinear adaptive parameter strategy is introduced to accelerate the convergence speed. The proposed algorithm considers “path length”, “path safety”, “path smoothness” and “physical constraints” synthetically. For the speciﬁc navigation environment of AUVs, the path planning simulation is conducted based on MATLAB/Simulink, and the navigation guidance and control closed-loop simulation system is established. Simulation results show the effectiveness of the proposed algorithm.


Introduction
Nowadays, autonomous underwater vehicles (AUVs) are extensively employed in military and civilian areas, such as geological sampling [1], mine clearance [2], ocean floor survey [3], oil and gas exploration [4,5], and so on [6].Because AUVs always need to be fully self-contained accomplish intelligently, and decision-making action during its mission, much research has been carried out worldwide with particular emphasis on autonomy, control, and navigation [7].Recently, the development in the field of navigation, guidance and control systems has contributed significantly to the progress achieved in the development of AUVs.Naeem W. et al. [8] extensively discussed some effective guidance laws applicable to AUVs such as Lyapunov-based guidance, Proportional Navigation guidance (PNG), and Line-of-Sight (LOS) guidance.M. Breivik et al. [9] proposed the Pure Pursuit (PP) guidance and the Constant Bearing (CB) guidance in the case of AUVs.With an appropriate guidance strategy, an AUV can effectively perform its tasks by successively passing through the fixed waypoints toward the destination.
Path planning is an essential problem in autonomous control technology.To a certain extent, it reflects the intelligent level of AUVs [10].At present, path planning can be divided into two categories: global and local path planning.The goal of global path planning is to find a feasible path in a known static environment, while local path planning aims at searching for an optimal or suboptimal path in unknown environments.In past decades, many approaches have been proposed for path planning of AUVs, including the Dijkstra algorithm [11], A* algorithm [12], artificial potential field algorithm (APF) [13], genic algorithm (GA) [14], particle swarm optimization (PSO) algorithm [15,16], neural network [17] and reinforcement learning [18,19].However, the single path planning algorithm has limitations in specific scenarios.Therefore, combining different algorithms to solve the path planning problem for AUVs becomes more and more important.For example, Lim et al. proposed a PSO algorithm for the path planning of AUVs by introducing a selective differential evolution strategy where the complexity of computation was reduced significantly [20].In [21], an ant colony optimization algorithm was developed by employing the pheromone elimination method, which can overcome the local extremum easily.To solve the premature problem in the conventional genetic algorithm, Yan and Pan presented a modified genetic algorithm by building a route planning model, which can quickly find the optimal path [22].Therefore, the combination of different path planning algorithms attracted more and more researchers' attention [23].
To quickly and accurately plan the safe optimal paths for AUVs in complex navigation environments, this paper proposes an improved standard PSO 2011 (SPSO-2011) algorithm.The contributions of this article are as follows:

•
The proposed algorithm introduces a mutation operator with a threshold and a nonlinear adaptive parameter strategy, which can effectively shorten the length of the path and accelerate convergence speed compared with the PSO algorithm and the SPSO-2011 algorithm.• A 3D guidance and control system is carried out to verify the effectiveness of the proposed algorithm.Simulation results show that the proposed algorithm has certain advantages in terms of path length and path rationality.
The remainder of this article is organized as follows.Section 2 establishes the AUV kinematic and dynamic models.Section 3 proposes a 3D guidance and control system for AUVs.Section 4 establishes the fitness function of the path.Section 5 proposes an improved SPSO-2011 algorithm.Simulation results are presented in Section 6.Finally, we offer some concluding remarks in Section 7.

AUV Kinematic and Dynamic Models
According to the AUV motion properties and neglecting the roll dynamics, the 5degree-of-freedom (DOF) kinematic and dynamics models of an underactuated AUV can be expressed as [24]: where x, y, z, θ and ψ are the positions and attitude of the AUV in the earth-fixed frame in Figure 1; u, v, w, q and r are the corresponding linear and angular velocities in the body-fixed frame; τ u , τ q and τ r are the control forces and moments of the AUV produced by thrusters and propellers; m ii (i = 1, 2, 3, 5, 6) denote the inertia and added mass parameters of the AUV, and d ii (i = 1, 2, 3, 5, 6) denote the hydrodynamic damping coefficients, ∇ denotes the volume of fluid displaced by the AUV, g denotes the acceleration of gravity, ρ denotes the fluid density, G denotes the gravity of the AUV, and M L denotes the distance between the center of gravity and the center of buoyancy [25].

Three-Dimensional Guidance System
The 3D guidance system is motivated by the 2D guidance law.This paper simplifies a 3D guidance system into two independent and decoupled 3-DOF cases; namely, the horizontal-plane guidance and the vertical-plane guidance.The horizontal-plane guidance strategy makes AUVs converge to a straight line on the horizontal plane via generating the reference heading angle; similarly, the vertical-plane guidance strategy generates the reference pitch angle to converge to a straight line on the vertical plane.The block diagram of the 3D guidance system is given in Figure 2. To obtain the 3D guidance algorithm, the original 2D guidance algorithm is extended.The inertial frame is transformed into the path frame by two rotations, and the tracking error vector is built to clearly represent the distance from the AUV to the path.
The first step is to rotate the inertial frame by α around the z axis, and the second step is to rotate the resulting frame from the first rotation by β around the y axis, where α and β, defined by ( 3) and ( 4), are the slope of the trajectory straight line before each rotation.The rotations can be described by two rotation matrices, R z (α) and R y (β), given in ( 5) and ( 6), respectively.
Then, the tracking error vector e = [e x , e y , e z ] T can be computed in the path frame as (7), where e x , e y and e z are the along, cross and vertical tracking errors, respectively.
In order to make the AUV follow the desired path, the lookahead guidance algorithm is employed by introducing a virtual target [26].In this algorithm, the error components e y and e z are used to guide the AUV to the virtual target.To guarantee that the tracking errors e y and e z converge to zero, the guidance angles ψ d and θ d are set as ).
where δ y and δ z are designed to force the position of the AUV to the xz and xy planes of the path frame, respectively.Then, we can obtain the desired angular velocities q d and r d by proportional controller gains k ψ and k θ .
The steps of the lookahead guidance algorithm for AUVs are listed in Algorithm 1.
Algorithm 1 Lookahead guidance algorithm. Input: : 10: This paper designs two independent controllers for the underactuated AUV based on the desired surge velocity u d , the desired pitch angle rate q d , and the desired heading angle rate r d to control the horizontal-plane and vertical-plane motions, respectively [27].
Define the surge velocity error z 1 , the pitch angle rate error z 2 and the heading angle rate error z 3 as: Step 1: Differentiating (10) with respect to time, respectively, and we have Step 2: The control law can be designed as: where k 1 > 0, k 2 > 0 and k 3 > 0 are the parameters to be designed.
Step 3: Define a Lyapunov function candidate as: Differentiating the Lyapunov function with respect to time, and we have Substituting Equations ( 2), ( 11) and ( 12) into ( 15), and we have According to the Lyapunov stability theorem, the errors z 1 , z 2 and z 3 can converge to zero, and the closed-loop system is asymptotically stable.

Multi-Objective Optimization
If P 0 is the starting point and P N is the destination point, then the path can be expressed as follows: where According to the given navigation environment and the physical property of AUVs, some formal constraints are formulated as follows: where x min and x max are constraints for x n , y min and y max are constraints for y n , z min and z max are constraints for z n , γ max is the maximum allowed angle of the planning path on the horizontal plane, and ϕ min is the minimal allowed angle of the planning path on the vertical plane.

Path Length
The total length of the path is usually discussed because it determines the sailing time and energy expenditure.The total length of the path can be calculated by: where P n − P n−1 indicates the Euclidean distance between P n = (x n , y n , z n ) and During path planning, the path length ratio is usually used to calculate the path length, specifically as follows: where P N − P 0 represents the Euclidean distance between the starting point P 0 and the destination point P N .

Path Smoothness
Path smoothness should be considered to avoid the mutations in navigation direction in path planning.Mutations in navigation direction will not only increase energy consumption, but also reduce navigation accuracy.Therefore, in order to avoid the mutations in navigation direction, the fitness function is defined as: where • represents the Euclidean distance, γ n and ϕ n represent the angle of the planning path on the horizontal plane and the angle of the planning path on the vertical plane, which are calculated according to the following formula: 2  ,

Path Safety
A safe path must avoid all the obstacles.The obstacles are assumed to be static with known position.The underwater obstacle is usually assumed to be a stationary target and positioned.The solutions should be penalized when the generated path cuts any obstacles.The safety fitness function of the path can be expressed as: where A 3 is the fitness function of the path, OB represents the collection of all obstacle areas, if the planned path does not intersect all obstacles, the fitness function of the path is 0, conversely, it is +∞.

The Construction of the Total Fitness Function
The path planning algorithm takes the path length, the path safety and the path smoothness as the main optimization goal.It is common to aggregate the multiple objectives into a single fitness function, which is nonzero and monotonic.The total fitness function of the path comes from a weighted sum of objectives above, and the smaller fitness function value represents a better path.Define the total fitness function as: where F represents the total fitness function of the path, η i (i = 1, 2, 3) are weight factors that determine the importance of each objective.

The Improved SPSO-2011 Algorithm
Evolutionary algorithms have been widely applied to solve multi-objective optimization engineering problems.One of the most popular evolutionary algorithms is the particle swarm optimization (PSO) algorithm.
The SPSO-2011 exploits the idea of rotational invariance to improve the standard PSO.The improved SPSO-2011 algorithm still utilizes the update rules of the SPSO-2011 algorithm and uses the uniform random initialization.Velocity and position of the particle are updated by where i = 1, 2, . . ., M, with M equal to swarm size and t = 1, 2, . . ., T with T equal to the maximum number of iterations, V represents the velocity of the particle, X the position of the particle, ω is the inertia weight, c1 is the cognitive learning factor, c2 is the social learning factor, G best denotes the best position that the whole swarm has found so far, and P best denotes the best position that the particle has found so far.

The Improved Adaptive Parameters
The inertia weight ω is applied to balance the global and local search capabilities.The larger the w, the faster the particle convergence rate and the stronger the global search ability, but it reduces the local search ability of the particles and ultimately leads to lower global convergence accuracy.The smaller w will improve the convergence accuracy of the particles, but reduces the convergence speed of the particles, which easily makes the particle into the local optimum in the search process and cannot jump out of the local extreme value [28].In the SPSO-2011 algorithm, the inertia weight is a fixed value, but it cannot consider both the search accuracy and the search range.A nonlinear adaptive strategy can ensure that all particles can quickly spread into the whole search space in the early search stage to determine the approximate range of the global extrema, accelerating the particle convergence in the late search stage [29].In the improved SPSO-2011 algorithm, the inertia weight w linearly increases in the early stage, which increases the search range, prevents falling into the local optimum, and then the inertia weight w nonlinearly reduces in the late stage to improve the search accuracy.The nonlinear adaptive inertia weight was proposed as the followed formula: where ω r represents the initial value, ω min is the minimum value, ω max is the maximum value, and iter min represents the minimum number of iterations.
In the SPSO-2011 algorithm, the update speed of the particle swarm is mainly adjusted through the cognitive learning factor and the social learning factor, but due to the lack of changes in learning factors, it is easy to make the particle fall into the local optimum.In the improved SPSO-2011 algorithm, two learning factors are devised with dynamic adjustment methods to avoid the local optimum.The dynamic adjustment methods are as follows: where c1 min represents the minimum value of the cognitive learning factor, c2 min represents the minimum value of the social learning factor, c1 max represents the maximum value of the cognitive learning factor, c2 max represents the maximum value of the social learning factor, and K 1 and K 2 represent two adjustable and positive constants.

Mutation Operator
The mutation is employed to give new information to the population and increase population diversity.In this paper, the improved SPSO-2011 algorithm introduces a mutation operator with a threshold.In the improved SPSO-2011 algorithm, when the cumulative number of iterations is greater than the threshold and the individual fitness function value is always greater than the global fitness function in the cumulative process, the mutation is performed.Otherwise, the cumulative number of iterations is 0. The improved method can effectively increase global search ability and avoid falling into the local optimum.The random mutation can be expressed by the following equation: where rand is the random number in the [0, 1] and D is the range of map.
The flow chart of the improved SPSO-2011 algorithm is shown in Figure 3.

Simulation Results
To verify the effectiveness of the proposed algorithm, this paper contrasts with the PSO and SPSO-2011 algorithms in terms of planning time and path length.For certain AUV, a 3D guidance and control strategy is designed, and a closed-loop simulation system is established based on MATLAB/Simulink.Comparative simulations are carried out to verify the effectiveness of the proposed algorithm.
The simulations are carried out in different 3D spaces with different obstacles and different starting and destination points.In general, the underwater obstacles mainly include sea ridges, underwater shipwrecks, marine suspended matter and other objects.To facilitate the problem description, the sphere and cuboids are used to describe the underwater obstacles.The parameters of the proposed Improved SPSO-2011 algorithm are given in Table 1.The simulations are carried out on a 500 m × 500 m × 100 m 3D space with some equivalent obstacles.In 3D space, the starting point is (2,10,7), and the destination point is (480,430,30).All obstacles are replaced by regular balls or cuboids.The main parameters of the improved SPSO-2011 algorithm are: γ max < | ± π/3|, ϕ min > | ± π/6|, M = 200, ω r = 0.7, ω min = 0.4, ω max = 0.9, c1 min = c2 min = 0.9,  The parameters of 3D space and the positions of starting and destination points are shown in Table 2. Simulations of the PSO algorithm, the SPSO-2011 algorithm and the improved SPSO-2011 algorithm are performed using MATLAB, and each three path planning algorithms were performed eight times.The optimal fitness function values of three path planning algorithms in different 3D spaces with different obstacles and different starting and destination points are shown in Figure 4.It can be clearly observed that the proposed improved SPSO-2011 algorithm has a faster convergence rate and the minimum fitness function values 0.9145 and 0.8926 for 3D space 1 and 2, respectively.This confirms that the proposed improved SPSO-2011 algorithm has better performance than the PSO and SPSO-2011 algorithms.The optimal planned paths of three path planning algorithms are shown in Figure 5.The shortest distance of the paths, and the average distance of the paths of three path planning algorithms, are shown in Table 2.As seen in Figure 5 and Table 2, under the proposed improved SPSO-2011 algorithm, the planned path has the shorter path length and higher path smoothness in 3D spaces 1 and 2. From the values of the average distance of the paths in Table 2, the proposed algorithm has the shortest average distance of the paths, and thus can effectively avoid falling into the local optimum.To verify the path performability, the planned path in the 3D space 1 is selected for tracking control by employing the proposed 3D guidance and control algorithm.The simulation results are illustrated in Figures 6 and 7.The 3D following trajectory of the AUV is illustrated in Figure 6a.The corresponding following trajectories in the xy, xz and yz planes are illustrated in Figure 6b-d, respectively.Figure 7a shows the desired heading angle and actual heading angle.Figure 7b shows the desired pitch angle and actual pitch angle.From Figures 6 and 7, we can observe that the proposed 3D guidance and control algorithm can make the AUV track the planned path accurately and the desired heading and pitch angles are reasonable.Simulation results demonstrate the effectiveness of the proposed algorithm.Compared with the PSO algorithm and SPSO-2011 algorithm, the proposed algorithm has the following advantages:

•
Under the proposed algorithm, the phenomenon of local optima can be avoided effectively and thus plan shorter path lengths.

•
The proposed algorithm has the faster convergence rate and higher accuracy.

•
The proposed 3D guidance algorithm can accurately track the planned path, indicating that the planned path has good performability.

Conclusions
This paper proposes an improved SPSO-2011 algorithm.A mutation operator with a threshold is introduced to prevent falling into local optima and a nonlinear adaptive parameter strategy is introduced to accelerate convergence speed.The construction of the total fitness function considers "path length", "path smoothness", "path safety" and "physical constraints", which can effectively avoid collision with threats, obtain a shorter path, and save energy consumption.Compared with the PSO algorithm and the SPSO-2011 algorithm, simulation results show that the proposed algorithm has greater advantages in terms of path length and planning time.To verify the performability of the planned path, a 3D guidance algorithm and controller are designed for AUVs.Simulation results show that the AUV can accurately track the planned path based on the improved SPSO-2011 algorithm.

Figure 1 .
Figure 1.AUVs with body and earth-fixed reference frames.

Figure 2 .
Figure 2. The block diagram of the 3D guidance system.

Figure 4 .
Figure 4.The fitness function curves of three path planning algorithms in different 3D spaces.

Figure 5 .
Figure 5. Compared with the optimal path of three path planning algorithms.

Figure 6 .Figure 7 .
Figure 6.(a) The following optimal path in the 3D space 1.(b) The following optimal path in the xy plane.(c) The following optimal path in the yz plane.(d) The following optimal path in the xz plane.

Table 1 .
The parameters of the improved SPSO-2011 algorithm.

Table 2 .
Performance comparisons of path planning algorithms in different 3D spaces.