# Study of Motion Control and a Virtual Reality System for Autonomous Underwater Vehicles
## 3 Design of AUV Motion Control Algorithm
### MATLAB Simulation  
The MATLAB software is used to simulate the course control system. The performance goals of the AUV motion control system are: (1) during the period of course changing, the motion control system changes the course rapidly and steadily, realizing a short accommodation time to not overshoot from the path; (2) during the period of course keeping, the motion control system must be able to eliminate interferences, and maintain robustness towards the model perturbation. In the control system, we established an AUV mathematical model according to the above AUV dynamics formula, and the important parameter settings are shown in Table 3.  
We introduce the reference trajectory setting technique used to design the reference course signal. To prove that the capacity of the controller in the design is capable of resisting external interferences, the sea wave interference model is imposed on the AUV model. Figure 5 shows the course tracking signal. The simulation results show that the course output can be rapidly changed to reach a predefined value such that the control response is smooth and the overshooting is small. The goal is to create an ideal tracking effect of the controller to match the course. From the simulation results, we can see that the course change is rapid and steady and has no static error.  
\begin{table}
\begin{tabular}{c c} \hline \hline  & \(\delta_{\max}=35^{\circ}\) \\ m = 56 kg & Y\({}_{\
u}=-24.6\) kg \\ \hline \(\chi_{\text{g}}=0\) m & N\({}_{\text{uv}}=-21\) kg \\ \(y_{\text{g}}=0\) m & X\({}_{\text{u}}=-0.45\) kg \\ \(Y_{\text{r}\,|\,r\,|\,1}=0.84\) kg\(\cdot\)m/rad\({}^{2}\) & Y\({}_{\text{uv}}=-32.4\) kg/m \\ \(\text{N}_{\text{ur}}=-3.5\) kg\(\cdot\)m/rad & X\({}_{\text{rr}}=62.1\) kg/rad \\ \(Y_{\text{p}}=3.42\) kg\(\cdot\)m/rad & N\({}_{\text{V}}=2.34\) kg/m \\ \(N_{\text{r}}=-6.35\) kg\(\cdot\)m\({}^{2}\)/rad & I\({}_{\text{zz}}=2.78\) kg\(\cdot\)m\({}^{2}\) \\ \(X_{\text{u}\,|\,u\,|\,}=-1.56\) kg/m & N\({}_{\text{uu}\,\delta r}=-7.21\) kg/rad \\ \(Y_{\text{ur}}=4.78\) kg/rad & X\({}_{\text{rr}}=-1.43\) kg\(\cdot\)m/rad \\ \(N_{\text{v}\,|\,v\,|\,}=-2.56\) kg & X\({}_{\text{T}\,\max}=5.78\) N \\ \(Y_{\text{v}\,|\,v\,|\,}=-11.25\) kg/m & N\({}_{\text{r}\,|\,r\,|\,}=-6.9\) kg\(\cdot\)m\({}^{2}\)/rad \\ \hline \hline \end{tabular}
\end{table}
Table 3: Parameters of AUV.  
Simulation results in Figure 6 show the comparison between the designed neuro-fuzzy controller and the adjusted PID controller. After a perturbation of 80% to the model parameter, a large overshoot occurs in the PID system. Figure 7 demonstrates the robustness of the neuro-fuzzy controller design by showing that the control effect works smoothly even after perturbations affect the model. Figure 4 shows the rudder order outputs of the neuro-fuzzy controller and the PID controller. When the course deviation is large, the two controllers output a large helm angle to reduce the course error. When the course deviation decreases, the rudder angle is reduced and finally a small counter rudder is output so that the vehicle avoids overshooting. The designed neuro-fuzzy controller has a lesser number of rudders and a lower rudder angle than the PID controller. Thus, the designed controller has better performance.  
Figure 5: Tracking response of the neuro-fuzzy controller. (**a**) Frequent turn tracking; (**b**) Elliptic trajectory tracking.