# Study of Motion Control and a Virtual Reality System for Autonomous Underwater Vehicles
## 2 Dynamic System of AUV  
Although the algorithm we studied is not based on the AUV dynamic model, the AUV dynamic model will be used in the following simulation and comparison with the traditional control method. The AUV dynamic model has been studied extensively [12]. The body-fixed coordinates depict AUV motion in 6-DOF, i.e., surge, sway, heave, roll, pitch, and yaw (heading) as shown in Figure 1. The mathematical models for the motion of underwater vehicles are expressed by the triple translation Equations (1)-(3) and the triple rotation Equations (4)-(6). Notations adopted are summarized in Tables 1 and 2. \[m[\dot{u}-vr+qw-x_{g}(q^{2}+r^{2})+y_{g}(pq-\dot{r})+[z_{g}(pr+\dot{q})]=\sum X _{\text{ext}} \tag{1}\]  
\[m[\dot{v}-wp+ur-y_{g}(p^{2}+r^{2})+x_{g}(pq+\dot{r})+[z_{g}(qr-\dot{p})]=\sum Y _{\text{ext}} \tag{2}\]  
\[m[\dot{w}-uq+vp-z_{g}(p^{2}+q^{2})+x_{g}(rp-\dot{q})+y_{g}[z_{g}(rq+\dot{p})]= \sum Z_{\text{ext}} \tag{3}\]  
\[I_{xx}\dot{p}-(I_{zz}-I_{yy})qr-I_{xx}(\dot{r}+pq)+I_{xy}(pr-\dot{q})+I_{yz}( r^{2}-q^{2})+my_{g}\sqrt{yc}(\dot{w}+vp-uq)-mz_{g}(\dot{v}+ur-wp)=\sum K _{\text{ext}} \tag{4}\]  
\[I_{yy}\dot{q}-(I_{zz}-I_{xx})pr-I_{yz}(\dot{r}-pq)-I_{xy}(\dot{p}+qr)+I_{xz}( p^{2}-r^{2})-mx_{g}(\dot{w}+vp-uq)+mz_{g}(\dot{u}-vr+wq)=\sum M_{\text{ext}} \tag{5}\]  
\[I_{zz}\dot{r}+(I_{yy}-I_{xx})pq-I_{xz}(\dot{p}-qr)-I_{yz}(\dot{q}+pr)-I_{xy}( p^{2}-q^{2})+mx_{G}(\dot{v}+ur+wp)-my_{g}(\dot{u}-vr+wq)=\sum N_{\text{ext}} \tag{6}\]The kinematic model of AUV can be expressed in terms of the relative surge and sway velocities by considering the influences of the ocean currents as follows:  
\[\left\{ \begin{array}{c}\dot{\psi}=r\\ \dot{x}=u_{r}\text{cos}\ \psi-v_{r}\text{sin}\ \psi+V_{x}\\ \dot{y}=u_{r}\text{sin}\ \psi+v_{r}\text{cos}\ \psi+V_{y}\end{array} \right. \tag{7}\]  
where \(V_{x}\) and \(V_{y}\) are the velocity components of the time-varying ocean currents in the x and y directions of the inertial reference frame and \(u_{r}\), \(v_{r}\), and r are the relative surge, sway, and yaw velocities, respectively. In this study, the design of the horizontal plane path tracking control of the AUV is taken as an example. The dynamic model of AUV in the horizontal plane can be simplified as shown in Equation (8) below:  
\[\left\{ \begin{array}{c}\dot{u}_{r}\ =f_{u}(u_{r},v_{r},r)+g_{u}X_{T}+d_{u}\\ \dot{v}_{r}=f_{v}(u_{r},v_{r},r)+d_{v}\\ \dot{r}\ =f_{r}(u_{r},v_{r},r)+g_{r}\delta+d_{r}\end{array} \right. \tag{8}\]  
where \(d_{u}\), \(d_{v}\), and \(d_{r}\) denote the compound uncertainties with unknown upper bounds, XT is the propeller thrust force along the surge motion of the vehicle, is the angle of the yaw rudder \(\delta\), _fu_\((u_{r}\), \(v_{r}\), \(r)\), _fu_\((u_{r}\), \(v_{r}\), \(r)\), _fr_\((u_{r}\), \(v_{r}\), \(r)\), _g\({}_{u}\), and _g\({}_{r}\)_ are known nonlinear functions, as shown in Equations (9)-(13). \[f_{u}(u_{r},v_{r},r)=\left(mv_{r}r+mx_{g}r^{2}+my_{g}\dot{r}+X_{u|u|}u_{r}|u_{r }|+X_{u}\dot{u}_{r}+X_{rr}v_{r}r\right)+X_{rr}r^{2})/\left(m-X_{u}\right) \tag{9}\]  
\[g_{u}=1/(m-X_{u}) \tag{10}\]  
\[f_{v}(u_{r},v_{r},r)=\left(-mu_{r}r+my_{g}r^{2}-mx_{g}\dot{r}+Y_{r|v|}v_{r}|v_ {r}|v_{r}|+Y_{r|r}i^{r}|r|+Y_{r}\dot{v}_{r}+Y_{r}\dot{r}\right. \tag{11}\]  
\[\left.+Y_{ur}u_{r}r+Y_{uv}u_{r}r_{r}\right)/(m-Y_{\dot{v}}) \tag{12}\]  
\[f_{r}(u_{r},v_{r},r)=\left(-mx_{g}\big{(}\dot{v}_{r}+u_{r}r\big{)}+my_{g} \big{(}\dot{u}_{r}-v_{r}r\big{)}+N_{v|v|}v_{r}|v_{r}|+N_{r|r|}r|+N_{v}\dot{v}_ {r}+N_{r}\dot{r}\right.\]  
\[\left.+N_{ur}u_{r}r+N_{uv}u_{r}v_{r}\right)/(I_{zz}-N_{\dot{r}}) \tag{13}\]  
The 3D path tracking control mainly decouples the control into horizontal (horizontal) and vertical (vertical) ones. We design the AUV horizontal path tracking motion as an example. The path tracking control system for AUV in the horizontal plane is shown in Figure 2. The definitions of the main parameters of the AUV model are given in Table 2.