*4.2. Tube MPC Controller*

Like the tube MPC scheme given in (10)–(14), the nominal control law is used to track the speed control law, which is obtained by solving an optimal control problem. The nonlinear hydrodynamic characteristics are considered in the state transition constraint, *xk*<sup>+</sup>1|*<sup>t</sup>* = *fd*(*xk*|*t*, *uk*|*t*, 0), which are decoupled in (19), (20), and (22). Moreover, the terminal feasible set *Xf* and the RPI set Ω also need to be obtained when formulating the optimal control problem. The state feedback control law, which considers the nonlinear characteristics of the AUV, is used to converge the deviation of the actual state *x* and the nominal state *x*. In a Lipschitz nonlinear system, the Lipschitz constant *L* can be used to describe the nonlinear characteristics. Following [23], with the Lipschitz constant *L* set, a feedback matrix used to calculate the stated feedback control law and the (RPI) set Ω can be obtained by formulating an LMI. Following [25], another optimal control problem is formulated to obtain the terminal feasible set *Xf* considering the linear differential inclusion characteristics of the AUV. To ensure real-time performance, they are calculated offline. A brief derivation of the LMI and the optimal control problem is given as follows.

**Assumption 1.** *In these decoupling models, there always exists a corresponding constant L to satisfy the condition of the Lipschitz nonlinear function (3).*

**Lemma 1** [23]**.** *For a Lipschitz nonlinear system (1), there exists a positive definite matrix <sup>X</sup>* <sup>∈</sup> *<sup>R</sup>n*×*n*, *a matrix Y* <sup>∈</sup> *<sup>R</sup>m*×*n*, *and scalars <sup>λ</sup>*<sup>0</sup> <sup>&</sup>gt; *<sup>λ</sup>* <sup>&</sup>gt; <sup>0</sup> *and <sup>μ</sup>* <sup>&</sup>gt; <sup>0</sup> *such that:*

$$\begin{bmatrix} \left( AX + BY \right)^{T} + AX + BY + \lambda X & B\_{\omega} \\ B\_{\omega}^{T} & -\mu I\_{n} \end{bmatrix} \le 0,\\ L \le \frac{(\lambda - \lambda\_{0}) a\_{\text{min}}(P\_{\mathbb{R}})}{2 \| P\_{\mathbb{R}} \|} \tag{31}$$

*with PR* = *X*−1, *and the feedback matrix K* = *X*−1*Y*.

With parameters *λ*<sup>0</sup> and *μ* set, LMI (31) is solved to obtain the matrices *X*,*Y* and the parameter *λ*. Matrices *X* and *Y* are used to calculate the feedback matrix *K*. With disturbance upper bound *c<sup>ω</sup>* set, together with *λ* and *X*, the RPI set Ω and the feedback control law *κ*(*x*, *x*) can be obtained:

$$\Omega = \begin{cases} \mathbf{x} \in \mathbb{R}^n | \mathbf{x}^T P\_{\mathbb{R}} \mathbf{x} \le \frac{\mu c\_{\omega}}{\Lambda} \mathbf{} \} \\ \kappa(\overline{\mathbf{x}}, \mathbf{x}) = K(\mathbf{x} - \overline{\mathbf{x}}) \end{cases} \tag{32}$$

where the RPI set Ω and the feedback matrix *K* are all invariant. With the RPI set Ω calculated, the constraint on the nominal state is obtained, which is equivalent to constraints on the nominal control input using the Minkowski Operation [26]. Then, constraints of nominal system (11) can be obtained.

With the RPI set Ω obtained, the constraints of nominal system (6) are invariant, which are treated as an invariant rigid tube. The LDI of nominal system (6) is defined:

$$\Theta(M) = \left\{ F\_{\overline{\Theta}}(i) := [\mathcal{A}(i), \mathcal{B}(i)] = \left[ \frac{\partial \overline{f}}{\partial \overline{\mathcal{X}}'} \frac{\partial \overline{f}}{\partial \overline{\overline{u}}} \right], \begin{bmatrix} \overline{\pi} \\ \overline{u} \end{bmatrix} \in M, i \in [k + \mathcal{N}, \infty) \right\} \tag{33}$$

The minimum convex polytope is denoted by CoΘ(*M*):

$$\text{Co}\Theta(M) = \left\{ F\_{\Theta}(i) \in R^{n \times (n+m)} : F\_{\Theta}(i) = \sum\_{j=1}^{N} \beta\_{j} F\_{\Theta^{j}} = \sum\_{j=1}^{N} \beta\_{i} \left[ \mathcal{A}\_{j}, \mathcal{B}\_{j} \right] \right\}$$

$$\beta\_{i} \ge 0, \sum\_{j=1}^{N} \beta\_{i} = 1, i \in [k + \mathcal{N}, \infty) \right\} \tag{34}$$

where *F*Θ*<sup>j</sup>* is the extreme matrix of the minimum convex polytope CoΘ(*M*), and N is the number of the extreme matrix.

The terminal feasible set *Xf* <sup>⊂</sup> *<sup>R</sup><sup>n</sup>* :<sup>=</sup> ) *<sup>x</sup>* <sup>∈</sup> *<sup>R</sup><sup>n</sup> <sup>x</sup>TPTx* <sup>≤</sup> *<sup>γ</sup>* \* is obtained as follows: **Lemma 2** [25]**.** *Suppose the LDI of nominal system (6) is given by (33), and the constraints of nominal system (6) are obtained by (11) and (31). There exist matrices* <sup>0</sup> <sup>&</sup>lt; *<sup>W</sup>*<sup>1</sup> <sup>∈</sup> *<sup>R</sup>n*×*<sup>n</sup> and <sup>W</sup>*<sup>2</sup> <sup>∈</sup> *<sup>R</sup>m*×*<sup>n</sup> such that:*

$$
\begin{bmatrix}
\begin{bmatrix}
\left(Q^\frac{1}{2}\right)^T W\_1 \\
W\_2
\end{bmatrix}
\end{bmatrix} \quad \begin{bmatrix}
I\_n & 0 \\
0 & R^{-1}
\end{bmatrix} \begin{bmatrix}
\geq 0, j = 1, 2, \cdots, N \\
\end{bmatrix} \tag{35}
$$

*and*

$$
\begin{bmatrix}
1/\gamma & c\_j W\_1 + d\_j W\_2 \\
\left(c\_j W\_1 + d\_j W\_2\right)^T & W\_1
\end{bmatrix} \ge 0,\\
j = 1, 2, \dots, p
\tag{36}
$$

*are satisfied with W* = *W*<sup>1</sup> *W<sup>T</sup>* 2 *. The terminal weighting matrix PT is set as PT* = *W*−<sup>1</sup> <sup>1</sup> . *<sup>Q</sup>* <sup>∈</sup> *<sup>R</sup>n*×*<sup>n</sup> and R* <sup>∈</sup> *<sup>R</sup>m*×*<sup>m</sup> are positive definite diagonal matrices.*

Note that the determinant, det(*γW*1), represents the volume of the terminal region *Xf* , and a too-small terminal region will easily lead to the infeasibility of nominal optimal control problem (14). To enlarge the terminal region, another optimal control problem is formulated as:

$$\min\_{\gamma, W\_1, W\_2} \log \det(\gamma W\_1)^{-1} \tag{37}$$

$$\text{s.t.} \begin{array}{l} \text{constraints (35), (36)} \\ \gamma > 0, W\_1 > 0 \end{array}$$

According to speed control law (30), surge speed step signal Δ*us* can be obtained. When the surge speed step signal exceeds the upper bound, i.e., Δ*us* > Δ*us*, the constraints of nominal system (6) will be used. When the surge speed step signal Δ*us* does not exceed the upper bound, i.e., Δ*us* ≤ Δ*us*, an adaptive flexible tube, treated in the form of inequalities, is introduced.

The variable *sk*|*t*, which represents the size of the adaptive flexible tube, is calculated by decision variable *wk*|*<sup>t</sup>* to change offline calculated constraints (11). The decision variable *wk*|*<sup>t</sup>* is subject to nonlinear function <sup>∼</sup> *<sup>w</sup>δ*(*sk*|*t*). Then, optimal control problem (14) becomes:

$$\min\_{\overline{\boldsymbol{m}}\_{k|t}, \overline{\boldsymbol{m}}\_{k|t}, k \in \mathbb{K}\_{\boldsymbol{0} \times N\_T - 1}} \boldsymbol{J} \tag{38}$$

$$\begin{array}{c} \overline{\mathbf{x}}\_{0|t} = \overline{\mathbf{x}}\_{0}, \overline{\mathbf{u}}\_{0|t} = \overline{\mathbf{u}}\_{0}, \overline{\mathbf{s}}\_{0|t} = \mathbf{0} \\ \overline{\mathbf{x}}\_{k+1|t} = f\_{d}(\overline{\mathbf{x}}\_{k|t}, \overline{\mathbf{u}}\_{k|t}, \mathbf{0}) \\ s\_{k+1|t} = \rho s\_{k|t} + w\_{k|t} \\ \text{s.t.} \, h\_{j}(\overline{\mathbf{x}}\_{k|t}, \overline{\mathbf{u}}\_{k|t}) + c\_{j}s\_{k|t} \le \mathbf{0}, j = 1, 2, \cdots, p \\ w\_{k|t} \le \overline{w}\_{\mathcal{I}}, s\_{k|t} \le \overline{\mathbf{s}} \\ w\_{k|t} \ge \hat{w}\_{\mathcal{I}}(s\_{k|t}) \\ \overline{\mathbf{x}}\_{N|t} \in X\_{f} \end{array}$$

where constant *ρ* ∈ (0, 1) is a decay factor, and *cj* is a positive constant. Constraint upper bound *w* and *s* are all positive constants.

The nonlinear constraint <sup>∼</sup> *<sup>w</sup>δ*(*sk*|*t*) is given by:

$$
\widehat{w}\_{\delta}(s\_{k|t}) = \sqrt{c\_{\delta,\mu}} c\_{\omega^\*} + \alpha\_{\nu}(s\_{k|t}) \tag{39}
$$

where *<sup>α</sup>w*(s*k*|*t*) :<sup>=</sup> <sup>∑</sup>*<sup>l</sup> <sup>i</sup>*=<sup>0</sup> *ai*s*<sup>i</sup> <sup>k</sup>*|*<sup>t</sup>* is a polynomial with *ai* <sup>≥</sup> 0. *<sup>c</sup>δ*,*<sup>u</sup>* and *<sup>c</sup><sup>ω</sup>* are positive constants.

#### *4.3. Implementation of the Proposed Strategy*

To conclude, the proposed tube-based event-triggered path-tracking strategy consists of an offline strategy and an online strategy. To achieve good real-time performance, the offline strategy is introduced in Algorithm 1. LMI (31) is used to calculate the tight constraint Ω and the feedback matrix *K*. Optimal control problem (37) is used to calculate the terminal feasible set *Xf* . The online strategy is introduced in Algorithm 2. The optimal control problem (29) in the LMPC controller is first solved to obtain the speed control law. Then, the control law of the tube MPC controller (10), which consists of a nominal control law and a feedback control law, is respectively calculated to track the speed control law based on these decoupled models (19), (20), and (22). According to the surge speed step signal Δ*us*, optimal control problem (38) or optimal control problem (14) is solved to obtain the nominal control law based on the offline calculated tight constraint and terminal feasible set *Xf* . Then, the offline calculated feedback control matrix is used to calculate the feedback control law to converge the deviation of the nominal and actual states.

**Algorithm 1** Offline strategy


**Algorithm 2** Online AUV path-tracking algorithm


4. Based on these decoupling models (19–20,22), separately formulate optimal control problem (38) to obtain nominal control vector *τ<sup>t</sup>* = *Fxt*, *δrt*, *δst T*

5. Otherwise:

6. Based on these decoupling models (19–20,22), separately formulate optimal control problem (14) to obtain nominal control vector *τ<sup>t</sup>* = *Fxt*, *δrt*, *δst T*

7. End


#### **5. Numerical Simulation**

Numerical simulations are conducted to demonstrate the control performance of the proposed tube-based event-triggered path-tracking strategy. Path-tracking deviation, control input smoothness, and real-time performance are used to evaluate the control performance. In order to show the variation trend of the path-tracking deviation intuitively, the path-tracking integral deviation index is introduced, e.g., *Sex* denotes the integral deviation of *x* in global coordinate system *E* − *ξηζ*:

$$Se\_{xt} = \int\_0^t |e\_{xj}| \, dj \tag{40}$$

Problem 1 is always solved by the proposed LMPC controller. These contrasting simulations differ in the method for solving Problem 2: "MPC" denotes simulation results using a nominal MPC controller from [15]. "RTMPC" denotes the simulation results using the tube MPC scheme (10)–(14) [23]. "ATMPC" denotes simulation results using the proposed tube-based event-triggered path-tracking strategy. To verify the superiority of the proposed path-tracking strategy, three real-time simulations were carried out, where "ATMPC" is compared with "RTMPC" and "MPC".

Numerical simulations were carried out using Simulink/Matlab, with AMD Ryzen Threadripper PRO 3995WX 64-Cores 2.70Ghz CPU and 256 GB RAM running Windows 10. Following this, optimal control problem (29) can be converted to a standard quadratic programming (QP) problem [22]. Then, the 'quadprog' function in Matlab can be used to solve the QP problem. When formulating the general optimal control problem (38), we refer to the open-source code, gitlab.ethz.ch/ics/RAMPC-CCM.
