Motion control and path optimization of intelligent AUV using fuzzy adaptive PID and improved genetic algorithm

: This study discusses the application of fuzzy adaptive PID and improved genetic algorithm (IGA) in motion control and path optimization of autonomous underwater vehicle (AUV). The fuzzy adaptive PID method is selected because it is considered to be a strongly nonlinear and coupled system. First, this study creates the basic coordinate system of the AUV, and then analyzes the spatial force from the AUV to obtain the control model of the heading angle, climb angle, and depth. Next, the knowledge of fuzzy adaptive PID and IGA technology on AVU are investigated, then fuzzy adaptive PID controllers and path optimization are established, and experimental simulations are carried out to compare and analyze the simulation results. The research results show that controllers and IGA can be used for the motion control and path optimization of AUV. The advantages of fuzzy adaptive PID control are less overload, enhanced system stability, and more suitable for motion control and path optimization of AUV.


Introduction
With the value of the ocean being paid more and more attention by human beings, the development of ocean as the main way for the development of various countries, the development of Autonomous Underwater Vehicle (AUV), a new and high technology, has been paid more and more attention, and its motion control research has also become a hot spot.Therefore, countries all over the world attach great importance to marine resources and accelerate the process of Marine development [1].Under such circumstances, AUV is particularly important.Therefore, the research on AUV has been developed by leaps and bounds, and the development trend of AUV is large depth, long voyage, multi-function and intelligent [2].Joo and Qu have studied an autonomous underwater vehicle as an underwater glider and its depth control, they assumed a moving battery and a buoyancy bag installed in a torpedo shaped autonomous underwater vehicle, and then developed a mathematical model for the underwater vehicle and derived a stable gliding condition for it [3].Recently, Kim et al. has presented current estimation and path following for an AUV by using a high-gain observer(HGO) based on an AUV dynamic model, a dynamic model of an AUV in a nonuniform flow was adopted to develop a HGO for estimation of the three-dimensional current velocities along AUV trajectories [4].Cao and Zuo have proposed a fuzzybased potential field hierarchical reinforcement learning approach for target hunting by multi-AUV in 3-D underwater environments [5].Guo et al. has studied neural network-based nonlinear slidingmode control for an AUV without velocity measurements.A nonlinear sliding-mode control based on linear-in-parameter neural network (NSMC-NN) was proposed to deal with the unknown dynamics and the external environmental disturbances and a first-order robust exact differentiator is introduced considering unknown velocities of an AUV [6].Doukhi and Lee proposed a robust adaptive neural network certainty equivalent controller for a quadrotor unmanned aerial vehicle, which is applied in the outer loop for position control to directly generate the desired roll and pitch angles commands and then to the inner loop for attitude control [7].For more manufacturing and control technology aspects of AUV, maybe we can refer to the innovative ideas in this literature [8].Joe et al. have proposd a sequential method to extract 3-dimensional information for mapping by using sensor fusion of two sonar devices [9].
In industrial control, PID control is the most commonly method, as long as the correct parameters K p , K i , K d , PID controller can achieve its role.It has the advantages of simple structure, good stability, reliable operation, and convenient adjustment, etc. [10].However, when the controlled object is in the complex water condition and the system is nonlinear, the control effect of PID control method is limited and it is difficult to meet the precision requirements of the system.In order to achieve good control effect which is under the different working conditions, the existing PID controllers generally need different parameters of K p , K i , K d , that is, the PID controller is required to have parameter adaptive function and use fuzzy reasoning to adjust PID parameters of K p , K i , K d .In the presence of various uncertain factors, the system of this method can adapt to the complex environment of inland river and unknown ocean current interference, so that the control effect of the controller can remain consistent and has good robustness.Recently, Qi et al. have investigated observer-based model predictive control (MPC) for switched systems with a mixed time/event-triggering mechanism [11].Zeng proposed an adaptive population extremal optimization-based PID neural network for multi-variable nonlinear control systems in [12].
AUV is also known as submersible or underwater vehicle, which is a kind of underwater device that can move under water and replace humans to complete work in some harsh and dangerous underwater environment [13].There are many types of underwater vehicles, which can be divided into ordinary ROV and intelligent AUV.Shi et al. have studied the obstacle type recognition in visual images via dilated convolutional neural network for unmanned surface vehicles [14].Rashidi et al. have designed a predictive controller approach for depth and steer control of an Autonomous Underwater Vehicle (AUV) [15].Maki et al. have proposed a method for autonomous underwater vehicles to chase sea turtles without attaching any tag to them, toward efficient and long-term observation of marine life [16].
The intelligent AUV was developed in the middle of the last century and had been slow to develop since the first unmanned remote-controlled submarine was launched in 1953, until 1974.Among them, the United States led the world in the early stage of development, and its experiment in the Spanish Sea attracted the attention of all countries in the world [17].Due to the limited depth of human diving, autonomous underwater vehicles can easily break through the human limit to complete operations in the deep sea, with excellent mobility and concealment.Now, intelligent submarine development has been developed to the third generation.In the development of AUV, the United States, Japan, Russia and other countries with advanced AUVs are in a leading position [18].
The development of China's intelligent AUV began in the great development period of oil and gas exploitation after the third Plenary Session of the 11th CPC Central Committee.During this period, relevant research institutions such as The China Harbin University of Science and Technology and the Shenyang Institute of Technology began to study intelligent AUV.For example, The AUV for hardware assembly and system debugging in the laboratory, which is shown in Figure 1.Qianlong I is composed by the Shenyang Institute of Technology and the Chinese Academy of Sciences.The developed AUV, which has a depth of 6000 meters, can perform many tasks, such as detecting the topography and landscape shape of the seabed while working underwater.The submersible, which is being developed jointly with various research institutes and is based in Shenyang, can be used to explore for polymetallic sulphides and other deep-sea mineral resources [19].At present, there are four main research directions: for the fuzzy control system, the main research content of this design, fuzzy control does not have a set of systematic methods, fuzzy rule table in fuzzy reasoning is also derived from previous experience, many parameters are selected and debugged based on experience; Expert (humanoid) control system, which is the combination of technical cybernetics and expert system, also does not have a set of systematic methods.It absorbs a series of reasoning techniques plus the control experience and methods of predecessors, and thus summarizes a control method.A hierarchical integrated intelligent control system uses a multi-level system structure to obtain control rights [20].Neural network control system, a system in which some changing signals are mapped to control signals through neural network behavior characteristics, and distributed and parallel processing control information [21,22].Recently, Xiong et al. have done some research aimed at exploring data driven adaptive berthing method and technology on unmanned surface vehicle [23].
As we know, path optimization is an important part of the autonomous navigation of AUV.Path optimization can be divided into two types of problems: one is global path optimization with known environmental information [24,25], and the other is local path optimization with unknown environmental information [26].The main research content of this paper is the global path optimization of AUV, which is to find a collision-free optimal path from the starting point to the target point by continuous searching and calculating in a known environment.Common criteria for judging whether the planned path is optimal are the following: the shortest path length, smooth path, least energy consumption or shortest time, etc., or multi-criteria comprehensive evaluation of the pros and cons of the path.
Based on the above discussion, the purpose of this study is to improve the effect of motion control, by introducing the idea of fuzzy to simplify the complexity of system, guaranteeing the AUV has a good motion control performance to meet the demand of more work.The main innovations and contributions are as follows: 1) This study creates the basic coordinate system of the AUV, and then analyzes the spatial force from the AUV to obtain the control model of the heading angle, climb angle, and depth.
2) The knowledge of fuzzy adaptive PID on AVU are investigated, then fuzzy adaptive PID controllers are established, and experimental simulations are carried out to compare and analyze the simulation results.The research results show that controller can be used for the motion control of AUV.The advantages of fuzzy adaptive PID control are less overload, enhanced system stability.
3) An improved genetic algorithm(IGA) is proposed and applied to the path optimization of AUV, and experimental simulations are carried out to compare and analyze the simulation results.The research results show that IGA can be used for the path optimization of AUV.
The organizational structure of this study is as follows.The second section studies the motion of the intelligent underwater vehicle and carries out modeling.First, the coordinate system is determined to obtain the space motion equation.The third section introduces the principle of PID control and fuzzy control methods, analyzes their advantages and disadvantages, and then compares and explores the fuzzy adaptive PID control method, respectively.The fourth section is the simulation part.By using the proposed fuzzy adaptive PID control, the controller is established in Matlab to carry out simulation operation.We compare and analyze the simulation results, and evaluate the excellence of the algorithm.In the fifth section, the conclusion summarizes the simulation results and research contents.We expand and verify the experiment according to the summarized simplified equation and the estimated coefficient, and make a prospect for the future research.

Mathematical model of intelligent AUV motion
In this section, motion modeling of AUVs is carried out.Robots have been widely used in many industries, of course, the biggest difference between the AUV of this study and ordinary robots is the difference of working environment.After all, underwater environments are very different from terrestrial environments.In complex inland river and Marine environments, AUV are subject to different forces from the external environment, and there are many difficult situations to overcome.Therefore, in this case, the control system of the underwater vehicle has strong self-regulation capability.Motion model is the foundation of AUV motion control.In order to ensure that the control effect of the controller can still maintain good robustness when the various uncertain factors occur in an underwater environment.If one constructs the motion control model of the AUV, the model will not be too complex, and the over-complex model will make the control system more complex.Sometime, the control system cannot be achieved even if it collapses.Usually, this model will not be too simple, which will greatly reduce the control performance of the control system, and it will be difficult to reflect the real movement mode of AUV [27].Therefore, it is necessary to rationally optimize the space motion model of AUV so that it can adapt to the complex inland river and Marine environment and has high reliability.Normally, the mathematical motion model need to be established a mathematical coordinate system to describe the motion of the AUV.This study adopts the international ship model experiment library meeting (ITTC) and the ship and ocean engineering society (SNAME) suggestion system [28], and the coordinate system belongs to the following two kinds of right-hand rule, one is a fixed coordinate system E − ξηζ, the other is G − xyz 1) Fixed coordinate system E−ξηζ is also called the ground coordinate system or inertial coordinate system for short 'fixed system'.The origin E can choose a point on the earth, Eξ shaft is in the horizontal plane, Eζ axis is perpendicular to the center of the earth, Eη axis can be obtained by the
right-hand rule [29].Coordinate system E − ξηζ is defined in a right-handed rectangular coordinate system.
2) The moving coordinate system G − xyz is usually the coordinate system of the AUV carrier, which can be built on the AUV carrier, referred to as the "moving system".When the carrier moves, the coordinate system will also move with the carrier.Usually, the origin of the coordinate system is the center of gravity of the carrier.G x shaft with AUV carrier structure is the symmetric axis direction, which is the same axis parallel with AUV, pointing at the AUV boat bow.G y axis is parallel to the plane of AUV ontology structure, and which is vertical to the baseline of AUV.G y axis is vertical to G x axis, which is longitudinal direction pointing to the direction of starboard of AUV.G z axis is perpendicular to the G x , G y shaft is in horizontal plane, and G z is pointing to the bottom of the ship motion.The coordinate system G − xyz also forms a right-handed rectangular coordinate system [30].The motion coordinate system has angular velocity and acceleration against the ground in the inertial coordinate system, so it does not apply to Newton's second law.However, it is very convenient that the motion coordinates are introduced to discuss fluid dynamics, and it is very simple and clear for the description of objects in the water with the coordinate system conversion than the other method of space motion equations.Of course, the relative position between the different objects and objects in space stress transformation can also be easily, and AUV by propeller thrust and thrust direction will not change because of the change of motion of the robot.
The matrix inverse transformation can be concluded that the movement in the space position depends on the fixed coordinate system of AUV [31], and the movement of three attitude angle: heading angle ψ, trim angle θ, heeling angle φ, which are relative to a fixed coordinate system: (i).Rotating the heading angle ψ of G − xyz coordinate system around the G x shaft, the coordinate transformation is shown in the Eq (2.1): here, Gx → Gx 1 , Gy → Gy 1 .
(ii).Rotating the trim angle θ of G − x 1 y 1 z coordinate system around the G y1 shaft, the coordinate transformation is shown in the Eq (2.2): here Gx 1 → Gξ, Gz → Gz 1 .
(iii).Rotating the heeling angle φ of G−ξy 1 z 1 coordinate system around the Gξ shaft, the coordinate transformation is shown in the Eq (2.3): The rotation matrix in the Eqs (2.1)-(2.3) is shown in Eq (2.5): So the inverse of the rotation matrix B, which is B −1 shown in Eq (2.6): Using the inverse transformation, which can be obtained the following Eq (2.7): here, Γ 4 = cos φ sin ψ sin θ − sin θ cos ψ, ∆ 4 = sin ψ sin θ sin φ + cos ψ cos φ, Θ 4 = cos θ sin φ, Λ 4 = cos ψ sin θ cos φ + sin ψ sin φ, Ξ 4 = sin ψ sin θ cos φ − cos ψ sin φ, Π 4 = cos θ cos φ.Generally speaking, the following Eq (2.8) can be obtained through Newton's second Law: here F ξ , F η , and F ζ are the projections of F on the ξ axis, η axis, and η axis, respectively.m is the quality of underwater robot.ξG , ηG and ζG are the projections of the acceleration of the center of gravity of the underwater robot on the ξ axis, η axis, and η axis, respectively.The three projected components of the velocity V for zero in the AUV's moving coordinate system G-xyz relative to the fixed coordinate system are u (transverse velocity), v (longitudinal velocity) and w (vertical velocity).When its angular velocity Ω round fixed coordinate system origin on G-xyz coordinate system, the three projection components are p (heeling angle speed), g (trim angle speed) and r (heading angular velocity).The components of force F and moment M on the x-axes, y-axes and z-axes of fixed coordinate system G − xyz are X (longitudinal force), Y( transverse force ), Z( vertical force ) and K (heeling moment), M (trim moment) and N (heading moment), respectively.
As shown in Table 1, each component represents the velocity, angular velocity, force and moment on each axis respectively, where the positive direction of velocity and force is generally the coordinate positive axis, and then the positive direction of angular velocity and moment can be determined according to the right hand rule.

Equations of AUV space motion in underwater
Six degrees of freedom of AUV movement in space are shown as follows [32]: 1) Advance and retreat: Forward is the positive movement of the carrier along the x-axis, while negative is backward; 2) Horizontal shift: the right shift is the positive motion of the carrier along the y-axis, while the negative shift is the left shift; 3) Diving: diving is the positive movement of the carrier along the z-axis, and negative is the upward movement; 4) Rotation: tilting along the x-axis is lateral tilt, tilting along the y-axis is trim, and along the z-axis is rotating.
AUV actually has six degrees of freedom in the underwater motion.For example, when the AUV is rocking bow motion, in addition to forward, transverse and yaw, it also has the occurrence of roll, trim and other phenomena from time to time.AUV can be treated as the quality of a certain quality and distribution of rigid body, with coordinates along three axis movement of linear motion and around the three axes of rotation.According to the mechanics of rigid body combined with Newton-Euler equation, one can build AUV underwater space of six degrees of freedom movement equations [33], as shown in Eq (2.9): here m is the mass of the AUV, x G , y G , z G are the gravity coordinates of the AUV; I x , I y , I z are respectively the moment of inertia of the AUV around the three axes of motion coordinate system; u, v, w, p, q, r are angular velocities of six degrees of freedom; u, v, ẇ, ṗ, q, ṙ are angular acceleration of six degrees of freedom; X, Y, Z, K, M, N are forces moments of six degrees of freedom.
Table 1.Moving coordinate components and motion parameters.
Due to the motion of six degrees of freedom is a little complicated [34], in order to combine the actual working situation, the model is appropriately practical and precise.In this study, only the most basic motion modes of AUV are considered, namely, pitch, bow and depth variation.The carrier only moves up and down on the vertical plane when the depth variation is only.At bow sway, the navigation direction of the carrier can be changed.The center of gravity of the carrier only changes the angle of the bow at the horizontal plane and does not move on the vertical plane.When the AUV moves in the horizontal plane, w = 0, p = q = 0, the motion state can be described as following Eq (2.10): Since the origin setting of the moving coordinate system is coincide or overlap with the center of gravity G.In this study, x G = y G = z G = 0, the Eq (2.10) can be further described as Eq (2.11): When the AUV moves on the vertical plane, v = 0, p = r = 0, the motion equation can be described as Eq (2.12): (2.12) Similarly, x G = y G = z G = 0, the equation can be further described as follows Eq (2.13):

Force analysis of AUV under water
In this section, the stress of AUV during movement is analyzed and its related structural parameters are given.The initial modeling of the AUV needs to consider its dynamic properties.Through the force analysis of the AUV, the resultant force F received by the robot in the water can be obtained as follows Eq (2.14):
where f z is fluid hydrodynamics; G is the gravity of the AUV, B is the buoyancy of the AUV, T i is the sum of all the thrust.The specific geometric and physical parameters of the AUV designed in this study are shown in Table 2. Fluid hydrodynamic force generally refers to the water resistance of the underwater vehicle acting on the carrier in the water area.The motion state of the underwater vehicle, the characteristics of the underwater vehicle and the nature of the ocean current are all the influencing factors of the hydrodynamic force of the underwater vehicle.Without considering the hydrodynamic interaction and determining the structure of the AUV, the hydrodynamic action of the underwater robot is not affected by the specific position.The hydrodynamic force is a function of motion parameters and elevator angle δ e , rudder angle δ r , and differential rudder angle δ d .
Hydrodynamics can be divided into two categories: viscous hydrodynamics and inertial hydrodynamics [35].The viscous hydrodynamic coefficients of AUV are usually expressed according to linear theory, and the fluid hydrodynamic forces are decomposed into transverse forces, longitudinal forces and vertical forces in the coordinate system.Ignoring the cross-coupling of the hydrodynamic forces in the coordinate system, the transverse forces are only related to δ r and δ d , and the longitudinal forces are only related to δ e .Then, each hydrodynamic coefficient is decomposed into position force, rudder force and rotation force.The coupling relationship is obtained in the following Eq (2.15): where p ′ = pL/V, q ′ = qL/V and r ′ = rL/V are dimensionless roll angular velocities, S is AUV maximum cross-sectional area, L is total length of robot carrier, Then, the hydrodynamic force is estimated.By using the position stacking method, the derivative of the directional force of the AUV is decomposed into several parts of the underwater propeller, body and rudder and wing for calculation respectively, and then all of them are superposed to obtain the overall hydrodynamic force.The calculation method of vertical force and lateral force is similar.Based on the data of the AUV mentioned above and the theory of literature [36], the hydrodynamic coefficient is estimated and obtained as follows.The dynamic coefficient of the vertical force is show in Eq (2.16): Similarly, the hydrodynamic coefficient of transverse force is show in Eq (2.17): The inertial hydrodynamic force of the AUV is directly proportional to the acceleration and angular acceleration of the AUV [37].Each degree of freedom of the AUV can generate linear acceleration and angular acceleration, and the six degrees of freedom can naturally have 36 inertial forces as shown below Eq (2.18): where, g i (i = 1, 2, 3, 4, 5, 6) represents the inertial hydrodynamic force generated by the six degrees of freedom respectively; The extra mass given by λ i j is not related to motion parameters, but λ i j is related to the coordinate system and shape characteristics chosen by the AUV.Since the AUV is symmetrical to the left and right, λ i j = λ ji so that λ can be reduced to 10 non-zero masses, such as: λ 11 , λ The inertial hydrodynamic parameters were estimated based on literature and theory [38], and the additional mass value of the AUV was obtained by calculating the structural parameters of the AUV in the above table, and then the overall inertial mass caused by angular acceleration and acceleration motion of the AUV was calculated by position stacking, λ 11 = 1.780, λ 22 = λ 33 = 37.190, λ 44 = 0, λ 55 = λ 66 = 4.106, λ 35 = −λ 26 = 0.723 The gravity acting on the AUV is the sum of the gravity of each component, and the combined point is the center of gravity G (x G , y G , z G ), which is shown in Eq (2.20): The buoyancy force acting on the AUV is the sum of the buoyancy forces of each component, and the combined point is the center of buoyancy C (x G , y G , z G ), which is shown in Eq (2.21): The combined force of gravity and buoyancy can be expressed as Eq (2.22): The restoring force of the AUV is calculated by setting the magnitude of the gravity vector as P = mg and the magnitude of the buoyancy vector as B = ρgV, in which m is the mass of the AUV, ρ is the density of water, g is the gravitational acceleration of the earth, and V is the volume of the AUV.In this study, after obtaining the gravity P and buoyancy B that the AUV is subjected to, B = P can be made by adding buoyancy material or adjusting ballast, so that As an important control component of AUV, the propeller is the main source of power in the analysis of the motion force.The AUV propeller involved in this study is mainly composed of propeller, brushless DC motor, deflector hood and dynamic seal assembly.Among them, the propeller plays a major role.The complex nonlinear characteristics of propeller thrust force are usually simplified in practical engineering.In order to simplify the work load, the thrust force of the propeller is generally calculated without considering its torque.The thrust of the propeller can be expressed as in Eq (2.23): where, ρ is the density of water, usually take ρ = 1000 kg/m 3 , n is the speed of the underwater propeller, D P is the diameter of the propeller, K T is the thrust coefficient of the propeller.The coefficient can be obtained through experiments, but due to limited experimental conditions, the approximate estimate can be calculated as K T = 0.15 according to the literature, and the thrust T = 0.02n 2 of the propeller can be obtained by substituting into the above equation [39,40].

AUV motion control equation
In this section,the motion equation of AUV is analyzed, and the transfer functions of the heading angle, pitch angle and depth of the horizontal plane and the vertical plane are obtained.According to the values of the AUV thrust and hydrodynamic calculated from the content of the previous section, these values are substituted into Eq (2.23).In the space motion equation of underwater vehicle (AUV), in order to simplify the calculation, the center of gravity coincides with the origin of moving coordinate system, and the second order term of motion parameters is ignored without cross-coupling.In this study, the motion of the AUV is divided into horizontal plane and vertical plane.Therefore, the motion states of the two planes are discussed and modeled in the following parts, respectively.
The horizontal movement for AUV refers to the horizontal plane motion and revolve around O z , here, w = p = q = θ = φ = 0, the calculated values of thrust and fluid hydrodynamic are substituted into the simplified movement equation of the horizontal plane, The center of gravity of the AUV is overlapped with the origin of the movable coordinate system, regardless of the cross coupling, the movement equations are simplified by (2.24): Under the condition of small sideslip angle, the horizontal plane motion control equation is the following Eq (2.25): The disturbance equation can be obtained in the following Eq (2.26): Substituting the coefficients into the equation and performing the Laplace transform, one can get Eq (2.27): The transfer function of heading angular velocity is obtained: Because ψ = r is a function of time t, the transfer function of heading angle can be obtained: The horizontal movement of the AUV refers to the movement on the vertical plane and the movement around O y , including v = p = r = ψ = φ = 0. Then according to the calculated thrust and fluid hydrodynamic values in the above content, substituting them into the simplified equation of horizontal plane motion and simplifying it to get: Under the condition of small angle of attack, the control equation of horizontal plane motion is as follows: (2.31) One can get the disturbance equation:
The transfer function of the angular velocity of the pitch angle is obtained: W q (s) = q(s) δ e (s) = 0.261s + 0.478 0.720s 2 + 0.316s + 0.884 (2.34) Since θ = q is a function of time t, we can get the transfer function of the trim angle: we can get the depth of the transfer function: 5(0.261s + 0.478) 0.720s 4 + 0.316s 3 + 0.884s 2  (2.36) In this section, the main work is the research on the motion control of AUV.First, we determine the coordinate system of AUV and the mathematical model of the six-degree-of-freedom spatial motion, and then conduct a detailed force analysis of AUV.It is mainly divided into fluid hydrodynamic force, gravity, buoyancy force and thrust force.Among them, the hydrodynamic coefficient is estimated through relevant references and theories, and the approximate superposition method is adopted.Finally, the motion equation of AUV is analyzed, and the transfer functions of the heading angle, pitch angle and depth of the horizontal plane and the vertical plane are obtained.

PID control
In this section, the PID controller is designed and the simulation study is carried out, so as to compare the performance of fuzzy adaptive PID controllers.As we know, PID controller has the advantages of simple structure, good stability, reliable operation and convenient adjustment, and does not need the prerequisite such as accurate system model.When we cannot get accurate and precise system modeling, PID control technology is the most appropriate.However, when the controlled object is in complex underwater environment and the system is nonlinear, the control effect of PID control method is limited and it is difficult to meet the precision requirements of the system.When the controlled object controlled by the control system is performing underwater tasks, its work efficiency will be significantly affected when it is interfered, and it cannot perform underwater tasks stably.Today's automatic control techniques are based on the concept of feedback.The feedback system is generally a closed-loop system with negative feedback.First, the input value is obtained through the transfer function, and the intermediate value is compared with the expected value to obtain the error.Then, the error feedback is used to adjust and control the operation of the system.The PID controller consists of proportional unit (P), integral unit (I) and differential unit (D).By means of trial and error method, the better parameter control quantity of linear combination is obtained, and the controlled object is simulated.The schematic diagram of the simulated PID system is shown in Figure 3.The system consists of simulated PID controller and controlled object.
PID controller is a dominant controller, When the PID controller forms a deviation according to the given value r(t) and the actual output value y(t): e(t) = r(t) − y(t).The method is to combine the deviation of P, I and D linearly, and finally input the operation result as feedback to the controlled object for control.The PID control principle diagram is shown in Figure 3.The control rule of PID controller is as follows:

Integral
Or it can be written as a transfer function: here e(t) = r(t) − y(t), K p is the scaling coefficient, T i is the integral time constant, T d is the differential time constant, According to different controlled objects, the three parameters K p , K i , K d can be properly adjusted, so that the whole control system can get good performance.The motion state of AUV can be adjusted by adjusting the parameters.Due to the complex underwater environment and the influence of water flow, the movement of the AUV is subject to various disturbances, so the unit step signal is taken as the input signal.
Heading angle is the direction indicated by the bow, and the navigation direction of the underwater vehicle on the horizontal plane can be controlled through the control of heading angle.When the AUV is interfered and deviates from the course, after the deviation is measured by the sensor, it can be controlled by PID controller to adjust the rudder angle so that the deviation value gradually returns to zero.The heading angle transfer function W ψ (s) obtained in the previous section is simulated by the Simulink module of MATLAB, which is shown in Figure 4.In PID control simulation of AUV, after unit step signal is input, output signal is obtained through PID controller and stepping motor to control the controlled object.Generally, the three parameters K p , K i , K d are adjusted and set by trial and error method.Finally, a set of relatively ideal adjustment parameters are obtained.K p = 8, K i = 0.01, K d = 12 are the parameters that obtain relatively ideal simulation results in this study.The response curve of the unit step input is shown in Figure 5. Trim angle is the angle at which the waterplane of a ship is intersecting with the waterplane after trim.The motion attitude of an underwater vehicle on the vertical plane can be adjusted by controlling trim angle.When the AUV deviates from the setting range of pitch angle when disturbed in the process of ascending or descending, the deviation can be measured by the sensor, and then the AUV can be controlled by PID controller to drive safely.The transfer function W θ (s) of the caster angle obtained in the previous section was simulated by Simulink module of MATLAB, which is shown in Figure 6.In PID control simulation of AUV, after unit step signal is input, output signal is obtained through PID controller and stepping motor to control the controlled object.Generally, the three parameters K p , K i , K d are adjusted and set by trial and error method.Finally, a set of relatively ideal adjustment parameters are obtained.K p = 5, K i = 0.01, K d = 6 are the parameters that obtain relatively ideal simulation results in this study.The response curve of unit step input is shown in Figure 7.When AUV is working under water, it usually needs to fix depth for easy operation.However, due to the disturbance of the fluid, some disturbances will reduce the working state and efficiency of the
AUV.Therefore, the depth control of PID is needed to adjust the deflection angle of the AUV, so as to achieve the control requirement of hovering in the water.From the depth transfer function W ζ (s) that has been obtained in the previous section, it is then simulated by the Simulink module of MATLAB, which is shown in Figure 8.In PID control simulation of AUV, after unit step signal is input, output signal is obtained through PID controller and stepping motor to control the controlled object.K p , K i , K d are usually adjusted and adjusted by trial and error method.Finally, a group of ideal adjustment parameters are obtained.K p = 0.275, K i = 0.001, K d = 0.225 are the parameters that obtain the ideal simulation results in this study.The response curve of unit step input is shown in Figure 9.In the simulation above, step response is adopted as input in order to conform to the situation and adapt to the situation where the controlled carrier works in complex under waters or in an environment where ocean currents are disturbed.When adjusting three PID coefficients by trial and error method, firstly, the proportional coefficient is generally adjusted when the differential coefficient is set to 0. According to the actual situation of response curve, if the oscillation is frequent, the proportional coefficient should be appropriately increased; if the overshooting is too large, the proportional coefficient should be appropriately reduced.Then adjusting the integral coefficient, which usually has a small influence degree.One can set a small initial value, gradually increasing, and then reducing to a stable level when the system is shaken.Finally, the differential adjustment is made to increase the differential coefficient, and the other two coefficients are adjusted accordingly.The simulation results with smooth effect are obtained step by step.Adjust the other two coefficients accordingly, and try to get it together step by step until a stable and good simulation result is obtained.
According to the above PID controller simulation results, it can be seen that the system has certain overshoot and there is a small steady-state error.However, the control effect of heading angle and trim angle is more stable than that of depth and the overshoot is less.

Fuzzy adaptive PID Control
In this section, the fuzzy adaptive PID is designed, and the design principle of the controller and fuzzy rules are given.The fuzzy method can be introduced in this study.In the traditional control field, the most important factor affecting the quality of control system is the dynamic mode of control system.The more detailed the system dynamic information is, the more accurate the control system is.Of course, in a complex environment with too many uncertain variables, the nonlinearity increases and system modeling becomes very difficult.However, the work requirements of AUV often need to adapt to the ocean with complex ocean currents, in order to make it still have good working efficiency in complex underwater environments.
Fuzzy control can simplify the complexity of the system, and has strong robustness and excellent anti-interference ability.Fuzzy control is a kind of computer intelligent control based on fuzzy combination theory, fuzzy control language variables and fuzzy logic reasoning.The basic idea is to use fuzzy set theory to quantify the control experience of human experts on a specific object, and convert it into a controller that can be realized through mathematics, so as to realize the control of the controlled object.The main flow of fuzzy control is shown in Figure 10.
The core part of fuzzy control is fuzzy controller, which consists of four basic parts: fuzzy, knowledge base, fuzzy reasoning and anti-fuzzy.The general structure is shown in Figure 11.
According to the PID simulation results of this study, it can be seen that the system has certain overshoot, small steady-state error and non-negligible disadvantages.We need to make some breakthroughs while retaining the traditional advantages.Fuzzy control is the product of the combination of fuzzy mathematical algorithm and control theory.Without obtaining accurate mathematical model, the control system can still be stable and reliable under nonlinear and complex variables.But in the control process, due to the fact of the integral term, the control effect is easy to  of experts is not easy to be described in the control process and the input is difficult to be expressed quantitatively, fuzzy control is adopted to realize the optimal adjustment of PID parameters.Fuzzy variables are programmed with fuzzy input values, and membership parameters are determined to determine the membership of fuzzy variables in the fuzzy domain, and fuzzy reasoning is carried out according to human experimental experience and intuitive thinking.Through these few steps, we can achieve fuzzy output and perform anti-fuzzification to obtain a clear output.Finally, the real-time self-adjustment of the three parameters of the PID controller is realized, and finally get the appropriate parameter values, so that the system can achieve the best response.The algorithm program flow is shown in Figure 13.

Modeling and simulation of AUV with fuzzy adaptive PID control
In this section, the simulation block diagram of simulink is presented and the performance of fuzzy adaptive PID control is verified by simulation.In order to facilitate the comparison with the PID control simulation results, firstly, a fuzzy adaptive PID controller needs to be established.
According to the previous experiences, the fuzzy vector is divided into seven grades (NB, NM, NS, ZE, PS, PM, PB).One determines the three parameters of input variables e, ec and output variables K p , K i , K d , taking the field of input variables e and ec as [−3, 3], the field of K p is [−0.3, 0.3], the field of K i is [−0.06,0.06] and the field of K d is [−0.03,0.03], which are shown in Figure 14.Next, the membership function will be determined.In this study, language variables (NB) is used Z-type functions, (PB) is used S-type functions, and other language variables are used trigonometric functions, respectively.
Then, the fuzzy rules are made, and the language variables of the preceding item and conclusion are made in the rule editor through the control rule table summarized by researchers and skilled operators, and then 49 fuzzy statements are automatically generated, as shown in Figure 15.Based on the Fuzzy adaptive control method of the previous part, combined with the AUV heading angle of the kinematics of the transfer function control model, a good heading angle of the fuzzy adaptive PID simulation module is established in the Matlab/Simulink.The FIS files of Fuzzy controller are added to the Fuzzy module, and connect each module to form a complete AUV control structure.The direction of AUV can be controlled by the control of heading angle.When the AUV is interfered and deviates from the course, after the deviation is measured by the sensor, it can be controlled by the fuzzy adaptive PID controller to adjust the rudder angle so that the deviation value gradually returns to zero.After continuous debugging of the system, AUV system simulation can be carried out, whichi is shown in Figure 16.Here, K p = 8, K i = 0.01, K d = 12.
The comparative analysis results of the two control methods on the performance of heading angle control of AUV are shown in Figure 17.The blue line is PID control and the red line is fuzzy adaptive PID control.As in the previous section, a fuzzy adaptive PID simulation module for heading angle of AUV is established with the Matlab/Simulink tool, the FIS file of the Fuzzy controller designed in the previous section is added to the Fuzzy module, and each module is connected to form a completed AUV control structure.The motion attitude of AUV in vertical plane can be adjusted by controlling the angle of pitch.When the AUV deviates from the setting range of pitch angle when disturbed in the process of ascending or descending, the deviation can be measured by the sensor, and then the AUV can be controlled by the fuzzy adaptive PID controller to drive safely.After continuous debugging of the system, system simulation can be carried out, which is shown in Figure 18.Here, K p = 5, K i = 0.01, K d = 6.
The comparison and analysis results of the two control methods of AUV are shown in Figure 19.The blue line is PID control and the red line is fuzzy adaptive PID control.Based on the Fuzzy adaptive control method in the previous section, combined with the AUV heading angle of the kinematics of the transfer function control model, a good heading angle of the fuzzy adaptive PID simulation module is established with the Matlab/Simulink tool.The FIS files of the designed Fuzzy controller are added to the Fuzzy module, and connecting each module to form a completed AUV control structure.Depth control can make the AUV work underwater hovering, the AUV working in a good condition, but often due to the interference of fluid, will produce some disturbance makes the working state of the AUV and the work efficiency is reduced, so need through the depth of the fuzzy adaptive PID control to adjust the deflection angle of AUV, which meet the control requirements to achieve the water hover state.After continuous debugging of the system, the system simulation can be carried out, which is shown in Figure 20.
The comparative analysis results of the two control methods on the performance of depth control are shown in Figure 21.The blue line is PID control and the red line is fuzzy adaptive PID control.The fuzzy adaptive PID control has the advantages of PID control, and on the basis of the realization of motion control over time, the control system is stable, the curve is smoother, the overshooting is smaller, the fluctuation is smaller, the system is stable, with better control effect.

Comparative analysis of basic and IGAs on AUV
In this section, the improved genetic algorithm is used to complete the path planning of AUV and the simulation verification is carried out.The flow chart of the IGA on AUV is shown in Figure 22, where the termination condition is to reach the maximum number of iterations.
According to the previous study on AUV, different parameters are set according to the control variable method, and the influence of each parameter on the planning result is analyzed.After comprehensive comparison, the initial population is set to 100, the path length weight is 80, the path smoothness weight is 20, the crossover probability is 0.8, the mutation probability is 0.1, the initial temperature is 50, the cooling rate is 0.9, and the maximum number of iterations is 200 .
In modeling and simulation, the basic genetic algorithm and the IGA are respectively simulated for path optimization of AUV.The path optimization results are shown in the figures of this study.Comparing Figures 23 and 24, we can see that the optimal path planned by the IGA is smoother and shorter than the basic genetic algorithm.It can be seen from Figures 25 and 26 that the average fitness curve of the basic genetic algorithm has a local optimum in the solution process, that is, at the 35th iteration, the population individuals of the basic genetic algorithm fall into the local optimum, and no more searching for the optimal solution.Therefore, the average fitness curve of the IGA is obviously better than that of the basic genetic algorithm.
For the specific path length, we can observe from Figures 27 and 28.The basic genetic algorithm has about 125 iterations, and the shortest path obtained in the population is 40.3848; while the IGA is iterated about 20 times, and the shortest path obtained in the population is 31.0779.Therefore, the IGA in this study can not only speed up the convergence speed, but also the planned path more in line with actual requirements.Since the design of the fitness function is basically obtained by the weighted summation of the reciprocal of the path length and the reciprocal of the path smoothness, the weighting coefficient of the path length is 80, and the weighting coefficient of the path smoothness is 20.That is to say, the importance of path length in the evaluation index is much higher than the path smoothness, so the degree of fitness is approximately inversely proportional to the path length.The path length convergence curve obtained by comparing the two algorithms is similar to the average fitness convergence.The path length convergence curve of the basic genetic algorithm showed a local optimum in the solution process, that is, at the 35th iteration, the population individuals of the basic genetic algorithm fall into the local optimum, and then it converges again around 125 iterations.The shortest path obtained by the basic genetic algorithm is 40.3848.In the IGA of this study, the path length converges to the minimum at about 20 iterations, which is 31.0779.
Through the above comparison, we can find that the planning results of the IGA are better than the basic genetic algorithm.The IGA not only calculates a shorter path than the basic genetic algorithm, but also converges faster than the basic genetic algorithm.In the planning process, it will not fall into the local optimum, which effectively solves this problem of the basic genetic algorithm.So the idea of simulated annealing into the genetic algorithm to improve the genetic algorithm is feasible.

Conclusions
In this study, the AUV is taken as the research object, a large number of research is conducted on the motion attitude control technology of the AUV, and the space force combined with parameter estimation is analyzed to establish the space kinematics equation.Due to the nonlinearity of the AUV motion control system and the disturbance of the surrounding environment, PID and fuzzy technology are studied, and a kind of fuzzy adaptive PID control technology of AUV is proposed, which can realize motion control.The design of the fuzzy adaptive PID controller does not have a complete set of systematic methods.The fuzzy adaptive PID rule table is also derived from the experience of predecessors, and the selection and debugging of many parameters are based on experience.According to the analysis of the results of the simulation verification, the IGA solves the problem that the basic genetic algorithm falls into the local optimum when it converges.It not only speeds up the convergence speed, but also has better planned path results.At the same time, this study introduces path length and smoothness indexes into the fitness function, the optimal path planned is more convenient and suitable for actual AUV navigation.
Due to the lack of experience and the lack of mature concepts, there is still a little gap with the level of experts.Our future work will be carried out from the following aspects: 1) improve the fuzzy rules and fuzzy adaptive PID controllers, update the simulation system.2) take into account the problem of environmental disturbance.3) Build the actual AUV platform and verify the relevant theories.

Figure 1 .
Figure 1.The AUV for hardware assembly and system debugging in the laboratory.

Figure 2 .
Figure 2. The moving and fixed coordinates systems.

Figure 5 .
Figure 5. Simulation results of PID control of heading angle.

Figure 7 .
Figure 7. Simulation results of PID control of trim angle.

Figure 17 .
Figure 17.Comparison curve of bow angle PID control and fuzzy adaptive PID control.

Figure 19 .
Figure 19.The comparison curve of pitch PID control and fuzzy adaptive PID control.

Figure 21 .
Figure 21.Contrast curve between depth PID control and fuzzy adaptive PID control of AUV.
Figures  23 and 24  are the path diagrams generated by the basic and IGA for path optimization simulation of AUV respectively.Figures 25 and 26 are the optimization curves of the average fitness of the basic and IGA for path optimization simulation of AUV respectively.Figures 27 and 28 are the convergence curves of the average path length and the optimal path length when the basic and IGAs are used for path optimization simulation of AUV.

Figure 22 .
Figure 22.Flow chart of IGA on AUV.

Figure 23 .
Figure 23.Movement trajectory of basic genetic algorithm path optimization.

Figure 25 .
Figure 25.Average fitness curve of basic genetic algorithm path optimization.

Figure 26 .
Figure 26.Average fitness curve of IGA path optimization.

Figure 27 .
Figure 27.Path length curve of basic genetic algorithm path optimization.

Figure 28 .
Figure 28.Path length curve of IGA path optimization.

Table 2 .
Structural parameters and motion parameters of underwater AUV.

Table 3 .
Fuzzy control rule table of parameters K p .

Table 4 .
Fuzzy control rule table of parameters K i .knowledge of engineering designers, establish appropriate fuzzy rule table, and get the fuzzy control table for parametersK p , K i , K d respectively.The fuzzy rule tables of the three parameters K p , K i , K d are shown in Tables3-5, respectively.

Table 5 .
Fuzzy control rule table of parameters K d .