*5.2. Input-Output Stability (IOS)*

To understand the notion of input-output stability, we start by considering a system *H* with input *u* and output *y*. The system *H* is a map between two signals spaces *y* = *H*(*u*). The gain *γ* of *H* measures the largest amplification from *u* to *y*, where the magnitude of the latter is computed using appropriate function norms, see [29]. *H* can be a constant, a matrix, a linear system or a nonlinear system. The gain *γ* of *H* is defined as

$$\gamma(H) = \sup\_{u \in \mathcal{L}\_p} \frac{\|y\|\_p}{\|u\|\_p} = \sup\_{u \in \mathcal{L}\_p} \frac{\|H(u)\|\_p}{\|u\|\_p}. \tag{50}$$

The system *H* is finite-gain *bounded-input bounded-output* (BIBO) if *γ*(*H*) < ∞.

The above stability concept has been extended to capture the effect of initial conditions and possible biases in the input-output operator, yielding the concept of input-to-output (IOS) stability. The resulting concept and main stability result, taken from [29], are briefly summarized next. In this context, Lyapunov stability tools can be used to establish the IOS stability of nonlinear systems represented by state models. Consider a state model presented in (46), together with output function

$$y = h(\mathbf{x}, t, \mathbf{u})\tag{51}$$

where *<sup>h</sup>* : [0, <sup>∞</sup>] <sup>×</sup> *<sup>D</sup>* <sup>×</sup> *Du* <sup>→</sup> IR*<sup>q</sup>* is piecewise continuous in *<sup>t</sup>* and continuous in (*x*, *<sup>u</sup>*), where *<sup>D</sup>* <sup>⊂</sup> IR*<sup>n</sup>* is a domain that contains *<sup>x</sup>* <sup>=</sup> 0, and *Du* <sup>⊂</sup> IR*<sup>m</sup>* is a domain that contains *u* = 0. The following theorem states conditions under which, following the terminology in Khalil, a system is L-stable or a small signal is L-stable for a given choice of signal space L. Suppose *x* = 0 is an equilibrium point of the unforced system

$$
\dot{\mathfrak{x}} = f(t, \mathfrak{x}, 0). \tag{52}
$$

**Theorem 2.** *Consider the system* (46) *and* (51) *and take r* > 0 *and ru* > 0 *such that* {*x* ≤ *r*} ⊂ *D and* {*u* ≤ *ru*} ⊂ *Du. Suppose that*

• *x* = 0 *is an equilibrium point of* (52)*, and there is Lyapunov function V*(*t*, *x*) *that satisfies*

$$c\_1 \|\mathbf{x}\|\|^2 \le V(t, \mathbf{x}) \le c\_2 \|\mathbf{x}\|\|^2 \tag{53}$$

$$\frac{\partial \upsilon}{\partial t} + \frac{\partial \upsilon}{\partial \mathbf{x}} f(t, \mathbf{x}, 0) \le -c\_3 \|\mathbf{x}\|^2 \tag{54}$$

$$\left\|\left\|\frac{\partial v}{\partial \mathbf{x}}\right\|\right\| \leq c\_4 \left\|\mathbf{x}\right\|\tag{55}$$

*for all* (*t*, *x*) ∈ [0, ∞) × *D for some positive constants c*1, *c*2, *c*3, *and c*4*.*

• *f and h satisfy the inequalities*

$$\left\|\left|f(t,\mathbf{x},\boldsymbol{u})\right\|-f(t,\mathbf{x},0)\right\|\leq L\left\|\boldsymbol{u}\right\|\tag{56}$$

$$\|\|h(t, \mathbf{x}, \boldsymbol{\mu})\|\| \le \eta\_1 \|\|\mathbf{x}\|\| + \eta\_2 \|\|\boldsymbol{\mu}\|\|\tag{57}$$

*for all* (*t*, *x*) ∈ [0, ∞) × *D* × *Du for some non negative constants L*, *η*1, *and η*2*.*

*Then, for each x*<sup>0</sup> *with x* ≤ *r* <sup>√</sup>*c*1/*c*2*, the system* (46) *and* (51) *is small-signal finite gain* <sup>L</sup>*p-stable for each <sup>p</sup>* <sup>∈</sup> [1, <sup>∞</sup>]*. In particular, for each <sup>u</sup>* ∈ L*pe with* sup*t*0≤*τ*≤*<sup>t</sup> <sup>u</sup>*(*t*) <sup>≤</sup> *min*{*ru*, *c*1*c*3*r*/(*c*2*c*4*L*)}*, the output y*(*t*) *satisfies*

$$\|\|y\_{\tau}\|\| \leq \gamma \|\|u\_{\tau}\|\|\_{\mathcal{L}\_p} + \beta \tag{58}$$

*for all τ* ∈ [0, ∞)*, with*

$$
\gamma = \eta\_2 + \frac{\eta\_1 c\_2 c\_4 L}{c\_1 c\_3},
\tag{59}
$$

$$\mathcal{B} = \eta\_1 \|\mathbf{x}\_0\| \sqrt{\frac{c\_2}{c\_1}} \rho, \quad \text{where} \quad \rho = \begin{cases} 1 & \text{if } \quad p = \infty \\ \left(\frac{2c\_2}{c\_3 p}\right)^{(1/p)}, & \text{if } \quad p \in [1, \infty) \end{cases} \tag{60}$$

*Furthermore, if the origin is globally exponentially stable and the assumptions hold globally (with <sup>D</sup>* <sup>=</sup> *IR<sup>n</sup> and Du* <sup>=</sup> *IRm), then, for each <sup>x</sup>*<sup>0</sup> <sup>∈</sup> *IRn, the system* (46) *and* (51) *is finite gain* <sup>L</sup>*p-stable for each p* ∈ [1, ∞]*.*

We refer the reader to explore [29] for details of the proof. ISS and IOS are the key Lyapunov stability tools used further for the analysis of our system.

#### *5.3. ISS Analysis*

For ISS analysis, the system model should satisfy the following equations for a suitably defined Lyapunov function candidate *V*(*t*, *x*):

$$
\mathfrak{a}\_1(\|\|x\|\|) \le V(t, x) \le \mathfrak{a}\_2(\|\|x\|\|) \tag{61}
$$

$$\frac{\partial V}{\partial t} + \frac{\partial V}{\partial x} f(t, x, u) \le -\mathcal{W}\_3(x) \quad \forall \|x\| \ge \rho(\|x\|) > 0. \tag{62}$$

where in this particular case, *f*(*t*, *x*, *u*) is the right-hand side of (45). Then, the system is ISS with, *γ* = *α*−<sup>1</sup> <sup>1</sup> ◦ *α*<sup>2</sup> ◦ *ρ* (please refer to [29] for definitions and theorems mentioned from now on).

Consider the following Lyapunov function candidate to check the ISS property of the system, given by

$$\mathbf{V} = \mathbf{x}^T \mathbf{P} \mathbf{x} \tag{63}$$

where *P* is a nonsingular symmetric matrix.

Then,

$$\lambda\_{\min}(P) \|\mathbf{x}\|\|^2 \le \mathbf{x}^T P \mathbf{x} \le \lambda\_{\max}(P) \|\mathbf{x}\|^2 \tag{64}$$

Thus, comparing (61) with Equation (64), we conclude that

$$
\mu\_1(\|\mathbf{x}\|) = \lambda\_{\min}(P) \|\mathbf{x}\|^2 \tag{65}
$$

$$\mathfrak{a}\_2(\|\!|\mathbf{x}\|\!|) = \lambda\_{\max}(P) \|\!|\mathbf{x}\|\!|^2 \tag{66}$$

The derivative of V along the trajectories defined by Equation (45) is given by

$$\dot{V} = \mathbf{x}^T \left[ A + G(\mathbf{x}) \right]^T \mathbf{P} + P[A + G(\mathbf{x})] \mathbf{x} + 2u \mathbf{B}^T \mathbf{P} \mathbf{x} \tag{67}$$

Equation (67) can be rewritten as

$$\dot{\mathcal{V}} = \mathbf{x}^T (A^T P + PA)\mathbf{x} + 2\mathbf{x}^T P G(\mathbf{x})\mathbf{x} + 2\mu B^T P \mathbf{x}.\tag{68}$$

The matrix product *PG*(*x*) results in

$$F = PG = \begin{bmatrix} -p\_{1,1}d\_1|\mathbf{x}\_1| & -p\_{1,2}d\_2|\mathbf{x}\_2| & 0\\ -p\_{1,2}d\_1|\mathbf{x}\_1| & -p\_{2,2}d\_2|\mathbf{x}\_2| & 0\\ -p\_{1,3}d\_1|\mathbf{x}\_1| & -p\_{2,3}d\_2|\mathbf{x}\_2| & 0 \end{bmatrix} = \begin{bmatrix} \bar{f}\_{1,1}|\mathbf{x}\_1| & \bar{f}\_{1,2}|\mathbf{x}\_2| & 0\\ \bar{f}\_{2,1}|\mathbf{x}\_1| & \bar{f}\_{2,2}|\mathbf{x}\_2| & 0\\ \bar{f}\_{3,1}|\mathbf{x}\_1| & \bar{f}\_{3,2}|\mathbf{x}\_2| & 0 \end{bmatrix} \tag{69}$$

where *d*<sup>1</sup> = *dv*<sup>2</sup> *mv* and *<sup>d</sup>*<sup>2</sup> <sup>=</sup> *dr*<sup>2</sup> *mr* , and *pij* is the entry *i*, *j* of *P*. Inserting both the Lyapunov equation *<sup>A</sup>TP* <sup>+</sup> *PA* <sup>=</sup> <sup>−</sup>*<sup>Q</sup>* and *<sup>x</sup>TFx* into Equation (68) yields

$$\begin{split} \mathcal{V} &= -\mathbf{x}^T \mathbf{Q} \mathbf{x} + 2 \left[ \bar{f}\_{1,1} |\mathbf{x}\_1| \mathbf{x}\_1^2 + \bar{f}\_{2,2} |\mathbf{x}\_2| \mathbf{x}\_2^2 + (\bar{f}\_{2,1} |\mathbf{x}\_1| + \bar{f}\_{1,2} |\mathbf{x}\_2|) \mathbf{x}\_1 \mathbf{x}\_2 + \bar{f}\_{3,1} |\mathbf{x}\_1| \mathbf{x}\_3 \mathbf{x}\_1 \\ &+ \bar{f}\_{3,2} |\mathbf{x}\_2| \mathbf{x}\_3 \mathbf{x}\_2 \right] + 2uB^T \mathbf{P} \mathbf{x} \end{split} \tag{70}$$

The following inequalities can be used in Equation (70):


Taking into account inequality I in Equation (70) yields

$$\begin{split} \dot{V} \leq & -\mathbf{x}^T Q \mathbf{x} + 2\left[ (|\ddot{f}\_{2,1}|\mathbf{x}\_1| + \ddot{f}\_{1,2}|\mathbf{x}\_2|) ||\mathbf{x}\_1 \mathbf{x}\_2| + |\ddot{f}\_{3,1}||\mathbf{x}\_1||\mathbf{x}\_3 \mathbf{x}\_1| + |\ddot{f}\_{3,2}|\|\mathbf{x}\_2||\mathbf{x}\_3 \mathbf{x}\_2| \right] \\ &+ 2||\boldsymbol{u}|| ||\boldsymbol{B}^T|| ||\boldsymbol{P}|| ||\mathbf{x}|| \end{split} \tag{71}$$

Now, inserting inequality II into Equation (71) leads to

$$\mathcal{V} \le -\lambda\_{\text{min}}(Q) \|\mathbf{x}\|^2 + 2\left[ (|\vec{f}\_{2,1}| + |\vec{f}\_{3,1}|)|\mathbf{x}\_1| + (|\vec{f}\_{1,2}| + |\vec{f}\_{3,2}|)|\mathbf{x}\_2| \right] \|\mathbf{x}\|^2 + 2\|\mathbf{u}\| \|B^T\| \|\mathbf{P}\| \|\mathbf{x}\|.\tag{72}$$

Concisely, Equation (72) can be expressed as:

$$\dot{V} \le -\lambda\_{\min}(Q) \|\mathbf{x}\|^2 + 2\|F(\mathbf{x})\| \|\mathbf{x}\|^2 + 2\|\mathbf{u}\| \|B^T\| \|\|P\| \|\mathbf{x}\| \tag{73}$$

where

$$\begin{split} F(\mathbf{x}) &= \left( |\vec{f}\_{2,1}| + |\vec{f}\_{3,1}| \right) |\mathbf{x}\_1| + \left( |\vec{f}\_{1,2}| + |\vec{f}\_{3,2}| \right) |\mathbf{x}\_2| \\ &= \underbrace{\left( |f\_{2,1}| + |f\_{3,1}| \underbrace{|f\_{1,2}| + |f\_{3,2}| \quad 0}\_{F'} \right)}\_{F'} \underbrace{\begin{bmatrix} |\mathbf{x}\_1| \\ |\mathbf{x}\_2| \\ |\mathbf{x}\_3| \end{bmatrix}}\_{\mathbf{x'}} = F'\mathbf{x'} \end{split} \tag{74}$$

Then, using the fact that *x*  = *x*, yields

$$\begin{split} \dot{V} &\leq -\left(\lambda\_{\min}(Q) - 2\|\vec{F}(\mathbf{x})\|\right) \|\mathbf{x}\|\|^2 + 2\|\boldsymbol{u}\|\|\|B^T\|\|\|P\|\|\|\mathbf{x}\| \\ &\leq -\left(\lambda\_{\min}(Q) - 2\|F'\|\|\|\mathbf{x}'\|\right) \|\mathbf{x}\|\|^2 + 2\|\boldsymbol{u}\|\|B^T\|\|\|P\|\|\mathbf{x}\| \\ &\leq -\left(\lambda\_{\min}(Q) - 2\|F'\|\|\|\mathbf{x}\|\right) \|\mathbf{x}\|^2 + 2\|\boldsymbol{u}\|\|B^T\|\|P\|\|\mathbf{x}\| \end{split} \tag{75}$$

Notice that for a given *δ*, there exists some *r* > 0 such that

$$|F(\mathbf{x})| < \delta, \quad \forall ||\mathbf{x}|| < r \tag{76}$$

Equation (75) can be rewritten as

$$\begin{array}{c} \dot{V} \le -\left(1-\theta\right)\left[\lambda\_{\min}(Q) - 2\delta\right] \|\mathbf{x}\|^2 - \left[\theta\left(\lambda\_{\min}(Q) - 2\delta\right)\|\mathbf{x}\|\right]^2\\ \qquad - 2\|\boldsymbol{u}\| \|B\| \|\boldsymbol{P}\| \|\mathbf{x}\|\| \end{array} \tag{77}$$

Then,

$$\dot{V} \le -(1 - \theta) \left[ \lambda\_{\min}(Q) - 2\delta \right] \|\mathbf{x}\|^2 \tag{78}$$

for

$$
\delta < \frac{\lambda\_{\min}(Q)}{2} \tag{79}
$$

and

$$||\mathfrak{x}|| > \frac{2||\mathfrak{u}|| \|\mathcal{B}^T|| ||\mathcal{P}||}{\theta \left[\lambda\_{\min}(\mathcal{Q}) - 2\delta\right]}.$$

As a consequence, the system with closed-loop dynamics defined by Equation (44) is ISS with

$$\begin{aligned} W\_3 &= (1 - \theta) \left[ \lambda\_{\min}(Q) - 2\delta \right], \\ \rho &= \frac{2|\mu| ||B^T|| ||P||}{\theta \left[ \lambda\_{\min}(Q) - 2\delta \right]}, \\\\ \gamma &= \frac{\lambda\_{\max}(P)}{\lambda\_{\min}(P)} \frac{2|\mu| ||B^T|| ||P||}{\theta \left[ \lambda\_{\min}(Q) - 2\delta \right]}. \end{aligned}$$

*λmin*(*P*) *θ λmin*(*Q*) − 2*δ*

and

*5.4. IOS Analysis*

The proof of the IOS property of the same system (represented by (44)) is based on Theorem 2 [29]. Consider the system

$$
\dot{\mathbf{x}} = f(\mathbf{x}, \boldsymbol{\mu}), \quad \mathbf{x}(0) = \mathbf{x}\_0 \tag{80}
$$

$$y = h(x) \tag{81}$$

According to Theorem 2, if the system (80) and (81) satisfies the conditions shown below, then the system is small-signal finite-gain L*p*-stable for each *p* ∈ [1, ∞]. In particular, for each *<sup>u</sup>* ∈ L*pe* with *sup*0≤*t*≤*<sup>τ</sup> <sup>u</sup>*(*t*)<sup>≤</sup> *min*{*ru*, *<sup>c</sup>*1*c*3*r*/(*c*2*c*4L)}, the output satisfies

$$\|\|\mathcal{Y}\|\|\mathcal{L}\_p \le \gamma \|\|\mu\_\mathbb{F}\|\|\mathcal{L}\_p + \beta \tag{82}$$

where the parameters *γ* and *β* are given by

$$
\gamma = \eta\_2 + \frac{\eta\_1 c\_2 c\_4}{c\_1 c\_3},
\tag{83}
$$

and

$$\mathcal{B} = \eta\_1 \|\mathbf{x}\_0\| \sqrt{\frac{c\_2}{c\_1}} \rho, \quad \text{where} \quad \rho = \begin{cases} 1 & \text{if } \quad p = \infty \\ \left(\frac{2c\_2}{c\_3 p}\right)^{(1/p)} & \text{if } \quad p \in [1, \infty) \end{cases}.\tag{84}$$

The parameters *c*1, *c*2, *c*3, *c*4, *η*1, and *η*<sup>2</sup> are determined from inequalities in Theorem 2.

For the particular case of the system under consideration, Equations (80) and (81) are given as

$$
\dot{\mathbf{x}} = f(\mathbf{x}) = A\mathbf{x} + G(\mathbf{x})\mathbf{x} + Bu; \quad \mathbf{x}(0) = \mathbf{x}\_0 \tag{85}
$$

$$y = h(\mathbf{x}) = H\mathbf{x} \tag{86}$$

where

$$H = \begin{bmatrix} 0 & 0 & 1 \ \end{bmatrix} \tag{87}$$

Thus, considering the Lyapunov function defined by Equation (63) yields the following sequence of partial results.

• From inequality (53)

$$
\lambda\_{\min}(P)||\mathbf{x}||^2 \le \mathbf{x}^T P \mathbf{x} \le \lambda\_{\max}(P)||\mathbf{x}||^2 \tag{88}
$$

Thus,

*c*<sup>1</sup> = *λmin*(*P*) and *c*<sup>2</sup> = *λmax*(*P*)

• From inequality (54)

$$\frac{\partial V}{\partial \mathbf{x}} f(\mathbf{x}, 0) \le -\left[\lambda\_{\text{min}}(Q) - 2\delta\right] \|\mathbf{x}\|^2 \tag{89}$$

and therefore *c*<sup>3</sup> = *λmin*(*Q*) − 2*δ*

• From inequality (55)

 *∂V <sup>∂</sup><sup>x</sup>* <sup>=</sup> <sup>2</sup> *<sup>x</sup>TP*<sup>≤</sup> <sup>2</sup>*λmax*(*P*)*<sup>x</sup>* (90)

Thus, *c*<sup>4</sup> = 2*λmax*(*P*)

• From inequality (56)

$$\|\|f(t, \mathbf{x}, \boldsymbol{\mu}) - f(t, \mathbf{x}, \mathbf{0})\|\| = \|Bu\|\| \le \|B\| \|\|u\|\|\tag{91}$$

and therefore <sup>L</sup> <sup>=</sup> *<sup>B</sup>* <sup>=</sup> <sup>6</sup>*λmax*(*BTB*). • From inequality (57)

$$\|\|h(\mathbf{x})\|\| \le \|\|H\|\| \|\mathbf{x}\|\|,\tag{92}$$

we obtain that

*<sup>η</sup>*<sup>1</sup> <sup>=</sup> *<sup>H</sup>* <sup>=</sup> <sup>6</sup>*λmax*(*HTH*) and *<sup>η</sup>*<sup>2</sup> <sup>=</sup> <sup>0</sup>

From the above, the parameters *γ<sup>f</sup>* = *γ* and *β <sup>f</sup>* = *β* for the Medusa model are given by

$$\gamma\_f = \frac{\eta\_1 c\_2 c\_4}{c\_1 c\_3} = \frac{||H||\lambda\_{\text{max}}^2(P)2\sqrt{\lambda\_{\text{max}}(B^T B)}}{\lambda\_{\text{min}}(P)\left[\lambda\_{\text{min}}(Q) - 2\delta\right]}\tag{93}$$

$$\beta\_f = \eta\_1 \|\mathbf{x}\_0\| \sqrt{\frac{c\_2}{c\_1}} \rho = \|H\| \|\mathbf{x}\_0\| \sqrt{\frac{\lambda\_{\max(P)}}{\lambda\_{\min}(P)}} \quad for \quad p = \infty \tag{94}$$

**Remark 1.** *From a mathematical standpoint, the machinery adopted for the description of the systems under study, that is, inner (dynamic) and outer (kinematic) dynamics, is rooted in their characterization as ISS (input-to-state stable) or IOS (input-to-output stable) systems. This allows us to use powerful tools of nonlinear stability analysis. The core mathematical characterization of IOS and ISS hinges on the assumption that all functions involved in the description of the systems of interest are piecewise continuous in time and locally Lipschitz in the state and input variables. This is clearly indicated in the results on ISS described in Sections 5.1 and 5.2, as applied to the system described by Equation* (44)*. Clearly, all functions involved (which capture the physical description of the vehicle) satisfy the conditions stated above. Identical comments apply to the results on IOS described in Sections 5.3 and 5.4, as applied to the system described by Equations* (85)*–*(87)*, consisting of Equation* (44) *together with the trivial output function h*(*x*) = *Hx, H* = [001] *described in Equations* (86) *and* (87)*. Again, all functions involved satisfy the conditions stated above (see Equation* (56)*. In addition, h*(*x*) *satisfies the extra output-related conditions in Equation* (57)*.*

#### **6. Path Following Problem**

Equipped with the above mathematical definitions and results, we now tackle the problem of path following. In the current setup, we design the kinematic (outer) loop without considering the dynamic (inner) loop or by assuming the inner loop is infinitely fast, which is not valid in practice. Moreover, the characteristics of inner loop controllers (such as heading and speed controllers) for many vehicles are provided in very general terms by their vendors. An example of these characteristics in a linear case is the approximate bandwidth and input-to-output stability gain (IOS) in the case of a nonlinear system [29]. Therefore, it is required for the system engineers to design or tune the outer-loop controller by considering these characteristics, such that the overall combined system is stable with the desired performance. However, this step necessitates going beyond qualitative assertions about the fast-slow temporal scale separation and quantitatively evaluating the combined inner-outer loop to obtain a relationship for assessing the combined system's stability. The methods used are based on nonlinear control theory, wherein the cascade and feedback systems of interest are characterized in terms of their IOS properties. We use the IOS small-gain theorem to obtain quantitative relationships for best controller tuning applicable to a broad range of marine vehicles.

The path-following controller discussed in this article is designed at the kinematic outer-loop that commands the inner-loop with the desired heading angles while the vehicle moves at an approximately constant speed. The idea is to provide a seamless implementation of the path-following control algorithms on the heterogeneous vehicles, which are pre-equipped with heading autopilots. To this effect, we assume that the heading control system is characterized only in terms of an IOS-like relationship without knowing detailed vehicle dynamic parameters.

#### *6.1. Path Following: Straight Lines Problem*

Figure 5 shows the path following problem for straight lines. In the figure, {I} = {*xI*, *yI*} represents the inertial reference frame, and {B} = {*xB*, *yB*} denotes a body reference frame fixed to the vehicle. Let us denote the position of the vehicle as vector *P* expressed in {I}. We assume that the ocean current velocity represented by *Vc* expressed in {I} is constant. The velocity of the vehicle expressed in {I} is given by

$$\boldsymbol{\mathcal{P}} = \mathcal{R}(\boldsymbol{\psi}) V\_{\boldsymbol{w}} + V\_{\boldsymbol{c}\boldsymbol{\nu}}$$

where *ψ* is the yaw angle, *Vw* denotes the velocity of the vehicle with respect to the water expressed in {B}, and *R*(.) is the rotation matrix from {B} to {I}, parameterized by *ψ*. Equivalently,

$$\dot{P} = \mathcal{R}(\psi + \beta) \begin{bmatrix} ||V\_w|| \ 0 \end{bmatrix}^T + V\_{\mathcal{C}\prime}$$

where *β* is the sideslip angle. Without any loss of generality, the straight-line path to be followed can be assumed to be along the *x*-axis of the inertial reference frame {I}. The evolution of the cross-track error *e* is given by

$$\dot{\varepsilon} = \sin(\psi + \beta) \parallel V\_w \parallel + v\_{cyr}$$

where *vcy* denotes the component of *Vc* along the unit vector *yI*. The total speed of the vehicle is set by an equivalent speed of rotation of the stern propeller(s) and the heading of the vehicle is controlled either by differential mode of two stern propellers or by the stern rudders operated in common mode.

**Figure 5.** Marine vehicle body reference frame showing the cross-track error.

We assume that the total speed *Vw* = *U* > *Vc* is constant. The objective is to command the heading angle which the vehicle can follow to drive the *e* to zero. In the following section, as a first step, we design an outer-loop controller at the kinematic level and show the convergence of the cross-track error to zero. In the second step, we include the yaw control dynamics (inner-loop) and determine the conditions and outer-loop tuning rules such that the complete inner-outer loop system is stable.

#### *6.2. Path-Following Algorithm*

To explain the rationale for the control law, we simplify the case by considering zero sideslip angle (this assumption will be lifted afterwards). In this case, the error dynamics are given by

$$\dot{\epsilon} = \mathcal{U}\sin(\psi) + \upsilon\_{cy}.\tag{95}$$

If we consider *vcy* to be zero, then (95) can be re-written as

$$\ell = \mathcal{U}u\_r$$

with *u* = sin(*ψ*). The choice of the control law *u* = −(*K*1/*U*)*e* would now ensure that *e* converges asymptotically and exponentially to the origin. In order to compensate for a fixed ocean current (bias) *vcy*, an integral term is introduced in the virtual input *u*, which is now re-rewritten as

$$\mu = -\frac{1}{U} \left( K\_1 e + K\_2 \int\_0^t e(\tau) \, d\tau \right).$$

As a consequence, the dynamics of *e* become

$$
\dot{e} + K\_1 e + K\_2 \int\_0^t e(\tau) \, d\tau = 0
$$

Let

$$\boldsymbol{\xi} = \int\_0^t \boldsymbol{e}(\boldsymbol{\tau}) \, d\boldsymbol{\tau}.$$

Then,

$$
\ddot{\mathfrak{z}} + \mathsf{K}\_1 \dot{\mathfrak{z}} + \mathsf{K}\_2 \mathfrak{z} = 0 \tag{96}
$$

The gains *K*<sup>1</sup> and *K*<sup>2</sup> can now be chosen so as to obtain a desired natural frequency and a desired damping factor in the above second-order system. The desired heading command obtained from the above virtual control is written as

$$\psi\_d = \sin^{-1}(\sigma\_\varepsilon(\mathfrak{u}))\_\prime$$

where *σ<sup>e</sup>* is a differentiable saturation function [42] bounded between ±*es* with 0 < *es* < 1, defined as

$$
\sigma\_{\mathfrak{c}}(\boldsymbol{\varrho}) = \begin{cases}
\begin{array}{c}
\varrho & \text{if } |\boldsymbol{\varrho}| < \varepsilon\_{\mathfrak{s}} - \varepsilon \\
& + \varepsilon\_{\mathfrak{s}} & \text{if } \boldsymbol{\varrho} > \varepsilon\_{\mathfrak{s}} + \varepsilon \\
& - \varepsilon\_{\mathfrak{s}} & \text{if } \boldsymbol{\varrho} < -\varepsilon\_{\mathfrak{s}} - \varepsilon \\
p\_{1}(\boldsymbol{\varrho}) = -\varepsilon\_{1}\boldsymbol{\varrho}^{2} + \varepsilon\_{2}\boldsymbol{\varrho} - \varepsilon\_{3} & \text{if } \boldsymbol{\varrho} \in \left[ \varepsilon\_{\mathfrak{s}} - \varepsilon\_{\mathfrak{s}}\varepsilon\_{\mathfrak{s}} + \varepsilon \right] \\
p\_{2}(\boldsymbol{\varrho}) = \varepsilon\_{1}\boldsymbol{\varrho}^{2} + \varepsilon\_{2}\boldsymbol{\varrho} + \varepsilon\_{3} & \text{if } \boldsymbol{\varrho} \in \left[ -\varepsilon\_{\mathfrak{s}} - \varepsilon\_{\mathfrak{s}} - \varepsilon\_{\mathfrak{s}} + \varepsilon \right]
\end{array} \tag{97}
$$

where 0 < < *es* can be arbitrarily small, with *c*<sup>1</sup> = <sup>1</sup> <sup>4</sup> , *<sup>c</sup>*<sup>2</sup> <sup>=</sup> <sup>1</sup> <sup>2</sup> <sup>+</sup> *es* <sup>2</sup> , and *<sup>c</sup>*<sup>3</sup> <sup>=</sup> 2−2*es*+*e*<sup>2</sup> *s* <sup>4</sup> . The saturation function is introduced to guarantee that the argument of *sin*−1(.) lies in the interval [−1, +1], see Figure 6.

**Figure 6.** Differentiable saturation function.

With the introduction of integrator in the control law, it is important to have an antiwindup mechanism in the integral term of *u*. Thus, the final form of the control law for *ψ<sup>d</sup>* involves a new definition of *u* and is given in terms of the operator *f* : *e* → *ψ<sup>d</sup>* defined by

$$\psi\_d = \sin^{-1}(\sigma\_\varepsilon(u)); u = \left(-\frac{K\_1\varepsilon}{U} - \frac{K\_2}{U}\xi\right) \tag{98}$$

where *ς* is the output of the dynamical system *faw*(*e*) : *e* → *ς* with realization

$$\dot{\zeta} = \varepsilon + K\_d \left[ -\frac{K\_1 \varepsilon}{lI} - \frac{K\_2 \zeta}{lI} - \sigma\_\varepsilon \left( -\frac{K\_1 \varepsilon}{lI} - \frac{K\_2 \zeta}{lI} \right) \right],\tag{99}$$

and *Ka* is an anti-windup gain to control the integrator's charge and discharge rate. In what follows, we show with the help of Lyapunov-based analysis tools that using the above control law, the cross-track error converges to zero if the actual vehicle heading *ψ* equals *ψd*.

#### *6.3. Convergence of Cross-Track Error without the Inner Loop Dynamics*

Using the control law mentioned in (98) and (99), and *Ka* = *<sup>U</sup> K*1 , the closed-loop kinematic equations can now be written as,

$$\dot{\varepsilon} = \mathcal{U} \sigma\_{\varepsilon} \left( -\frac{K\_1 \varepsilon}{\mathcal{U}} - \frac{K\_2 \xi}{\mathcal{U}} \right) + V\_{\text{yc}} \tag{100}$$

$$\dot{\zeta} = -\frac{K\_2}{K\_1}\zeta - \frac{\mathcal{U}}{K\_1}\sigma\_\varepsilon \left(-\frac{K\_1\varepsilon}{\mathcal{U}} - \frac{K\_2\xi}{\mathcal{U}}\right),\tag{101}$$

Define the new set of variables

$$\begin{aligned} \mathbf{x}\_1 &= \mathbf{e} \\ \mathbf{x}\_2 &= \boldsymbol{\zeta} - \mathbf{K}\_\prime \end{aligned} \tag{102}$$

where *K* is a constant.

The equations of motion can then be written as

$$\dot{\mathbf{x}}\_1 = \mathcal{U}\sigma\_\mathbf{f} \left( -\frac{\mathcal{K}\_1 \mathbf{x}\_1}{\mathcal{U}} - \frac{\mathcal{K}\_2 \mathbf{x}\_2}{\mathcal{U}} - \frac{\mathcal{K} \mathcal{K}\_2}{\mathcal{U}} \right) + V\_{\mathbf{y}\varepsilon} \tag{103}$$

$$\dot{\mathbf{x}}\_{2} = -\frac{K\_{2}}{K\_{1}}\mathbf{x}\_{2} - \frac{K\_{2}}{K\_{1}}\mathbf{K} - \frac{\mathbf{U}}{K\_{1}}\sigma\_{\varepsilon} \left(-\frac{\mathbf{K}\_{1}\mathbf{x}\_{1}}{\mathcal{U}} - \frac{\mathbf{K}\_{2}\mathbf{x}\_{2}}{\mathcal{U}} - \frac{\mathbf{K}\mathbf{K}\_{2}}{\mathcal{U}}\right). \tag{104}$$

We define another set of variables as

$$\begin{aligned} rly\_1 &= \frac{K\_1 x\_1}{\underline{U}} + \frac{K\_2 x\_2}{\underline{U}} r \\ y\_2 &= \frac{K\_2 x\_2}{\underline{U}} \end{aligned} \tag{105}$$

In terms of the new variables above,

$$\begin{split} \dot{y}\_1 &= -K\_1 \sigma\_\varepsilon \left( y\_1 + \frac{K K\_2}{\mathcal{U}} \right) + K\_1 \frac{V\_{yc}}{\mathcal{U}} + \dot{y}\_2\\ \dot{y}\_2 &= -\frac{K\_2}{K\_1} y\_2 - \frac{K\_2}{K\_1} \frac{K K\_2}{\mathcal{U}} + \frac{K\_2}{K\_1} \sigma\_\varepsilon \left( y\_1 + \frac{K K\_2}{\mathcal{U}} \right), \end{split} \tag{106}$$

At this point, we explore an important property of the *σ<sup>e</sup>* function defined in (97).

#### **Property 1.**

$$
\sigma\_\mathfrak{e}(Z+\mathfrak{x}) - Z = \sigma\_{l\_\ast}^{\mu\_\ast}(\mathfrak{x}) \,\,\forall\,\,\,|Z|\,<\mathfrak{e}\_{\mathfrak{s},\gamma}
$$

*where ls* = −*es* − |*Z*| *and us* = *es* − |*Z*|*.*

To simplify the notation, we use *σ* instead of *σus ls* from here on. Using this property, we can write

$$
\sigma\_{\varepsilon} \left( y\_1 + \frac{KK\_2}{\mathcal{U}} \right) - \frac{KK\_2}{\mathcal{U}} = \sigma(y\_1)\_{\prime} \quad \forall \quad \left| \frac{KK\_2}{\mathcal{U}} \right| < \varepsilon\_{s\prime} \tag{107}
$$

and later in the proof, it will be evident that *KK*<sup>2</sup> *U* <sup>&</sup>lt; *es*. Thus, by simplifying further, we get

$$\begin{aligned} \dot{y}\_1 &= -K\_1 \sigma(y\_1) - K\_1 \frac{KK\_2}{\mathcal{U}} + K\_1 \frac{V\_{yc}}{\mathcal{U}} + \dot{y}\_2\\ \dot{y}\_2 &= \frac{K\_2}{K\_1} \sigma(y\_1) - \frac{K\_2}{K\_1} y\_2 \end{aligned} \tag{108}$$

Choosing *V*(*y*1, *y*2) = *y*1 0 *σ*(*η*)*dη* + <sup>1</sup> 2 *y*2 <sup>2</sup> as a Lyapunov candidate function yields

$$\begin{split} \dot{V} &= \sigma(y\_1)\dot{y}\_1 + y\_2\dot{y}\_2 \\ &= \sigma(y\_1) \left[ -K\_1\sigma(y\_1) - K\_1 \frac{KK\_2}{\mathcal{U}} + 1 \right. \\ &K\_1 \frac{V\_{yc}}{\mathcal{U}} + \frac{K\_2}{K\_1}\sigma(y\_1) - \frac{K\_2}{K\_1}y\_2 \right] \\ &= -\left(K\_1 - \frac{K\_2}{K\_1}\right)\sigma^2(y\_1) - \frac{K\_2}{K\_1}y\_2^2 + \\ &\sigma(y\_1) \left[ K\_1 \frac{V\_{yc}}{\mathcal{U}} - K\_1 \frac{KK\_2}{\mathcal{U}} \right]. \end{split}$$

Making

$$K = \frac{V\_{\rm yc}}{K\_2} \tag{109}$$

yields

$$\dot{V} = -\left(K\_1 - \frac{K\_2}{K\_1}\right)\sigma^2(y\_1) - \frac{K\_2}{K\_1}y\_2^2\tag{110}$$

At this point, it is reasonable to assume that the vehicle speed with respect to water is larger than the intensity of the ocean current, that is,

$$\|U > \frac{1}{c\_s} \|V\_c\|. \tag{111}$$

Using the above assumption, it is now straightforward to show that *KK*<sup>2</sup> *U* <sup>&</sup>lt; *es*. Thus,

$$
\dot{V} < 0 \quad \forall \ K\_1 > \frac{K\_2}{K\_1}. \tag{112}
$$

We therefore conclude that the origin *y*<sup>1</sup> = *y*<sup>2</sup> = 0 is asymptotically stable. It is now trivial to show that the cross-track error *e* will tend to zero and the integrator *ς* will charge up to *Vyc <sup>K</sup>*<sup>2</sup> , in order to "learn" the currents as time increases.

### *6.4. Inner-Loop Dynamics*

The key goal of this paper is to show that "identical behavior" is obtained when the dynamics of the heading autopilot (inner loop) and the sideslip of the vehicle are taken into account. In particular, we show that *the basic structure and the simplicity of the outer-loop control law are preserved*. The theoretical machinery used to prove stability borrows from IOS concepts and a related small-gain theorem. See [29] for a fast-paced introduction to the subject and [43,44] for interesting applications of control techniques that bear affinity with inner-outer loop control structures. Here, we indicate briefly how the existence of the heading autopilot is taken into account without having to change the structure of the outer-loop described before. The resulting control scheme is depicted in Figure 7, where the heading autopilot plays the role of an inner loop.

This section addresses explicitly the inclusion of the inner-loop dynamics, thus lifting the assumption that the actual heading *ψ* equals the desired heading *ψd*. Let

$$
\ddot{\psi} = \psi - \psi\_d,
$$

be the mismatch between actual and desired heading angles. We assume that the autopilot characteristics can be described in very general terms as an IOS system, see [29]. In order to understand the rationale for this characterization, notice that if the inner-loop dynamics are linear with static gain equal to 1, then its dynamics admit a realization of the form

$$\begin{aligned} \dot{\mathfrak{x}} &= A\mathfrak{x} + B\psi\_d \\ \psi &= \mathbb{C}\mathfrak{x} \end{aligned}$$

with *CA*−1*B* = 1. In this case, the coordinate transformation *η* = *x* + *A*−1*Bψ<sup>d</sup>* yields the realization

$$\begin{aligned} \dot{\eta} &= A\eta + A^{-1}B\psi\_d, \\ \ddot{y} &= C\eta \end{aligned}$$

for the operator from *ψ*˙ to *y*˜, with *y*˜ = *ψ*˜ + *β* that characterizes the inner-loop dynamics, where *β* is sideslip angle and the output *y*˜ is the sum of the heading angle and sideslip angle. An IOS characterization of the loop can be easily derived from the above system matrices [29]. Notice, however, that this type of description applies also to general nonlinear systems of the form

$$\begin{aligned} \dot{\eta} &= \lg(\eta\_{\prime}\dot{\psi}\_{d}) \\ \ddot{y} &= h(\eta\_{\prime}\dot{\psi}\_{d}) \end{aligned}$$

and allows for a somewhat loose, yet quantifiable description of the inner-loop dynamics. This justifies the IOS characterization of the inner loop dynamics as

$$\|\|\ddot{y}(t)\|\| \le \gamma\_f \|\|\dot{\psi}\_d(t)\|\| + \beta\_{f'} \tag{113}$$

where *γ<sup>f</sup>* and *β <sup>f</sup>* are nonnegative constants. The above characterization captures in a rigorous mathematical framework simple physical facts about the inner-loop control system. Namely, (i) if the time-derivative of the heading reference *ψ<sup>d</sup>* is bounded, then the

heading-tracking error is bounded and (ii) the dynamics of the inner-loop system can be characterized in terms of bandwidth-like characteristics that are reflected in *β <sup>f</sup>* and *γ<sup>f</sup>* , see [29]. A simple exercise with a first-order system will convince the reader that as the bandwidth of the system increases, *γ<sup>f</sup>* will decrease. For practical purposes, the latter can be viewed as a "tuning knob" during the path-following controller design phase. For analysis purposes, it is also required to ensure that not only *y*˜ but also the remaining variables in the inner loop be bounded in response to *ψ*˙ *<sup>d</sup>*. This fact can be easily captured with an ISS condition of the type

$$\|\|\eta(t)\|\| \le \beta\_{\mathcal{S}}(\|\|\eta(0)\|, t) + \gamma\_{\mathcal{S}}\left(\sup\_{t\_0 \le \tau \le t} \|\dot{\psi}\_d(\tau)\|\right),\tag{114}$$

for some *β<sup>g</sup>* ∈ KL and *γ<sup>g</sup>* ∈ K. We have shown before that such a condition holds. At this point, we make the key observation that the complete path-following control system can be represented as the interconnected structure depicted in Figure 8. The latter can be further abstracted to the scheme in Figure <sup>9</sup> consisting of blocks *<sup>H</sup>*<sup>1</sup> : *<sup>y</sup>*˜ → *<sup>ψ</sup>*˙ *<sup>d</sup>* and *H*<sup>2</sup> : *ψ*˙ *<sup>d</sup>* → *y*˜, a description of which is given next. To this effect, using the control law mentioned in (98) and (99), the system *H*<sup>1</sup> clearly admits the following representation

$$\begin{aligned} \dot{\varepsilon} &= \mathcal{U}\sin(\tilde{y} + \psi\_d) + v\_{\varepsilon\mathcal{Y}\prime} \\ \dot{\xi} &= -\frac{K\_2}{K\_1}\varepsilon - \frac{\mathcal{U}}{K\_1}\sigma\_\varepsilon \left( -\frac{K\_1\varepsilon}{\mathcal{U}} - \frac{K\_2\varepsilon}{\mathcal{U}} \right) \\ \psi\_d &= \sin^{-1}\left( \sigma\_\varepsilon \left( -\frac{K\_1\varepsilon}{\mathcal{U}} - \frac{K\_2}{\mathcal{U}}\varepsilon \right) \right), \end{aligned} \tag{115}$$

and *H*<sup>2</sup> satisfies the IOS stability condition in (113).

Inner Loop Dynamics

**Figure 8.** IOS characterization of inner-outer loop.

**Figure 9.** General feedback interconnection.

#### *6.5. Convergence: Realistic Inner-Loop Dynamics*

The proof that *H*<sup>1</sup> is IOS hinges on the facts that *H*<sup>1</sup> is the composition of two auxiliary systems *Ha*<sup>1</sup> : *<sup>y</sup>*˜ → *<sup>e</sup>* and *Ha*<sup>2</sup> : *<sup>e</sup>* → *<sup>ψ</sup>*˙ and that both are IOS. This is done next. Expanding Equation (115) and following the transformation of variables as mentioned in (105), the equation of motion can be rewritten as

$$\begin{aligned} \dot{y}\_1 &= -K\_1 \cos \tilde{y} \sigma\_\varepsilon \left( y\_1 + \frac{K K\_2}{\underline{U}} \right) + K\_1 \sin \tilde{y} \cos \psi\_d + \\ &\frac{K\_1}{\underline{U}} V\_{y\varepsilon} + \dot{y}\_2 \\ \dot{y}\_2 &= \frac{K\_2}{K\_1} \left[ \sigma\_\varepsilon \left( y\_1 + \frac{K K\_2}{\underline{U}} \right) - \frac{K K\_2}{\underline{U}} - \frac{K\_2}{K\_1} y\_2 \right] \end{aligned} \tag{116}$$

By adding and subtracting the term *K*<sup>1</sup> cos *y*˜ *KK*<sup>2</sup> *<sup>U</sup>* , and by using the special property of the function *σ<sup>e</sup>* in (107), we can write

$$\begin{aligned} \dot{y}\_1 &= -K\_1 \cos \vec{y} \sigma(y\_1) + K\_1 \sin \vec{y} \cos \psi\_d + \frac{K\_1}{\underline{U}} V\_{\text{yc}} \\ &- K\_1 \cos \vec{y} \frac{K K\_2}{\underline{U}} + \frac{K\_2}{K\_1} \sigma(y\_1) - \frac{K\_2}{K\_1} y\_2 \\ \dot{y}\_2 &= \frac{K\_2}{K\_1} \sigma(y\_1) - \frac{K\_2}{K\_1} y\_2 \end{aligned} \tag{117}$$

Choosing the same Lyapunov function as in Section 6.3 yields

$$\begin{aligned} \dot{\mathcal{V}} &= \sigma(y\_1)\dot{y}\_1 + y\_2\dot{y}\_2 \\ &= \sigma(y\_1)[-K\_1\cos\bar{y}\sigma(y\_1) + K\_1\sin\bar{y}\cos\psi\_d \\ &+ \frac{K\_1}{\mathcal{U}}V\_{yc} - K\_1\cos\bar{y}\frac{K\mathcal{K}\_2}{\mathcal{U}} + \frac{K\_2}{K\_1}\sigma(y\_1) - \frac{K\_2}{K\_1}y\_2] \\ &+ y\_2\left[\frac{K\_2}{K\_1}\sigma(y\_1) - \frac{K\_2}{K\_1}y\_2\right] \\ &= -K\_1\cos\bar{y}\sigma^2(y\_1) - \frac{K\_2}{K\_1}y\_2^2 \\ &+ \sigma(y\_1)\left[K\_1\sin\bar{y}\cos\psi\_d + \frac{K\_1}{\mathcal{U}}V\_{yc} - K\_1\cos\bar{y}\frac{K\mathcal{K}\_2}{\mathcal{U}}\right] \\ &+ \frac{K\_2}{K\_1}\sigma^2(y\_1) \\ &= -\left(K\_1\cos\bar{y} - \frac{K\_2}{K\_1}\right)\sigma^2(y\_1) - \frac{K\_2}{K\_1}y\_2^2 \\ &+ \sigma(y\_1)\left[K\_1\sin\bar{y}\cos\psi\_d + \frac{K\_1}{\mathcal{U}}V\_{yc} - K\_1\cos\bar{y}\frac{K\mathcal{K}\_2}{\mathcal{U}}\right], \end{aligned} \tag{118}$$

Now, substituting *K* from (109), we obtain

$$\begin{split} \dot{V} &= -\left(K\_1 \cos \tilde{y} - \frac{K\_2}{K\_1}\right) \sigma^2(y\_1) - \frac{K\_2}{K\_1} y\_2^2 \\ &+ \sigma(y\_1) \left[ K\_1 \sin \tilde{y} \cos \psi\_d + \frac{K\_1}{\underline{U}} V\_{\text{yc}} (1 - \cos \tilde{y}) \right]. \end{split}$$

For

$$K\_1 \cos \tilde{y} \ge \frac{K\_2}{K\_1} + \delta\_\prime \quad \text{with } 0 < \delta \le K\_1 - \frac{K\_2}{K\_1}\prime \tag{119}$$

we can further simplify the equations as

$$\begin{split} \dot{V} &\leq -\delta\sigma^{2}(y\_{1}) - \frac{K\_{2}}{K\_{1}}y\_{2}^{2} \\ &\quad + \sigma(y\_{1}) \Big[ K\_{1}\sin\bar{y}\cos\psi\_{d} + \frac{K\_{1}}{\underline{U}}V\_{yc}(1-\cos\bar{y}) \Big], \\ &= -\delta\sigma^{2}(y\_{1}) - \frac{K\_{2}}{K\_{1}}y\_{2}^{2} \\ &\quad + |\sigma(y\_{1})| \Big[ |K\_{1}\sin\bar{y}\cos\psi\_{d}| + \left|\frac{K\_{1}}{\underline{U}}V\_{yc}\right| |1-\cos\bar{y}| \Big], \\ &= -\delta\sigma^{2}(y\_{1}) - \frac{K\_{2}}{K\_{1}}y\_{2}^{2} \\ &\quad + |\sigma(y\_{1})|K\_{1}\left[\left|\frac{V\_{yc}}{\underline{U}}\right| |1-\cos\bar{y}| + |\sin\bar{y}|\right], \\ &= -\delta(1-\theta)\sigma^{2}(y\_{1}) - \delta\theta\sigma^{2}(y\_{1}) - \frac{K\_{2}}{K\_{1}}y\_{2}^{2} \\ &\quad + |\sigma(y\_{1})|K\_{1}\left[\left|\frac{V\_{yc}}{\underline{U}}\right| |1-\cos\bar{y}| + |\sin\bar{y}|\right], \end{split}$$

where 0 < *θ* < 1. This implies that

> *<sup>V</sup>*˙ <sup>&</sup>lt; <sup>−</sup>*δ*(<sup>1</sup> <sup>−</sup> *<sup>θ</sup>*)*σ*2(*y*1) <sup>−</sup> *<sup>K</sup>*<sup>2</sup> *K*1 *y*2 2 ∀|*σ*(*y*1)| > *K*1 *δθ Vyc U* |1 − cos *y*˜| + |sin *y*˜| . (120)

Since *Vyc U* |<sup>1</sup> <sup>−</sup> cos *<sup>y</sup>*˜<sup>|</sup> <sup>+</sup> <sup>|</sup>sin *<sup>y</sup>*˜<sup>|</sup> is bounded by *Vyc U* <sup>+</sup> <sup>1</sup> (|*y*˜|), it follows that

$$\dot{V} < 0 \quad \forall |\sigma(y\_1)| > \quad \frac{K\_1}{\delta \theta} \left( \left| \frac{V\_{yc}}{L} \right| + 1 \right) |\ddot{y}| \tag{121}$$

thus showing that *y* = [*y*<sup>1</sup> *y*2] *<sup>T</sup>* is ISS with restriction given by (119) on the input. Thus, from the definition of ISS, we obtain

$$||y(t)|| \le \beta\_l(\|y(0)\|, t) + \gamma\_l \left(\sup\_{0 \le \tau \le t} |\bar{y}(\tau)|\right) \quad \forall \ t \ge 0,\tag{122}$$

where *<sup>β</sup><sup>l</sup>* is a class KL-function, and *<sup>γ</sup><sup>l</sup>* is a class K-function. To show that *<sup>H</sup>*<sup>1</sup> : *<sup>y</sup>*˜ → *<sup>ψ</sup>*˙ *<sup>d</sup>* is IOS, we start by computing *ψ*˙ *<sup>d</sup>*. The control law *ψ<sup>d</sup>* is given by

$$\psi\_d = \sin^{-1}\left\{\sigma\_\varepsilon \left(-\frac{K\_1 \varepsilon}{\underline{U}} - \frac{K\_2}{\underline{U}} \xi\right)\right\}.\tag{123}$$

Using (105), the above can be written as

$$\psi\_d = \sin^{-1}\left\{\sigma\_\varepsilon \left(-y\_1 - \frac{KK\_2}{\mathcal{U}}\right)\right\}.\tag{124}$$

Defining *<sup>ξ</sup>* <sup>=</sup> <sup>−</sup>*y*<sup>1</sup> <sup>−</sup> *KK*<sup>2</sup> *<sup>U</sup>* , the time derivative of *ψ<sup>d</sup>* is given by

$$\begin{split} \frac{d\psi\_d}{dt} &= \frac{d\psi\_d}{d\sigma\_\varepsilon(\xi)} \quad \frac{d\sigma\_\varepsilon(\xi)}{d\xi} \quad \frac{d\xi}{dt} \\ &= -\dot{y}\_1 \frac{d}{d\xi} \sigma\_\varepsilon(\xi) \left[ 1 - \left\{ \sigma\_\varepsilon \left( -y\_1 - \frac{KK\_2}{\mathcal{U}} \right) \right\}^2 \right]^{-\frac{1}{2}} \end{split} \tag{125}$$

with

$$\left[1-\left\{\sigma\_{\varepsilon}\left(-y\_{1}-\frac{K\xi\_{2}}{\mathcal{U}}\right)\right\}^{2}\right]^{-\frac{1}{2}}\leq\eta\tag{126}$$

where *η* = <sup>1</sup> (1−*e*<sup>2</sup> *s* ) 1 2 .

From the definition of *σe*(.) , *<sup>d</sup> <sup>d</sup><sup>ξ</sup> <sup>σ</sup>e*(*ξ*) is bounded by 1. Thus, *<sup>ψ</sup>*˙ *<sup>d</sup>* in (125) is bounded by |*ψ*˙ *<sup>d</sup>*| ≤ *η*|*y*˙1|. (127)

Equipped with the above result and the one in (122), we will now show that the system *H*<sup>1</sup> is IOS.

From Equation (117), we have

$$\dot{y}\_1 = -K\_1 \cos \bar{y} \sigma(y\_1) + K\_1 \sin \bar{y} \cos \psi\_d + \frac{K\_1}{\mathcal{U}} V\_{yc} - 1$$

$$K\_1 \cos \bar{y} \frac{K K\_2}{\mathcal{U}} + \frac{K\_2}{K\_1} \sigma(y\_1) - \frac{K\_2}{K\_1} y\_2.$$

With *K* = *Vyc K*2 ,

$$\begin{aligned} \dot{y}\_1 &= -K\_1 \cos \vec{y} \sigma(y\_1) + \frac{K\_2}{K\_1} \sigma(y\_1) - \frac{K\_2}{K\_1} y\_2 + \cdots \\ K\_1 &\left[ \sin \vec{y} \cos \psi\_d + \frac{V\_{\text{yc}}}{\mathcal{U}} (1 - \cos \vec{y}) \right]. \end{aligned}$$

Taking the absolute value of both sides yields

$$\begin{aligned} |\dot{y}\_1| &\le \left(K\_1 + \frac{K\_2}{K\_1}\right) |\sigma(y\_1)| + \frac{K\_2}{K\_1} |y\_2| + \\ K\_1 &\left[|\sin \vec{y}| + \frac{V\_{yc}}{\underline{U}} |(1 - \cos \vec{y})|\right] \\ |\dot{y}\_1| &\le \left(K\_1 + \frac{K\_2}{K\_1}\right) |\sigma(y\_1)| + \frac{K\_2}{K\_1} |y\_2| + K\_1 \left(1 + \frac{V\_{yc}}{\underline{U}}\right) |\vec{y}|. \end{aligned}$$

Thus,

$$|\psi\_d| \le C\_1|\sigma(y\_1)| + C\_2|y\_2| + C\_3|\bar{y}|^2$$

where *C*<sup>1</sup> = *η K*<sup>1</sup> + *<sup>K</sup>*<sup>2</sup> *K*1 , *C*<sup>2</sup> = *η <sup>K</sup>*<sup>2</sup> *K*1 , and *C*<sup>3</sup> = *ηK*<sup>1</sup> 1 + *Vyc U* . Using the fact |*y*1| + |*y*2| = *y* <sup>1</sup> and |*σ*(*y*1)| ≤ |*y*1|, we can state that

$$|\mathcal{C}\_1|\sigma(y\_1)| + \mathcal{C}\_2|y\_2| \le \max(\mathcal{C}\_1, \mathcal{C}\_2) ||y||\_1 \le \mathcal{C}\_1 ||y||\_1.$$

Thus,

$$|\dot{\Psi}\_d| \le \beta\_1 + \gamma\_1 |\ddot{\Psi}|\tag{128}$$

where *β*<sup>1</sup> = *C*1*β<sup>l</sup>* and *γ*<sup>1</sup> = *C*1*γ<sup>l</sup>* + *C*<sup>3</sup> (using the conditions in Theorem 2 and Equation (121)) is given by

$$\gamma\_1 = \eta K\_1 \left(\frac{V\_{yc}}{\mathcal{U}} + 1\right) \left[\frac{1}{\delta\theta} \left(K\_1 + \frac{K\_2}{K\_1}\right) + 1\right],\tag{129}$$

with *γ*<sup>1</sup> showing explicit dependence on *K*1, *K*2. In conclusion, the systems *H*<sup>1</sup> and *H*<sup>2</sup> are both IOS. It can now be shown, using the small gain theorem in [29], that the interconnected system is stable if *γ*1*γ<sup>f</sup>* < 1. This result yields a rule for the choice of gains *K*1, *K*<sup>2</sup> (as functions of the inner-loop dynamic parameters) so that stability is obtained. Hence, we show using a small gain theorem that the above interconnected system is closed-loop-stable and all signals are bounded.

*Notice that for restriction* (119) *to be feasible, it is important that K*<sup>1</sup> > *<sup>K</sup>*<sup>2</sup> *K*1 *. In other words, if we choose K*<sup>1</sup> = 2*ξω<sup>n</sup> and K*<sup>2</sup> = *ω*<sup>2</sup> *n, where ξ and ω<sup>n</sup> are damping factor and natural frequency, respectively, then ξ* > 0.5 *must be used as design parameter.*

#### *6.6. An Example*

Let us take a simple illustrative example, considering that the sideslip angle *β* is zero. In this situation, the inner Loop (Heading control) is characterized in terms of an IOS relationship given in (113) with *<sup>y</sup>*˜ = *<sup>ψ</sup>*˜, where *<sup>ψ</sup>*˜ = *<sup>ψ</sup>* − *<sup>ψ</sup>d*, see (44). For such a system, it is straightforward to show that the system is finite-gain *L*∞-stable, that is,

$$\|\|\tilde{\Psi}\|\|\_{\infty} \le \gamma\_f \|\|\dot{\Psi}\_d\|\|\_{\infty} + \beta\_f \tag{130}$$

with the gain *γ<sup>f</sup>* given by

$$\gamma\_f = \frac{2\lambda\_{\max}^2(Q) \|A^{-1}B\|\_2 \|C\|\_2}{\lambda\_{\min}(Q)},\tag{131}$$

where *<sup>Q</sup>* is the solution of the Lyapunov equation *QA* <sup>+</sup> *<sup>A</sup>TQ* <sup>=</sup> <sup>−</sup>*I*. Approximating the inner loop as a first-order system with dynamics given by

$$
\psi = -a\psi + a\psi\_d.\tag{132}
$$

$$y\_2 = \psi \tag{133}$$

it follows that

$$\gamma\_f = \frac{2(\frac{1}{2a})^2}{(\frac{1}{2a})} \tag{134}$$

$$
\gamma\_f = \frac{1}{a'} \tag{135}
$$

yielding the stability condition

$$
\gamma\_1 < a.
$$

From (129), we have

$$\eta K\_1 \left(\frac{V\_{yc}}{\mathcal{U}} + 1\right) \left[\frac{1}{\delta\theta} \left(K\_1 + \frac{K\_2}{K\_1}\right) + 1\right] < a. \tag{137}$$

For an inner-loop bandwidth *a* = 1 rad/s, using the parameters mentioned in Table 1 and equating *γ*<sup>1</sup> to *a*, the natural frequency *ω<sup>n</sup>* for the outer loop should not be more than 0.095 rad/s.

**Table 1.** Parameters to design outer loop.


Thus, in terms of bandwidth-like characterization, the inner loop bandwidth should be approximately 10 times higher than outer-loop bandwidth. The parameters *δ* and *θ* chosen in Table 1 impose a restriction of *ψ*˜ < 20.7 degrees.

*6.7. Relation between Outer-Loop Path Following and Using a Variable Look-Ahead Visibility Distance Line-of-Sight Guidance*

Consider a case of simple path-following controller without the integral term, such that the control law can be written as

$$
\psi\_d = \sin^{-1}\left(\frac{-K\_1\varepsilon}{\mathcal{U}}\right),
\tag{138}
$$

whereas, in the case of *look-ahead distance* line-of-sight guidance, the control law is given by

$$
\psi\_d = \tan^{-1} \left( -\frac{e}{\Delta\_d} \right),
\tag{139}
$$

where Δ*<sup>d</sup>* is the *look-ahead distance* as shown in Figure 10.

**Figure 10.** Line-of-sight guidance using *look-ahead distance*.

By equating Equations (138) and (139), we get a relationship between gain *K*<sup>1</sup> and the *look-ahead distance* Δ*<sup>d</sup>* as follows:

$$-\frac{K\_1 e}{\mathcal{U}} = \sin\left(\tan^{-1}\left(-\frac{e}{\Delta\_d}\right)\right) \tag{140}$$

$$K\_1 = \frac{\mathcal{U}}{\left(\Delta\_d^2 + \varepsilon^2\right)^{\frac{1}{2}}}\tag{141}$$

$$
\Rightarrow \Delta\_d = \pm \frac{1}{K\_1} \left( \mathcal{U}^2 - K\_1^2 \varepsilon^2 \right)^{\frac{1}{2}} \tag{142}
$$

Figure 11 shows the variation of look-ahead distance with cross-track error at different bandwidth in the above example. Notice that the look-ahead distance is a function of cross-track error (not fixed in this setup), and increases as the gain *K*<sup>1</sup> is reduced.

**Figure 11.** Look-ahead distance plotted against the cross-track error with different gains.

#### **7. Path Following Problem: Arcs**

Let *Pa* be the position of the vehicle (see Figure 12) in an inertial reference frame {I} and the associated Seret–Frenet frame T defined on the curve such that its origin (*Ps*) is the orthogonal projection of the point *Pa* onto curve; thus, *e* is the cross-track error with the coordinates of vehicle (0,*e*) in {*T*}. With *U* as the speed of the vehicle, the kinematic equation for the evolution of *e* is given by

$$
\dot{\varepsilon} = \mathcal{U}\sin(\psi - \theta\_{\mathcal{L}}) \tag{143}
$$

where *ψ* is the vehicle orientation with respect to the {I}, *θ<sup>c</sup>* is the angle of tangent at point *Ps* measured from abscissa of {I}, and *Rc*(*Ps*) is the radius of curvature at {*T*} (see [6]). Note that ˙ *θ<sup>c</sup>* becomes infinite when the *Rc*(*Ps*) = *e*, which in turn means that the vehicle is positioned exactly at the center of the circle with radius *Rc* and a tangent at {*T*}. However, for most of the practical applications, the reference paths to follow are curves with slowly varying curvature, this problem is unlikely to occur.

**Figure 12.** Cross-track error for straight-line following.

Following an approach similar to that in Section 6.2, the most suitable choice for the desired heading *ψ<sup>d</sup>* will be

$$\psi\_d = \sin^{-1}\left\{\sigma\_c \left(-\frac{K\_1 \varepsilon}{lI}\right)\right\} + \theta\_c. \tag{144}$$

In order to follow a circumference, we compute at each instant the tangent to the path and act as if we were following a straight line. The algorithm applies to the case of straight lines and yields automatic compensation of the effect of unknown but constant currents. The methodology does not go through for the case of general paths even if we restrict ourselves to constant currents. Interestingly enough, as far as we know, this combined problem has not been solved yet. In the paper, we proposed a simple extension of the method to follow arcs of circumference that showed acceptable performance (small steady-state track error) in simulations and real test with the Medusa vehicle (figures are explained in next section); however, a general theoretical result is not available at this point [45].

#### **8. Implementation and Field Test Results**

The previous sections described the rationale and provided the mathematical machinery required for the study of a path-following controller for marine vehicles that relies on a two-scale inner-outer loop architecture. This approach effectively decouples the design of the inner and outer control loops, the combination of the two being studied at a later stage. The tools derived borrow extensively from nonlinear control theory and make use of the ISS and IOS characterization of dynamical systems. In this context, the analysis of the combined inner-outer loop structure is done using an appropriate small gain theorem [29]. For inner-loop controller design, the technique described in Section 4 was used, yielding a simple proportional and derivative control law that is pervasive in heading autopilots. In what concerns outer-loop design and stability analysis, despite the apparent complexity of the methodology adopted, the resulting outer-loop controller lends itself to the simple implementation structure shown in Equations (98) and (99) and depicted in Figure 13, where an anti-windup scheme is implemented using the so-called *D-methodology* introduced in [46]. Clearly, the implementation of the outer-loop controller does not require intensive computational power. We recall that the gains *K*<sup>1</sup> and *K*<sup>2</sup> can easily be computed by solving the characteristic Equation (96) for a choice of natural frequency *ωn*, with *K*<sup>1</sup> = 2*ξω<sup>n</sup>* and *K*<sup>2</sup> = *ω*<sup>2</sup> *<sup>n</sup>*, where *ξ* is the damping factor.

**Figure 13.** Implementation of the path-following algorithm using an anti-windup technique scheme that includes the so-called D-methodology in [46].

The algorithm for path following described was implemented and fully tested with success in three types of vehicles: the *DELFIMx* ASV, the *MAYA* AUV, and several vehicles of the *MEDUSA* class. The first is an autonomous surface vehicle that is the property of the Instituto Superior Tecnico, Lisbon, Portugal (see Figure 14). The second is an autonomous underwater vehicle (see Figure 15) described in Section 3.3. Implementation issues and results of tests carried out with the MAYA AUV are briefly discussed in [45]. The algorithm is also an part of the several *MEDUSA* class vehicles developed by IST, Lisbon. The results are shown for one of the *MEDUSA* class marine vehicle described in Section 3.2.

**Figure 14.** The DELFIMx ASV.

**Figure 15.** The MAYA AUV.

Prior to testing the path-following algorithm on the *DELFIMx* ASV, simulations were done with a full nonlinear model of the vessel. The outer-loop controller parameters were tuned based on the bandwidth of the linearized equations of motion of the vessel about 1.6 m/s. We call attention to the fact that we did not measure the ocean current during the sea trials of *DELFIMx*. However, an estimate was obtained using the difference between the heading and course angles of the vehicle along the straight line components of the path. The estimated current of 0.2 m/s with direction from southwest to northeast was introduced in the simulation to allow for a fair comparison of real and simulated data.

We include both the results of simulations and actual tests at sea. Namely, Figures 16 and 17 show the results of simulations of a lawn-mowing maneuver for the ASV. Figure 16 illustrates the complete maneuver, whereas Figure 17 shows the cross error observed. The corresponding plots for real tests are shown in Figures 18 and 19, respectively. Clearly, the results of simulations and the real data are very similar, thus confirming the adequacy of the new method developed for path following. Notice in particular how both in simulated and related data the cross-track error converges to approximately zero over similar portions of the path (straight line segments), in the presence of a constant current. The variation in the cross-track error after the convergence at 300 s and 700 s are due to the transition from straight line to the arc and vice versa which is reflected in both simulations and the real tests. Notice that the heading of the vehicle (represented by a the symbol of ASV with the triangular-shaped head (see legend in Figure 18)) is different from course of the vehicle. This shows that the algorithm has learned the ocean currents and adjusted the heading accordingly.

**Figure 16.** Simulated lawnmowing maneuver of the *DELFIMx* vehicle in the presence of ocean currents.

**Figure 17.** Cross-track error for the simulated track.

**Figure 18.** Delfimx performing a lawn-mowing maneuver in the Azores, PT.

**Figure 19.** Delfimx cross-track error during the real mission.

Another test was conducted using the MAYA AUV at a lake to map chlorophyll at three different depths. The path-following algorithm used for these tests shows how the AUV was able to follow a path in a real environment independent of the depth control. The results are shown in Figure 20.

**Figure 20.** Square mission of MAYA at surface, 3 m and 5 m depth at Supa Dam, India.

The efficacy of the path following for straight lines was also shown during a real test with a Medusa class vehicle. The vehicle's GPS track and the reference path for the test performed are shown in Figure 21. It can be inferred from the fact that the course angle available from GPS and the vehicle angles were not the same that the vehicle was under the influence of an ocean current, see Figure 22. This figure shows clearly the role of the integrator to "learn" the constant ocean current and offset the heading angle accordingly.

**Figure 21.** Medusa Vehicle performing lawnmower at Expo Site, Lisbon, Portugal.

**Figure 22.** Heading and Course of the Medusa Vehicle Showing the effect of ocean currents.

The simulation results in Figures 23 and 24 illustrate the case where the *MAYA* vehicle is requested to follow a segment of a circular path. The results show that in the presence of currents, the vehicle follows the arc with an error (i.e., the cross-track error will not converge to zero but to a neighborhood of zero). The convergence of the cross-track error to a neighborhood of zero along segments of arc is also captured in the sea tests performed by *DELFIMx* and *MEDUSA* vehicles, as shown in Figures 18 and 21.

**Figure 23.** Simulation result of arc following.

**Figure 24.** Evolution of cross-track error during arc following.

#### **9. Conclusions and Future Work**

This paper introduced an inner-outer control structure for marine vehicle path following in 2D, with due account for the vehicle dynamics and ocean currents. The structure is simple to implement and provides system designers a convenient way of tuning the outerloop control law parameters as functions of a "bandwidth-like" characterization of the inner loop. Stability of the complete path-following control system was proven for straight paths, by resorting to nonlinear control theoretical tools that borrow from input-to-output stability concepts and a related small gain theorem. The efficacy of the inner-outer control structure adopted was shown during the rigorous tests with AUVs and ASVs at sea. These algorithms are now integral part of many autonomous marine vehicles used at NIO and IST. Moreover, the problem of cooperative control and navigation works on the assumption that the single vehicle is able to follow a desired path (without any temporal constraints).

The applications of this strategy include: (i) single-vehicle path following for a number of missions that include environmental surveying, seabed habitat mapping, and critical infrastructures security, and (ii) cooperative path following, which aims to steer a number of vehicles along pre-determined paths in a synchronized manner, with a view to overcoming the limitations imposed by the use of a single vehicle, effectively allowing for ocean exploration at unprecedented temporal and spatial scales. The method is easily extended to fully actuated or overly actuated vehicles where, besides having the center of mass of the vehicle follow a desired path, it is also required for the vehicle to track an arbitrary heading reference (that is, complete pose control). An obvious desired extension (pointed out before) is to derive a path-following controller capable of ensuring precise path following of general paths in the presence of constant currents. We conjecture that some form of an internal model principle should be used, which provides a good ground for future extension of the present work, see, for example, Refs. [47–49] and the references therein.

We also remark that we have addressed explicitly the effect of unknown but constant currents and showed how the path-following control law adopted allows for the rejection of this type of disturbance. We did not address the impact of waves, which cause first-order (oscillating) and second-order (drift) effects. We conjecture that the influence of waves may be studied by modeling (as is customary in the literature) their effect as a bounded output disturbance *dw*, and characterizing the closed-loop operator with input *dw* and output *e* (cross-track error) in terms of its input-output characteristics (IOS analysis).

**Author Contributions:** Conceptualization, P.M. and A.P.; methodology, P.M., A.P., H.M.M. and A.P.A.; software, P.M.; validation, P.M., A.P. and H.M.M.; formal analysis, P.M. and H.M.M.; investigation, P.M.; resources, P.M.; data curation, P.M.; writing—original draft preparation, P.M.; writing—review and editing, P.M., A.P. and H.M.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work has been supported by RAMONES, funded by the European Union's Horizon 2020 research and innovation programme, under grant agreement No. 101017808 and by Fundação para a Ciência e a Tecnologia (FCT) through LARSyS—FCT Project UIDB/50009/2020. The design and development of "Maya" AUV was funded by Ministry of Electronics & Information Technology (MeitY), Government of India.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors are thankful to the Director CSIR—National Institute of Oceanography, Goa for encouragement and administrative support. Colleagues from the marine instrumentation division are acknowledged for their help during the field tests with MAYA AUV and preparation of the manuscript. We are also grateful to Elgar Desa from NIO for his constant encouragement, guidance, and support during the phases of design and testing of the MAYA AUV. This manuscript is NIO's contribution number 6928. A special word of thanks goes also to Rita Cunha, Carlos Silvestre, Luis Sebastiao, Bruno Cardeira, and Manuel Rufino for their support in conducting test at sea using *DELFIMx* and Medusa vehicles.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **Appendix A. Vehicle Parameters**

**Table A1.** Mass, inertia and hydrodynamics coefficients for a MEDUSA vehicle.



