*2.1. Problem Description*

AUV works in a complex marine environment, which is a complex dynamic system with strong nonlinearity. Due to the complexity and unpredictability of the marine environment, thrusters are easy to fail. However, when the thruster fails, the expected task of the AUV cannot be completed, or AUV may be destroyed directly, which will cause extremely serious losses and may pollute the environment.

Thruster fault diagnostics is the premise to solve the above problems, which include the type of motor fault, propeller enwinding by foreign matter, propeller blade damage, thruster idling, and so on. However, AUV is greatly affected by the external disturbance of ocean currents, the external interference and fault are difficult to be separated, which takes grea<sup>t</sup> difficulty for AUV fault diagnosis. Meanwhile, the ocean currents increase the

difficulty of controlling the AUV to accomplish the missions with thruster fault. Figure 1 gives the design process of thruster fault diagnostics and faults tolerant control for AUV, the PFCM algorithm is proposed to realize the thruster fault diagnostics. Once the thruster fault is diagnosed, based on the fault diagnosis results, a fault tolerant control is presented by the fuzzy controller, in order to improve the performance of the fuzzy controller, a robust optimization problem is proposed by considering the uncertainty of ocean currents, which is solved by the proposed CPSO algorithm, finally, it forms a mechanism of fault diagnostics and tolerant control strategy to accomplish the missions.

**Figure 1.** Design process of thruster fault diagnostics and fault tolerant control for AUV.

## *2.2. AUV KINEMATIC model*

Figure 2 gives two coordinate systems for AUV to obtain the kinematic model, one is the earth-frame {*O* − *X*,*Y*, *<sup>Z</sup>*}, the other is the body-fixed frame {*<sup>O</sup>*1 − *X*1,*Y*1, *<sup>Z</sup>*1}. The AUV kinematic model can deal with the geometric aspects of motion, which is written in a general form as follows [16–19]:

$$
\dot{\eta} = \begin{bmatrix} J\_1 & \mathbf{0}\_{3 \times 3} \\ \mathbf{0}\_{3 \times 3} & J\_2 \end{bmatrix} \mathbf{v} \tag{1}
$$

$$
\begin{bmatrix} \dot{x} & \dot{y} & \dot{z} & \dot{\phi} & \dot{\theta} & \dot{\psi} \end{bmatrix}^T = \begin{bmatrix} J\_1 & \mathbf{0}\_{3 \times 3} \\ \mathbf{0}\_{3 \times 3} & J\_2 \end{bmatrix} \begin{bmatrix} \mu & v & w & p & q & r \end{bmatrix}^T \tag{2}
$$

where the vector *η* = *xyz φθψ<sup>T</sup>* denotes the position and orientation of AUV in the Earth-frame, *x*, *y*, *z* represent the position, *φ*, *θ*, *ψ* are the Euler angles of roll, pitch and yaw angles respectively; *υ* = *uvwpqr* denotes the translational and rotational velocities in the body-fixed frame, *u*, *v*, *w* are the surge, sway and heave components respectively, *p*, *q*, *r* are the roll, pitch and yaw rates respectively; *J*1 and *J*2 are the coordinate transformation matrixes, which are given as follows:

$$J\_1 = \begin{bmatrix} \cos\theta\cos\psi & \sin\theta\sin\phi\cos\psi - \cos\phi\sin\psi & \sin\theta\sin\psi + \sin\theta\cos\phi\cos\psi\\ \cos\theta\sin\psi & \sin\theta\sin\phi\sin\psi + \cos\phi\cos\psi & \sin\theta\cos\phi\sin\psi - \sin\phi\cos\psi\\ -\sin\theta & \sin\phi\cos\theta & \cos\phi\cos\theta \end{bmatrix} \tag{3}$$

$$J\_2 = \begin{bmatrix} 1 & \sin\phi \tan\theta & \cos\phi \tan\theta \\ 0 & \cos\phi & -\sin\phi \\ 0 & \sin\phi / \cos\theta & \cos\phi / \cos\theta \end{bmatrix} \tag{4}$$

**Figure 2.** Coordinate systems for AUV.

*2.3. AUV Dynamic Model*

It can describe the general motion of AUV with six degrees of freedom dynamic equation as follows [17,18,20]:

$$
\mathcal{M}\dot{\boldsymbol{\nu}} + \mathcal{C}(\boldsymbol{\nu})\boldsymbol{V} + \mathcal{D}(\boldsymbol{\nu})\boldsymbol{\nu} + \mathcal{g}(\boldsymbol{\eta}) = \boldsymbol{\pi} \tag{5}
$$

where *M* ∈ *R*6×<sup>6</sup> is the inertial matrix; *υ* is the position and orientation vector; *C* ∈ *R*6×<sup>6</sup> is the matrix of Coriolis and Centripetal terms; *g* ∈ *R*6×<sup>6</sup> is the gravitational terms matrix; *D* ∈ *R*6×<sup>6</sup> is the damping matrix; *τ* is the control forces vector. Figure 3 shows the planform of the designed AUV, it assumes that the center of gravity is at the same point as the center of buoyancy for AUV, the translational motion and rotational motion are expressed by six equations as follows:

$$\begin{aligned} m\left(\dot{u} - vr + wq - x\_{\mathcal{S}}\left(q^2 + r^2\right) + z\_{\mathcal{S}}(pr + q)\right) \\ = X\_{HS} + X\_{\mathbb{H}}|u| + X\_{\mathbb{H}}u + X\_{\mathbb{H}}uq + X\_{\mathbb{H}}qq + X\_{\mathbb{H}}vr + X\_{\mathbb{H}}rr + X\_{\mathbb{H}}rv \end{aligned} \tag{6}$$

$$\begin{aligned} \mathbf{m} \left( \dot{\mathbf{v}} - \mathbf{w}p + \mathbf{u}r - z\_{\mathcal{S}} \left( q\mathbf{v} - \dot{p} \right) + \mathbf{x}\_{\mathcal{S}} \left( pq + \dot{r} \right) \right) \\ \mathbf{y} = \mathbf{y}\_{HS} + \mathbf{Y}\_{\mathbb{P}[\mathbf{v}]} \mathbf{v} \left| \mathbf{v} \right| + \mathbf{Y}\_{\mathbb{P}[\mathbf{r}]} r \left| \mathbf{r} \right| + \mathbf{Y}\_{\dot{\mathbf{v}}} \dot{\mathbf{v}} + \mathbf{Y}\_{\mathbf{u}} \mathbf{u}r + \mathbf{Y}\_{\mathbf{u}\mathbf{p}} \mathbf{w}p + \mathbf{Y}\_{\mathbf{p}\mathbf{q}} p\mathbf{q} + \mathbf{Y}\_{\mathbf{u}\mathbf{u}} \mathbf{u} \mathbf{v} + \mathbf{Y}\_{\mathbf{u}\mathbf{u}\mathbf{\delta}} \mathbf{u}^{2} \delta\_{\mathbf{r}} \end{aligned} \tag{7}$$

$$\begin{aligned} &m\left(\dot{w} - uq + vp - z\_{\mathfrak{J}}\left(q^2 + p^2\right) + x\_{\mathfrak{J}}\left(rp + \dot{q}\right)\right) \\ &= Z\_{HS} + Z\_{w|w|}w|w| + Z\_{q|\mathfrak{g}|}q|q| + Z\_{\dot{w}}\dot{w} + Z\_{\dot{q}}\dot{q} + Z\_{\mathfrak{u}q}uq + Z\_{\mathfrak{u}p}vp + Z\_{\mathfrak{p}l}pr + Z\_{\mathfrak{u}u\mathfrak{u}}uw + Z\_{\mathfrak{u}u\mathfrak{d}}u^2\delta\_{\mathfrak{s}} \end{aligned} \tag{8}$$

$$\begin{aligned} &I\_{xx}\dot{p} + \left(I\_{zz} - I\_{yy}\right)qr + m\left|-z\_{\mathcal{F}}(\dot{v} - wp + \mu r)\right| \\ &= K\_{HS} + K\_{p|p|}p|p| + k\_{p|p|}p|p| + k\_{\dot{p}}\dot{p} + k\_{prop} \end{aligned} \tag{9}$$

$$\begin{aligned} \left| I\_{yy}\dot{q} + (I\_{xx} - I\_{zz})pr + m \right| z\_{\mathcal{G}} (\dot{u} - \nu r + u\eta) - x\_{\mathcal{G}} (\dot{w} - u\eta + \nu p) \right| &= \\ \left| M\_{\rm HS} + M\_{w|w|} q|q| + M\_{\dot{q}|q|} q|q| + M\_{\dot{w}} \dot{w} + M\_{\dot{q}} \dot{q} + M\_{\dot{u}\eta} uq + M\_{\overline{w}p} \varpi p + M\_{\overline{p}l} r p + M\_{\text{uu}\delta\_{\overline{s}}} u^2 \delta\_{\overline{s}} \end{aligned} \tag{10}$$

$$\begin{aligned} \left| I\_{zz}\dot{r} + (I\_{yy} - I\_{xx})q\rho + m \right| \mathbf{x}\_{\mathcal{g}} (\dot{v} - w\rho + \mu r) \right| &= \\ \left| N\_{HS} + N\_{\nu|\upsilon|}v|v| + N\_{r|r|}r|r| + N\_{\dot{v}}\dot{v} + N\_{\dot{r}}\dot{r} + N\_{\text{ur}}\mu r + N\_{\text{up}}\mu p + N\_{pq}pq + N\_{\text{uv}}\mu v + N\_{\text{unsf}}\mu^2 \delta\_r \right| \end{aligned} \tag{11}$$

$$F = \begin{bmatrix} 0 & 0 & \cos\beta & \cos\beta & -\cos\beta & -\cos\beta \\ 0 & 0 & \sin\beta & -\sin\beta & \sin\beta & -\sin\beta \\ 0 & 1 & 0 & 0 & 0 & 0 \\ b\_v & b\_v & \sin\beta \cdot c\_h & \sin\beta \cdot c\_h & -\sin\beta \cdot c\_h & \sin\beta \cdot c\_h \\ a\_v & a\_v & \cos\beta \cdot c\_h & \cos\beta \cdot c\_h & -\cos\beta \cdot c\_h & -\cos\beta \cdot c\_h \\ 0 & 0 & B\_1 & B\_2 & B\_3 & B\_4 \end{bmatrix} \begin{bmatrix} F\_1 \\ F\_2 \\ F\_3 \\ F\_4 \\ F\_5 \\ F\_6 \end{bmatrix} \tag{12}$$

where *B*1 = cos *β* · *bh* + sin *β* · *ah*, *B*2 = − cos *β* · *bh* − sin *β* · *ah*, *B*3 = − cos *β* · *bh* − sin *β* · *ah*, *B*4 = cos *β* · *bh* − sin *β* · *ah*. *F*1 is the thrust of the left vertical thruster; *F*2 is the thrust of the right vertical thruster. *F*3 is the thrust of the left front horizontal thruster; *F*4 is the thrust of the right front horizontal thruster; *F*5 is the thrust of the left rear horizontal thruster thrust; *F*6 is the thrust of the right rear horizontal thruster thrust. *av* is the distance between the center of vertical thruster and *X*1*O*1*Z*1 plane; *bv* is the distance between the center of vertical thruster and *Y*1*O*1*Z*1 plane; *ah* is the distance between the center of horizontal thruster and *X*1*O*1*Z*1 plane; *bh* is the distance between the center of horizontal thruster and *Y*1*O*1*Z*1 plane; *ch* is the distance between the center of horizontal thruster and *X*1*O*1*Y*1 plane.

**Figure 3.** Planform of the designed AUV.

### **3. Thruster Fault Diagnostics and Fault Tolerant Control**

Thruster fault diagnostics and fault tolerant control problem is discussed in this section. Based on the results of thruster fault diagnostics by PFCM algorithm, a fuzzy controller is proposed for AUV fault tolerant control, which is optimized with the proposed CPSO algorithm, the control performance is ensured with the robust optimization design.

### *3.1. Thruster Fault Diagnostics for AUV*

AUV thruster is usually constituted by a motor, reducer, propeller, controller, and so on. The battery pack provides the drive energy, motor, and reducer as the actuator, the output voltage is controlled by the received upper computer instruction by the driver controller, further to control motor speed, motor and speed reducer drive screw rotation. Generally, the speed is proportional to the thrust. The propeller provides the thrust to realize the variable speed sailing of AUV, the drive controller uploads the real-time operation parameters of the propeller to the upper computer. The propeller protection cover is used to avoid the propeller damage caused by the impact of fish or other objects. In this paper, the type of the thruster fault is given as follows: motor fault, propeller enwinding by foreign matter, propeller blade damage, thruster go<sup>t</sup> stuck, thruster idling. The voltage, current, and speed of the thruster are used to judge whether the thruster is faulty.

It is well known that it is difficult for fault diagnosis of nonlinear systems [21,22]. Moreover, ocean currents perturbations could produce noise and further increase the difficulty of thruster fault diagnosis. To solve the thruster diagnosis of AUV nonlinear system with ocean currents, it proposes the PFCM algorithm. PFCM algorithm is one popular clustering method, it is highly sensitive to noise and outliers, and the size of the clusters [23,24]. The algorithm is an unsupervised technique, the data is clustered based on similarities and dissimilarities, which are measured via distances of the cluster centers to the data points. The clustering results are described by introducing membership and probability partition matrixes.

PFCM algorithm is proposed with optimization as follows [25].

$$\begin{aligned} \min \quad & J\_M(\mathcal{U}, T, V) = \sum\_{i=1}^{n} \sum\_{j=1}^{\mathcal{L}} \left( a u\_{ij}^m + b t\_{ij}^p \right) d\_{ij}^2 + \sum\_{i=1}^{n} \eta\_i \sum\_{j=1}^{\mathcal{L}} \left( 1 - t\_{ij} \right)^p \\ \text{s.t.} \quad & \sum\_{i=1}^{\mathcal{L}} u\_{ij} = 1 \end{aligned} \tag{13}$$

$$\eta\_i = \, K \sum\_{j=1}^n u\_{ij}^m d\_{ij}^2 / \sum\_{j=1}^n u\_{ij}^m \tag{14}$$

where *c* is the number of clusters; *m* > 1 is the degree of fuzziness; *n* is the number of data points; *a* and *b* are the constants (*a* > 0, *b* > 0), which represent relative importance of fuzzy and possibilistic terms respectively, the larger value of *b*, the better the ability to resist noise points; *U* = [*uij*] *c*×*n* is the membership degrees matrix (0 ≤ *uij*); *T* = [*tij*] *c*×*n* is the typicality matrix (*tij* ≤ 1); *V* = [*vij*] *c*×*n* is the cluster centers matrix; *p* > 1 is the possibilistic exponent, *dij* is the distance between the cluster center (*vi*) and data point (*xi*); *ηi* is the penalty factor, *K* is a constant.

The objective function in Equation (13) can be solved via an iterative procedure as follows:

$$\mu\_{ij} = \frac{1}{\sum\_{k=1}^{c} \left(\frac{d\_{ij}}{d\_{kj}}\right)^{2/m - 1}} \tag{15}$$

$$t\_{ij} = \frac{1}{1 + \left(\frac{b}{\eta\_i} d\_{ij}^2\right)^{\frac{1}{p-1}}}\tag{16}$$

$$w\_i = \frac{\sum\_{j=1}^n \left( a u\_{ij}^m + b t\_{ij}^p \right) x\_j}{\sum\_{j=1}^n \left( a u\_{ij}^m + b t\_{ij}^p \right)} \tag{17}$$

according to the above Equations (15)–(17), it can obtain the optimal degree of membership and cluster center.

### *3.2. Fault Tolerant Control for AUV*

Fuzzy theory can describe the uncertainty of the system, it has been used to solve the problem of fault diagnosis and control effectively [26–28]. Therefore, in this paper, fuzzy controller is proposed to solve the fault tolerant control problem for AUV path tracking, the fuzzy control includes the fuzzification, fuzzy inference and defuzzification. For the fuzzification operation, the Gaussian function is selected as the membership function of fuzzy variable; Table 1 gives the fuzzy control rule for fuzzy inference; centroid method is used to realize the defuzzification operation. The input parameters of the fuzzy controller are position error *e*(*t*) and its derivative . *<sup>e</sup>*(*t*), the output parameters of the fuzzy controller are angles and those derivatives. Figures 4 and 5 give the membership functions for position error and its derivative respectively. *λ*1, *λ*2, *λ*3, *λ*4, *λ*5, *λ*6, *λ*7 are the mean of the normal distribution for Gaussian membership function of position error. It includes seven fuzzy states: *NB*(*<sup>λ</sup>*1), *NM*(*<sup>λ</sup>*2), *NS*(*<sup>λ</sup>*3), *ZO*(*<sup>λ</sup>*4), *PS*(*<sup>λ</sup>*5), *PM*(*<sup>λ</sup>*6), *PB*(*<sup>λ</sup>*7). *β*1, *β*2, *β*3, *β*4, *β*5, *β*6, *β*7 are the mean of the normal distribution for Gaussian membership function of the derivative of position error. It includes seven fuzzy states: *NB*(*β*1), *NM*(*β*2), *NS*(*β*3), *ZO*(*β*4), *PS*(*β*5), *PM*(*β*6), *PB*(*β*7).

**Table 1.**  control rules for AUV.

Fuzzy*e*(*t*)**/.***e*(*t*) **NB NM NS ZO PS PM PB** NB NB NB NM NS NS ZO PM NM NB NM NS ZO ZO PS PM NS NB NM NS ZO PS PS PM ZO NB NM NS ZO PS PM PB PS NM NS NS ZO PS PM PB PM NM NS ZO ZO PS PM PB PB NM ZO PS PS PM PB PB

**Figure 4.** Membership function for position error.

**Figure 5.** Membership function for the derivative of position error.

### *3.3. Robust Optimization for AUV*

Tracking error between the desired and tracking path is the important performance index for path tracking results, which is replaced by the average of the total absolute of the position errors in this paper, it can be given as follows:

$$f\_E = \frac{1}{T} \sum\_{t=0}^{T} |e\_t| \tag{18}$$

where *et* is one position error at the point *qt* of the tracking path; |*et*| is the absolute value of *et*, *fE* is the average of the total |*et*|, *T* is the total number of points of AUV tracking path.

It defines that the start and target points are (*<sup>x</sup>*0, *y*0, *<sup>z</sup>*0) and (*xT*, *yT*, *zT*) for the tracking path respectively, the tracking path can consist of a sequence of points *A* = [(*<sup>x</sup>*0, *y*0, *<sup>z</sup>*0), ··· ,(*xt*, *yt*, *zt*), ··· ,(*xT*, *yT*, *zT*)].

$$\begin{aligned} \min & \quad f\_E(A) \\ \text{s.t.} & \quad x\_{\min} \le x\_t \le x\_{\max} \\ & \quad y\_{\min} \le y\_t \le y\_{\max} \\ & \quad z\_{\min} \le z\_t \le z\_{\max} \\ & \quad \dot{\eta} = \begin{bmatrix} f\_1 & \mathbf{0}\_{3 \times 3} \\ \mathbf{0}\_{3 \times 3} & f\_2 \end{bmatrix} V \end{aligned} \tag{19}$$

where *xm*, *ym*, *zm* are the decision variables of the optimization problem for AUV path tracking; (*<sup>x</sup>*max, *y*max, *<sup>z</sup>*max) and (*<sup>x</sup>*min, *y*min, *<sup>z</sup>*min) are the maximum and minimum coordinate position points, respectively.

Considering the uncertain ocean currents, Equation (19) can be transformed into a robust optimization problem as follows:

$$\begin{array}{l} \min \max \max \, f(x\_{\mathsf{m},\mathsf{y},\mathsf{Z}\_{\mathsf{m}}}, f(x\_{\mathsf{m},\mathsf{y},\mathsf{Z}\_{\mathsf{m}}}, z\_{\mathsf{m}}, u\_{\mathsf{c}}, v\_{\mathsf{c}}, w\_{\mathsf{c}})\\ \text{s.t.} \quad \mathsf{x}\_{\mathsf{min}} \le x\_{\mathsf{m}} \le x\_{\mathsf{max}}\\ \quad \mathsf{y}\_{\mathsf{min}} \le y\_{\mathsf{m}} \le y\_{\mathsf{max}}\\ \quad z\_{\mathsf{min}} \le z\_{\mathsf{m}} \le z\_{\mathsf{max}}\\ \quad \dot{\eta} = \begin{bmatrix} \ I\_{1} & \mathbf{0}\_{3\times 3}\\ \mathbf{0}\_{3\times 3} & \ I\_{2} \end{bmatrix} \mathbf{V}\\ \quad u\_{\mathsf{min}} \le u\_{\mathsf{c}} \le u\_{\mathsf{max}}\\ \quad v\_{\mathsf{min}} \le v\_{\mathsf{c}} \le v\_{\mathsf{max}}\\ \quad w\_{\mathsf{min}} \le w\_{\mathsf{c}} \le w\_{\mathsf{max}} \end{array} \tag{20}$$

where *<sup>u</sup>*minc *ν*minc *<sup>w</sup>*minc and *<sup>u</sup>*maxc *ν*maxc *<sup>w</sup>*maxc are the minimum and maximum values of the components of ocean currents. Equation (20) is the robust optimization problem, which is also called "min-max" optimization problem for the AUV path tracking, whose goal is to find the robust solution for the tracking path with the best performance in all the worst ocean currents.

CPSO is proposed to solve the robust optimization problem (20), which can find a good solution to the "min-max" optimization problem for the AUV path tracking. The CPSO algorithm involves two populations *P*1 and *P*2, each population evolves independently and tied together via the fitness evaluation [29,30]. The first population *P*1 is used to evolve the decision variables (*xm*, *ym*, *zm*), the second population *P*2 is used to evolve the ocean currents (*uc*, *νc*, *wc*).

For the first population, the fitness function of decision variables is given by

$$G(\mathbf{x}\_{m\prime}y\_{m\prime}z\_{m}) = \max\_{\boldsymbol{\mu}\_{\mathcal{E},\boldsymbol{\nu}\_{\mathcal{E}},\boldsymbol{\mu}\_{\mathcal{E}} \in P\_{2}} f(\mathbf{x}\_{m\prime}y\_{m\prime}z\_{m\prime}\boldsymbol{\mu}\_{\mathcal{E}\prime}\boldsymbol{\nu}\_{\mathcal{E}\prime}\boldsymbol{w}\_{\mathcal{E}}) \tag{21}$$

which is to be minimized.

> For the second population, the fitness function of ocean currents is given by

$$H(\boldsymbol{\mu}\_{\boldsymbol{\varepsilon}\prime}, \boldsymbol{\nu}\_{\boldsymbol{\varepsilon}\prime} \boldsymbol{w}\_{\boldsymbol{\varepsilon}\prime}) = \min\_{\boldsymbol{x}\_{\boldsymbol{m}\_{\boldsymbol{\varepsilon}}\prime \boldsymbol{y}\_{\boldsymbol{m}\_{\boldsymbol{\varepsilon}}\prime} \boldsymbol{z}\_{\boldsymbol{m}} \in P\_{1}} f(\boldsymbol{x}\_{\boldsymbol{m}\_{\boldsymbol{\varepsilon}\prime}} \boldsymbol{y}\_{\boldsymbol{m}\_{\boldsymbol{\varepsilon}\prime}}, \boldsymbol{z}\_{\boldsymbol{m}\_{\boldsymbol{\varepsilon}\prime}} \boldsymbol{u}\_{\boldsymbol{c}\_{\boldsymbol{\varepsilon}\prime}} \boldsymbol{w}\_{\boldsymbol{c}\_{\boldsymbol{\varepsilon}}}) \tag{22}$$

which is to be maximized.

### *3.4. Thruster Fault Diagnostics and Fault Tolerant Control Algorithm*

For the CPSO algorithm, in the light of Equation (21), the global best value in *P*1 is gotten as the solution. Based on Equation (22), the globally best values in *P*2 are obtained as the scenarios for ocean currents. According to the above design principles, the optimal tracking path can be obtained.

Figure 6 gives the flowchart for the thruster fault diagnostics and fault tolerant control of AUV, the corresponding steps are given in detail in Algorithm 1.

### **Algorithm 1:** Thruster fault diagnostics and fault tolerant control for AUV


**Figure 6.** Flowchart for thruster fault diagnostics and fault tolerant control for AUV.

### **4. Simulation and Experiment Analysis**

In this paper, different experiments are given to analyze the performance of the proposed thruster fault diagnostics and fault tolerant control method for AUV, Figure 7 shows the designed AUV, and Figure 8 gives the AUV thruster in practice. Based on the test data of the thruster fault, the results of the fault type are obtained for AUV thruster fault diagnostics. AUV is equipped with six underwater propellers, among which the propeller at the top of the AUV is used to control the sinking and floating of the AUV, and the other four propellers at the front and back are used to control the forward, backward, and steering of the AUV. The speed of AUV is set as 0.15 m/s, and the speed of uncertain ocean

current is set as 0–0.08 m/s, whose direction is random. Sine path, circular path, rectangular path, and irregularity path are given to illustrate the tracking effect with thruster fault. The algorithm is coded in MATLAB R2019a and simulations are run on the PC with 2.00 GHz CPU/8 GB RAM.

**Figure 7.** The designed AUV.

**Figure 8.** The thruster of AUV.

In order to test the effectiveness of the proposed thruster fault diagnostics, a data set with 300 groups is obtained from the underwater experiment for our designed AUV. Each group data is composed of voltage, current, and speed of the thrusters, which can denote the characteristic of six types of thruster operation: motor fault, propeller enwinding by foreign matter, propeller blade damage, thruster go<sup>t</sup> stuck, thruster idling, and normal operation. Therefore, it assumes that the number of the clustering centers is 6. Figure 9 shows the classification results by the proposed PFCM algorithm. The center of clustering of the thruster stuck state is (11.98 V, 0.58 A, 0.75 r/s), the center of clustering of the propeller enwinding state is (12.2 V, 0.41 A, 12.07 r/s), the center of clustering of the thruster normal operation is (12.48 V, 0.35 A, 16.9 r/s), the center of clustering of the propeller damage is (12.78 V, 0.27 A, 21.01 r/s), the center of clustering of the thruster idling state is (13 V, 0.17 A, 25 r/s), the center of clustering of the motor fault is (13 V, 0.05 A, 0.77 r/s). The signals of six different fault types are closely clustered around their respective clustering centers after classification by the PFCM algorithm. The proposed fault detection algorithm can accurately identify the fault types of AUV and effectively classify them.

Because the thrusters of AUV are often immersed in seawater, the probability of failure is significantly improved after the corrosion of seawater. AUV operation in the ocean may be enwound by marine plants or marine organisms, which affects the performance of the thrusters. The thruster is the main forward power of AUV, if the above phenomenon occurs, it affects the velocity, heading angle, and the safety of AUV, and even leads to the AUV being unrecoverable. Therefore, in this paper, after detecting the fault type of AUV based on the PFCM algorithm, the corresponding fault tolerant control is adopted according to the

fault type and degree. By reducing the thrust of other thrusters, the AUV can continue to move to accomplish the missions. If the AUV loses all power, it can be stopped and floated up for recovery. Therefore, the fault tolerant control proposed in this paper only applies to the fault types of AUV power loss caused by AUV enwinding or propeller damage.

**Figure 9.** The classification results by the proposed PFCM algorithm.

When a thruster fault happens, it loses thrust and its torque balance is broken, which leads the change of heading angle and takes off its desired path. For example, if the left thruster (F5) of the AUV fault happens and its thrust decreases, the thrust of its adjacent thruster (F6) should be correspondingly reduced to balance the torque of the AUV. If the two adjacent thruster faults happen, the thrust of the thruster with a larger thrust is reduced accordingly to make its torque reach balance. If these two thrusters (F5, F6) have a large degree of fault, the thrusters (F3 and F4) are responsible for AUV regression on the opposite side, which can complete the follow-up tasks or realize turning back.

In the complex environment, there are many factors that affect the AUV operation, such as obstacles, ocean currents, and fish schools. Therefore, the AUV path is not a line, the curved path is an essential to the AUV path. This paper gives a sine curve path as follows:

$$\begin{cases} x(t\_1) = t\_1\\ y(t\_1) = 80\sin(t\_1\pi/80) \\ z(t\_1) = 0 \end{cases} \tag{23}$$

where *t*1 ∈ [0 : 0.25 : <sup>360</sup>], it assumes that the sine curve is constituted of 1440 points [(0, 0, <sup>0</sup>), (0.25, 0.78, <sup>0</sup>), ··· , (360, 0, <sup>0</sup>)], the tracking start point is (0, 0, <sup>0</sup>). The initial position, angle, initial velocity, and expected velocity are set as (*<sup>x</sup>*, *y*, *z*)=(0, 0, 0) m,(*ϕ*, *θ*, *φ*)=(0◦, 0◦, <sup>0</sup>◦), (*<sup>u</sup>*, *v*, *w*)=(0, 0, 0) [kn], (*<sup>u</sup>*, *v*, *w*)=(0.2, 0, 0) [kn] for AUV. If the thruster is enwound with foreign matter. Based on the results of thruster fault diagnostics, Figure 10 gives the tracking results for the sine path by the proposed fault tolerant control algorithm, the tracking path length is 832.91 m. Figure 11 shows the position error for the corresponding sine path tracking, the average position errors is 0.27 m, the range of the tracking error is [−1.44 m, 1.91 <sup>m</sup>], and the standard deviation of the tracking error is 0.16 m. The proposed algorithm can realize the sine path tracking with thruster enwinding effectively.

**Figure 10.** Tracking for sine path.

**Figure 11.** Position error for the sine path tracking.

In the practice, in order to complete some specific tasks, AUV needs to move around the detected object in a circle. Therefore, the circular curve is also one of the key paths of AUV path tracking. The circular path is described as follows:

$$\begin{cases} x(t\_2) = 55 + 40 \cos(t\_2) \\ y(t\_2) = 40 \sin(t\_2) \\ z(t\_2) = 0 \end{cases} \tag{24}$$

where *t*2 ∈ [*π* : −*<sup>π</sup>*/400 : <sup>−</sup>*<sup>π</sup>*], it assumes that the curve is constituted of 800 points [(15, 0, <sup>0</sup>), (15.002, 0.31, <sup>0</sup>), ··· , (15, 0, <sup>0</sup>)], the stat tracking point is (0, 0, <sup>0</sup>). The initial position, initial angle, initial velocity, and expected velocity are set as (*<sup>x</sup>*, *y*, *z*)=(5, −5, 0) m, (*ϕ*, *θ*, *φ*)=(0◦, 0, 0 ), (*<sup>u</sup>*, *v*, *w*)=(0, 0, 0) [kn]. (*<sup>u</sup>*, *v*, *w*)=(0.2, 0, 0) [kn] for AUV respectively. If the thruster is enwound with foreign matter. Based on the results of thruster fault diagnostics, Figure 12 gives the path tracking results for the circle path. Figure 13 shows the position error for the circle path tracking. The tracking path length is 261.73 m, the average position errors is 0.59 m, the range is [−<sup>10</sup> m, 0.71 m] for AUV tracking position errors, the standard deviation of the tracking error is 0.15 m. The proposed algorithm can realize the circle path tracking with thruster enwinding effectively.

**Figure 12.** Tracking for circle path.

**Figure 13.** Position error for the circle path tracking.

In the real working environment, in order to successfully complete the missions, AUV needs to run along different paths, among which rectangular paths are common. Therefore, a rectangular path is given to simulate the actual path tracking, the basic path parameters are given for the rectangular path as follows:

$$\begin{cases} \begin{aligned} x &= t\_3\\ y &= t\_3 + 10 \end{aligned} & t\_3 \in [10, 50] \\ \begin{aligned} y &= -t\_3 + 110 \quad t\_3 \in [50, -30] \\ y &= t\_3 + 170 \quad t\_3 \in [-30, -70] \\ y &= -t\_3 + 30 \quad t\_3 \in [-70, 10] \end{aligned} \end{cases} \tag{25}$$

It assumes that the path is constituted of the points [(10, 20, <sup>0</sup>), (1, 11, <sup>0</sup>), ··· , (10, 20, <sup>0</sup>)]. The start tracking point is (10, 20, <sup>0</sup>), The initial position, initial angle, initial velocity, and expected velocity are set as (*<sup>x</sup>*, *y*, *z*)=(0, 0, 0) m, (*ϕ*, *θ*, *φ*)=(0◦, 0◦, <sup>0</sup>◦), (*<sup>u</sup>*, *v*, *w*)=(0, 0, 0) [kn], (*<sup>u</sup>*, *v*, *w*)=(0.2, 0, 0) [kn]. If the thruster is enwound with foreign matter. Based on the results of thruster fault diagnostics, Figure 14 gives the tracking results for the rectangular path. Figure 15 shows the position error for the rectangular path tracking. The tracking path length is 255.06 m, the average position errors is 0.81 m, the range is [−1.94 m, 8.26 m] for AUV tracking position errors, the standard deviation of the tracking error is 0.35 m. The proposed algorithm can realize the rectangular path tracking with thruster enwinding effectively.

**Figure 14.** Tracking for the rectangular path.

**Figure 15.** Position error for the rectangular path tracking.

In order to verify the path tracking effect of the controller proposed in the presence of obstacles, multiple circular obstacles are set in the environment. The tracking start point is (*<sup>x</sup>*, *y*, *z*)=(0, 0, <sup>0</sup>), the target point is (*<sup>x</sup>*, *y*, *z*)=(100, 100, <sup>0</sup>). The initial position, initial angle, initial velocity, and expected velocity are set as (*ϕ*, *θ*, *φ*)=(0◦, 0◦, <sup>0</sup>◦), (*<sup>u</sup>*, *v*, *w*)=(0, 0, 0) [kn]. (*<sup>u</sup>*, *v*, *w*)=(0.2, 0, 0) [kn]. If the thruster is enwound with foreign matter, the ocean current is 0.07 [kn]. Based on the results of thruster fault diagnostics, it can obtain the fault tolerant control results by the proposed and existing traditional algorithms as shown in Figure 16. For the proposed algorithm, the tracking path length is 150.54 m, the average of the position errors is 0.78 m, and the standard deviation of the position errors is 0.18 m. For the traditional fuzzy control, the parameters of the membership function are optimized by the trial and error method. The tracking path length is 152.71 m, the average of the position errors is 0.92 m, the standard deviation of the position errors is 0.22 m. Table 2 gives the comparison results between the proposed and traditional algorithms. Figure 17 shows the position error for the function tracking. The ranges of the position errors are [−1.65 m, 7.53 m] and [−1.75 m, 7.47 m] for the proposed and existing algorithms respectively. Compared with the traditional algorithm, one can see that the tracking path length, average position error, and time are smaller by the proposed algorithm. The proposed algorithm can realize the path tracking in the environment with obstacles and ocean currents effectively.

**Figure 16.** (**a**) Path tracking in the environment with obstacles. (**b**) Part of the enlarged view for path tracking curve.

**Figure 17.** Position error for the path tracking in the environment with obstacles.


**Table 2.** Comparison results between the proposed and traditional algorithms.
