1. Introduction
The autonomous underwater vehicle (AUV) is a type of underwater unmanned vehicle (UUV) that has become important to ocean exploration and as a development tool in which artificial intelligence and other advanced computing technologies are integrated [
1,
2]. Because AUVs operate without an umbilical cord, they are more flexible in underwater operations [
3]. In the early stages of deployment, AUVs were mainly used for the development of offshore oil and gas facilities, etc., although later, this technology played an important role in the field of military salvage [
4,
5]. The AUV has increasingly become of interest to researchers in the marine, oil, industry and military fields of countries around the world [
6,
7]. So that the AUV can successfully complete its assigned underwater operations, the performance of its control system is critical, especially the design of its trajectory tracking control method [
8,
9].
Trajectory tracking is limited by time constraints [
10]. This technology feature only needs to track the reference path within a certain error allowable range to guide the AUV from the initial state to the final state [
11]. For the state error of the system to converge to zero, the selection and optimization of the control method is highly important [
11]. At present, many control methods have been successfully applied in the field of AUV trajectory tracking control, including proportional-integral-derivative (PID) control, neural network (NN) control, sliding mode control (SMC) and model predictive control (MPC) [
12,
13].
PID control is the most widely used control method in engineering, as well as the most stable. Among the various methods, the proportional (P) aspect corrects the deviation so that the process can respond quickly [
14,
15]. The integral (I) represents information accumulated in the past, which eliminates static errors and improves the static characteristics of the system [
16]. The derivative (D) plays a leading control role in signal changes, reduces overshoot, overcomes oscillations and improves system stability [
17]. However, an AUV is a high-inertia system. When the expected control command changes suddenly, the output of the AUV cannot be adjusted in time, which results in large system errors [
18]. Therefore, PID control is usually combined with adaptive control, fuzzy control or neural network control, among others [
19].
NN control is a current frontier in the field of automatic control [
20,
21]. This method represents a new branch of intelligent control, offering a new way to solve the control problems of complex nonlinear, uncertain and uncertain systems [
22,
23]. The NN controller is actually a feedforward controller that establishes the inverse model of the controlled object and adjusts the weights between the NN by learning the input and output of the traditional controller as samples to allow the feedback control input to approach zero and replace the traditional controller [
24]. The advantage of NN control is that a precise dynamic model of the control target is not needed; additionally, NN can be used to approximate the nonlinear system [
25]. The disadvantage is that it is difficult to obtain learning samples. Because the AUV system is highly nonlinear and strongly coupled, these uncertainties challenge the ability of the offline neural network controller in regard to robustness; as a result, the development of an online NN controller should be emphasized [
26].
SMC is a special kind of nonlinear control that can, in essence, overcome the uncertainty of the system and has strong robustness in the face of an unknown disturbance, thus it is suitable for the control of AUVs [
27]. However, when the state trajectory of the SMC reaches the sliding mode surface, it is difficult to slide strictly along the sliding mode toward the equilibrium point and instead passes back and forth on both sides of the SMC to approach the equilibrium point, resulting in chattering [
28]. Elmokadem et al. derived an SMC method for the trajectory tracking control of an AUV but did not solve the chattering problem exhibited by the controller [
29]. Londhe and Patre proposed an adaptive fuzzy sliding mode controller by deriving fuzzy logic rules using the Lyapunov energy function to reduce the SMC chattering problem [
30].
When using the MPC feedback control method, the current control action is obtained by solving a finite time-domain open-loop optimal control problem at each sampling moment [
31,
32]. The current state of the process is the initial state of the optimal control problem, and the optimal control sequence only implements the first control effect [
33,
34]. The advantage of MPC is that it is good at dealing with problems with constraints. In traditional MPC, the process of solving the optimal control sequence is usually transformed into a quadratic programming (QP) problem, which solves the minimum value of a positive definite quadratic function with linear equality constraints [
35,
36]. However, the QP process often cannot obtain the global optimal solution. To solve this problem, the improved particle swarm optimization (PSO) algorithm, genetic algorithm (GA) and ant colony optimization (ACO) algorithm are usually introduced into MPC to replace the QP solution process. Ref. [
37] Gan et al. applied quantum particle swarm optimization (QPSO) to model a predictive controller to solve the optimal control quantity. The application of QPSO enhanced the global search ability of traditional PSO and applied the controller to the trajectory tracking control field of AUVs, achieving a good tracking effect. Ref. [
38] Zhang et al. proposed an improved GA to optimize the Q and R matrices in the control objective function of the MPC method; unfortunately, the GA easily falls into a local optimal value due to the lack of population diversity. Additionally, it is difficult for the algorithm to converge quickly in the later stage, and it is difficult to obtain the optimal solution within the MPC sampling time. The ACO algorithm can compensate for the slow convergence rate of the GA in the later stage, although the initial convergence rate of the algorithm is slow due to its low initial pheromone concentration.
To solve the above problems, this paper proposes an MPC method optimized by the GA-ACO algorithm based on population normal probability division. The standard GA of the fitness value according to the normal probability interval is divided into the following steps: put forward the internal and external hybrid crossover operator and dynamic hybrid mutation operator to maintain the diversity of the population, and later, using the ACO algorithm to accelerate convergence, make MPC obtain the global optimal control sequence. Finally, combine the process with dynamic SMC, which is used in AUV trajectory tracking control. The controller recalculates the optimal input at the next time according to the systematic error at each sampling time. The hydrodynamic coefficients used in AUV modeling in this paper are computational fluid dynamics (CFD) data based on the actual solution of ANSYS Fluent.
The main content of this paper is as follows:
Section 2 introduces the kinematic and dynamical model of the AUV. In
Section 3, the solution methods and results for the main hydrodynamic coefficients of the AUV are introduced.
Section 4 introduces the formulation of the optimization problem and the control method proposed in this article.
Section 5 presents a stability analysis of the proposed control method based on terminal constraints.
Section 6 gives the simulation results.
Section 7 offers some concluding comments.
2. Modeling of the AUV
This paper focuses on AUV modeling and trajectory tracking control. As shown in
Figure 1, the size and mechanical structure of the AUV proposed in this paper are designed using the SOLIDWORKS design platform, with the relevant parameter values shown in
Table 1. The arrangement of thrusters supports the movement of the AUV with five degrees of freedom. To avoid the singularity of the Euler angle, the pitch angle
of the AUV is bounded and satisfies
. The AUV roll angle
is also self-stable due to the recovery torque caused by buoyancy and other factors. Therefore, the default expected angle and velocity values of
and
in this paper are 0. In the forward direction, one main propeller is used to generate the thrust of the surge, two vertical propellers complete the thrust of the heave and the pitch moment, and two lateral propellers complete the thrust of the sway and the yaw moment.
2.1. Kinematic Modeling
To establish the kinematic model of the AUV to study its trajectory tracking control, the body coordinate frame B and the inertial coordinate frame I are introduced, both of which are defined in right-handed Cartesian coordinate systems. The origin of B is the center of gravity of the AUV, which is used to describe the velocity information of the AUV. The velocity vector of the AUV is defined as , where u, v and w are the velocities in the surge, sway and heave directions, respectively, and q and r are the angular velocities in the pitch and yaw directions. The origin of I may be any point on Earth, which is used to define the position and attitude information of the AUV in B with respect to I. The position and attitude vector of the AUV is defined as , where the positive direction of the x, y and z axes points in the horizontal north direction, the horizontal east direction and the geocentric direction, respectively, and and are the pitch and yaw angle attitudes of the AUV.
The kinematic model can be defined in the following form:
Here,
is the transition matrix between the two coordinate frames:
2.2. Dynamic Modeling
The dynamic model of the AUV, as proposed by Fossen, is expressed [
35]:
Here, is defined as the inertia matrix. is the rigid-body inertial mass matrix, which is a property of the AUV itself and does not change with time, where m is the mass of the AUV and and are the inertia tensors of the and axes. is the additional mass matrix, which represents the hydrodynamic force due to the acceleration of the AUV underwater, where , , , and are the inertial hydrodynamic coefficients.
is the Coriolis and centripetal force matrix. is the Coriolis and centripetal force matrix due to the rigid-body inertial mass, and is the hydrodynamic Coriolis and centripetal force matrix due to the additional mass.
is the fluid damping matrix, including the linear damping matrix and the quadratic damping matrix , where and . Here, , , , , , , , and are measurable viscous hydrodynamic coefficients.
is a vector representing the restoring forces and moments due to the forces of gravity and buoyancy, b. In this paper, the force of gravity of the AUV is set equal to its buoyancy. is the vertical coordinate of the center of gravity.
is the vector of the input forces and moments for each DOF.
4. Design of the Controller
In this part, the AUV controller used to perform trajectory tracking tasks is designed in detail. The controller is composed of two cascaded controllers. The outer loop controller uses the novel GA-ACO algorithm based on the population division of the normal probability interval, combined with the constraints of velocity and position and the system output feedback, to solve the optimal control sequence of the model predictive controller, that is, the expected velocity command of the AUV, which is transmitted to the inner loop controller. The inner loop controller is a sliding mode controller that can obtain the control input instructions of the AUV and ensure tracking of the AUV along its entire trajectory. The control strategy block diagram is shown in
Figure 13.
4.1. MPC Based on Novel GA-ACO
It is assumed that the trajectory is given in advance and is smooth and bounded. The expected trajectory is described as follows:
The expected velocity command is obtained by inputting the error between the actual position of the AUV and the expected position.
is the sampling time, and the motion model of the system is obtained after discretization as follows:
To ensure stable motion of the AUV, the velocity increment is given as an input, and the state-space model of the AUV is expressed as follows:
The velocity increment is defined as follows:
is defined as the output. By defining matrices
and
in the form given below, the equation of state can be rewritten as follows:
with
where
is a
identity matrix and
is a
zero matrix. Equations (
10) and (
11) are the model prediction equations for the AUV, from which the future state of the system can be inferred. The prediction horizon is denoted by
, and the control horizon is denoted by
; these horizons must satisfy
. The control value is held constant outside the control horizon. The controller output sequences are as follows:
The system input sequence is as follows:
Based on the principle of MPC, the model prediction equations can be further expressed as
where
Constraints: The upper and lower bounds on the AUV state and the velocity increment are set as follows:
By adjusting the current and future inputs to the system, the predicted performance cost function is defined as follows:
where
and
are symmetric positive-definite weight matrices. Within the sampling time
, the cost function
is discretized as follows:
According to Equation (
13), the above equation can be transformed into
where
is the pseudoinverse of the matrix
C. According to Equation (
17), the simplified equation can be expressed as follows:
where
It can be seen from Equations (
27)–(
29) that
is a function of
; thus, the optimization problem can be transformed into the following problem of finding the minimum value of the cost function with constraints (
20) and (
21):
4.2. Novel GA-ACO for Solving the Cost Function
In this section, we introduce a novel GA-ACO method to replace the QP method in the standard MPC to solve the extreme value of the cost function and obtain the optimal control variable . The proposed population normal probability division method is helpful to maintain the diversity of the GA population, to avoid falling into the local optimal solution and to improve the global search ability of the algorithm. To improve the convergence speed in the later stage of the algorithm, the initial optimization result of the GA is used as the initial pheromone of the ACO algorithm, and the global optimal solution is obtained by the rapid convergence of the ACO algorithm.
- 1.
Chromosome coding and fitness function setting.
Chromosomes are encoded in real numbers. As shown in
Figure 14, the length of the chromosomes is consistent with the control horizon of MPC, where each locus corresponds to the predicted control amount in each sampling period of MPC. Taking Equation (
27) as the fitness function of the algorithm, through continuous iteration, the optimal control sequence for each sampling period is obtained.
- 2.
Population normal probability division.
To reasonably improve the diversity of the population in the GA algorithm, a method of dividing the population normal probability interval is proposed. Equation (
31) is a one-dimensional normal distribution function, with a probability density function given as Equation (
32), where
is the standard deviation and
is the mean value. According to the 3
criterion, the probability that the value is distributed in
is
, the probability of being distributed in
is
, and the probability of being distributed in
is
, which basically represents the entire probability space. The initial population is sorted according to the fitness value from greatest to least, and the population is divided into six families according to the above method. In this paper, the initial population number is set to 200, giving the division results shown in
Table 9.
- 3.
Crossover, mutation and convergence.
- (1)
Intra-family crossover: The optimal individual within the family is retained without a crossover operation. In the same family, individuals were randomly selected for intrafamily crossover, and the elite retention strategy was adopted. The parents and offspring were sorted according to the fitness function value, and the optimal retention was selected.
- (2)
Cross between families: Set the maximum and minimum number of iterations, when the number of iterations is less than the maximum number of iterations, and update the optimum population fitness values that are either not changed or for which the rate of change is small. For the crossover operation between families, randomly select the best individual in the families of two different crossover operations, and take the elite reserved strategy after the cross. The idea of interfamily crossover controls the hemming distance of crossover individuals, avoids inbreeding, helps to maintain population diversity and prevents the algorithm from falling into a local minimum.
- (3)
Mixed mutation operator: Hybrid mutation integrates the advantages of Gaussian mutation, Cauchy mutation, Levy mutation and single point mutation to make all of the mutation types work together. In the initial state, the selection probability of the four mutation operators is the same, where all are 0.25. The elite retention strategy is implemented after the mutation operation. If the offspring fitness of the individual after mutation is better than that of the parent, then the probability of the individual type occurring with the corresponding mutation strategy is increased; if the offspring fitness value of the individual is lower than that of the parent after mutation, then the probability of the individual type occurring in the corresponding mutation strategy is reduced. Finally, the probability of updating the four mutation modes after each population mutation operation is determined.
- (4)
Algorithm convergence: In the proposed algorithm, by combining the advantages of the GA and ACO algorithms, the ant colony algorithm adopts the maximum-minimum ant algorithm. The preliminary optimal solution obtained by the GA is used as the initial pheromone of the ACO algorithm, allowing the algorithm to quickly converge to the global optimal control sequence , which makes up for the disadvantage of the slow convergence of the GA algorithm in the later stage. Take the first predicted value of the optimal control sequence as the expected velocity control command.
- 4.
Population normal probability judgment.
Due to crossover and mutation within the population, it is necessary to monitor the normality of the population fitness value during the iteration process. It is proposed to use the absolute value difference of the median, mode and mean of the population fitness value of each iteration as the threshold for monitoring normality. According to the observations of several simulation results in the later period, the threshold value is set as 0.05. When the data normality quality is low and the minimum value of the difference value is greater than 0.05, the normal probability interval family is terminated. If convergence to the optimal solution has been achieved, then the optimal path is output and executed. Otherwise, the random crossover and mutation algorithm is adopted, and the elite retention strategy is implemented. As shown in
Figure 15, using the simulation tool Quantile-Quantile Plots, the initial population number is 200, the maximum number of iterations is 50, and the 5th to 50th and the normality monitoring results of the population fitness value at the 50th generation. Excluding the special values, the results show that the sample points all fall near the red standard normal distribution line, which conforms to the normal probability distribution.
4.3. Dynamic Sliding Mode Velocity Controller
In this part, we design a dynamic sliding mode velocity controller. The conventional SMC control law is usually designed as a discontinuous function, which leads to chattering in the whole system. To overcome the chattering problem of SMC, we put the discontinuous function into the first derivative of the control input, so that the derivative of the control input is discontinuous, but the control input becomes a continuous function after integration, which can effectively suppress or eliminate the chattering problem of SMC.
The dynamic sliding mode controller is designed to overcome the external interference of THE AUV in the offshore environment and improve the robustness of the whole AUV control system. The force and torque required to drive the AUV are designed according to the input velocity error.
The difference between the expected velocity of the system according to Equation (
33) and the actual velocity of the AUV is used as the input to the velocity controller. This error is defined as follows:
where
. According to the velocity error
, the dynamic sliding surface is designed as follows:
where
is the sliding surface coefficient. The following form can be obtained by deriving the sliding surface:
We take the sliding mode surface s as the system state, design the sliding mode surface again as follows:
The derivative of sliding mode surface in Equation (
36) is obtained and is equal to the exponential asymptotic law:
Here, is a discontinuous symbolic function, denotes the velocity at which the moving point of the system approaches the switching surface .
It can be concluded from Equations (
36) and (
37) that the discontinuous function causing SMC chattering only appears in sliding mode surface
, that is, the discontinuous function only appears in the derivative of control input. After integrating the sliding mode surface
, the control input is a continuous function, which eliminates the chattering problem of dynamic SMC. According to Equation (
3), we obtain
According to Equations (
3)–(
5), by combining Equations (
34) and (
35), the amount of control for each degree of freedom of the AUV can be obtained:
At each sampling time k, is recalculated. Then, the optimal control forces and moments are repeatedly computed and executed by the AUV to achieve rolling optimization. The optimization process iterates until the AUV completes the trajectory tracking task.
6. Simulation Results
In this section, the effectiveness and robustness of the controller proposed in this paper (MPC-GA-ACO) are verified using the MATLAB/Simulink simulation platform, and the simulation results for the proposed controller are compared with those for a GA model predictive controller (MPC-GA) [
35] and a standard model predictive controller (MPC) [
38]. The above three controllers all form a cascade control with dynamic SMC. The main hydrodynamic parameters of the AUV used in the simulations are shown in
Table 5 and
Table 8.
The parameter settings for the controller proposed in this paper are as follows: The sampling period is Ts = 0.1 s. The prediction horizon is , the control horizon is , the weighted factors are and , the amplitudes of the input constraints are and , and the state constraints are and . In the novel MPC-GA-ACO, the number of populations is set to , and the maximum number of iterations is 50. The sliding surface coefficient is set to 2.
Random disturbances are also introduced in the simulation as follows:
where rand(1) is a normally distributed noise signal with mean 0 and variance 1.
The initial position and pose vector of the AUV is
. Expected trajectory 1 of the AUV in the simulation is as follows:
The expected trajectory 2 of the AUV in the simulation is as follows:
Figure 16 shows the trajectory 1 tracking performance of the AUV without disturbance. The simulation results show that the three controllers can give the AUV good trajectory tracking performance. Obviously, the controller designed in this paper is the best of the three controllers in the initial speed of tracking the expected trajectory and the final tracking performance (red curve).
Figure 17 shows a comparison of the tracking error results of each degree of freedom of the AUV and the tracking errors of the three control methods are bounded. Although the tracking error of the controller designed in this paper is lower than that of the standard model predictive controller in the initial stage, its overall tracking error result is better than that of the other two controllers (red curve).
Table 10 shows the average position error of the three control methods in tracking the desired trajectory. It can be clearly seen from the table that the average error of the controller designed in this paper in five degrees of freedom is the smallest. The average position error data of surge, sway, heave, pitch and yaw are, respectively, 0.1431 m, 0.1654 m, 0.0999 m, 0.1178 m, 0.0987 m.
As shown in
Figure 18, the control input stability of the controller proposed in this paper is the best in the comparison of the control input of the three controllers without disturbance (red curve).
Figure 19 shows the simulation results of trajectory 1 tracking performance with the random disturbance. Compared with the simulation results without disturbance, the random disturbance interferes with the motion of AUV in the three degrees of freedom of surge, sway and heave. Obviously, the tracking performance of the three control methods is slightly reduced. However, compared with the other two controllers, the controller proposed in this paper still has the best tracking performance (red curve).
Figure 20 shows the comparison of the tracking error results of each degree of freedom of AUV, and the tracking error of the three control methods is bounded. The error fluctuates with the random disturbance, and the error fluctuation of standard MPC controller is the largest (green curve). However, the controller proposed in this paper has the minimum tracking error and the error fluctuation is stable (red curve).
Table 11 shows the average position error of the three control methods when tracking the expected trajectory. It can be clearly seen from the table that the average position error of the controller designed in this paper is the smallest under five degrees of freedom. The average position error data of surge, sway, heave, pitch and yaw are 0.1893 m, 0.1867 m, 0.1445 m, 0.1498 m and 0.1612 m, respectively.
Figure 21 shows the control input fluctuation of the three controllers in the case of random disturbance. The control input stability of the proposed controller is still the best among the controllers and the fluctuation is the smallest (red curve).
To further verify the performance of the controller, the trajectory tracking the performance of AUV is simulated again in aperiodic function trajectory 2.
Figure 22 shows the trajectory 2 tracking performance of AUV without disturbance. The overall tracking effect of the standard MPC controller is poor (green curve). Although the overall tracking effect of the MPC-GA controller is improved compared with the standard MPC controller, the tracking speed is the slowest in the initial stage of trajectory tracking (blue curve). Because the new GA-ACO algorithm can reasonably maintain the diversity of the population, and ensure the local search and global search ability of the algorithm at the same time, so that the optimal control sequence can be obtained in each sampling period of MPC, the simulation results show that the controller proposed in this paper not only ensures the tracking speed of AUV in the initial stage of trajectory tracking but also the overall tracking effect is the best of the three (red curve).
Figure 23 shows the comparison of the tracking error results of each degree of freedom of AUV, and the tracking errors of the three control methods are bounded. Among them, the standard MPC controller error fluctuates greatly when the AUV bow direction change rate is large (green curve), but the controller proposed in this paper has the smallest tracking error (red curve).
Table 12 shows the average position error of the three control methods when tracking the desired trajectory. It can be seen from the table that the average error of the controller designed in this paper is the smallest under five degrees of freedom. The average position error data of surge, sway, heave, pitch and yaw are 0.1881 m, 0.1825 m, 0.1110 m, 0.0915 m, and 0.0873 m, respectively.
Figure 24 shows the control input fluctuation of the three controllers without disturbance. The control input stability of the proposed controller is still the best and the fluctuation is the smallest (red curve).
Figure 25,
Figure 26 and
Figure 27 show the trajectory 2 tracking performance of the AUV with random disturbance. Compared with the other two controllers, the controller achieves the optimal trajectory tracking performance under the condition of minimum error and smooth control intput under random disturbance. The random disturbance leads to a high-frequency variation of the desired speed command, but the proposed controller can still track the desired speed perfectly, which proves its effectiveness and robustness (red curve).
Table 13 shows the average position error of the three control methods in tracking the desired trajectory. It can be clearly seen from the table that the average error of the controller designed in this paper in five degrees of freedom is the smallest. The average position error data of surge, sway, heave, pitch and yaw are, respectively, 0.1932 m, 0.1894 m, 0.1777 m, 0.0998 m, 0.1221 m.
7. Conclusions
In this paper, a novel AUV double closed-loop trajectory tracking method based on model prediction and sliding mode cascade control is designed. First, a kinematics analysis of the fully driven AUV is carried out, and the kinematics and dynamics equations of five degrees of freedom are established. Second, the CFD software ANSYS Fluent is used to simulate the uniform velocity and uniform acceleration of AUV in surge, sway, heave, pitch and yaw degrees of freedom, and solve the main hydrodynamic coefficients required to establish the dynamic model. Then, a novel GA-ACO algorithm based on normal probability interval population division is proposed is proposed. Combined with the constraints of actual control input and state, the algorithm is applied to the outer loop MPC to solve the optimal velocity control sequence, generate the expected velocity command, which is passed to the inner loop. Compared with standard MPC and MPC-GA, this method can reasonably increase the diversity of GA population, improve the local and global search ability of the algorithm, and avoid the problem of falling into local optimal solution caused by QP or GA. Then combined with ACO algorithm, the convergence speed of the algorithm can be accelerated and the global optimal speed control sequence can be obtained for each sampling period. The inner loop uses dynamic SMC to generate the available control input of AUV to ensure the closed-loop tracking along the whole trajectory. A rolling time-domain implementation can be used to recalculate the optimal control input at each sampling instant, compensating for system uncertainties caused by modeling and external disturbances. Finally, two different types of reference desired trajectories are simulated to verify the effectiveness and robustness of the proposed controller under uncertain disturbances in the simulated marine environment. It is improved in reducing the position error of trajectory tracking and increasing the input stability of the controller. In the future research, we will further solve the adverse impact of SMC chattering on the controller, and strengthen the analysis of the impact of the actual marine environment on the control disturbance of AUV and the research on practical problems such as thruster output saturation.