## 6 Simulation and Experiment
### Experiment
#### 6.2.2 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. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **MAE(m)** & **RMSE(m)** \\ \hline LOS & 5.9279 & 6.8329 \\ APLOS & 2.9467 & 4.0580 \\ Improvement & 50.30\% & 40.61\% \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Performance metric of a sinusoidal path following (\(u=1\) m/s). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **MAE(m)** & **RMSE(m)** \\ \hline LOS & \(-\)0.6156 & \(-\)0.6023 \\ APLOS & +0.3155 & +0.3236 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: MAE and RMSE fluctuations relative to \(u=1\) m/s. Figure 19c presents the time evolution of look-ahead distance. _LOS_ (the blue line) uses a constant look-ahead 15 m. _APLOS_ (the red line) uses varied look-ahead distance in accordance with real-time curvature. Compared with the comparison of trajectory, _APLOS_ has an ability to adapt to the change of curvature. 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. Figure 19: Sinusoidal path following (\(u=1\) m/s). (**a**) comparison of trajectory; (**b**) comparison of cross-track error; (**c**) comparison of look-ahead distance; (**d**) comparison of velocity and drift angle; (**e**) comparison of heading effect. 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.