## 6 Simulation and Experiment
### Simulation
#### 6.1.1 Zig-Zag Path Following under Constant Ocean Currents
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_. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline  & _LOS_ & _PLOS_ & _ALOS_ & _APLOS_ & **Improvement** \\ \hline MAE(m) & 6.3387 & 1.0397 & 3.9487 & 0.9359 & 85.24\% \\ RMSE(m) & 6.6802 & 2.3832 & 4.2723 & 2.1517 & 67.79\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance metric of zig-zag tracking under constant ocean currents (\(u=1\) m/s). 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. Figure 13: Zig-zag tracking under constant ocean currents (\(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. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **LOS** & **PLOS** & **ALOS** & **APLOS** \\ \hline MAE(m) & +2.2106 & \(-\)0.2336 & +1.4351 & \(-\)0.1645 \\ RMSE(m) & +2.1573 & \(-\)0.3739 & +1.0864 & \(-\)0.4260 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: MAE and RMSE fluctuations relative to \(u\) = 1.5 m/s. 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.