# Numerical Test of Several Controllers for Underactuated Underwater Vehicles
## 3 Short Description of Selected Algorithms
### Selected Trajectory Tracking Methods
Moreover, the other symbols mean: \(u_{e}=u-u_{d}\), \(\alpha_{ve}=\alpha_{v}-\alpha_{vd}\), \(u_{d}=v_{p}\cos\psi_{e}-k_{1}x_{e}/E\), \(\alpha_{vd}=-v-k_{2}y_{e}/E\), \(E=\sqrt{1+x_{e}^{2}+y_{e}^{2}}\), \(v_{p}=\sqrt{x_{d}^{2}+y_{d}^{2}}\), \(\alpha_{v}=v_{p}\sin\psi_{e}\), \(Q_{2}=(m_{2}/m_{3})\alpha_{ve}v_{p}\cos\psi_{e}\), \(Q_{2}=(m_{2}/m_{3})(\dot{u}_{ve}v_{p}\cos\psi_{e}+\alpha_{ve}v_{p}\cos\psi_{e}- \alpha_{ve}v_{p}\sin(r-\dot{\psi}_{d}))\), and \(r_{e}=r-r_{d}\). The function \(r_{d}=f(\dot{\psi}_{d},\dot{\psi}_{p},\psi_{e},\hat{F}_{2},m_{2},k_{2},E,x_{e},y_{e },\dot{x}_{e},\dot{y}_{e},k_{3}x_{ve})\) depends on many factors. The position and the attitude errors, and their time derivatives are defined as:  
\[x_{e}=(x-x_{d})\cos\psi+(y-y_{d})\sin\psi,\ \ y_{e}=-(x-x_{d})\sin \psi+(y-y_{d})\cos\psi,\ \ \psi_{e}=\psi-\psi_{d}, \tag{18}\] \[\dot{x}_{e}=u_{e}-k_{1}x_{e}/E+ry_{e},\ \ \dot{y}_{e}=\alpha_{ve}-k_{2}y_{e}/E- rx_{e}, \tag{19}\]  
where \(\psi_{d}=\arctan(\dot{y}_{d}/\dot{x}_{d})\). The subscript \(d\) denotes the desired value of each quantity. The control gains are: \(k_{1},k_{2},k_{3}\), \(c_{1},c_{2}\), \(k_{3},k_{1},k_{2}\), \(w_{3},w_{2}\). Comment. The method is a combination of backstepping and the SMC. It can easily be seen that the equations defining the signals \(\hat{\tau}_{u}\) and \(\hat{\tau}_{r}\) depend on many factors. In order to obtain the input force \(\tau_{u}\) and the torque \(\tau_{r}\) their time derivatives must be integrated. Moreover, some control gains are present in various formulas. Therefore, it is difficult to say how they affect the control quality and the tracking errors. The authors of [11] suggested the trial and error approach. Despite the difficulties, studies were carried out for various scenarios, obtaining satisfactory results for the task of the desired trajectory tracking. For this reason, this method seems to be promising for this test. Controller 3 (SMC) developed in [17] is suitable for underactuated underwater vehicles moving horizontally. The input signals are described by the following equations:  
\[\tau_{u} =-d_{u}u-m_{2}vr+m_{1}\big{(}\dot{u}_{d}-\lambda_{1}e_{u}-k_{1}S_ {1}-W_{1}\text{sgn}(S_{1})\big{)}, \tag{20}\] \[\tau_{r} =-d_{r}r-(m_{1}-m_{2})uv\] \[+b^{-1}\big{(}-m_{2}^{-1}\big{(}d_{v}\dot{v}-m_{1}\dot{u}r\big{)} +\Gamma-\lambda_{3}\dot{e}_{v}-\lambda_{2}e_{v}-k_{2}S_{2}-W_{2}\text{sgn}(S_{ 2})\big{)}. \tag{21}\]  
In the above equations, the quantities mean \(e_{u}=u-u_{d}\) and \(e_{v}=v-v_{d}\) where the desired velocities \(u_{d},v_{d}\) are defined as:  
\[\left[ \begin{array}{c}u_{d}\\ v_{d}\end{array} \right]=\left[ \begin{array}{cc}\cos\psi&\sin\psi\\ -\sin\psi&\cos\psi\end{array} \right]\left[ \begin{array}{c}\dot{x}_{d}+l_{x }\tanh\left(-\frac{k_{x}}{l_{x}}x_{e}\right)\\ \dot{y}_{d}+l_{y}\tanh\left(-\frac{k_{y}}{l_{y}}y_{e}\right)\end{array} \right]. \tag{22}\]  
The position errors are \(x_{e}=x-x_{d},y_{e}=y-y_{d}\) (\(x_{d},y_{d}\) define the desired position) while other symbols mean:  
\[b =m_{3}^{-1}(-\frac{m_{1}}{m_{2}}u+u_{d}), \tag{23}\] \[\Gamma =-\ddot{x}_{d}\sin\psi+\ddot{y}_{d}\cos\psi-\dot{x}_{d}r\cos\psi+ \ddot{y}_{d}r\sin\psi-u_{d}r\] \[\quad+Y_{1}r\cos\psi+Y_{2}r\sin\psi+\dot{Y}_{1}\sin\psi-\dot{Y}_{ 2}\cos\psi,\] (24) \[Y_{1} =k_{x}\dot{x}_{e}\text{sech}^{2}\left(-\frac{k_{x}}{l_{x}}x_{e} \right),\ \ Y_{2}=k_{y}\dot{y}_{e}\text{sech}^{2}\left(-\frac{k_{y}}{l_{y}}y_{e} \right),\] (25) \[S_{1} =e_{u}+\lambda_{1}\int_{0}^{t}e_{u}(\tau)d\tau,\ \ S_{2}=\dot{e}_{v}+ \lambda_{3}e_{v}+\lambda_{2}\int_{0}^{t}e_{v}(\tau)d\tau. \tag{26}\]  
The sliding surfaces are defined as \(S_{1}\) and \(S_{2}\). The following parameters of the control algorithm must be found: \(l_{x}\), \(l_{y}\), \(k_{x}\), \(k_{y}\), \(\lambda_{1}\), \(\lambda_{2}\), \(\lambda_{3}\), \(k_{1}\), \(k_{2}\), \(W_{1}\), \(W_{2}\). Comment. This method is a variation of the sliding mode control. The role of gains \(k_{1}\), \(k_{2}\), \(W_{1}\), \(W_{2}\) is obvious due to their place of occurrence.