# Nonlinear Optimal Control Law of Autonomous Unmanned Surface Vessels
## 4 Discussion
### Simulation Results of Tracking Continuous Trajectory and Waypoints  
To verify the control performance of the proposed optimal method to the AUSV, a scenario with a continuous circular trajectory and a scenario with eight waypoints were arranged. **Scenario 1:** The predefined circular reference trajectory was generated by Equation (30) as below:  
\[\left\{ \begin{array}{l}x_{d}=x_{0}+R\cos(\psi_{d})\\ y_{d}=y_{0}+R\sin(\psi_{d})\end{array} \right., \tag{30}\]  
where \(R\) is the radius of the desired circular trajectory, and \(\psi_{d}\) is a rotation angle that was integrated with constant angle velocity \(w_{d}\) as the following:  
\[\psi_{d}=\int_{0}^{t}w_{d}dt. \tag{31}\]  
On the basis of Equations (30) and (31), the desired trajectory can be expressed as \(\eta_{d}=\left[ \begin{array}{cc}x_{d}&y_{d}&\psi_{d}\end{array} \right]\). The parameters for building up a circular trajectory are listed as Table 5, and the initial conditions of the controlled AUSV are given in Table 6.  
Simulation results for tracking the desired circular trajectory are shown in Figures 3-6, based on parameters listed in Tables 5 and 6. Figure 3a shows that the controlled AUSV tracked the desired circular trajectory from initial point \(\eta=[800,0,90]\) using the proposed nonlinear optimal control law. Figure 4 shows that tracking errors \(e_{x}\), \(e_{y}\), and \(e_{\psi}\) of the controlled AUSV in the \(X\) and \(Y\) axes, and yaw direction exponentially converged to zero, respectively, and these results indicated the promising tracking abilities of this proposed control law. The moving velocities and angle velocity of the controlled AUSV in the global co-ordinate are plotted in Figure 5. \begin{table}
\begin{tabular}{c c c} \hline \hline \(x\left(\mathrm{m}\right)\) & \(y\left(\mathrm{m}\right)\) & \(\psi\left(\mathrm{degree}\right)\) \\ \hline
800 & 0 & 90\({}^{\circ}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Initial AUSV conditions (continuous trajectory). \begin{table}
\begin{tabular}{c c c c} \hline \hline \(x_{o}\left(\mathrm{m}\right)\) & \(y_{o}\left(\mathrm{m}\right)\) & \(w_{d}\left(\mathrm{rad/s}\right)\) & \(r\left(\mathrm{m}\right)\) \\ \hline
0 & 0 & \(\pi/900\) & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Circular-trajectory parameters. Figure 4: Tracking errors in \(x,y,\) and \(\psi\) of controlled AUSV: proposed method, blue solid line; desired trajectory, black dashed line. Figure 3: Tracking histories of controlled AUSV: proposed method (blue solid line) and desired trajectory (black dashed line). Applied control forces and torque are illustrated in Figure 6, which shows that control efforts \(F_{x}\) and \(F_{y}\), and applied yaw torque \(\tau_{\psi}\) are bounded within \(\pm 0.8\times 10^{6}\) N, \(\pm 1.3\times 10^{6}\) N, and \(\pm 1.5\times 10^{7}\) nm. These control commands are within a reasonable range in a marine environment. **Scenario 2:** In this scenario, the desired path is generated with eight waypoints: \(WP_{1}\): (0,200), \(WP_{2}\): (300,500), \(WP_{3}\): (700,500), \(WP_{4}\): (1000,200), WP5: (1000,-200), \(WP_{6}\): (700,-500), \(WP_{7}\): (300,-500), \(WP_{8}\): (0,-200), and \(WP_{9}\): (0,0). Line-of-sight (LOS) angle between controlled AUSV and each waypoint can be calculated by using the following equation:  
\[\psi_{d}=\tan^{-1}\frac{(y_{d}-y)}{(x_{d}-x)}. \tag{32}\]  
Figure 5: Histories of rotation velocities of controlled AUSV. Figure 7 demonstrates the history of the waypoint-tracking result, indicating how the AUSV controlled via our proposed optimal method successfully tracks waypoint-generated trajectory, and how it turns automatically at each waypoint, i.e., \(WP_{i}\), for \(i=1,\,\ldots,\,9\). Figure 6: Control commands of controlled AUSV. Figure 7: Waypoint-tracking result. Histories of tracking errors in tracking each waypoint are illustrated in Figure 8, where the exponential convergent properties of tracking errors are revealed by applying this proposed optimal method.