The Application of PSO-AFSA Method in Parameter Optimization for Underactuated Autonomous Underwater Vehicle Control

In consideration of the difficulty in determining the parameters of underactuated autonomous underwater vehicles in multidegree-of-freedom motion control, a hybrid method that combines particle swarm optimization (PSO) with artificial fish school algorithm (AFSA) is proposed in this paper. The optimization process of the PSO-AFSA method is firstly introduced. With the control simulation models in the horizontal plane and vertical plane, the PSO-AFSAmethod is elaborated when applied in control parameter optimization for an underactuated autonomous underwater vehicle. Both simulation tests and field trials were carried out to prove the efficiency of the PSO-AFSAmethod in underactuated autonomous underwater vehicle control parameter optimization. Theoptimized control parameters showed admirable control quality by enabling the underactuated autonomous underwater vehicle to reach the desired states with fast convergence.


Introduction
The rapid development of artificial intelligence, automatic control, and simulation technology has brought significant progress to autonomous underwater vehicle (AUV) technologies [1].AUVs have been used in various fields including the development of marine mineral resources [2], topographical surveying [3], hydrological information collection [4], dam and pipeline detection [5], and relay communication [6].With respect to multiple parameters, strong nonlinearity, and strong coupling effect of underactuated AUV control system, how well an AUV completes its task depends on not only the sensors and actuators equipped but also reliable control performance [7].
In practice, however, the design of underactuated AUV controller depends on the designer's personal experience.The control parameters are often determined with the cutand-try method, which is not only time-consuming but also difficult to get the optimal or even satisfying control parameters.Especially when multiple degrees of freedom are involved in AUV motion control, experience-based trials will become a more difficult problem.For the resolution of control parameter optimization, colony algorithm [8], immune algorithm [9,10], and PSO [11] had been adopted, but they all fail in engineering practice due to complicated coding process, tendency to be stuck with local extremum, or inability to satisfy multi-degree-of-freedom motion control.
For this reason, in this paper, combining PSO with AFSA is proposed to optimize underactuated AUV control parameters and also to provide an effective solution to parameter optimization for nonlinear control systems.
When applied to control parameter optimization, PSO is noticeable for fast convergence [12], high efficiency, and parallel searching ability, but it is likely to be stuck with local extremum and miss the global extremum.AFSA is highly tolerant with algorithm parameters' initial value and is recommended for its strong global searching ability, though it is inferior to PSO in terms of convergence efficiency [13].PSO is combined with AFSA in this paper, with the fast convergence of PSO making up for that of AFSA and the global searching wV t ability of AFSA solving PSO's tendency of being stuck with local extremum, so that the two can collaborate in parameter optimization for underactuated AUV control and achieve efficient and desirably optimized results.This paper is organized as follows.The second section summarizes the principles and procedures of PSO, AFSA, and PSO-AFSA method, respectively.The frames of motion control are established in the third section, where the research object is introduced, the horizontal and vertical motion models are established, and how the PSO-AFSA method is applied to underactuated AUV control parameter optimization is expounded.The simulation tests are carried out in the fourth section for underactuated AUV motion control in the horizontal plane and the vertical plane.The field trials are carried out in the fifth section.Both the simulation tests and field trials have justified the efficiency of the PSO-AFSA method in parameter optimization for underactuated AUV control.

Algorithm Overview
2.1.PSO.In particle swarm optimization, each particle in the searching space represents a potential solution to the problem to be optimized.Each particle corresponds to a fitness value determined by the function to be optimized [14].During the optimization, each particle is subordinate to a velocity vector that determines the direction and distance that they can fly.Before reaching the optimal solution, particles keep updating themselves by following two values as shown in Figure 1.The first value is called individual extremum, namely, the optimal solution that each individual particle has found by far.The second value is called global extremum, namely, the optimal solution that the entire swarm has ever found.Each particle updates their velocity and position by where  is the inertia weight,    is the velocity of particle  at time ,    is the position of particle  at time ,    is the optimal position that individual particle  has ever found,    is the optimal position that the entire swarm has ever found, and rand() is a random value from [0, 1]. 1 and  2 are accelerating coefficients introduced to adjust the maximum step length that the participles fly towards the individual extremum and global extremum.With small values,  1 and  2 may lead the particles away from the target area, while large values of the accelerating coefficients will make the particles rush to the target area or fly over the target area.In addition, the particles are limited with the preset maximum flying velocity  max whose larger value guarantees the global searching ability of the entire swarm.Boundary conditions are also set to keep the swarm within the searching space.
Formula (1) consists of three parts. ⋅    indicates each individual particle's tendency to fly following their previous direction and velocity, which is called the "inertia" part. 1 ⋅ rand() ⋅ (   −    ) reflects each individual particle's tendency to fly towards their respective optimal position, which is known as the "cognition" part. 2 ⋅ rand() ⋅ (   −    ) shows each individual particle's tendency to fly towards the optimal position the entire swarm has ever experienced, which is named as the "society" part.

AFSA.
It is often seen that fish would swim to or follow its companions to where the food concentration is the highest [15].In this regard, the place of the biggest number of fish typically means the highest food concentration.This is the foundation on which AFSA constructs artificial fish to achieve optimization by simulating fish's acts of preying, swarming, following, and moving.
An artificial fish is encapsulated with variables and acts.The variables include ,   ( = 1, 2, . . ., ), , , ,  ,  , = ‖  −   ‖, and  = ().The acts include (), (), (), V(), and V().The definitions of variables and acts in AFSA are provided in "Abbreviations" at the end of the paper.The acts are described in detail as below (the discussion in this paper focuses on the optimization for maximum value, for example.Those that require optimization for minimum value can be exchanged with that for maximum value).

Act of
Preying.An artificial fish conducts the act of preying to move towards food.  is assumed to be the current state of artificial fish .When determining a random state   within its visual scope where rand() is a random value from [0, 1] and   <   , artificial fish  moves according to or otherwise artificial fish  determines another random state   and judges whether after artificial fish  tries   times, artificial fish  moves randomly according to

Act of Swarming.
A school of fish would swarm naturally to survive or keep themselves away from danger.In AFSA, all artificial fish shall move towards the center of their companions and avoid overcrowding in the meantime.  is assumed to be the current state of artificial fish .
When detecting the number of companions   within its neighborhood and their central position   , with   /  >  ⋅   which means the food concentration is high and it is not overcrowding at the central position   , artificial fish  moves towards   according to or otherwise artificial fish  conducts the act of preying.

Act of
Following.An artificial fish conducts the act of following to move towards the neighboring artificial fish whose position shows the highest food concentration.The act of following means moving towards the best companion in an artificial fish's neighborhood.  is assumed to be the current state of artificial fish .When detecting   that has the highest food concentration   within its neighborhood ( , < ) and with   /  >  ⋅   , which means the food concentration is satisfyingly high and it is not overcrowding at   , artificial fish  moves towards   according to or otherwise artificial fish  conducts the act of preying.

Act of Moving.
As a default of the act of preying, the act of moving means that artificial fish  randomly determines a state within its visual scope and moves towards the state according to

Act of Evaluating.
As shown in Figure 2, in the process of optimization, an artificial fish evaluates the acts of preying, swarming, following, and moving before determining and conducting the best act based on its evaluation so as to reach the position of higher food concentration.
In addition, a bulletin board is introduced in AFSA to record the optimal state the entire school has ever experienced.After each time of iteration, each artificial fish compares its individual state with that recorded in the bulletin board.If the state of an individual artificial fish is better than that recorded in the bulletin board, the bulletin record will be updated, or otherwise the bulletin record will remain.When the iteration is finished, the bulletin record is the expected optimal solution.

PSO-AFSA.
Combining PSO with AFSA, the PSO-AFSA method takes advantage of the rapid convergence ability of PSO and the strong global searching ability of AFSA to provide more desirable optimized results.
The PSO-AFSA method works in accordance with the following procedures shown in Figure 3.
Step 1 (initialization).The particle swarm 1, artificial fish school 2, size of the particle swarm 1, and size of the artificial fish school 2 are firstly defined.Individual particles and artificial fishes are generated randomly within the feasible domain of the parameters to be optimized. 1 ,  2 , , , , and   Define Pop1, Pop2, N1, and N2 The particle swarm updates according to formulas (1) and ( 2)  (whose definitions are provided in "Abbreviations") are also set.
Step 2 (PSO).Each particle in the swarm updates itself according to formulas (1) and ( 2).After each time of iteration, each individual extremum PSO Pbest and the global optimal extremum PSO Gbest are obtained.
Step 3 (AFSA).The artificial fish school realizes optimization according to Section 2.2 and provides the optimized result AFSA best after each time of iteration.
Step 4 (bulletin).A global bulletin board is introduced to compare the fitness value reported back from the particle swarm and the artificial fish school with the better value recorded in the global bulletin board (PSO-AFSA best).When PSO Gbest is better than AFSA best, the optimization result from AFSA is replaced by PSO Gbest, which can improve the optimization efficiency of AFSA.When AFSA best is better than PSO Gbest, the optimization result from PSO is replaced by AFSA best, which can strengthen the global searching ability of PSO.
Step 5 (termination conditions).Steps 2-4 repeat till the termination condition is satisfied (such as times of iteration or error tolerance).
Step 6 (output).When the optimization completes, PSO-AFSA best recorded on the bulletin board is the optimized result expected.

Construction and Transformation of Frames.
In accordance with the standard symbol system, the inertial frame  −  and the body frame  −  [16] are constructed as shown in Figure 4.
The transformation between the inertial frame and the body frame complies with [17] where  is the transformation matrix,  is the heading angle,  is the trimming angle, and  is the heeling angle.

Profile of Research
Object.Designed with conventional streamline, the research object weighs 183 kg, 2.55 m long, with the cruising speed of 3 kn.It is equipped with one thruster at the stern, together with one rudder and one elevator.The underactuated AUV can realize movement in five degrees of freedom including the surge, sway, and heave directions, as well as the pitch and yaw dimensions.The gravity center of the AUV is the origin of the body frame and its weight is equated to its buoyancy.The buoyancy center is 0.02 m over the gravity center in a vertical line.The AUV is assumed to be in a symmetric structure in left-right, frontrear, and top-bottom dimensions.
The AUV adopts sigmoid-function control method that integrates fuzzy control with PD control structure [18].Due to the simple structure and demand on small number of parameters, the sigmoid-function control method has been successfully applied to different models of AUV motion control and received admirable control result.Numerous field trials have also justified the feasibility and effectiveness of sigmoid-function method in underwater vehicle motion control.In practice, however, the control parameters of sigmoid-function method mostly come from the designer's personal experience and trials.The adjustment process is not only time-consuming but also difficult to achieve satisfactory control parameters.For the interest of efficient parameter adjustment and more desirable test results, it is necessary to optimize the control parameters of sigmoid-function method with PSO-AFSA method.
The sigmoid-function controller is expressed as [19] where  1 and  2 are the control parameters. and ė are, respectively, the deviation and rate of deviation change between the desired value and actual value of the input. is the control output.The kinetic equation of the research object in the horizontal plane is [20] where  and V are the AUV's linear velocity in the surge and sway directions,  is the AUV's angular velocity in the yaw dimension,  is the force in the surge direction,  is the moment in the yaw dimension,  is the mass of the AUV, and  u and  V are hydrodynamic coefficients.The hydrodynamic coefficients are obtained with planar motion mechanism in the circulating water flume as shown in Figure 5.The hydrodynamic tests carried out and hydrodynamic coefficients of the AUV in the horizontal plane are, respectively, provided in Tables 1 and 2.
It can be inferred from formula (11) that there is no input in the sway direction, which means that the AUV is obviously an underactuated system.
The kinetic equation of the research object in the vertical plane is [20] where  and  are the AUV's linear velocity in the surge and heave directions,  is the AUV's angular velocity in the pitch dimension,  is the force in the surge direction,  is the moment in the pitch dimension,  is the mass of the AUV,  is the weight of the AUV,  is the buoyancy of the AUV, and   is the vertical distance between the buoyancy center and the gravity center.The hydrodynamic coefficients such as  u and  V have the same definitions as those in the horizontal motion model.The hydrodynamic coefficients of the AUV in the vertical plane are listed in Table 3.
It can be inferred from formula ( 14) that there is no input in the heave direction, which means that the AUV is obviously an underactuated system.

Control Simulations
In order to verify the PSO-AFSA method proposed, the control simulations are carried out with the platform of Matlab 8.6 in the horizontal plane and vertical plane, respectively.The property parameters and hydrodynamic coefficients of the AUV are listed in Tables 2 and 3.   17.

Simulation in the Horizontal
Since the AUV realizes movement in three degrees of freedom in the horizontal plane, the PSO-AFSA method implements parameter optimization for  and  control at the same time. 1 and  2 , the parameters for velocity control, are optimized based on the deviation and rate of deviation change between the desired velocity value and actual velocity value. 1 and  2 , the parameters for heading angle control, are optimized based on the deviation and rate of deviation change between the desired heading angle value and actual heading angle value.
The indicator function of Integral of Time-Weighted Absolute Value of the Error (ITAE) is adopted in this paper to evaluate the optimization of control parameters.ITAE gives little consideration to the initial deviation but puts more emphasis on the overshooting and adjusting time.ITAE is commonly used in the control fields because it comprehensively reflects the rapidity and accuracy of the control system.The function to be optimized is as follows [21]: where  stands for the error between the desired and actual inputs and  1 ,  2 ,  3 , and  4 are the control parameters to be optimized.
For each time of iteration in PSO-AFSA optimization, the two sets of control parameters, { 1 ,  2 } and { 1 ,  2 }, reported back from PSO and AFSA are stored in Matlab workspace and then input to the four  modules of the simulation control model in Simulink.The simulation time is set to be 50 s, after which the fitness value of min { 1 , 2 , 1 , 2 } Φ is reported back from the  module to Matlab workspace to enable the PSO-AFSA method to continue with the optimization.
In the optimization of underactuated AUV control parameters for the horizontal plane, the PSO-AFSA method is set as follows: 1 = 20,  1 =  2 = 1, 2 = 20,  = 5,  = 0.5,  = 0.55, and   = 4. Based on the experience in practice, 0 <  1 ,  2 ,  1 ,  2 ≤ 10.The simulation model is set with fixed-step solver with the sample time of 0.01 s.In addition, disturbing items are also included in the simulation model, with the current velocity   = 0.1 m/s and current angle   = 0.5 ∘ .Figure 6 shows the optimization results for AUV motion control in the horizontal plane with the desired velocity   = 1.5 m/s and desired heading angle   = 20 ∘ .
It can be seen in Figure 6 that the optimized parameters for velocity control are  1 = 9.8 and  2 = 5.4 and those for heading angle control are  1 = 9.5 and  2 = 7.6.The best fitness value comes from min { 1 , 2 , 1 , 2 } Φ at the end of  each time of iteration.Figures 7 and 8 show, respectively, the control result of velocity and heading angle with the optimal parameters  1 ,  2 ,  1 ,  2 .
As shown in the simulation results, the two sets of control parameters { 1 ,  2 } and { 1 ,  2 } optimized by the PSO-AFSA method enable the AUV to achieve the desired velocity and heading angle value within a very short period of time in a steady manner.

Simulation in the Vertical
Plane.When applied to control parameter optimization in the vertical plane, the PSO-AFSA method is also firstly written in the .mfile and the simulation model is then constructed in Simulink as shown in Figure 18.
Since the AUV realizes movement in three degrees of freedom in the vertical plane, the PSO-AFSA method implements parameter optimization for  and  control at the same time.The same as the optimization in the horizontal place,  3 and  4 are optimized based on the deviation and rate of deviation change between the desired and actual velocity values. 1 and  2 are optimized based on the deviation and rate of deviation change between the desired and actual trimming angle values.
The indicator function of Integral of Time-Weighted Absolute Value of the Error (ITAE) is also adopted for the optimization of the control parameters in the vertical plane.The simulation procedures and settings are the same as those for the horizontal plane.In the optimization of underactuated AUV control parameters for the vertical plane, 1,  1 ,  2 , 2, , , , and   have the same settings as those for the horizontal plane.Based on the experience in practice, 0 <  3 ,  4 ,  1 ,  2 ≤ 12.The simulation model is set with fixed-step solver with the sample time of 0.01 s.Again, disturbing items are also included in the simulation model, with the current velocity   = 0.1 m/s and current angle   = 0.5 ∘ .Figure 9 shows the optimization results for AUV motion control in the vertical plane with the desired velocity   = 1.5 m/s and desired heading angle   = −5 ∘ .
It can be seen that the optimized parameters for velocity control are  3 = 9.1 and  4 = 4.5 and those for trimming angle control are  1 = 9.5 and  2 = 5.9.Figures 10 and 11 show, respectively, the control result of velocity and trimming angle with the optimal parameters  3 ,  4 ,  1 ,  2 .As shown in the simulation results, the two sets of control parameters { 3 ,  4 } and { 1 ,  2 } optimized by the PSO-AFSA method show admirable controlling quality by enabling the AUV to reach the desired velocity and trimming angle within a very short period of time without overshooting.

Field Trials
In order to justify the effectiveness of the PSO-AFSA method, the optimized control parameters { 1 ,  2 } and { 1 ,  2 } and { 3 ,  4 } and { 1 ,  2 } were applied to field trials in the horizontal plane and vertical plane, respectively.The field trials were carried out as shown in Figure 12, with the trial results shown in Figures 13-16.In Figure 12, (a) provides the environment of the field trials, (b) shows the launch of the AUV, (c) shows the AUV in sea trials, and (d) shows the retrieval of the AUV.
Figures 13 and 14 show, respectively, the result of velocity control in the surge direction and heading angle control in the yaw dimension with the desired velocity   = 1.5 m/s and desired heading angle   = 20 ∘ .Overshooting is hardly seen in the velocity output, with the error less than 0.05 m/s in the steady state.The heading angle control result is output smoothly with rapid convergence and hardly overshooting.The error is less than 1.0 ∘ , which reflects the admirable control effect.than 0.1 m/s in the steady state.The trimming angle control shows rapid convergence with the error less than 1.0 ∘ , which can fully satisfy the requirement on accuracy in engineering practice.
In the field trials, there exists inevitable rough disturbance from the complex marine environment, which can never be accurately estimated in the simulations.This accounts for the fluctuation in the outputs of heading and trimming angle control.As shown in the field trial results, the control parameters optimized by the PSO-AFSA method enabled the research object to achieve rapid convergence, with admirable quality, and the desired control states in the horizontal plane and vertical plane control.

Conclusions
PSO and AFSA are combined in this paper to solve parameter optimization for underactuated AUV control.There exists great difficulty in determining the parameters for underactuated AUV motion control especially with multiple degrees of freedom.Experience-based trials are time-consuming and difficult to get satisfactory control parameters.The existing optimization methods failed to provide a satisfying solution to underactuated AUV motion control with multiple degrees of freedom in view of rapid convergence and global optimal solution.
The proposed PSO-AFSA method is expounded when applied to parameter optimization for underactuated AUV motion control.The simulation tests and field trials were then carried out to prove that the control parameters optimized by the PSO-AFSA method can achieve admirable control effect over the underactuated AUV in the horizontal plane and vertical plane.The control quality can meet the requirement on precision in engineering practice.Although the PSO-AFSA method proposed in this paper is applied to parameter optimization for underactuated AUV motion control, the research findings are also of practical significance to parameter optimization of full-actuated and overactuated AUVs.The research later will focus on the feasibility and effectiveness of the PSO-AFSA method in parameter optimization for full-actuated and overactuated AUV motion control.

Figure 4 :
Figure 4: Inertial frame and body frame.
cos  sin  cos  − sin  cos  sin  sin  − sin  cos  sin  sin  sin  + cos  cos  cos  sin  cos  sin  cos  + sin  sin  sin  sin  cos  − cos  sin  cos  cos  ] ] ] ,

Figure 6 :
Figure 6: Control parameter optimization results in the horizontal plane.

Figure 9 :Figure 10 :
Figure 9: Control parameter optimization results in the vertical plane.

Figure 17 :
Figure 17: Simulation model for control in the horizontal plane.

Figure 18 :
Figure 18: Simulation model for control in the vertical plane.