3DOF Adaptive Line-Of-Sight Based Proportional Guidance Law for Path Following of AUV in the Presence of Ocean Currents

: In order to achieve high-precision path following of autonomous underwater vehicle (AUV) in the horizontal plane, a three degrees-of-freedom adaptive line-of-sight based proportional (3DOFAPLOS) guidance law is proposed. Firstly, the path point coordinate system is introduced, which is suitable for the conversion of an arbitrary path. Then, the appropriate look-ahead distance is obtained by an improved adaptive line-of-sight (ALOS) according to three degrees-of-freedom (3DOF), including the cross-track error, the curvature of reference path, and the forward speed. Moreover, combining three degrees-of-freedom ALOS (3DOFALOS) with proportional guidance law, the desired heading is calculated considering the drift angle. 3DOFAPLOS has two functions: in the convergence stage, 3DOFALOS plays a leading role, making AUV converge to the path more quickly and smoothly. In the guidance stage, proportional guidance law plays a major role in effectively resisting the influence of drift angle and making AUV sail along the reference path. If the path is curved, 3DOFALOS makes contributions in both stages, adjusting look-ahead distance in real time with respect to curvature. The stability of the designed closed system is proved by Lyapunov theory. Both simulation and experiment results have verified that 3DOFAPLOS has a satisfactory result, which improves tracking performance more than 50% compared with the traditional line-of-sight (LOS). Specifically, the mean average error (MAE) of path following under 3DOFAPLOS can be reduced by about 60%, and the root mean square error (RMSE) can be reduced by about 50% compared with LOS.


Introduction
AUV is a kind of marine equipment that plays a major role to improve the human life, such as marine environment exploration, marine resource monitoring, pelagic survey, seabed resource exploitation, military mission, and so forth [1][2][3]. It is increasingly becoming a hot topic for research in the world. Limited by its own energy consumption and endurance, AUV is mostly used to carry sensors for ocean exploration. The research object of this paper is an underactuated AUV, and, based on the analysis, the horizontal planar motion model is established by hypothesis and simplification.
For now, three different types of control technologies play a crucial role in the development of AUVs: set-point control, trajectory tracking control and path following control [4]. Set-point control enables AUV to reach the target point as a desired attitude without any requirements for the path. Trajectory tracking control enables AUV to track the time parameterized reference path. Path following control enables AUV to converge and follow the desired path without any time specification. The motion control system of AUV is susceptible to external disturbances. Obviously, path following control is more robust and more practical. Morten presents that path following is the most basic function of autonomous navigation [5], and the research problem of this paper is path following of AUV.
In recent years, many path following control methods have been well verified in theory, such as fuzzy control [6,7], backstepping control [8,9], sliding mode control [10,11], etc., [12,13]. Specifically, an adaptive fuzzy control method is presented to stabilize the underactuated surface vessel (USV) to the desired position [14]. However, the fuzzy method can not adapt to the change of a controlled object and has poor robustness. An adaptive nonlinear second order sliding mode controller is designed in [15], and a lake experiment verified the effect of the method under linear tracking. However, it does not apply to curve tracking. Backstepping is mostly used for three-dimensional path following, and its control law is usually characterized by multiple parameters adjustment. Considering the complexity of the whole control system of AUV in practical application, the simple design of the control law with less parameters adjusting is more suitable. LOS guidance for underactuated ship path following is presented in [16], which is often used in a way-point ship control practice. Now, the most classic and stable method of path following is LOS guidance law combined with heading controller, which has been verified in practice and applied to the path following of AUV, remotely operated vehicle (ROV), USV and other intelligent machines. The guidance law aims at calculating the desired heading. The control law is introduced to make the current heading reach the desired heading. Hence, the effect of path following is closely related to the guidance law and the control law [17], especially the former. The reason is that this special guidance law exploits the geometry relationships to generate a yaw angle known as the approaching angle, which is fed into the control system. In other words, the control system tracks the reference yaw angle signal together with the specified velocity tracking [18]. In this paper, the path following controller of AUV is designed based on the classical LOS, which aims at realizing precise tracking of arbitrary curves.
The remainder of this paper is organized as follows: Section 2 concludes the literature review, introduces the methods in the paper and presents the contributions. In Section 3, the model of AUV is given. Section 4 introduces the problem statement and some preliminaries. In Section 5, the designed guidance law and the controller are deduced. At the same time, the stability analysis is given by a Lyapunov theorem. In Section 6, simulations and experiments validate the previous analyses of the method. Section 7 summarizes the conclusions of this work.

Literature Review
An overview of LOS guidance principles for marine craft is offered in [19]. Path following is usually divided into two stages by the cross-track error: convergence and guidance. In convergence, the look-ahead distance is so important that it affects the tracking performance. Large look-ahead distance reduces overshoot and results in smooth, but slow convergence. Small look-ahead distance corresponds to fast convergence to the path, but with a large overshoot [20]. An ALOS method considering a lateral error to solve the above problems is derived in [21,22]. Simulation results show the effectiveness of this method, so that it is widely used in the research of path following. In addition, there is a strong correlation between the curvature of the desired path and the look-ahead distance if the reference path is curve. The comparisons between look-ahead and lateral error is summarized in [23], and guidelines for more accurate vehicle operations are provided for curve path. However, there is no specific formula for the relationship between look-ahead distance and curvature. Furthermore, the reference path cannot be followed by an underactuated AUV subjected to the effect of a sideslip angle [24]. To solve this problem, scholars have devoted many efforts to the field in recent years. The integral LOS (ILOS) is presented in [25,26] to counteract the disturbance of ocean currents by using an integral, which may cause the reduced stability margin due to phase lag. A proportional LOS (PLOS) considering the effect of drift angle is presented in [27,28]. The path tracking deviation under PLOS has been significantly improved. A novel extended state observer-based LOS (ESO-LOS) is presented in [29] to estimate the drift angle, which also has obvious improvements with complicated parameters. A model predictive control scheme with LOS (MPCLOS) is proposed in [30] to formulate the path generation capability and has a good tracking performance. These control methods have been theoretically verified; however, they are rarely used to test their reliability in practical. Therefore, the actual path following performance of these methods is not clear.
On the premise of feasibility and parameter simplicity, this manuscript presents a 3DOFALOS guidance method. The adaptive method mainly considers three degrees of freedom: the cross-track error, the curvature of reference path and the forward speed of AUV. The real-time look-ahead distance is obtained under the established rules. Then, a proportional guidance method related to drift angle is designed to obtain the desired heading. Finally, the fractional order proportion integration differentiation (FOPID) controller is introduced to realize the heading control. Simulation results show the feasibility and effectiveness of the proposed method. Furthermore, the AUV's path following performance is greatly improved in practical applications. The major contributions of the paper are as follows: • Firstly, the appropriate rules are deduced, i.e., the larger the cross-track error, the smaller the look-ahead distance. The larger the curvature, the smaller the look-ahead distance. The smaller the forward speed, the smaller the look-ahead distance. In addition, the specific relationship between these 3DOF (the cross-track error, the path curvature and the forward speed) and the look-ahead is introduced in detail. The change of the intensity of look-ahead distance under three degrees of freedom is depicted in a four-dimensional graph. • Secondly, the proportional guidance method is derived in detail to eliminate the influence of drift angle on path following, which makes the resultant speed of AUV on the desired path. Hence, the 3DOF adaptive proportional guidance method is constructed based on the above methods.
Lyapunov theory proves the stability of the proposed closed-loop system. • Finally, FOPID is employed as a heading controller to realize heading tracking. Several simulation cases are designed to compare the tracking performance of the proposed method on the straight line path and curve path under the disturbance of ocean currents. The application ability of the new method is also proved in the practical experiments.

Establishing Coordinate System
Two coordinate systems based on ITTC (International Towing Tank Conference, 1932) are introduced to conveniently describe various motion parameters, as shown in Figure 1. One is the earth-fixed coordinate system {I}: (E-ξηζ) with origin E fixed to the earth. The other is the body-fixed coordinate system {B}: (O-xyz) with origin O fixed to AUV, which is a moving reference frame [31]. The six degrees of freedom of AUV general motion can be summarized in Table 1. Due to the low speed motion of AUV, earth's motion could be neglected. Therefore, a point on the surface of the earth can be assumed to be fixed and applied as the center of the earth-fixed coordinate system [32]. In the earth-fixed coordinate, let (x G , y G , z G ) describe the AUV's center of gravity, and (φ, θ, ψ) represent the orientation. In the body-fixed coordinate, let V = [u, v, w, p, q, r] T be the linear velocity and angular velocity, and τ = [X, Y, Z, K, M, N] T be the total forces and torque acting on AUV.

Vector
x-Axis y-Axis z-Axis

Dynamic Model of AUV
Assuming that the origin of the body-fixed coordinate system coincides with the center of gravity of AUV, the rigid body dynamics theory is analyzed. The six degrees of freedom of AUV are described as Equation (1) [33]: where: m = Mass of AUV; I x ,I y ,I z = Rotational inertia of AUV mass; u,v,ẇ,ṗ,q,ṙ = Acceleration and angular acceleration. The equations can be written in matrix form as Equation (2), if moving the inertial hydrodynamic forces to the left side of Equation (1), and the rest to the right side. F vis is the hydrodynamic force (or the resistance force) generated by the vehicle movement in the fluid. F else is the external force, such as the rudder force, propulsion force, gravity and buoyancy, etc. where where Xu, Yv, Yṗ, Yṙ, Yṗ, Kṗ, Kṙ, Zq, Mq, Kṙ, Nṙ -hydrodynamic coefficients; X = [u, v, w, p, q, r] T . AUV operates in three dimensions. However, it is quite common to assume that altitude/depth is controlled independently such that the path-following objective is limited to motion control in the horizontal plane [21]. Hence, the horizontal equation of motion is generalized in Equation (5): In the consideration of unknown disturbances, the dynamics of AUV will be affected by the ambient environment, such as ocean current, temperature, salinity and density of sea water, etc. However, in the area of 0-100 m below sea level, the seawater is approximately a homogeneous mixing layer [34]. The influence of temperature, salinity and density of sea water on the heading of AUV can be neglected, while only the ocean current should be taken into consideration. Suppose that ocean currents are parallel to the horizontal plane of the earth-fixed coordinate system [31], U c is the current velocity of irrotational fluid, and δ is the angle of current. The velocity vector of AUV is notified in Equation (6). After time derivation, the corresponding acceleration can be written in Equation (7): Considering the ocean current, the linear angular velocity V and its derivationV can be written as Equation (8):

Problem Statement
For the existing LOS method solving the path following problem, there are two limitations. Firstly, the look-ahead distance considered is usually time-invariant, which is poorly adapted to changes in external conditions, especially changes in path form. Secondly, the drift angle of AUV during navigation will cause the heading of AUV to be inconsistent with the course of AUV, that is, the direction of forward speed is inconsistent with the direction of combined velocity, which leads to deviations from the desired path.
In this paper, an improved ALOS is designed. Three main factors are considered to make look-ahead distance more adaptive. The look-ahead is adjusted according to the cross-track error and path curvature, and the change speed of look-ahead is determined according to the speed of AUV. The adaptive look-ahead allows AUV to converge quickly if it deviates from the path, and accurately guides AUV to sail along the path, whether the path is a straight line or a curve. Due to the presence of the time-varying drift angle, the deviations problem should be solved. However, the drift angle generated from the sway speed, such as ocean currents or AUV itself, can not be eliminated. In this paper, a modified guidance law with an extra proportional term according to drift angle is employed, so that the direction of combined velocity of AUV is consistent with the desired path. The essence is to reduce the effect of drift angle, rather than eliminate drift angle itself. Some preliminaries are explained here. In order to study any curve tracking between path points, the path point coordinate system and Serret-Frenet (SF) coordinate system are introduced, as shown in Figure 2, which makes the guidance method have the versatility for path following of straight lines or curves. There are two path points: A(X1, Y1) and B(X2, Y2). Firstly, taking A as the origin and AB as the x-axis to establish the path point coordinate system (x o y ), any point on the given curve f ( * ) can be conveniently represented. Let point P(x, y) express the current position of AUV in earth-fixed coordinates. Transformation matrix κ(α) is employed to know P in path point coordinates by Equation (9), i.e., the target point P (x , y ) on the desired path can be calculated: Figure 2. Path following error model.
where α = tan −1 ((Y2 − Y1)/(X2 − X1)) is the rotation angle of transformation matrix, which is defined as the angle between the x-axis (o x ) of the path point coordinate system and the x-axis (ox) of the world coordinate system. Then, the desired position T (x T , y T ) in the path point coordinate system can be obtained by the converted coordinates because of x T = x and y T = f (x T ). Finally, T can be converted to the world coordinate system by Equation (10): The SF coordinate system (x SF o SF y SF ) is established at point T. γ T is the rotation angle between the x-axis (o SF x SF ) of the SF coordinate system and the x-axis (o x ) of the path point coordinate system. Consequently, the along-track error x e and the cross-track error y e for a given position (x, y) are calculated by Equation (11): where Expanding Equation (11): The projection of (x, y) on the path is employed to be (x T , y T ); hence, x e = 0. Time differentiation of the cross-track error y e is given by Equation (14): The position and attitude vectors of AUV in {I} are denoted by [x, y, ψ] T . ψ is the current heading of AUV. The kinematics equation can be expressed as Equation (15): Therefore, Equation (15) can be written as: The amplitude-phase form of Equation (16) is: where β = arctan (v/u) is the drift angle of AUV. U = √ v 2 + u 2 is the magnitude of the velocity vector. Then, consider Equation (17) in the following form: In fact, the slide angle is small, and cos β ≈ 1 and sin β ≈ β. Equation (18) can be simplified to:

Path Following Control Design
The control law is mainly divided into three parts: 3DOFAPLOS guidance law, heading controller and speed controller. Firstly, 3DOFAPLOS guidance is used to determine the desired heading of AUV considering drift angle. Then, by combining the FOPID heading controller, the error between the current heading and the desired heading can be reduced. The system block diagram of path following is depicted as Figure 3. As shown in Figure 3, 3DOFAPLOS guidance is the basis of the path following system to determine the desired heading of AUV. Four inputs need to be known, including forward speed, cross-track error, curvature of path and slide angle. The speed controller based on proportion integration differentiation (PID) requires two inputs, including mission speed and current forward speed, and has an output propeller speed. The aim is to make forward speed achieve the desired mission speed by adjusting the propeller speed of AUV. Similarly, the heading controller based on FOPID requires two inputs, including desired heading and current heading, and has an output rudder angle. The purpose is to make the heading error between desired heading and current heading tend to zero.

3DOFAPLOS Guidance Law
Based on the path following error model, LOS guidance law is established to convert the desired path to reference heading angle. The look-ahead distance ∆ is taken on the x SF -axis, as indicated by the line TC between the target point T (x T , y T ) and the virtual point C (x C , y C ), as shown in Figure 4. In fact, the path following can be divided into two parts according to the cross-track error, the convergence stage (y e = 0) and the guidance stage (y e = 0), as shown in Figure 5. The convergence stage is mainly to pursue the rapidity and smoothness. The guidance stage is mainly to resist the influence of drift force. In the paper, a 3DOFAPLOS guidance law is proposed.
In particular, time-varying look-ahead distance is derived to perform a good convergence performance. Proportional guidance law is designed to perform a good anti-interference with respect to the drift angle.

3DOF Adaptive Look-Ahead Distance
The key of the LOS guidance law is to introduce the suitable look-ahead distance, which essentially determines the convergence performance of path following. The traditional method employed a constant look-ahead. However, the cross-track error continues to decrease when AUV is converging to the path. If look-ahead is not selected properly, constant look-ahead distance easily leads to some problems, such as oscillation or failure to converge. Lekkas and Fossen presented an adaptive look-ahead method Equation (20) considering the cross-track error in convergence stage, which improved the convergence performance [35]. On this basis, we hope to consider two other factors to make the look-ahead distance more adaptive: where ∆ ∈ (∆ min , ∆ max ). ∆ min and ∆ max denote the predetermined minimum and maximum values of the look-ahead distance, respectively, which are mainly decided by the sensitivity of AUV itself.

Assumption 1. The path curvature.
Suppose that the reference path is a curve path with different curvature. Compared with constant look-ahead distance, as shown in Figure 6a, smaller look-ahead distance is more suitable in large curvature, and larger look-ahead distance is more fit in small curvature, as shown in Figure 6b. The saturated function sat(·) is introduced to reduce the ∆ min and ∆ max , aiming at ∆ in smaller scope. The descending function is constructed to describe the relationship between look-ahead distance and curvature. The results are described in Equation (21).
where ∆ min and ∆ max denote the redetermined minimum and maximum values of the look-ahead distance with respect to the path curvature, respectively. Consequently, ∆ ∈ (∆ min , ∆ max ).
Curve tracking under ALOS and improved ALOS method are illustrated in Figure 7. Obviously, the path following performance based on the improved ALOS considering the real-time curvature of the path is better, especially where the curvature of path is large. Hence, the improved ALOS can be able to adjust the range of the look-ahead distance in real time based on the time-varying curvature of the path.

Assumption 2. The forward speed.
Suppose that AUV is converging to the reference path. The look-ahead distance presents an increasing trend. Compared with ALOS mentioned above, a change norm is developed. If AUV sails at a high forward speed, the look-ahead distance should be quickly increased corresponding to the weak adjustment, as shown in Figure 8a. If AUV sails at a low forward speed, the look-ahead distance should be slowly increased corresponding to the strong adjustment, as shown in Figure 8b. Therefore, function L (u) is introduced to provide different correction strength. u expresses the current forward speed of AUV. The inverse proportional function (L (u) = 1/u) is constructed to describe the relationship between look-ahead distance and the forward speed. The results are described in Equation (22). Suppose the adjustment range of the look-ahead distance is 10-15 m at a certain moment. The adjustment strategy at different speeds is shown in Figure 9. Note that, if the path is a straight line or has no curvature, ∆ min / max = ∆ min / max : 3DOFALOS is established as follows: where c max = 0. Just two inputs, ∆ min and ∆ max , are required to determine the range of look-ahead distance. Equation (23) is suitable for any curve tracking. If c max = 0, i.e., c ≡ 0, 3DOFALOS can be simplified to 2DOFALOS, as shown in Equation (24): In summary, 3DOFALOS considers three degrees of freedom, y e , c and u. Firstly, on the basis of ALOS only considering y e , this paper optimizes the range of ∆ by using c. If the reference path is curved, the improved ALOS makes ∆ selected in a smaller range (∆ min , ∆ max ). Then, additional factor u is considered to optimize ∆ to employ suitable adjustment strength. At high speed, the adjustment should be weakened. At low speed, the adjustment should be enhanced. Table 2 summarizes the comparison of ALOS and improved ALOS 3DOFALOS in this paper.  Figure 10 depicts the intensity of look-ahead distance under three degrees of freedom. The change of hue from cyanine to pink corresponds to the change of the intensity of look-ahead, i.e., from small to large. The evolution of look-ahead distance with the other two degrees of freedom under the interpolation of the constant curvature (c = 0.5 m −1 ), the constant cross-track error(y e = 0,10 m) and the constant forward speed (u = 0.5,1,1.5 m/s) are given, respectively. Significantly, when y e > 5 m, the look-ahead distance is generally small. The curvature and the forward speed have little effect on it. The main function of the look-ahead is convergence. When y e < 5 m, the look-ahead is greatly affected by curvature and speed. The main function of the look-ahead is guidance. When c < 0.3 m −1 , the look-ahead distance is generally large. When c > 0.3 m −1 , the look-ahead distance is generally small. The main function of the look-ahead is adaptive to the change of curvature. At different speeds, the trend of the look-ahead with the cross-track error and the curvature is similar, but the pace of change varies.

Proportional Guidance Law
The core of guidance law is to calculate the desired heading through the cross-track error and look-ahead distance. Tradition guidance law is given by Equation (25). LOS angle ψ los will guide the object until y e = 0. However, under unknown sea conditions, AUV is subjected to drift forces mainly caused by external disturbance so that nonzero drift angle β arises during path following. In order to handle ocean currents or any other environmental disturbance, a modified guidance law with an extra proportional term according to drift angle is proposed in the paper, as shown in Equation (26): where ∆ ∈ (∆ min , ∆ max ). χ is the extra proportional term with respect to the drift angle. Assume that the current heading tracks the desired heading perfectly, i.e., ψ = ψ los . Equation (26) can be deduced as Equation (27): Substituting Equation (27) into Equation (19) gets Equation (28): where β is well known according to u, v, i.e., β = arctan(v/u). Consequently, χ = ∆β is derived and is substituted into Equation (28):ẏ Hence, the proposed 3DOF adaptive proportional LOS guidance law can be expressed by Equation (30):

Stability Analysis
Based on above guidance law, the Lyapunov function is established as Equation (31): By differentiating Equation (31) with respect to time and using (29), the equation can be obtained as Equation (32) Consequently, a non-negative system known V y e is bounded by Lyapunov stability, and the system of path following is stable.

Fractional Order PID Controller
The heading controller of AUV is designed by the FOPID control method. Compared with conventional PID, the FOPID controller gives better performance owing to having extra two parameters. The transfer function can be written as Equation (33): where 0 ≤ λ, µ ≤ 1. λ and µ are the order of integral and differential controller, respectively. If λ = 1 and µ = 1, it is a PID controller. If λ = 1 and µ = 0, it is a PI controller. If λ = 0 and µ = 1, it is a PD controller [36], as shown in Figure 11. Therefore, the heading error between a desired heading obtained by guidance law and the current heading obtained by AHRS (Attitude and Heading Reference System) is taken as the input of an FOPID heading controllor. Then, by the linear combination calculation and adjustment of the proportion, integral and differential coefficients, the error of the heading is reduced. Finally, the system reaches a stable state to realize the heading control of AUV.

Simulation
Simulations of several different algorithms are conducted to prove the theoretical results proposed in this paper, including: conventional LOS (LOS), 3DOFALOS (ALOS), proportional LOS (PLOS) and 3DOFAPLOS (APLOS). The results and analysis are discussed as follows. Note that the predetermined range of look-ahead distance of ALOS and APLOS employs 8-15 m in the simulation. The look-ahead distance of LOS and PLOS employs 15 m in the simulation. The optimal range used for simulation of different AUV models varies slightly, depending on the dynamics of different models, etc.

Zig-Zag Path Following under Constant Ocean Currents
In the case study, we assume that the reference path is composed of two linked non-colinear straight lines, namely P = P 1 ∪ P 2 , where P 1 {y = x − 20, x ∈ [20, 120]} and P 2 y = − 2 3 x + 180, x ∈ [120, 270] . The velocity of ocean currents is a constant 0.5 m/s with the direction from south to north (0 • ). The desired forward speed is constant with u = 1.5 m/s. The initial conditions of AUV are [u, v, r, x, y, ψ] T = [1.5, 0, 0, 0, 0, 45 • ] T . The comparison diagrams are sketched in Figure 12 and Table 3.   Figure 12a shows the resulting motion of AUV. The red line is the trajectory of APLOS and the black dashed line is the reference. The blue arrow shows forty times the velocity of ocean currents (40U c ) every 12 s. From this plot, it can clearly be seen that ALOS and APLOS have a better convergence performance in the convergence stage, which proves the effectiveness of the ALOS method taking the cross-track error into consideration. Although ALOS converges to the reference path, it has some deviation in the guidance stage. This is because the combined motion of AUV deviates from the desired path because of drift angle. PLOS and APLOS are able to converge to the path and fit the path well in the guidance stage, but PLOS reaches the reference path slowly in the convergence stage, which also reflects the role of ALOS considering cross-track error. Under the ocean currents, APLOS has a better tracking effect than other methods. Figure 12b illustrates the trajectory deviation under four methods. Significantly, LOS (the yellow line) and ALOS (the blue line) are larger than PLOS (the pink line) and APLOS (the red line). Hence, it is necessary to consider the effect of drift angle. Compared with PLOS, the cross-track error of APLOS is first reduced to a stable value due to the adaptivity of look-ahead distance. Figure 12c presents the time evolution of look-ahead distance. LOS (the yellow line) and PLOS (the pink line) use a constant look-ahead 15m. ALOS (the blue line) and APLOS (the red line) use varied look-ahead distance in the convergence. In the guidance, the look-ahead of ALOS is smaller than APLOS because the cross-track error of ALOS is larger than APLOS, which reflects the effect of the proportional method on eliminating the influence of drift angle. Figure 12d gives the time history of velocity and drift angle. In four plots, the red line and the blue line are the forward speed and sway speed of AUV, respectively. The black line is the real-time drift angle. Obviously, the sway speed based on four methods in P 1 is different from P 2 . Combined Figure 12d with Figure 12a, PLOS and APLOS can resist the effects of drift angles, i.e., under the changing drift angle, both PLOS and APLOS can sail on the reference path without deviation. However, LOS and ALOS, without considering proportional guidance, deviate from the path as the drift angle changes. Figure 12e gives the performance of heading control. In four plots, the current heading is denoted by the blue line, and the desired heading is denoted by the red line. Clearly, the current heading of four methods track the desired heading well because they all use the same heading controller FOPID. Therefore, the final tracking performance mainly depends on the design of the guidance law. Table 3 shows that APLOS has the lowest MAE and RMSE, 1.1004 m and 2.5777, respectively. Therefore, the position data of APLOS are more continuous, more concentrated and closer to the expected value. Meanwhile, APLOS reduces the MAE by about 73.34% and the RMSE by 43% compared to the traditional LOS.
According to Figure 12 and Table 3, it can be concluded that, compared to LOS, ALOS and PLOS, APLOS can converge to the desired path faster and track it under the ocean currents.
Then, AUV's desired forward speed is set as 1 m/s and other conditions remain unchanged. The comparison diagrams are sketched in Figure 13 and Table 4. The resulting motion of AUV and the cross-track error are shown in Figure 13a,b respectively, and APLOS also tracks well along the reference path. Figure 13c presents the time evolution of look-ahead distance. The trend of the look-ahead of the four methods is similar to the first case. Figure 13d gives the time history of velocity and drift angle. Significantly, the sway velocity based on four methods in P 1 is different from P 2 . Figure 13e gives the performance of heading control, and they all use the same heading controller. Therefore, the performance of path following is closely related with the guidance law. Hence, it is same as the first case that APLOS has a better tracking effect than others. As shown in Table 4, APLOS has the lowest MAE and RMSE, 0.9359 m and 2.1517 m, respectively, and reduces the MAE by about 85.24% and the RMSE by 67.79% compared to LOS. The convergence speed and real-time drift angle of AUV will be affected by its forward speed. Table 5 provides the fluctuations of MAE and RMSE of the four methods after changing the speed. Compared with the first case and the second case, it is clear that the changing speed has little influence on tracking performance of APLOS, whose MAE is kept near 1 m and RMSE is kept near 2.3 m. In addition, the MAE and RMSE of PLOS also have small fluctuations because the convergence stage in the two cases provided only accounts for a small part of the whole tracking stage. AUV sails under ocean currents in simulation, and the drift angle affects the whole tracking process. Hence, the proportional guidance method considering the drift angle plays an important role in the stable tracking performance. However, the tracking performance of the other methods is greatly affected by speed, and MAE and RMSE fluctuate significantly. Therefore, it can be concluded that APLOS has the stable tracking performance considering the influence of speed and drift angle.

. Sinusoidal Path Following under Constant Ocean Currents
In the case study, we assume that the reference path is a sinusoidal path, the curvature is time-varying. The equation expression of path is P y = sin π 4 x+ cos π 4 · A sin 2π T x , T = 125 √ 2, A = T 4 , x ∈ [0, 400]}. The velocity of ocean currents is a constant 0.5 m/s with the direction from south to north (0 • ). The desired forward speed of AUV is constant with u = 1.5 m/s. The initial conditions of AUV are [u, v, r, x, y, ψ] T = [1.5, 0, 0, 0, 0, 45 • ] T . The comparison diagrams are sketched in Figure 14 and Table 6.   Figure 14a shows the resulting motion of AUV under four methods, LOS (the yellow line), PLOS (the pink line), ALOS (the blue line) and APLOS (the red line). The black dashed line denotes the reference path. The blue arrow shows forty times the velocity of ocean currents (40U c ) every 30 s. From this plot, it can clearly be seen that, when the path curvature varies greatly, ALOS has a better tracking performance than LOS, and APLOS has a better tracking performance than PLOS. In addition, the effectiveness of the adaptive method considering the path curvature is embodied. Furthermore, APLOS can reject the constant ocean currents compared with ALOS, which embody the effectiveness of the proportional guidance. Figure 14b illustrates the cross-track error of LOS (the yellow line) is larger than ALOS (the blue line) and PLOS (the pink line) is larger than APLOS (the red line), which also reflects the adaptive method considering curvature factor plays an important role. Compared with ALOS, the cross-track error of APLOS is smaller, which reflects the proportional method considering the fact that the drift angle plays a crucial role. Figure 14c presents the time evolution of look-ahead distance, including LOS (the yellow line), PLOS (the pink line), ALOS (the blue line) and APLOS (the red line). LOS and PLOS use a constant look-ahead 15 m. ALOS and APLOS use a varied look-ahead distance with respect to the curvature, and ALOS is mostly smaller than APLOS because the cross-track error of ALOS is larger than APLOS, which also reflects the role of a proportional method. Figure 14d gives the time history of velocity and drift angle. In four plots, the red line and the blue line are the forward speed and sway speed of AUV, respectively. The black line is the real-time drift angle. Clearly, the drift angle is time-varying with respect to the sway speed of AUV based on four methods changed with the current heading of AUV. Compared with Figure 14a, PLOS and APLOS can resist the effects of time-varying drift angles and make AUV track along the reference path. Figure 14e gives the heading control effect. In four plots, the current heading is denoted by the blue line, and the desired heading is denoted by the red line. Clearly, the final tracking performance mainly depends on the design of guidance law due to the similar heading control performance of the four methods.
As shown in Table 6, it is concluded that the MAE and RMSE of APLOS are the lowest 1.2980 m and 2.5612 m, respectively, reflecting the position of APLOS being closer to the reference path. Compared with LOS, APLOS improves the tracking performance, reducing MAE and RMSE by 79.84% and 68.72%, respectively. Hence, APLOS has a goodness of fit.
According to Figure 14 and Table 6, APLOS can sail along the curve path well under the ocean currents compared to LOS, ALOS and PLOS.

Experiment
The method proposed in this paper is validated on the Sailfish AUV-a kind of torpedo underwater vehicle independently developed at the Underwater Vehicle Lab of the Ocean University of China, as shown in Figure 15. Its displacement is 260 Kg. It measures 3.60 m in length, 0.324 m in diameter. A detailed set of experiments is carried out in the Yellow Sea of China to prove the performance of this algorithm, as shown in Figure 16. After the appropriate motion control parameters adjustment, 3DOFAPLOS and the conventional LOS experiment are tested, which is used to confirm the performance improvement relative to LOS. The experimental data are analyzed by graphs and tables as follows. The predetermined range of look-ahead distance of APLOS uses 8-15 m, and the look-ahead distance of LOS uses 15 m.

Path Following for a Lawnmower
Set the reference path as a lawnmower shown by the black dotted line in Figure 17a, which is converted to Universal Transverse Mercator (UTM) coordinates during data processing, and (0,0) is the first path point. Set the desired speed of AUV as 1 m/s. The comparison of performance indicators (trajectory, cross-track error, look-ahead distance, compensation and heading performance) is shown in Figure 17. Table 7 tabulates the MAE and RMSE of two methods.   Figure 17a shows the resulting motion of AUV. The red line is the trajectory of APLOS, the blue line is LOS and the black dashed line is the reference path. From this plot, it can be clearly seen that APLOS has a better tracking performance than LOS. Especially at the apex, LOS with constant look-ahead distance has a serious overshoot. APLOS with time-varying look-ahead distance fits turning well. In addition, APLOS based AUV sails along the desired path with smaller deviations compared with LOS. Figure 17b illustrates the comparison of cross-track error. The red line denotes APLOS and the blue line denotes LOS. Note that, after determining that AUV has reached the receiving circle, AUV is ready to follow another path. Hence, when the cross-track error suddenly increases, AUV converges to the path of the new direction. Clearly, compared with LOS, the cross-track error of APLOS is not only reduced faster, but also smaller in size. Hence, it is feasible to consider the cross-track error in the tracking process. Figure 17c presents the time evolution of look-ahead distance. The red line denotes APLOS and the blue line denotes LOS. LOS uses a constant look-ahead 15 m in both the convergence and guidance stage. APLOS uses a varied look-ahead distance between the determined range. Figure 17d gives the time history of velocity and drift angle. In four plots, the pink line and the black line are the forward speed and sway speed of AUV, respectively. The blue line is the real-time drift angle. Combining Figure 17d with Figure 17a, in practical application, APLOS makes the AUV fit the path well, while LOS based AUV is affected by drift angle and has obvious deviation from the path. Therefore, APLOS can resist the effects of drift angles. Figure 17e gives the performance of heading control. In four plots, the current heading is denoted by the blue line, and the desired heading is denoted by the red line. Significantly, the current heading of four methods track the desired heading well because they all use the same heading controller FOPID. Therefore, the final tracking performance mainly depends on the design of guidance law.
In Table 7, whether MAE or RMSE, the path following performance of APLOS is greatly improved compared with LOS. The MAE and the RMSE reduce to 1.4683 m and 2.4597 m, improving 54.46% and 39.90%, respectively.
Then, AUV's desired speed is adjusted to 1.5 m/s. The first path point of reference path is (0,0), and the initial position of AUV is about (−10,0). The comparisons are sketched in Figure 18 and Table 8.  Figure 18a shows the resulting motion of AUV. The red line and the blue line denote the trajectory of APLOS and LOS, respectively. The black dashed line denotes the reference path. Note that AUV starts as a convergence stage because the initial position is not near the first point. It is apparent that the convergence effect is better under the APLOS algorithm. At the apex, LOS with constant look-ahead distance has a serious overshoot, which is similar to the first experiment. Due to the increased speed, APLOS with a time-varying look-ahead distance also has a slight overshoot compared with the first experiment. However, the tracking performance of APLOS is still better than LOS. Furthermore, APLOS based AUV sails along the desired path with small deviations considering drift angle. Figure 18b illustrates the comparison of cross-track error under two methods. APLOS is denoted by the red line and LOS is denoted by the blue line. The comparison further illustrates the cross-track error of APLOS is mostly smaller than LOS. Therefore, the adaptive method and proportional guidance method significantly improve the path tracking performance and greatly reduce the cross-track error.   Figure 18d gives the time history of the forward speed (the pink line), the sway speed (the black line) and the drift angle (the black line). It is obvious that the drift angle of AUV is time-varying. Combining Figure 18d with Figure 18a, APLOS can resist the effects of drift angles. However, because of drift angle, the resultant motion of LOS based AUV is not coincident with the desired course so that it deviates from the desired path. It is necessary to consider the drift angle.
LOS and APLOS both have good heading control performance, as shown in Figure 18e. The current heading denoted by the blue line fits the desired heading denoted by the red line well. Therefore, the final tracking performance mainly depends on the guidance law. Table 8 summarizes the related indicators. The MAE and RMSE of APLOS are 1.7838 m and 2.7833 m, reduced by 32% and 20%, respectively. Hence, compared with conventional LOS, APLOS has improved a lot under ocean currents. Table 9 provides the fluctuations of MAE and RMSE of two methods after increasing speed. It is clear that the fluctuation of APLOS is smaller than LOS. Hence, under the adaptive and proportional method, the path following performance of AUV is more stable for different speeds of AUV. The two experiments illustrate that APLOS offers the great tracking performance. In the convergence stage, APLOS automatically adjusts the look-ahead distance by time-varying cross-track error and speed. AUV converges to the path faster and more stably. In the guidance stage, APLOS reflects the role of a proportional method considering drift angle, which fits the reference path better compared with LOS.

Path Following for Sinusoidal
A sinusoidal tracking experiment is conducted to compare the curve path following performance based on LOS and APLOS. Set two path points to determine the sinusoidal path denoted by the black dotted line, as shown in Figure 19a. Set the forward speed of AUV as 1 m/s, and the initial position of AUV is near the first path point (−50, 0). The comparison of performance indicators (trajectory, cross-track error, look-ahead distance, compensation and heading performance) are shown in Figure 19. Table 10 tabulates the MAE and RMSE of two methods.  Figure 19a shows the resulting motion of AUV. The trajectory of APLOS and LOS are denoted by the red line and the blue line, respectively. From this plot, it can be clearly seen that APLOS has the advantage of better guidance to curve compared with LOS. When the curvature changes drastically, such as amplitude, the tracking trajectory based on LOS is not as smooth as APLOS. Thus, the curvature of the path is closely related to the tracking effect. The adaptive method with respect to curvature can make up for the shortcomings of traditional LOS for poor curve tracking. Furthermore, when the curvature of the sine path changes slowly, LOS deviates seriously from the desired path because of drift angle. By contrast, APLOS fits well on the reference path in the same environment. Figure 19b illustrates the comparison of cross-track error. APLOS is denoted by the red line and LOS is denoted by the blue line. It is apparent that the cross-track error of APLOS is mostly smaller than LOS. Therefore, the effectiveness of considering curvature and drift angle is important for path following.   Figure 19d gives the time history of velocity and drift angle. In two plots, the forward speed is denoted by the pink line, the sway speed is denoted by the black line and the drift angle is denoted by the black line. It can be concluded that the drift angle of both algorithms is non-zero and APLOS based AUV can track the curve path well due to considering the effect of drift angle. Figure 19e gives the performance of heading control. Significantly, the current heading (the blue line) of two methods track the desired heading (the red line) well because they all use the same heading controller FOPID. Clearly, the final tracking performance mainly depends on the design of guidance law.
In Table 10, regardless of whether it is MAE or RMSE, the path following performance of APLOS is greatly improved because of the adaptivity to curvature and the effect of the proportional method.
LOS has an MAE of 5.9279 m. APLOS has an MAE of 2.9467 m, which has an approximate reduction of 50%. The RMSE of traditional method and improved method are 6.8329 m and 4.0580 m, respectively. Based on APLOS, the actual locations are more concentrated and continuously distributed along the reference path.
This experiment of curve path following illustrates the fact that APLOS offers the satisfactory curve tracking performance compared with LOS. The look-ahead distance of APLOS is adapted to the change of curvature. Meanwhile, APLOS can effectively offset the influence of drift angle. Therefore, the feasibility and effectiveness of APLOS for tracking complex paths are verified in practice.

Conclusions
The paper proposes an improved ALOS method considering three degrees of freedom: the cross-track error, the curvature of reference path and the forward speed of AUV. Based on the simplicity and practicality of conventional LOS, the variation rules of time-varying look-ahead distance under 3DOF are derived in detail, which lays a foundation for good path following. Under 3DOFALOS, AUV obtains behavior similar to an excellent helmsman, i.e., if AUV approaches a very steep path, the small look-ahead distance is provided. If AUV approaches a straight line, the large look-ahead distance is employed. Meanwhile, the closer to the reference path, the larger the look-ahead distance. In addition, the higher the forward speed of AUV, the weaker the adjustment strength of look-ahead distance. Simulations and experiments show that 3DOFALOS has good convergence and curve guidance. Moreover, the proportional guidance method is introduced to eliminate the influence of drift angle on path following. Under proportional guidance considering the real-time drift angle, AUV's combined motion is on the desired path to avoid the deviation. Simulation and experiment show that the proportional guidance method can improve the deviation effectively. Therefore, the feasibility and effectiveness of 3DOFAPLOS are proved. 3DOFAPLOS is suitable for precise path following of complex curves in the presence of ocean currents.
In the future, many external factors still remain to be studied, and the choice of look-ahead distance should be more intelligent to achieve the optimal value of independent learning. In fact, there are indeed many other factors that affect the selection of look-ahead distance. Under multiple degrees of freedom, it will be a complicated and huge work to deduce the influence of each degree of freedom. Therefore, the choice of intelligent look-ahead distance should be a correct direction. Furthermore, guidance law in the three-dimensional space path following should also be improved to achieve accurate underwater navigation.