**1. Introduction**

The use of autonomous marine vehicles, including surface and underwater robots, for various scientific and commercial applications at sea, has increased multi-fold in the last decade. Missions of interest include, among others, bathymetric surveys, seabed imaging, environmental monitoring, inspection of offshore critical infrastructures, and marine archaeology studies. In most of these missions, marine vehicles are required to follow spatial paths accurately. A representative example is the case where an AUV (autonomous underwater vehicle) or an ASV (autonomous surface vehicle) is requested to execute "lawn-mowing" maneuvers along desired paths in the presence of unknown ocean currents.

We recall the crucial difference between trajectory tracking and path following. In the latter, no explicit temporal constraints are imposed on the desired vehicle's motion and a

**Citation:** Maurya, P.; Morishita, H.M.; Pascoal, A.; Aguiar, A.P. A Path-Following Controller for Marine Vehicles Using a Two-Scale Inner-Outer Loop Approach. *Sensors* **2022**, *22*, 4293. https://doi.org/ 10.3390/s22114293

Academic Editor: Baochang Zhang

Received: 31 March 2022 Accepted: 29 May 2022 Published: 5 June 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

path is planned using spatial coordinates only, along with a reference speed profile that may depend on where the vehicle is on the path. In contrast, in trajectory tracking, space and time explicitly define the reference coordinates for the desired vehicle's motion, that is, the vehicle is required to track a 3D curve parameterized in time. This strategy is only pursued in practice when simultaneous and temporal specifications play a decisive role. However, in the process of tracking a desired inertia trajectory, a vehicle may be required to reach a speed with respect to the water that may either be too small, leading to the loss of surface control authority or too high, exceeding the capability of the propulsion system installed onboard.

A properly designed path-following control systems can naturally lead to smoother vehicle trajectories without pushing the control signals into saturation, in contrast to what may happen when trajectory tracking controllers are used. The fundamental limitations of trajectory tracking can be found in [1,2]. In [2], Aguiar studied performance limitations of trajectory tracking strategies due to unstable zero-dynamics in terms of a lower bound on L2-norm of the tracking error even if the control effort is unlimited. It was also shown that path following is free from such a limitation. In [3], a hybrid solution to path following and trajectory tracking problem for underactuated vehicles was discussed for 2D and a more general 3D space. Aguiar and Hespanha in [3] followed a supervisory control architecture in which a switching logic is used to adapt an adequate estimator and control law from the family of estimators and candidate control laws. Supervisory control combined with a nonlinear Lyapunov-based tracking control was demonstrated and its robustness to parametric modeling uncertainties was shown with examples of a hovercraft and an AUV. Marine vehicles suffer from disturbances induced by ocean currents. The issue of disturbances was not addressed in [3]. The path following problem in 3D for an underwater vehicle was also described in [4], where the controller design builds on the Lyapunov theory and resorts to back-stepping techniques, demanding the knowledge of a complete hydrodynamic model of the vehicle.

In [5], Indiveri described a 3D kinematical solution to path following by recalling sliding-mode control techniques. Rather than designing the control input to drive a tracking error to zero, the sliding mode control uses the control input to drive and keep the state on a surface where the error has stable dynamics. However, the authors did not address the issues related to the vehicle dynamics and described the controller only at the kinematic level.

Pioneering work in solving the path following problem for wheeled robots has been addressed in [6,7]. Path-following problem for a car pulling several trailers is addressed in [8]. In [9], Altafini provided local asymptotic stability for a path of non-constant curvature for a trailer vehicle. More recently, in [10], a model predictive path-following control of a laboratory tower crane has been described to move a load along a predefined geometric path.

It is interesting to see in [11,12] that path following is at the core of cooperative motion control for multiple vehicles where these vehicles are supposed to follow a set of fixed spatial paths while holding a desired formation pattern. Each vehicle is equipped with a path-following algorithm to maneuver along its assigned spatial path, whereas a distributed control law performs the formation control by adjusting the speeds of different vehicles. It is therefore important to emphasize the need for a reliable path-following method that is suitable for heterogeneous vehicles with little knowledge of their dynamics. Cooperation among multiple vehicles with a view to performing different tasks plays a critical role in executing a number of mission scenarios [13]. The *GREX* project is an example of the use of cooperative-motion control strategies involving a number of vehicles developed by different oceanographic institutions for their needs. Figure 1 illustrates the diversity in the marine vehicles used for cooperation during the sea trials of the GREX project.

**Figure 1.** Heterogeneous vehicle used to demonstrate cooperative motion control during GREX trails at Sesimbra, Portugal.

The EU-funded project MORPH (FP7-ICT-2011-7 GA 288704, 2012–2016) [14] advanced the novel concept of an underwater robotic system composed of a number of spatially separated mobile robot-modules, carrying distinct and yet complementary resources with path-following algorithms implemented on every vehicle. MORPH provided the foundation for efficient methods to survey the underwater environment with great accuracy, especially in situations that defy classical technology. Namely, underwater surveys over rugged terrain and near vertical cliffs.

The WiMUST project (H2020-ICT-2014-1, 2015–2018) [15] witnessed the development of advanced cooperative and networked control/navigation systems to enable a group of marine robots (both on the surface and submerged) equipped with acoustic sources and towed acoustic streamers to perform geotechnical seismic surveys in a fully automatic manner. For the first time worldwide, a mission was performed in 2018 at sea in Sines, Portugal, with a fleet of seven autonomous marine robots performing high-resolution 3D sub-bottom mapping in cooperation. Every individual vehicle was required to be equipped with a path-following algorithm.

Path-following algorithms are fundamental for these vehicles to cooperate effectively. The straight-line path following problem for formations of multiple under-actuated marine surface vessels is addressed in [16]. The controller used is a combination of an LOS-based path-following controller and a nonlinear synchronization controller for the along-path synchronization of the vessels. The synchronization controller takes into account the loss of controllability at velocities close to zero for under-actuated vehicles. A unified analysis of stability properties of both the cross-track error dynamics and the synchronization error dynamics are discussed by using the tools from the theory of nonlinear cascaded systems. For the path-following controller of each vehicle, the authors used a line-of-sight guidance law in combination with a stabilizing heading controller. The guidance law is a function of cross-track error and look-ahead distance [17], which is an along-track distance between the nearest point on the track and a point that lies ahead of the vehicle. The look-ahead distance is used as design parameter. Depending on the damping on sway motion, the look-ahead distance can be increased or reduced to impose restrictions on the commanded yaw rate. However, the bound on the design parameter (look-ahead distance) requires the

knowledge of the mass matrix and damping coefficients for surge and sway dynamics of the vehicle and the proposed controller does not take ocean currents into account.

Similar work that takes ocean currents into account is reported in [18]. The control law proposed to drive the cross-track error to zero is the same as that reported in [16] with an extra term which is a function of the ocean currents. The ocean currents for an individual vehicle are estimated using an adaptation law, which solves a differential Ricatti equation that is again a function of the mass matrix and damping coefficients.

In [19], instead of estimating the currents, the authors used an integrator similar to the work reported in this paper. Burger et al. introduced a conditional integrator to avoid large overshoots during the saturation of the control signal. The conditional integrator combines the benefits of integral action and sliding-mode control. It behaves either like a PI controller or like a sliding-mode controller, depending on the magnitude of the control signal to avoid the chattering caused by the sliding-mode control. However, the problem of integrator windup can also be addressed by using a smooth anti-windup scheme.

The tools used for stability analysis in [16,18,20] are similar to the one reported in this paper, which relies on the theory of interconnected and cascaded systems. In [20], path following problems for more general spatial paths (with constraints on their curvature) in the presence of constant ocean currents were addressed. The authors introduced a virtual Serret–Frenet reference frame that is anchored on and propagates along the desired path. When the vehicle reaches the vicinity of that point, the reference is updated, requesting the vehicle to converge to another point further on the reference path. A Luenberger-type observer is designed to estimate the currents by measuring the relative velocity of the vehicle w.r.t the water. The proposed guidance law is a nonlinear function of surge and sway velocities and involves solving a quadratic function of currents, cross-track error and look-ahead distance. The estimation of ocean currents requires the measurement of relative velocity from an Acoustic Doppler Current Profiler (ADCP). Most surface vehicles are equipped only with GPS and cannot measure the relative velocity of the vehicle. In the simplified case of [20], to follow straight lines while cruising at a constant speed, the measurement of the relative velocity was critical to estimate currents. Again, the design of the controller requires knowledge of surge and sway dynamics.

We now shift our attention to the importance of inner-outer loop control structures. In the field of aircraft control, path following has been addressed as dynamic and kinematic loop control structures similar to inner and outer loop in marine vehicles. In [21], pathfollowing control in 3D was built on a nonlinear control strategy that is first derived at the kinematic level, followed by the design of a *L*1-adaptive output-feedback control law that effectively augments an existing autopilot and yields an inner-outer loop control structure with guaranteed performance whereas, multiple vehicle coordination is achieved by enforcing temporal constraints on the speed profiles of the vehicles along their paths. A survey and analysis of algorithms for path following reported in [22] showed how innerouter loop-based guidance schemes are implemented in most Unmanned Air Vehicles (UAV) where practitioners used inexpensive open-source autopilots.

There is extensive literature on the path following, displaying a vast choice of available control laws based on linear and nonlinear techniques. Representative examples of pathfollowing controllers for marine vehicles can be found in [23–26]. Furthermore, in [27], the authors described a nonlinear path-following guidance method in inner-outer loop form, where the outer loop plays a role of a guidance scheme, generating lateral acceleration commands, and the inner loop follows. This paper does not address the stability of the outer loop in the presence of the inner loop. This topic was addressed in [28] with the assumption that there is complete knowledge of the vehicle model parameters.

No reference in the literature, to the best of our knowledge, addresses the problem of path following without prior knowledge of the inner loop dynamics. Path following is either designed at a kinematic level only or demands complete knowledge of horizontal plane dynamics.

The scarcity of publications on nonlinear path following for ocean vehicles without complete knowledge of vehicle dynamics somehow reflects the hardness of the problem mainly due to the presence of a nonzero lateral velocity and shows the relevance of the research topic here discussed. Motivated by the above considerations, this article addresses the problem of path following for marine vehicles by resorting to inner-outer control loops, with due account for the vehicle dynamics and currents. The inner-outer loop control structures exhibit a fast-slow temporal scale separation that yields simple "rules of thumb" for controller tuning. Stated intuitively, the inner loop dynamics should be much faster than those of the outer loop. This qualitative result is well rooted in singular perturbation theory [29]. Conceptually, the procedure described has three key advantages: (i) it decouples the design of the inner and outer control loops, (ii) the structure of the outer loop controller does not depend on the dynamics of the vehicle, and (iii) it provides practitioners a very convenient method to effectively implement path-following controllers on a wide range of 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 path-following control algorithms on heterogeneous vehicles that may be pre-equipped with heading autopilots. To address this issue, we developed a novel methodology for the design of path-following controllers for marine vehicles which uses a simple characterization of the marine vehicle's dynamics, in the form of input-output gains or bandwidth-like characterization, without having to know the detailed dynamics of a marine vehicle. This is the key contribution of this article,which is rooted in and extends substantially the methodology described in [30]. The focus of the presentation is on AUVs; however, the techniques can be easily extended to autonomous surface vehicles (ASVs). The paper is organized as follows. We first discuss the nonlinear dynamics of two marine vehicles used in experiments, followed by the formal proof of the stability of a simple inner-loop PD controller applied to a nonlinear three-degree-of-freedom model. We then tackle the problem of path following without considering the dynamics of the vehicle. In Section 6.5, we consider path following for straight lines in 2D, propose an inner-outer loop control structure for its solution, and provide the proof of the stability of the resulting feedback control system. We describe the results of simulations and field tests performed with real marine vehicles, summarize the main conclusions, and discuss problems that warrant further research.

#### **2. Notation and AUV Modeling**

Depth and heading controllers are the core systems of autonomous marine. Depth control is used to maintain the depth of an AUV at a desired value, whereas heading control is used to steer both AUVs and ASVs along desired directions with respect to the magnetic north. The design of such controllers varies from simple proportional-integral-derivative (PID) and linear quadratic methods based on linearized dynamic models [31] to more complex Lyapunov-based nonlinear control. Modeling the dynamics of a vehicle is critical for its maneuvering, stabilization, and motion control. However, accurate modeling of the dynamics of such vehicles is oftentimes painstaking, time consuming, and quite costly. In [32], the hydrodynamic data required to model the Marius AUV have been determined by full-scale tests, using a towing tank equipped with a *Planar Motion Mechanism*. There are only a few test facilities of this kind which many researchers developing AUVs for scientific needs cannot afford. To avoid such expensive and time-consuming methods of determining the hydrodynamic coefficients, most of the users rely on semi-empirical and analytical methods [33], together with CFD analysis. Later, the parameters of importance in simplified models can be derived/verified by performing certain open loop maneuvers in the water. One such example is the *circular maneuver* for horizontal plane models [34]. Vehicle models obtained using such techniques are necessarily simplified but, if properly exploited, may be extremely useful in characterizing the system to be controlled in a form

that is suitable for input-output stability analysis. A compelling example is the case where, using nonlinear system analysis, the dynamics of a system may be characterized in terms of parameters that play a role equivalent to static gain and bandwidth for first-order linear systems. Such models can be used to design the controllers with a simple structure. In what follows, the structure of a generic vehicle model that we adapt borrows from the work of Fossen [34].

#### *2.1. Vehicle Modeling*

Following usual practice, we define two reference frames: a body-fixed reference frame {B} in which the dynamics of the vehicle are naturally described and an earth-fixed reference frame {I} in which the position and orientation of the vehicle are expressed (see Figure 2). The following notation is required.


**Figure 2.** Notations and reference frames for an AUV.

An arbitrary vector <sup>B</sup>*<sup>V</sup>* <sup>∈</sup> IR3 expressed in {B} can be expressed in {I} as <sup>I</sup>*<sup>V</sup>* <sup>=</sup><sup>I</sup> <sup>B</sup>✁ *<sup>R</sup>*B✁*V*. An important relation for I <sup>B</sup>*<sup>R</sup>* (abbreviated as *<sup>R</sup>*) [35] is *<sup>R</sup>TR* <sup>=</sup> *<sup>I</sup>*, implying that *<sup>R</sup><sup>T</sup>* <sup>=</sup> *<sup>R</sup>*−<sup>1</sup> and det(*R*) <sup>=</sup> 1. The matrix *<sup>R</sup>* <sup>∈</sup> IR3×<sup>3</sup> can be described locally in terms of a sequence of 3 transformations that take {B} to {I} by rotating it sequentially about its current *z* → *y* → *x* axis through the Euler angles *ψ*—yaw (rotation about z-axis), *θ*—pitch (rotation about y-axis) and *φ*—roll (rotation about x-axis) [34]. The final rotation matrix from {B} to {I} parameterized by the Euler angles *η*<sup>2</sup> = [*φθψ*] *<sup>T</sup>* is given by

$$R(\eta\_2) = \begin{pmatrix} c\psi c\theta & -s\psi c\phi + c\psi s\theta s\phi & s\psi s\phi + c\psi c\phi s\phi \\ s\psi c\theta & c\psi c\phi + s\phi s\theta s\psi & -c\psi s\phi + s\theta s\psi c\phi \\ -s\theta & c\theta s\phi & c\theta c\phi \end{pmatrix},\tag{1}$$

where *s*(.) = *sin*(.) and *c*(.) = *cos*(.).

#### *2.2. Kinematics*

The kinematic equations that relate body-fixed with inertial linear and angular velocities are given by

$$
\dot{\eta}\_1 = \mathbb{R}(\eta\_2)\nu\_{1\prime} \tag{2}
$$

$$
\dot{\eta}\_2 = Q(\eta\_2)\nu\_2. \tag{3}
$$

The transformation of body-fixed angular velocities is performed using the transformation matrix *Q*(*η*2) given by

$$Q(\eta\_2) = \begin{pmatrix} 1 & s\phi t\theta & c\phi t\theta \\ 0 & c\phi & -s\phi \\ 0 & s\phi/c\theta & c\phi/c\theta \end{pmatrix} \tag{4}$$

where *t*(.) = *tan*(.). Note that *Q* is singular for *θ* = ±*π*/2 when using the above sequence of Euler angles and can be avoided by using quaternions (see [34] for details). However, for an AUV, an angle close to *π*/2 is practically not desirable and is avoided by design. Thus, it is reasonable to assume that most AUVs operate with small pitch angle. Finally, the combined 6-DOF kinematic equation can be written as

$$
\begin{bmatrix} \eta\_1\\ \eta\_2 \end{bmatrix} = \begin{bmatrix} \ R(\eta\_2) & 0\\ 0 & Q(\eta\_2) \end{bmatrix} \begin{bmatrix} \ \nu\_1\\ \ \nu\_2 \end{bmatrix} \Longleftrightarrow \dot{\eta} = J(\eta)\nu. \tag{5}
$$

An important relation for the derivative of a rotation matrix is given by

$$\mathcal{R}(\eta\_2) = \mathcal{R}(\eta\_2)\mathcal{S}(\nu\_2),\tag{6}$$

where *S* is a skew-symmetric matrix, for an arbitrary vector *u* = [*ux uy uz*] *<sup>T</sup>* <sup>∈</sup> IR3, it takes the form

$$S(u) = \begin{bmatrix} 0 & -u\_z & u\_y \\ u\_z & 0 & -u\_x \\ -u\_y & u\_x & 0 \end{bmatrix}. \tag{7}$$

Furthermore,

$$S^T = -S; \; S(\mu)\upsilon = -S(\upsilon)\mu; \; \; S(\mu)\upsilon = \mu \times \upsilon. \tag{8}$$
