# Nonlinear Trajectory Tracking Controller for Underwater Vehicles with Shifted Center of Mass Model
## Appendix B
: The proposed LFC has the form  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]0  
Recalling (11) (with \(\tau_{w}=0\)), one has  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]1  
Calculating the derivative of (101) with respect to time leads to  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]2  
Since \(\zeta_{3}\) (8), thus  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]3  
Denoting now \(A_{3}=\hat{Y}_{34}q\), \(A_{4}=m_{14}q^{2}+m_{11}uq-d_{34}q+f_{w}\), one obtains  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]4  
To guarantee \(\dot{V}_{\zeta_{3}}<0\), four cases must be considered (recall that \(\mathbb{N}_{3}>0\)):  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]5 \[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]6 \[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]7 \[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]8  
Taking into account (105), the fact that \(u,q,r\) can all be controlled and limited, and that the function \(f_{w}\) is limited, one obtains  
\[\dot{V}_{K} =x_{e}\big{(}u-u_{d}(c\psi_{e}c\theta_{e}+s\theta s\theta_{d}) \big{)}+vy_{e}+z_{e}\big{(}w+u_{d}(1-c\psi_{e})c\theta s\theta_{d}\big{)}\]9 \[\quad+(q-q_{d}-u_{d}z_{e}c\psi_{e})s\theta_{e}+(r/c\theta-r_{d}/ c\theta_{d}+u_{d}y_{e}c\theta_{d})s\psi_{e}. \tag{106}\]0  
where \(\Delta_{3}=Z_{w}^{2}-4Z_{|w|w}A_{4}\) and \(\Delta_{4}=Z_{w}^{2}+4Z_{|w|w}A_{4}\). Hence, it is clear that \(w\) is decreasing and therefore bounded. And since \(\zeta_{3}=w-\hat{Y}_{34}q\), it can be deduced that \(\zeta_{3}\) is also bounded. Since the desired trajectory \(u_{d}\) is planned, and therefore limited, while the velocities \(u,w\) are due to constraints on the values generated by the thrusters, the errors \(y_{e},z_{e}\) are also limited. Recall now [PERSON]'s inequality \(ab\leq\frac{\epsilon^{2}}{2}|a|^{2}+\frac{1}{2\epsilon^{2}}|b|^{2}\) for \((a,b)\in\mathcal{R}\), and \(\epsilon\) is a positive number [38]. Using this inequality, one obtains \(|vy_{e}|\leq\frac{\epsilon^{2}}{2}|v|^{2}+\frac{1}{2\epsilon^{2}}|y_{e}|^{2}\), \(|z_{e}w|\leq\frac{\epsilon^{2}}{2}|z_{e}|^{2}+\frac{1}{2\epsilon^{2}}|w|^{2}\), and \(2|z_{e}u_{d}|\leq\epsilon^{2}|z_{e}|^{2}+\frac{1}{\epsilon^{2}}|u_{d}|^{2}\). Denoting  
\[\quad+(q-q_{d}-u_{d}z_{e}c\psi_{e})s\theta_{e}+(r/c\theta-r_{d}/ c\theta_{d}+u_{d}y_{e}c\theta_{d})s\psi_{e}. \tag{106}\]1  
the expression (102) can be given in the following form:  
\[\quad+(q-q_{d}-u_{d}z_{e}c\psi_{e})s\theta_{e}+(r/c\theta-r_{d}/ c\theta_{d}+u_{d}y_{e}c\theta_{d})s\psi_{e}. \tag{106}\]2  
The problem, however, is that the input desired velocities \(\mu_{du},\mu_{dq},\mu_{dr}\) are some virtual inputs and this results in the fact that (109) does not apply to vehicle dynamics. Hence,there is the need to design an additional dynamic control algorithm to guarantee that \(\hat{V}_{K}\leq\delta_{1}\) where \(\delta_{1}\) means a constant. **Dynamic controller design**. The dynamic controller's purpose is to guide the vehicle to the desired speeds using the signals \(\tau_{u}\), \(\tau_{q}\), and \(\tau_{r}\).