1 Introduction

The control of autonomous underwater vehicles (AUVs) is a huge focus area within the research community. The use of AUV is rapidly increasing within several fields, such as marine biology, seafloor mapping, oceanography, military use and oil and gas industry [1,2,3,4,5,6,7]. A basic and highly applicable task is to follow a desired path to perform and achieve some missions [5, 6]. The vehicle’s weight and cost, energy consumption and system reliability are what we must first take into consideration, so an underactuated AUV is usually designed which can achieve the same control effects as a fully actuated AUV with less control inputs. For most underactuated AUVs, lateral and vertical thrusters are not available, but only surge velocity, yaw angular velocity and pitch angular velocity can be controlled directly. Therefore, the underactuated AUV control is much more difficult than the fully actuated AUV control [8].

Much of the early work in this area is related to path following controllers for the underactuated AUV. Moreover, numerous approaches to the AUVs path following control have been addressed in some researches, such as backstepping control, sliding mode control and fuzzy control. Approaches based on the line-of-sight (LOS) guidance are popular on horizontal path following [9,10,11,12,13,14,15]. Further research has been reported in [9], where the issue of compensating for the sideslip angle is discussed in detail and a new k-exponentially stable integral LOS guidance law is derived. Neural network (NN) with iterative updating laws based on prediction errors is designed to identify the dynamical uncertainty and time-varying ocean disturbances for marine surface vehicles [15]. The novel direct adaptive fuzzy tracking control (DAFTC) scheme with fully unknown parametric dynamics and adaptive robust online constructive fuzzy control (AR-OCFC) scheme for marine vehicles to deal with uncertainties and unknown disturbances are proposed in [16,17,18]. The robust adaptive formation controller for ASVs based on neural network and neurodynamic-based output feedback scheme are presented in the presence of uncertainties and ocean disturbances [19, 20]. Backstepping method has been applied successfully for the path following control of the underactuated AUVs [21, 22]. However, most researches on the path following control of underactuated AUVs concentrate on the horizontal plane and vertical plane, respectively, that is, the three-dimensional (3D) motion model of the underactuated AUV is decoupled into two plane models, and the path following controllers are designed, respectively. Due to ignoring the model coupling effects among different degrees of freedom, the controllers on decoupling model design cannot achieve accurate 3D path following for underactuated AUVs. Therefore, building the 3D path following error model and designing 3D path following controller have been the key research for AUV motion control. Three-dimensional optimal paths planning for designed miniature AUV is investigated in [23], and a set of optimal paths is determined that includes some waypoints to be passed. Zhou et al. [24] designed three adaptive neural network controllers based on Lyapunov stability theorem to estimate uncertain parameters of the AUV model and unknown current disturbances. These controllers were designed to guarantee that all the error states in the path following system are asymptotically stable. Lapierre and Jouvencel [25] designed a kinematic controller to deal with vehicle dynamics based on backstepping and Lyapunov-based techniques. Borhaug and Pettresen [26] applied cascade system theory and backstepping method to design controllers based on LOS, which can simplify the form of controllers, but not discuss path following problem for general desired path. To sum up, the path following control methods for underactuated AUVs have been discussed during the past decade [27]. And the problems of exterior interfere and uncertain model of AUV have been investigated in some related papers [28,29,30,31].

Motivated by the above considerations, this paper investigates the 3D path following control design for the underactuated AUV. Firstly, we establish the 3D path following error model based on virtual guidance method. Then, the nonlinear fuzzy backstepping slide mode controllers are proposed to solve the problems of nonlinearity, uncertainties and external disturbances, which make AUV follow the desired path from any position and guarantee that all state variables converge to the desired value [32]. Finally, stability analysis for the whole control system is performed based on Lyapunov stability theorem, and simulations are conducted to verify the feasibility and superiority of the proposed controllers.

2 Problem Description

The AUV dynamic model in 3D space is proposed in this section. Assume that the AUV center of gravity is the origin of the kinetic coordinate system, and ignore the effects of AUV rolling due to its good symmetrical structure. Therefore, 6-DOF model can be simplified into 5-DOF model [33].

The AUV dynamic equation is:

$$\left\{ {\begin{array}{*{20}l} {\left( {m\, - \,X_{{\dot{u}}} } \right)\dot{u}\, = \,X\, + \,f_{u} \, + \,X_{uu} u^{2} \, + \,X_{vv} v^{2} \, + \,X_{ww} w^{2} + X_{qq} q^{2} } \hfill \\ {\left( {m - Y_{{\dot{v}}} } \right)\dot{v}\, = \,f_{v} - \left( {m - Y_{ur} } \right)ur \,+\, Y_{uv} uv \,+\, Y_{v\left| v \right|} v\left| v \right|} \hfill \\ {\left( {m - Z_{{\dot{w}}} } \right)\dot{w}\, = \,f_{w} - \left( {m - Z_{uq} } \right)uq\, +\, Z_{uw} uw \,+\, Z_{w\left| w \right|} w\left| w \right| + mz_{g} q^{2} } \hfill \\ {\left( {I_{y} - M_{{\dot{q}}} } \right)\dot{q}\, = \,M + f_{q}\, +\, M_{q\left| q \right|} q\left| q \right|\, -\, M_{uq} uq \,-\, M_{uw} uw\, - \,\left( {z_{g} W - z_{b} B} \right)\sin \theta - mz_{g} \left( {wq - vr} \right)} \hfill \\ {\left( {I_{z} - N_{{\dot{r}}} } \right)\dot{r}\, = \,N + f_{r} \,+\, N_{uv} uv\, +\, N_{v\left| v \right|} v\left| v \right| + N_{ur} ur} \hfill \\ \end{array} } \right.$$
(1)

The AUV kinematic equation is:

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = u\cos \psi \cos \theta - v\sin \psi + w\cos \psi \sin \theta } \hfill \\ {\dot{y} = u\sin \psi \cos \theta + v\cos \psi + w\sin \psi \sin \theta } \hfill \\ {\dot{z} = - u\sin \theta + w\cos \theta } \hfill \\ {\dot{\theta } = q} \hfill \\ {\dot{\psi } = {r \mathord{\left/ {\vphantom {r {\cos \theta }}} \right. \kern-0pt} {\cos \theta }}} \hfill \\ \end{array} } \right.$$
(2)

where m is the AUV weight; u, v and w represent surge velocity, sway velocity and heave velocity of the AUV, respectively; and q and r represent pitch angular velocity and yaw angular velocity, respectively. θ and ψ are pitch angle and yaw angle from the geodetic coordinate system to the kinetic coordinate system. \(I_{y} , \, I_{z}\) are the moments of inertia. \(X_{( \cdot )} , \, Y_{( \cdot )} , \, Z_{( \cdot )} , \, M_{( \cdot )}\) and \(N_{( \cdot )}\) represent the AUV hydrodynamic coefficients. \(z_{g}\) and \(z_{b}\) are the coordinate positions of the center of gravity W and buoyancy B in the kinetic coordinate system. \(f_{( \cdot )}\) is unknown disturbance assuming \(\left| {f_{( \cdot )} } \right| \le F_{( \cdot )}\). X is the longitudinal thrust provided by the AUV propellers; M and N are the torque around y axis and z axis produced under the joint action of thrusters and rudders, respectively.

The AUV is a complex nonlinear dynamic system, and its dynamic model precision can be affected by external disturbances and load change. The AUV dynamic equations based on (1) are not precise because of ignoring higher-order hydrodynamic coefficients. However, they can be used as nominal model in simulation. Without affecting the generality, the AUV model can be expressed as

$$\left\{ {\begin{array}{*{20}l} {\dot{u}\, = \,f_{1} \left( {{\mathbf{v}},t} \right) + b_{1} \left( {{\mathbf{v}},t} \right)X + d_{1} \left( t \right)} \hfill \\ {\dot{v}\, = \,f_{2} \left( {{\mathbf{v}},t} \right) + d_{2} \left( t \right)} \hfill \\ {\dot{w}\, = \,f_{3} \left( {{\mathbf{v}},t} \right) + d_{3} \left( t \right)} \hfill \\ {\dot{q}\, = \,f_{4} \left( {{\mathbf{v}},t} \right) + b_{4} \left( {{\mathbf{v}},t} \right)M + d_{4} \left( t \right)} \hfill \\ {\dot{r}\, = \,f_{5} \left( {{\mathbf{v}},t} \right) + b_{5} \left( {{\mathbf{v}},t} \right)N + d_{5} \left( t \right)} \hfill \\ \end{array} } \right.$$
(3)

where \({\mathbf{v}} = (u,v,w,q,r)^{\text{T}}\). In Fig. 1, the desired path is the spatial curve described by design parameters. {E}, {B} and {F} represent the geodetic coordinate system, kinetic coordinate system and Serret–Frenet coordinate system, respectively. We define the angle \(\psi_{F}\), \(\theta_{F}\) rotating around the axis Z E and Y E , respectively.

$$\left\{ {\begin{array}{*{20}l} {\theta_{F} \, = - \arctan \left( {\frac{{\dot{z}_{d} }}{{\sqrt {\dot{x}_{d}^{2} + \dot{y}_{d}^{2} } }}} \right)} \hfill \\ {\psi_{F} \, = \,\arctan \left( {\frac{{\dot{y}_{d} }}{{\dot{x}_{d} }}} \right)} \hfill \\ \end{array} } \right. .$$
(4)
Fig. 1
figure 1

Diagram of 3D path following of AUV

The desired path is the 3D curve described by parameter s in Fig. 1. P is the virtual reference guidance point in the Serret–Frenet coordinate system, and the position is \({\varvec{\upeta}}_{d}^{e} \, = \,\left( {x_{d} \left( s \right),y_{d} \left( s \right),z_{d} \left( s \right)} \right)^{\text{T}}\). Q represents the mass center, and the AUV position is \({\varvec{\upeta}}^{e} \, = \,\left( {x,y,z} \right)^{\text{T}}\).

The path following error \({\varvec{\uptau}}\, = \,\left( {x_{e} ,y_{e} ,z_{e} } \right)^{\text{T}} \, = \,{\mathbf{R}}_{b}^{{e{\text{T}}}} \left( {{\varvec{\upeta}}^{e} - {\varvec{\upeta}}_{d}^{e} } \right)\) can be defined in kinetic coordinate system [34].

$${\dot{\mathbf{\tau }}}\, = \,{\dot{\mathbf{R}}}_{b}^{{e{\text{T}}}} \left( {{\varvec{\upeta}}^{e} - {\varvec{\upeta}}_{d}^{e} } \right)\, + \,{\mathbf{R}}_{b}^{{e{\text{T}}}} \left( {{\dot{\mathbf{\eta }}}^{e} - {\dot{\mathbf{\eta }}}_{d}^{e} } \right)$$
(5)

where \({\mathbf{R}}_{b}^{e}\) is the rotation matrix from the coordinate system {B} to {E}. \({\dot{\mathbf{R}}}_{b}^{e} = {\mathbf{R}}_{b}^{e} \left[ \varpi \right]_{qr}\), \(\left[ \varpi \right]_{qr}\) is the angular velocity matrix. \({\dot{\mathbf{\eta }}}^{e} = {\mathbf{R}}_{b}^{e} {\mathbf{v}}_{b}\), \({\mathbf{v}}_{b} = \left( {u,v,w} \right)^{\text{T}}\) is the AUV velocities in the coordinate system {B}. \({\dot{\mathbf{\eta }}}_{d}^{e} = {\mathbf{R}}_{F}^{e} {\mathbf{v}}_{F}\), \({\mathbf{v}}_{F} = \left( {u_{r} ,0,0} \right)^{\text{T}}\) is the velocity of the virtual reference and \({\mathbf{R}}_{F}^{e}\) is the rotation matrix from the coordinate system {F} to {E}.

$$\begin{aligned} {\dot{\mathbf{\tau }}} & = \left[ \varpi \right]_{qr}^{\text{T}} {\mathbf{R}}_{b}^{{e{\text{T}}}} \left( {{\varvec{\upeta}}^{e} - {\varvec{\upeta}}_{d}^{e} } \right) + {\mathbf{R}}_{b}^{{e{\text{T}}}} {\dot{\mathbf{\eta }}}^{e} - {\mathbf{R}}_{b}^{{e{\text{T}}}} {\dot{\mathbf{\eta }}}_{d}^{e} \\ & = \left[ \varpi \right]_{qr}^{\text{T}} {\varvec{\uptau}} + {\mathbf{R}}_{b}^{{e{\text{T}}}} {\mathbf{R}}_{b}^{e} {\mathbf{v}}_{b} - {\mathbf{R}}_{b}^{{e{\text{T}}}} {\mathbf{R}}_{F}^{e} {\mathbf{v}}_{F} \\ & = \left[ \varpi \right]_{qr}^{\text{T}} {\varvec{\uptau}} + {\mathbf{v}}_{b} - {\mathbf{R}}\left( {\psi_{e} ,\theta_{e} } \right){\mathbf{v}}_{F} \\ \end{aligned}$$
(6)

within

$${\mathbf{R}}\left( {\psi_{e} ,\theta_{e} } \right) = \left( {\begin{array}{*{20}c} {{ \cos }\psi_{e} { \cos }\theta_{e} } & { - { \sin }\psi_{e} } & {{ \cos }\psi_{e} { \sin }\theta_{e} } \\ {{ \sin }\psi_{e} { \cos }\theta_{e} } & {{ \cos }\psi_{e} } & {{ \sin }\psi_{e} { \sin }\theta_{e} } \\ { - { \sin }\theta_{e} } & 0 & {{ \cos }\theta_{e} } \\ \end{array} } \right)$$

and

$$\left[ \varpi \right]_{qr} = \left[ {\begin{array}{*{20}c} 0 & r & { - q} \\ { - r} & 0 & 0 \\ q & 0 & 0 \\ \end{array} } \right],\quad {\mathbf{R}}_{b}^{{e{\text{T}}}} {\mathbf{R}}_{F}^{e} = {\mathbf{R}}\left( {\psi_{e} ,\theta_{e} } \right) ,$$

The matrix form is

$$\left[ \begin{aligned} \dot{x}_{e} \hfill \\ \dot{y}_{e} \hfill \\ \dot{z}_{e} \hfill \\ \end{aligned} \right] = \left[ {\begin{array}{*{20}c} 0 & { - r} & q \\ r & 0 & 0 \\ { - q} & 0 & 0 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {x_{e} } \\ {y_{e} } \\ {z_{e} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} u \\ v \\ w \\ \end{array} } \right] - {\mathbf{R}}\left( {\psi_{e} ,\theta_{e} } \right)\left[ {\begin{array}{*{20}c} {u_{r} } \\ 0 \\ 0 \\ \end{array} } \right]$$
(7)

So the AUV path following error in 3D space is

$$\left\{ {\begin{array}{*{20}l} {\dot{x}_{e} = ry_{e} - qz_{e} + u - u_{r} \cos \psi_{e} \cos \theta_{e} } \hfill \\ {\dot{y}_{e} = - rx_{e} + v - u_{r} \sin \psi_{e} \cos \theta_{e} } \hfill \\ {\dot{z}_{e} = qx_{e} + w + u_{r} \sin \theta_{e} } \hfill \\ {\dot{\psi }_{e} = {r \mathord{\left/ {\vphantom {r {\cos \theta }}} \right. \kern-0pt} {\cos \theta }} - \dot{\psi }_{F} } \hfill \\ {\dot{\theta }_{e} = q - \dot{\theta }_{F} } \hfill \\ \end{array} } \right. .$$
(8)

3 Fuzzy Backstepping Sliding Mode Control

Consider the n order nonlinear controller object

$$\left\{ {\begin{array}{*{20}l} {\dot{x}_{i} = x_{i + 1} } \hfill \\ {\dot{x}_{n} = f\left( {{\mathbf{x}},t} \right) + b\left( {{\mathbf{x}},t} \right)u + d\left( t \right)} \hfill \\ {y = x_{1} } \hfill \\ \end{array} } \right.$$
(9)

where \(f\left( {{\mathbf{x}},t} \right), \, b\left( {{\mathbf{x}},t} \right)\) are unknown nonlinear functions, \({\mathbf{x}} = \left[ {x_{1} ,x_{2} , \ldots ,x_{n} } \right]^{\text{T}}\) is system state vector. \(u \in {\mathbf{R}}\) is control input, and \(y \in {\mathbf{R}}\) is the system output. \(d\left( t \right)\) is unknown disturbance and \(\left| {d\left( t \right)} \right| \le D + \eta\); D is the maximum value of absolute value of \(d\left( t \right)\), and η is a small positive number.

3.1 Step 1: Backstepping Algorithm

Define following error

$$z_{1} = y - y_{d}$$
(10)

where \(y_{d}\) is the desired value, then

$$\dot{z}_{1} = \dot{y} - \dot{y}_{d} = \dot{x}_{1} - \dot{y}_{d} = x_{2} - \dot{y}_{d}$$
(11)

Define virtual control value

$$\alpha_{1} = - k_{1} z_{1} + \dot{y}_{d}$$
(12)

where \(k_{1} > 0\).

Define

$$z_{2} = x_{2} - \alpha_{1}$$
(13)
$$V_{1} = \frac{1}{2}z_{1}^{2}$$
(14)

Differentiate \(V_{1}\) with respect to time yields

$$\dot{V}_{1} = z_{1} \dot{z}_{1} = z_{1} \left( {x_{2} - \dot{y}_{d} } \right) = z_{1} \left( {z_{2} + \alpha_{1} - \dot{y}_{d} } \right)$$
(15)

Substitute (12) into (15) and we get

$$\dot{V}_{1} = - k_{1} z_{1}^{2} + z_{1} z_{2}$$
(16)

Consider Lyapunov function

$$V_{2} = V_{1} + \frac{1}{2}z_{1}^{2}$$
(17)

Differentiate \(V_{2}\) with respect to time yields

$$\dot{V}_{2} = \dot{V}_{1} + z_{1} \dot{z}_{1} = - k_{1} z_{1}^{2} + z_{1} z_{2} + z_{2} \left[ {x_{3} - \dot{\alpha }_{1} } \right]$$
(18)

Define virtual control value

$$\alpha_{2} = - k_{2} z_{2} + \dot{\alpha }_{1} - z_{1}$$
(19)

where \(k_{2} > 0\).

Define

$$z_{3} = x_{3} - \alpha_{2}$$
(20)

then

$$\begin{aligned} \dot{V}_{2} & = - k_{1} z_{1}^{2} + z_{1} z_{2} + z_{2} \left[ {x_{3} - \dot{\alpha }_{1} } \right] \\ & = - k_{1} z_{1}^{2} - k_{2} z_{2}^{2} + z_{2} z_{3} \\ \end{aligned}$$
(21)

The n−1 step

$$\begin{aligned} \dot{V}_{n - 1} & = - k_{1} z_{1}^{2} - \cdots - k_{n - 1} z_{n - 1}^{2} + z_{n - 1} z_{n} \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} + } z_{n - 1} z_{n} \\ \end{aligned}$$
(22)

where \(z_{n} = x_{n} - \alpha_{n - 1} , \, \alpha_{n - 1} = - k_{n - 1} z_{n - 1} + \dot{\alpha }_{n - 2} - z_{n - 2}\).

3.2 Step 2: Sliding Mode Control

The sliding mode surface can be designed as follows

$$S = c_{1} z_{1} + \cdots + c_{n - 1} z_{n - 1} + z_{n}$$
(23)

where \(c_{1} \cdots c_{n - 1}\) are constants.Consider Lyapunov function

$$V_{n} = V_{n - 1} + \frac{1}{2}S^{2}$$
(24)

Differentiate \(V_{n}\) with respect to time yields

$$\begin{aligned} \dot{V}_{n} = & \, - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\dot{S} \\ = & \, - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {c_{1} \dot{z}_{1} + \cdots + c_{n - 1} \dot{z}_{n - 1} + \dot{z}_{n} } \right) \\ = & \, - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} } + \dot{x}_{n} - \dot{\alpha }_{n - 1} } \right) \\ = & \, - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} + f\left( {{\mathbf{x}},t} \right) + b\left( {{\mathbf{x}},t} \right)u + d - \dot{\alpha }_{n - 1} } } \right) \\ \end{aligned}$$
(25)

If \(f\left( {{\mathbf{x}},t} \right),{\text{ b}}\left( {{\mathbf{x}},t} \right)\) are known, the sliding mode control law can be designed as

$$u = \frac{1}{{b({\mathbf{x}},t)}}\left( { - f\left( {{\mathbf{x}},t} \right) - \sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} } + \dot{\alpha }_{n - 1} - D\text{sgn} \left( S \right) - hS} \right)$$
(26)

where h is a positive constant.

3.3 Step 3: Adaptive Fuzzy Logic System

Assume the following form of fuzzy logic system (MISO)

$$\begin{aligned} & R^{j} :{\text{ if }}x_{1} {\text{ is }}A_{1}^{j} {\text{ and }}x_{2} {\text{ is }}A_{2}^{j} {\text{ and}} \cdots {\text{and }}x_{n} {\text{ is }}A_{n}^{j} \, \\ & \quad \,{\text{then }}y{\text{ is }}B^{j} \\ \end{aligned}$$

where \(R^{j}\) represents the fuzzy rules, \(j = 1,2, \ldots ,k\). y is the output and \({\mathbf{x}} = \left( {x_{1} ,x_{2} , \ldots ,x_{n} } \right)\) are the input. The fuzzy values \(A_{i}^{j} ,B^{j}\) are expressed by the membership function. The Gaussian function of product inference engine, single value fuzzy unit and center average defuzzifier can be designed [35].

$$y({\mathbf{x}}) = \sum\limits_{j = 1}^{k} {\varvec{\xi}_{j} \left( {\mathbf{x}} \right)\theta_{j} = } \, {\varvec{\uptheta}}^{\text{T}}\varvec{\xi}$$
(27)

where \({\varvec{\uptheta}} = \left( {\theta_{1} ,\theta_{2} , \ldots ,\theta_{k} } \right)^{\text{T}}\) is adjustable parameter vector, \(\varvec{\xi}_{j} \left( x \right)\) are the membership function.

$$\varvec{\xi}_{j} \left( x \right) = \frac{{\prod\nolimits_{i = 1}^{n} {\mu_{Ai}^{j} (x_{i} )} }}{{\sum\nolimits_{j = 1}^{k} {\left( {\prod\nolimits_{i = 1}^{n} {\mu_{Ai}^{j} (x_{i} )} } \right)} }}$$
(28)

The control law can be designed as

$$u = \frac{1}{{\hat{b}({\mathbf{x}},t)}}\left( { - \hat{f}\left( {{\mathbf{x}},t} \right) - \hat{d}\left( S \right) - \sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} } + \dot{\alpha }_{n - 1} - \left( {h + \lambda } \right)S} \right)$$
(29)

where λ is a positive constant, \(\hat{f}\left( {\left. {\mathbf{x}} \right|\varvec{\theta}_{f} } \right) =\varvec{\theta}_{f}^{\text{T}}\varvec{\xi}_{1} \left( {\mathbf{x}} \right)\), \(\hat{b}\left( {\left. {\mathbf{x}} \right|\varvec{\theta}_{b} } \right) =\varvec{\theta}_{b}^{\text{T}}\varvec{\xi}_{2} \left( {\mathbf{x}} \right)\) and \(\hat{d}\left( {\left. S \right|\varvec{\theta}_{d} } \right) =\varvec{\theta}_{d}^{\text{T}}\varvec{\xi}_{3} \left( S \right)\) are the output of fuzzy system.

Adaptive law can be designed as follows

$$\left\{ {\begin{array}{*{20}l} {\dot{\varvec{\theta }}_{f} = \alpha_{1} S\varvec{\xi}_{1} \left( {\mathbf{x}} \right)} \hfill \\ {\dot{\varvec{\theta }}_{b} = \alpha_{2} S\varvec{\xi}_{2} \left( {\mathbf{x}} \right)u} \hfill \\ {\dot{\varvec{\theta }}_{d} = \alpha_{3} S\varvec{\xi}_{3} \left( S \right)} \hfill \\ \end{array} } \right.$$
(30)

where \(\alpha_{1} ,\,\alpha_{2} ,\,\alpha_{3}\) are positive constants.

4 Controller Design

4.1 Surge Velocity Controller

According to (29), the surge velocity controller can be designed as follows

$$X = \frac{1}{{\hat{b}_{1} ({\mathbf{v}},t)}}\left( { - \hat{f}_{1} \left( {{\mathbf{v}},t} \right) - \hat{d}_{1} \left( {S_{1} ,t} \right) - \left( {h_{1} + \lambda_{1} } \right)S_{1} } \right)$$
(31)

where \(h_{1}\) is a positive constant. \(\hat{f}_{1} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{f1}^{\text{T}}\varvec{\xi}_{f1} \left( {\mathbf{v}} \right)\), \(\hat{b}_{1} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{b1}^{\text{T}}\varvec{\xi}_{b1} \left( {\mathbf{v}} \right)\), \(S_{1} = u - u_{d}\) and the corresponding membership function is selected as

$$\varvec{\xi}_{j}^{1} \left( {v_{i} } \right) = \exp \left[ { - \left( {\left( {\upsilon_{i} + \frac{{\rho_{1} }}{6} - (j - 1)\frac{{\rho_{1} }}{12}} \right)/\sigma_{1} } \right)^{2} } \right]{ ,}\quad \, j = 1,\,2 \ldots 5.$$
(32)

But \(\hat{d}_{1} \left( {S_{1} } \right) =\varvec{\theta}_{d1}^{\text{T}}\varvec{\xi}_{d1} \left( {S_{1} } \right)\), the corresponding membership function is selected as

$$\varvec{\xi}_{j}^{1} (S_{1} ) = \exp \left[ { - \left( {\left( {S_{1} + \rho_{1} - (j - 1)\rho_{1} } \right)/\sigma_{1} } \right)^{2} } \right]{ , }\quad j = 1,\,2,\,3 .$$
(33)

There are 3125 fuzzy rules that can be used to approximate\(f_{1} \left( {{\mathbf{x}},t} \right), \, b_{1} \left( {{\mathbf{x}},t} \right)\) and three fuzzy rules to \(d_{1} \left( t \right)\). We get the corresponding adaptive control laws.

$$\left\{ {\begin{array}{*{20}l} {\dot{\varvec{\theta }}_{f1} = \alpha_{f1} S_{1}\varvec{\xi}_{f1} \left( {\mathbf{v}} \right)} \hfill \\ {\dot{\varvec{\theta }}_{b1} = \alpha_{b1} S_{1}\varvec{\xi}_{b1} \left( {\mathbf{v}} \right)u} \hfill \\ {\dot{\varvec{\theta }}_{d1} = \alpha_{d1} S_{1}\varvec{\xi}_{d1} \left( {S_{1} } \right)} \hfill \\ \end{array} } \right. .$$
(34)

4.2 Pitch Controller

In this section, we consider the sideslip angle α, β and design the calm function as \(\varTheta_{d} = - \arctan \left( {k_{n} z_{e} } \right)\).

$$\left\{ {\begin{array}{*{20}l} {\alpha = \arctan \left( {{\raise0.7ex\hbox{$w$} \!\mathord{\left/ {\vphantom {w u}}\right.\kern-0pt} \!\lower0.7ex\hbox{$u$}}} \right),\quad u \ge 0;} \hfill \\ {\beta = \arctan \left( {{\raise0.7ex\hbox{$v$} \!\mathord{\left/ {\vphantom {v {\sqrt {u^{2} + w^{2} } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\sqrt {u^{2} + w^{2} } }$}}} \right)} \hfill \\ \end{array} } \right. .$$
(35)

The goal is to make θ converge to \(\varTheta_{d}\), that is to make pitch angle θ converge \(\varTheta_{d} + \theta_{F} - \alpha\). In this way, we can define \(\theta_{d} = \varTheta_{d} + \theta_{F} - \alpha\) and obtain the pitch controller according to (29).

$$M = \frac{1}{{\hat{b}_{5} ({\mathbf{v}},t)}}\left( { - \hat{f}_{5} \left( {{\mathbf{v}},t} \right) - c_{1} \dot{z}_{1} + \dot{\alpha }_{1} - \hat{d}_{5} \left( {S_{2} ,t} \right) - \left( {h_{2} + \lambda_{2} } \right)S_{2} } \right)$$
(36)

where \(h_{2}\) is a positive constant. \(z_{1} = \theta - \theta_{d}\), \(\alpha_{1} = - k_{1} z_{1} + \theta_{d}\), \(z_{2} = q - \alpha_{1}\), \(S_{2} = c_{1} z_{1} + z_{2}\) and the corresponding membership function \(\hat{f}_{5} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{f5}^{\text{T}}\varvec{\xi}_{f5} \left( {\mathbf{v}} \right)\), \(\hat{b}_{5} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{b5}^{\text{T}}\varvec{\xi}_{b5} \left( {\mathbf{v}} \right)\) is selected as

$$\xi_{j}^{2} \left( {v_{i} } \right) = \exp \left[ { - \left( {\left( {\upsilon_{i} + \frac{{\rho_{2} }}{6} - (j - 1)\frac{{\rho_{2} }}{12}} \right)/\sigma_{2} } \right)^{2} } \right]{ , }\quad j = 1,\,2 \ldots 5 .$$
(37)

But \(\hat{d}_{5} \left( {S_{2} } \right) =\varvec{\theta}_{d5}^{\text{T}}\varvec{\xi}_{d5} \left( {S_{2} } \right)\), the corresponding membership function is selected as

$$\varvec{\xi}_{j}^{2} (S_{2} ) = \exp \left[ { - \left( {\left( {S_{2} + \rho_{2} - (j - 1)\rho_{2} } \right)/\sigma_{2} } \right)^{2} } \right]{ , }\quad j = 1,\,2,\,3 .$$
(38)

There are 3125 fuzzy rules that can be used to approximate \(f_{5} \left( {{\mathbf{x}},t} \right), \, b_{5} \left( {{\mathbf{x}},t} \right)\) and three fuzzy rules to \(d_{5} \left( t \right)\). We get the corresponding adaptive control laws.

$$\left\{ {\begin{array}{*{20}l} {\dot{\varvec{\theta }}_{f5} = \alpha_{f5} S_{2}\varvec{\xi}_{f5} \left( {\mathbf{v}} \right)} \hfill \\ {\dot{\varvec{\theta }}_{b5} = \alpha_{b5} S_{2}\varvec{\xi}_{b5} \left( {\mathbf{v}} \right)M} \hfill \\ {\dot{\varvec{\theta }}_{d5} = \alpha_{d5} S_{2}\varvec{\xi}_{d5} \left( {S_{1} } \right)} \hfill \\ \end{array} } \right. .$$
(39)

4.3 Yaw Controller

Firstly, we design the calm function as \(\varPsi_{d} = - \arctan \left( {k_{n} y_{e} } \right)\). Then, we define \(\psi_{d} = \varPsi_{d} + \psi_{F} - \beta\) and get the yaw controller.

$$N = \frac{1}{{\hat{b}_{6} ({\mathbf{v}},t)}}\left( { - \hat{f}_{6} \left( {{\mathbf{v}},t} \right) - c_{2} \dot{z}_{3} + \dot{\alpha }_{2} - \hat{d}_{6} \left( {S_{3} ,t} \right) - \left( {h_{3} + \lambda_{3} } \right)S_{3} } \right)$$
(40)

where \(h_{3}\) is a positive constant. \(z_{3} = \psi - \psi_{d}\), \(\alpha_{2} = - k_{2} z_{3} + \psi_{d}\),\(z_{4} = r - \alpha_{2}\),\(S_{3} = c_{2} z_{3} + z_{4}\) and the corresponding membership function \(\hat{f}_{6} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{f6}^{\text{T}}\varvec{\xi}_{f6} \left( {\mathbf{v}} \right)\), \(\hat{b}_{6} \left( {{\mathbf{v}},t} \right) =\varvec{\theta}_{b6}^{\text{T}}\varvec{\xi}_{b6} \left( {\mathbf{v}} \right)\) can be selected as

$$\varvec{\xi}_{j}^{3} \left( {v_{i} } \right) = \exp \left[ { - \left( {{{\left( {\upsilon_{i} + \frac{{\rho_{3} }}{6} - (j - 1)\frac{{\rho_{3} }}{12}} \right)} \mathord{\left/ {\vphantom {{\left( {\upsilon_{i} + \frac{{\rho_{3} }}{6} - (j - 1)\frac{{\rho_{3} }}{12}} \right)} {\sigma_{3} }}} \right. \kern-0pt} {\sigma_{3} }}} \right)^{2} } \right]{ , }\quad j = 1,\,2 \ldots 5$$
(41)

But \(\hat{d}_{6} \left( {S_{2} } \right) =\varvec{\theta}_{d6}^{\text{T}}\varvec{\xi}_{d6} \left( {S_{3} } \right)\), the corresponding membership function is

$$\varvec{\xi}_{j}^{3} (S_{3} ) = \exp \left[ { - \left( {{{\left( {S_{3} + \rho_{3} - (j - 1)\rho_{3} } \right)} \mathord{\left/ {\vphantom {{\left( {S_{3} + \rho_{3} - (j - 1)\rho_{3} } \right)} {\sigma_{3} }}} \right. \kern-0pt} {\sigma_{3} }}} \right)^{2} } \right] , { }\quad \,j = 1,2,3 .$$
(42)

There are 3125 fuzzy rules that can be used to approximate\(f_{6} \left( {{\mathbf{x}},t} \right), \, b_{6} \left( {{\mathbf{x}},t} \right)\) and three fuzzy rules to \(d_{6} \left( t \right)\). We get the corresponding adaptive control laws.

$$\left\{ {\begin{array}{*{20}l} {\dot{\varvec{\theta }}_{f6} = \alpha_{f6} S_{3}\varvec{\xi}_{f6} \left( {\mathbf{v}} \right)} \hfill \\ {\dot{\varvec{\theta }}_{b6} = \alpha_{b6} S_{3}\varvec{\xi}_{b6} \left( {\mathbf{v}} \right)N} \hfill \\ {\dot{\varvec{\theta }}_{d6} = \alpha_{d6} S_{3}\varvec{\xi}_{d6} \left( {S_{1} } \right)} \hfill \\ \end{array} } \right. .$$
(43)

5 Stability Proving

Define optional parameters

$$\left\{ {\begin{array}{*{20}l} {\varvec{\theta}_{f}^{*} = \arg \mathop {\hbox{min} }\limits_{{\varvec{\theta}_{f} \in \varPhi_{f} }} \left( {\mathop {\sup }\limits_{{\varvec{x} \in R^{n} }} \left| {\hat{f}\left( {{\mathbf{x}}|\varvec{\theta}_{f} } \right) - f\left( {{\mathbf{x}}|t} \right)} \right|} \right)} \hfill \\ {\varvec{\theta}_{b}^{*} = \arg \mathop {\hbox{min} }\limits_{{\varvec{\theta}_{b} \in \varPhi_{b} }} \left( {\mathop {\sup }\limits_{{\varvec{x} \in R^{n} }} \left| {\hat{b}\left( {{\mathbf{x}}|\varvec{\theta}_{b} } \right) - b\left( {{\mathbf{x}}|t} \right)} \right|} \right)} \hfill \\ {\varvec{\theta}_{d}^{*} = \arg \mathop {\hbox{min} }\limits_{{\varvec{\theta}_{d} \in \varPhi_{d} }} \left( {\mathop {\sup }\limits_{S \in R} \left| {\hat{d}\left( {\varvec{S}|\varvec{\theta}_{d} } \right) - d\left( t \right)} \right|} \right)} \hfill \\ \end{array} } \right.$$
(44)

where \(\varPhi_{f} , \, \varPhi_{b} , \, \varPhi_{d}\) are the collections of \(\varvec{\theta}_{f} , \,\varvec{\theta}_{b} , \,\varvec{\theta}_{d}\). Define minimum approximation error

$$\varepsilon = f\left( {{\mathbf{x}},t} \right) - \hat{f}\left( {{\mathbf{x}}|\varvec{\theta}_{f}^{*} } \right) + d\left( t \right) - \hat{d}\left( {S|\varvec{\theta}_{d}^{*} } \right) + \left( {b\left( {{\mathbf{x}},t} \right) - \hat{b}\left( {{\mathbf{x}}|\varvec{\theta}_{b}^{*} } \right)} \right)u .$$
(45)

According to universal approximation theorem, the control objectives can be described as

$$\left\{ {\begin{array}{*{20}l} {\left| {f({\mathbf{x}},t) - \hat{f}({\mathbf{x}}|\varvec{\theta}_{f}^{*} )} \right| \le \varepsilon_{1} } \hfill \\ {\left| {b({\mathbf{x}},t) - \hat{b}({\mathbf{x}}|\varvec{\theta}_{b}^{*} )} \right| \le \varepsilon_{2} } \hfill \\ {\left| {d(t) - \hat{d}(S|\varvec{\theta}_{d}^{*} )} \right| \le \varepsilon_{3} } \hfill \\ \end{array} } \right.$$
(46)

where \(\varepsilon_{1} , \, \varepsilon_{2} , \, \varepsilon_{3}\) are small positive numbers.

then

$$\begin{aligned} |\varepsilon | & \le \,\left| {f\left( {{\mathbf{x}},t} \right) - \hat{f}\left( {{\mathbf{x}}|\varvec{\theta}_{f}^{*} } \right)} \right| + \left| {\left( {b\left( {{\mathbf{x}},t} \right) - \hat{b}\left( {{\mathbf{x}}|\varvec{\theta}_{b}^{*} } \right)} \right)u} \right|\,\, + \,\,\left| {d\left( t \right) - \hat{d}\left( {S|\varvec{\theta}_{d}^{*} } \right)} \right| \\ & \le \,\varepsilon_{1} + \varepsilon_{2} \left| u \right| + \varepsilon_{3} = \varepsilon_{\hbox{max} } \le \gamma \left| S \right| \\ \end{aligned} .$$
(47)

We get

$$\begin{aligned} \dot{V}_{n} & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\left( {\sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} } \, + \,f\left( {{\mathbf{x}},t} \right) + \, b\left( {{\mathbf{x}},t} \right)u + d\left( t \right) - \dot{\alpha }_{n - 1} } \right.} \right) \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\sum\limits_{i = 1}^{n - 1} {c_{i} \dot{z}_{i} } + f\left( {{\mathbf{x}},t} \right) + \hat{b}\left( {{\mathbf{x}},t} \right)u - \hat{b}\left( {{\mathbf{x}},t} \right)u + b\left( {{\mathbf{x}},t} \right)u + d\left( t \right) - \dot{\alpha }_{n - 1} } \right) \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {f\left( {{\mathbf{x}},t} \right) - \hat{f}\left( {{\mathbf{x}},t} \right) + b\left( {{\mathbf{x}},t} \right)u - \hat{b}\left( {{\mathbf{x}},t} \right)u + d\left( t \right) - \hat{d}\left( {S,t} \right) - \left( {h + \lambda } \right)S} \right) \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\hat{f}({\mathbf{x}}|\varvec{\theta}_{f}^{*} ) - \hat{f}\left( {{\mathbf{x}},t} \right) + \, \hat{b}\left( {{\mathbf{x}}|\varvec{\theta}_{b}^{*} } \right)u} \right. \\ & \quad \left. { -\, \hat{b}\left( {{\mathbf{x}},t} \right)u + \hat{d}\left( {S|\varvec{\theta}_{d}^{*} } \right) - \hat{d}\left( {S,t} \right) + \varepsilon - \left( {h + \lambda } \right)S} \right) \\ & = S\left( {\varvec{\chi}_{f}^{\text{T}}\varvec{\xi}_{1} \left( {\mathbf{x}} \right) +\varvec{\chi}_{b}^{\text{T}}\varvec{\xi}_{2} \left( {\mathbf{x}} \right)u +\varvec{\chi}_{d}^{\text{T}}\varvec{\xi}_{3} \left( S \right) + \varepsilon - \left( {h + \lambda } \right)S} \right) \\ & \quad - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} \\ \end{aligned}$$
(48)

where \(\varvec{\chi}_{f} =\varvec{\theta}_{f}^{*} -\varvec{\theta}_{f}\), \(\varvec{\chi}_{b} =\varvec{\theta}_{b}^{*} -\varvec{\theta}_{b}\) and \(\varvec{\chi}_{d} =\varvec{\theta}_{d}^{*} -\varvec{\theta}_{d}.\)

Consider Lyapunov function

$$V_{n + 1} = V_{n} + \frac{1}{2}\left( {\frac{1}{{\gamma_{1} }}\varvec{\chi}_{f}^{\text{T}}\varvec{\chi}_{f} + \frac{1}{{\gamma_{2} }}\varvec{\chi}_{b}^{\text{T}}\varvec{\chi}_{b} + \frac{1}{{\gamma_{3} }}\varvec{\chi}_{d}^{\text{T}}\varvec{\chi}_{d} } \right)$$
(49)

then

$$\begin{aligned} \dot{V}_{n + 1} & = \dot{V}_{n} + \frac{1}{{\gamma_{1} }}\varvec{\chi}_{f}^{\text{T}} \dot{\varvec{\chi }}_{f} + \frac{1}{{\gamma_{2} }}\varvec{\chi}_{b}^{\text{T}} \dot{\varvec{\chi }}_{b} + \frac{1}{{\gamma_{3} }}\varvec{\chi}_{d}^{\text{T}} \dot{\varvec{\chi }}_{d} \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + S\left( {\varvec{\chi}_{f}^{\text{T}}\varvec{\xi}_{1} \left( {\mathbf{x}} \right) +\varvec{\chi}_{b}^{\text{T}}\varvec{\xi}_{2} \left( {\mathbf{x}} \right)u} \right. \\ & \quad \left. { +\, \varvec{\chi}_{d}^{\text{T}}\varvec{\xi}_{3} \left( S \right) + \varepsilon - hS} \right) + \frac{1}{{\gamma_{1} }}\varvec{\chi}_{f}^{\text{T}} \dot{\varvec{\chi }}_{f} + \frac{1}{{\gamma_{2} }}\varvec{\chi}_{b}^{\text{T}} \dot{\varvec{\chi }}_{b} + \frac{1}{{\gamma_{3} }}\varvec{\chi}_{d}^{\text{T}} \dot{\varvec{\chi }}_{d} \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} S\varvec{\chi}_{f}^{\text{T}}\varvec{\xi}_{1} \left( {\mathbf{x}} \right) + \frac{1}{{\gamma_{1} }}\varvec{\chi}_{f}^{\text{T}} \dot{\varvec{\chi }}_{f} + S\varvec{\chi}_{b}^{\text{T}}\varvec{\xi}_{2} \left( {\mathbf{x}} \right)u \\ & \quad + \frac{1}{{\gamma_{2} }}\varvec{\chi}_{b}^{\text{T}} \dot{\varvec{\chi }}_{b} + S\varvec{\chi}_{d}^{\text{T}}\varvec{\xi}_{3} \left( S \right) + \frac{1}{{\gamma_{3} }}\varvec{\chi}_{d}^{\text{T}} \dot{\varvec{\chi }}_{d} + S\varepsilon - \left( {h + \lambda } \right)S^{2} \\ & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} + \frac{1}{{\gamma_{1} }}\varvec{\chi}_{f}^{\text{T}} \left( {\gamma_{1} S\varvec{\xi}_{1} \left( {\mathbf{x}} \right) + \dot{\varvec{\chi }}_{f} } \right) + \frac{1}{{\gamma_{2} }}\varvec{\chi}_{b}^{\text{T}} \left( {\dot{\varvec{\chi }}_{b} + \gamma_{2} S\varvec{\xi}_{2} \left( {\mathbf{x}} \right)u} \right) \\ & \quad + \frac{1}{{\gamma_{3} }}\varvec{\chi}_{d}^{\text{T}} \left( {\gamma_{3} S\varvec{\xi}_{3} (S) + \dot{\varvec{\chi }}_{d} } \right) + S\varepsilon - \left( {h + \lambda } \right)S^{2} \\ \end{aligned}$$
(50)

where \(\dot{\varvec{\chi }}_{f} = - \dot{\varvec{\theta }}_{f}\), \(\dot{\varvec{\chi }}_{b} = - \dot{\varvec{\theta }}_{b}\) and \(\dot{\varvec{\chi }}_{d} = - \dot{\varvec{\theta }}_{d}\).

Substitute (30) into (50)

$$\begin{aligned} \dot{V}_{n + 1} & = - \sum\limits_{i = 1}^{n - 1} {k_{i} z_{i}^{2} } + z_{n - 1} z_{n} - \left( {h + \lambda } \right)S^{2} + S\varepsilon \\ & = - \varvec{z}^{\text{T}} Q\varvec{z} + S\varepsilon - \lambda S^{2} \\ \end{aligned}$$
(51)

within

$$Q = \left( {\begin{array}{*{20}c} {k_{1} + hc_{1}^{2} } & {hc_{1} c_{2} } & \cdots & {hc_{1} } \\ {hc_{1} c_{2} } & {k_{2} + hc_{2}^{2} } & \cdots & \vdots \\ \vdots & \vdots & \ddots & {hc_{n - 1} - \frac{1}{2}} \\ {hc_{1} } & \cdots & {hc_{n - 1} - \frac{1}{2}} & h \\ \end{array} } \right)$$
(52)

Combine (48) and (52), we get

$$\begin{aligned} \dot{V}_{n + 1} & \le - \varvec{z}^{\text{T}} Q\varvec{z} + \left| S \right|\left| \varepsilon \right| - \lambda S^{2} \le - \varvec{z}^{\text{T}} Q\varvec{z} + \gamma \left| S \right|^{2} - \lambda S^{2} \\ & = - \varvec{z}^{\text{T}} Q\varvec{z} + \gamma S^{2} - \lambda S^{2} = - \varvec{z}^{\text{T}} Q\varvec{z} - (\lambda - \gamma )S^{2} \\ \end{aligned}$$
(53)

Because γ is a small positive constant, there is \(\lambda \ge \gamma\) satisfying \(\dot{V}_{n + 1} \le z^{\text{T}} Qz\). We can make \(\left| Q \right| > 0\) and Q a positive definite matrix by selecting the values of \(h_{i} , \, c_{i} , \, k_{i}\), then \(\dot{V}_{n + 1} \le 0\).

6 Simulation

In this section, to verify the feasibility of the path following controller proposed in this paper, we conduct simulations on the underactuated AUV WL-II (Fig. 2) developed by Harbin Engineering University in China [36, 37].

Fig. 2
figure 2

WL-II underactuated AUV

Initially, the 3D desired path is defined as a spiral in the following form.

$$\left\{ {\begin{array}{*{20}l} {x_{d} = 20{ \cos }\left( {\frac{\pi }{26}s} \right) + 10} \hfill \\ {y_{d} = 20\sin \left( {\frac{\pi }{26}s} \right) + 5} \hfill \\ {z_{d} = - s - 5} \hfill \\ \end{array} } \right. .$$

The initial position and attitude angle of AUV are \(\left( {x,y,z} \right) = \left( {15,5,0} \right)\), \(\left( {\psi ,\theta } \right)\, = \,\left( {0,0} \right)\). The initial velocity matrix is \(\left( {u,v,w} \right)\,{ = }\,\left( {0,0,0} \right)\), and the velocity of the virtual reference is \(u_{r} = u_{0} \left( {1 - \tanh \left( {{{x_{e} } \mathord{\left/ {\vphantom {{x_{e} } \sigma }} \right. \kern-0pt} \sigma }} \right)} \right)\), where the desired velocity \(u_{0} = 1\,{\text{m/s}}\) and σ = 0.5. To verify the robustness of controller, we assume that the AUV is affected by white noise disturbances which have the largest amplitude of \(\omega = 5\,\,({{\text{N}} \mathord{\left/ {\vphantom {{\text{N}} {\text{Nm}}}} \right. \kern-0pt} {\text{Nm}}})\) and compare the simulation results of AUV path following control using fuzzy backstepping slide mode (FBSM) with traditional backstepping.

Furthermore, we design AUV controllers according to (29) and the parameters of controller are as follows.

  1. (1)

    The parameters of surge velocity controller are

    $$\begin{aligned} & h_{1} = 1,\,\,\lambda_{1} = 0.1,\,\,\rho_{1} = 1,\,\,\sigma_{1} = 0.25,\,\,\alpha_{f1} = 1,\,\,\alpha_{b1} = 0.1,\,\,\alpha_{d1} = 1,\,\, \\ & k_{n} \, = 0.1,\,\,k_{\tau } = 0.5. \\ \end{aligned}.$$
  2. (2)

    The parameters of pitch controller are

    $$\begin{aligned} & h_{2} = 0.3,\,\,\lambda_{2} = 0.1,\,\,\rho_{2} = {{2\pi } \mathord{\left/ {\vphantom {{2\pi } 3}} \right. \kern-0pt} 3},\,\,\sigma_{2} = {\pi \mathord{\left/ {\vphantom {\pi {12}}} \right. \kern-0pt} {12}},\,\,\alpha_{f2} = {\pi \mathord{\left/ {\vphantom {\pi 6}} \right. \kern-0pt} 6},\,\, \\ & \alpha_{b2} = {\pi \mathord{\left/ {\vphantom {\pi {24}}} \right. \kern-0pt} {24}},\,\,\alpha_{d2} = {\pi \mathord{\left/ {\vphantom {\pi {12}}} \right. \kern-0pt} {12}},\,\,k_{1} = 5,\,\,c_{1} = 3. \\ \end{aligned}$$
  3. (3)

    The parameters of yaw controller are

    $$\begin{aligned} & h_{3} = 0.2,\,\,\lambda_{3} = 0.1,\,\,\rho_{3} = {\pi \mathord{\left/ {\vphantom {\pi 3}} \right. \kern-0pt} 3},\,\,\sigma_{3} = {\pi \mathord{\left/ {\vphantom {\pi 6}} \right. \kern-0pt} 6},\,\,\alpha_{f3} = {\pi \mathord{\left/ {\vphantom {\pi 3}} \right. \kern-0pt} 3},\,\, \\ & \alpha_{b3} = {\pi \mathord{\left/ {\vphantom {\pi {12}}} \right. \kern-0pt} {12}},\,\,\alpha_{d3} = {\pi \mathord{\left/ {\vphantom {\pi 6}} \right. \kern-0pt} 6},\,\,k_{2} = 0.3,\,\,c_{2} = 2 .\\ \end{aligned}$$

The simulation results by using fuzzy backstepping slide mode (FBSM) control and the traditional backstepping control are shown in Figs. 3, 4, 5, 6, 7, 8 and 9. Figures 4 and 5 are the projection curves on the horizontal and vertical plane, respectively. In the presence of model perturbation and external disturbances, the controllers can achieve the AUV 3D path following. There are steady-state errors which eventually converge to 0 under the fuzzy backstepping slide mode control, which indicates the proposed controller is of strong robustness. As can be seen from Fig. 7, the surge velocity control in the traditional backstepping has an overshoot at about 10%, but fuzzy backstepping slide mode control can control the AUV surge velocity fast, gently and without overshoot. In addition, the AUV control force and moments are relatively stable using fuzzy backstepping slide mode control. The results show that the controller is not sensitive to external disturbances and of good robustness.

Fig. 3
figure 3

3D path following of AUV

Fig. 4
figure 4

Horizontal projection for 3D path following of AUV

Fig. 5
figure 5

Vertical projection for 3D path following of AUV

Fig. 6
figure 6

Path following errors of AUV

Fig. 7
figure 7

Velocity response of AUV

Fig. 8
figure 8

Angle response of AUV

Fig. 9
figure 9

Control force and moments of AUV

7 Conclusion

This paper considers the problems of 3D path following for the underactuated AUV in the presence of model perturbation and external disturbances. Path following error model of AUV in Serret–Frenet coordinate frame is established, and the virtual guiding speed is designed based on Lyapunov stability theory. Moreover, we designed a fuzzy backstepping sliding mode controller which can not only restrain external unknown disturbances, but avoid the chattering of AUV actuators. Simulation results show that the 3D path following controller for underactuated AUVs proposed in this paper is effective and robust to external disturbances greatly, which indicates high accurate tracking capacity and good robustness. Future research will address the extension of these results, and path following controller based on nonlinear ocean current observer to estimate unknown current disturbances should be developed.