*4.1. LMPC Controller*

First, nominal kinematics model (1) is discretized as:

$$
\overline{\eta}\_{t+1} = \overline{\eta}\_t + T f\_{\mathcal{V}\eta} \overline{\eta}\_t \tag{24}
$$

where *T* is the sampling time.

Limited by the AUV's kinetics characteristics, sharp changes in speed *ν* are not allowed. Then, the increment of speed *ν* is used as the control input:

$$
\overline{u}\_{lt} = \Delta \overline{v}\_t = \overline{v}\_t - \overline{v}\_{t-1} \tag{25}
$$

To minimize the path-tracking deviation and avoid sharp changes in speed, the objective function is designed as follows:

$$J\_{\rm LMPC} = \sum\_{k=0}^{N\_l - 1} \left( \left\| \overline{\boldsymbol{\varepsilon}}\_{\eta\_{\bar{k}} \mid t} \right\|\_{Q\_{\eta}}^2 + \left\| \overline{\boldsymbol{\varepsilon}}\_{u\_{\bar{k}} \mid t} \right\|\_{Q\_{u\_{\bar{k}}}}^2 + \left\| \overline{\boldsymbol{u}}\_{\boldsymbol{l}k \mid t} \right\|\_{R\_v}^2 \right) + \left\| \overline{\boldsymbol{\varepsilon}}\_{\eta\_{N\_l} \mid t} \right\|\_{P\_{\eta}}^2 \tag{26}$$
 
$$\to \left\| \overline{\boldsymbol{\varepsilon}}\_{\boldsymbol{u}\_{\bar{k}} \mid t} \right\|\_{P\_v}^2$$

where *Nl* is the predictive horizon in the LMPC controller.

The constraints of the control input and speed are given as:

$$\mathfrak{u}\_l \in \mathfrak{u}\_l = \{ \mathfrak{T}\_l : \mathfrak{T}\_{l\min} \le \mathfrak{u}\_l \le \mathfrak{u}\_{l\max} \}\tag{27}$$

$$\nabla \in V = \{ \nabla : \overline{\nabla}\_{\min} \le \overline{\nu} \le \overline{\nu}\_{\max} \} \tag{28}$$

where *ulmax* and *ulmin* are the control input's upper bound and low bound, which satisfy *ulmin* = −*ulmax*, and *νmax* and *νmin* are the speed's upper bound and low bound.

Then an optimal control problem is designed to calculate the nominal speed control law *νdt* :

$$\begin{array}{c} \min\_{u\_{lk|t},k \in \mathbb{K}\_{0:N\_l-1}} \int\_{LMPC} \\ \overline{\eta}\_{0|t} = \overline{\eta}\_{t'}, \overline{u}\_{0|t} = \overline{u}\_{t} \\ \overline{\eta}\_{k+1|t} = \overline{\eta}\_{k|t} + Tf\overline{\nu}\_{k|t} \\ \text{s.t. } \overline{\nu}\_{k|t} = \overline{\nu}\_{t} + \sum\_{j=0}^{k} \overline{u}\_{lj|t} \\ \overline{u}\_{lk|t} \in \mathbb{U}\_{l} \\ \overline{\nu}\_{k|t'} \overline{\nu}\_{N\_l|t} \in \mathcal{V} \end{array} \tag{29}$$

where *u*∗ *<sup>l</sup> <sup>k</sup>*|*<sup>t</sup>* is the solution to the optimal control problem. Then the speed control law *<sup>ν</sup>dt* is obtained as:

$$\boldsymbol{\nu}\_{d\_l} = \overline{\boldsymbol{\pi}}\_{l\ 0\mid t}^\* + \overline{\boldsymbol{\nu}}\_t \tag{30}$$

where *u*\* *<sup>l</sup>* <sup>0</sup>|*<sup>k</sup>* is the increment of speed in the present moment.
