Trajectory Tracking of Underactuated Unmanned Surface Vessels: Non-Singular Terminal Sliding Control with Nonlinear Disturbance Observer

An underactuated unmanned surface vessel (USV) is a nonholonomic system, in which trajectory tracking is a challenging problem that has drawn more and more attention from researchers recently. The control of trajectory tracking is of critical importance since it determines whether the task can be carried out successfully. In this paper, a non-singular terminal sliding model (NTSM) controller is proposed for the trajectory tracking control of the underactuated USV, with a nonlinear disturbance observer which is designed to measure complex environmental disturbances such as wind, waves, and currents. Exploratory simulations were carried out and the results show that the proposed controller is effective and robust for the trajectory tracking of underactuated USVs in the presence of environmental disturbances.


Introduction
In recent years, with the dramatic development of unmanned driving technology, research on USVs has received great attention in the military and civilian fields. Equipped with different device systems, the USV can accomplish various operational tasks such as security patrols, marine environment monitoring, searching for resources, and rescue tasks [1][2][3][4][5]. The USV system itself is nonlinear, and there are many coupling terms [6]. In addition, most USVs are underactuated systems, and there will be parameter uncertainties during navigation. The influence of unknown disturbances and the speed vectors are often difficult to measure directly. Because of these problems, underactuated USVs are unable to track a specific predefined trajectory, which leads to inability to complete the task. In order to devise a solution to the problem of trajectory tracking control, researchers have applied many control methods such as backstepping, adaptive control, sliding mode control [7][8][9][10], neural network control [11,12], output feedback control [13,14], model prediction [15][16][17], L1 adaptive control [18], and finite time control [19][20][21][22][23], as well as combinations of various control theories.
The backstepping method has been widely used to deal with uncertain systems and adaptive controls. The core idea of the backstepping method is to recursively deduct the control design of the entire system by means of designing the virtual control variables and the Lyapunov function of the subsystems. However, in the process of the backstepping method design, the derivatives of virtual variables must be calculated. The higher the order of the system, the higher the order of the derivatives to be calculated. As a result, a differential explosion phenomenon appears, which increases the difficulty of controller design.
In order to reduce the difficulty of control design, a low-pass filter is usually used to replace the derivation of the virtual variables. Dynamic surface control (DSC) uses a low-pass filter to avoid the differential explosion phenomenon in the design process. The dynamic surface control method was applied in [24] to solve the control problem of a class of nonlinear systems. In [25], two cascaded subsystems were formed by coordinate conversion of the system error model, and the DSC method was introduced into the trajectory tracking control of the USV. In [26], an adaptive dynamic sliding mode control based on the idea of the backstepping method was proposed to solve the trajectory tracking control problem for an unmanned underwater vessel (UUV) for modeling parameter uncertainty and environmental perturbation. Due to the inevitable calculation of multiple design virtual control variables in the design process, the calculation complexity can be reduced using the differential substitution characteristics of the model based on a biologically inspired model. In [27], an adaptive backstep sliding mode controller was designed based on a biologically inspired model to realize the trajectory tracking of a USV.
The underactuated USV has no lateral thrusters to control the lateral displacement. The objective of control of underactuated vessels is to solve the problem that occurs when a fully actuated USV breaks down, or in the absence of bow thrusters, where only the propellers and the yaw moment are utilized to achieve the purpose of trajectory tracking control. An underactuated USV with a forward speed is inevitably affected by the wind, waves, currents, and other unknown disturbances. If these unknown disturbances cannot be handled properly, the functionality of the underactuated USVs will be much reduced.
Measuring the unknown disturbance is the key to underactuated USV trajectory tracking control [28]. In addition, in sliding mode control, the upper and lower bounds of the disturbance are usually estimated, and a larger gain parameter is designed to solve the disturbance problem. By adopting a disturbance observer, the value of the disturbance can be estimated, to better solve the disturbance problem. In [29], aiming at the formation control problem of an underactuated USV, an adaptive finite-time disturbance observer was introduced to observe external environmental disturbances. In [30], based on fuzzy theory, a fuzzy unknown observer was proposed to estimate the compound disturbance of the system, to solve the underactuated USV path tracking control problem. By treating external disturbances as periodic disturbances, the Fourier series expansion of periodic disturbances and Lyapunov theory were used to obtain the optimal estimation of environmental disturbances [31]. In [32], model predictive control was used to devise trajectory tracking control, and nonlinear disturbance observers were introduced to compensate for unknown disturbances, to achieve optimal trajectory control. In [33], due to the difficulty of obtaining information about the underactuated state, a sliding mode observer was designed to estimate the linear velocity and angular velocity, combined with a backstepping sliding mode control principle to realize the underactuated UUV trajectory tracking control. Since an RBF network is able to approximate arbitrary functions, an adaptive neural network was designed [34] to approximate unknown external environmental disturbances, in combination with a high-gain observer to achieve fast feedback, to ensure the transient performance of underactuated USVs. In approximating unknown disturbances with neural networks [35,36], the choice of the weighting matrix and the number of nodes in the implicit layer is a difficult issue. The nonlinear disturbance observer design is transformed into a linear matrix inequality, making the selection of parameters easier, while the speed of convergence is related to the selection parameters of the Lyapunov function coefficients.
In this paper, a method combining a nonlinear disturbance observer and NTSM control is proposed for an underactuated USV, to deal with the trajectory tracking control problem under external environmental disturbances. In addition, in order to demonstrate the effectiveness and performance of the derived control strategy, a straight-line trajectory and a circular trajectory are proposed for simulation verification. The main contributions of this paper are: (1) An NTSM controller integrating a nonlinear disturbance observer is proposed to solve the trajectory tracking problem under the environmental disturbances of wind, waves, and currents. The stability of the observer and controller is proved strictly using the Lyapunov theory. (2) The non-singular terminal sliding mode control method proposed in this paper results in a dynamic system with a better performance than that of the classic sliding mode controller. To improve the robustness of the control system, a disturbance observer is also designed to observe unknown disturbances.

Definition and Lemma
Definition 1. The NTSM is described by the following first-order nonlinear differential equation [37].
where x ∈ R and sign a x sign(x) · |x| a .
Lemma 1 [38]. Let the partitioned matrix be symmetric. Then, The standard three-degrees-of-freedom (surge, sway, and yaw) USV model is used, which is characterized by uniform mass distribution and left-right symmetry, and the center of gravity of the USV is located at the origin of the coordinate system. Then, the three-degrees-of-freedom mathematical model of the USV can be obtained as follows.

Controller Design
where x and y denote the surge displacement and sway displacement, and ψ is the heading angle. In addition, u and v denote the surge velocity and sway velocity; r is the angular velocity; τ u and τ r denote the surge force and yaw moment; d 1 , d 2 and d 3 , are the environment disturbances induced by waves, wind, and ocean currents, respectively. Furthermore, where m is the mass of the USV; I z is the ship's moment of inertia about the Z−axis of the body-fixed frame; X u , Y v , N r are the linear hydrodynamic damping coefficients; and X . u , Y . v , N . r , are the additional mass coefficients [39]. In order to better reflect the relationship between kinematics and kinetics, this relationship is described in a matrix form, to facilitate the subsequent design of the disturbance observer. The kinematic equation is . η = R(ψ)V (6) and the dynamic equation is where η = x y ψ T denotes the position and orientation vector of the USV in the earth-fixed inertial frame; and V = u v r T denotes the velocity vector of the USV in the body-fixed frame. The earth-fixed inertia frame O − X o Y o and body-fixed frame A − XY are depicted in Figure 1. In addition, τ = τ u 0 τ r T is the control vector of the USV; and d = d 1 d 2 d 3 T are the environment disturbances. R(ψ) is a rotation matrix that satisfies R(ψ)R T (ψ) = I 3×3 , where I 3×3 represents the third-order unit matrix. M is the inertia matrix of the system, which satisfies M = M T > 0 and . M = 0 3×3 . C is the Coriolis and centripetal matrix, which satisfies C = −C T . D is the hydrodynamic damping matrix, which satisfies D > 0. They are, respectively, Appl. Sci. 2022, 12, 3004 5 of 19 coordinate frames of a USV.

Design of Virtual Velocities
Usually, the aim of trajectory tracking control is to make the actual trajectory follow the reference trajectory by adjusting the controller according to the position error. In order to construct the Lyapunov function according to the position error equation and the design, a suitable control expression to satisfy the Lyapunov stability theory to achieve trajectory tracking, the actual position, and the reference position are calculated to obtain the position error equation.

Design of Virtual Velocities
Usually, the aim of trajectory tracking control is to make the actual trajectory follow the reference trajectory by adjusting the controller according to the position error. In order to construct the Lyapunov function according to the position error equation and the design, a suitable control expression to satisfy the Lyapunov stability theory to achieve trajectory tracking, the actual position, and the reference position are calculated to obtain the position error equation.
x e y e = x − x d y − y d (9) where (x, y), (x d , y d ), (x e , y e ) are the USV time-varying actual trajectory coordinates, reference trajectory coordinates, and error trajectory coordinates, respectively. The derivation of the two sides of Equation (9) with respect to time t can be obtained.
In order to devise the controller based on the dynamic equation, the virtual speed is defined as follows: where a x and a y are positive numbers, and b x , b y = 0. The position error converges to (0, 0) when the actual velocity satisfies the defined virtual velocity. The velocity error is defined in the same way as the position error: where y . Then the velocity errors can be calculated as: When the velocity error converges to (0, 0), the position error satisfies the following expression: Therefore, the following Lyapunov function can be defined according to the position error.
The time derivative of V 1 is It can be seen that Inequality (16) is semi-negative definite, and the position error converges asymptotically, which means that when the speed error converges to (0, 0), the position error also converges to (0, 0).

Design of the USV Controller
Next, it must be ensured that the convergence of the velocity error satisfies the convergence of the position error. For the sliding mode control, a sliding mode surface is constructed according to the error, and a suitable control law is designed to ensure that the sliding mode surface satisfies the Lyapunov stability condition.
Without considering the environmental disturbances, we consider the following NTSM surfaces: The derivative of the virtual speed can be obtained: .. where .. ..

r.
Then, the time derivative of Equation (18) is: .
Due to the USV tracking error in Equation (13), the following control inputs can be designed.
Stability Analysis of the USV Controller Consider the following Lyapunov function for the NTSM: By taking the first time derivative of the Lyapunov function V 2 , along with Equations (19) and (20), one can obtain Substituting Equations (21) and (22) into Equation (24) yields where ε 1 , ε 2 > 0. Because V 2 is positively defined and . V 2 is negatively defined, it can be seen that the NTSM surfaces meet the Lyapunov stability condition, which indicates that the system can reach the sliding mode surfaces from any initial position, as given in Equation (18).
When the trajectory reaches the sliding mode surfaces, and t 0 e u dt = −β 1 (e u ) p 1 /q 1 can be obtained. That is to say, the constructed NTSM can make the velocity error converge, thus indicating the position error convergence.

Disturbance Observer
The disturbance of the external environment cannot be ignored in the actual navigation of underactuated USVs. In order to eliminate the influence of disturbances on the controller, a nonlinear disturbance observer [40] was introduced to estimate the unknown disturbances and compensate for disturbances in the controller, to achieve high-quality control of the closed-loop system.
L and P can take the following forms: The nonlinear disturbance observer was constructed using Equations (26)- (28), where X is an invertible matrix which can be solved for via linear matrix inequality (LMI).
The stability of the disturbance observer is proved in the next subsection. If the disturbance errors converge, then the disturbance observer is stable, and it can be used for controller design.

Proof of the Disturbance Observer
The Lyapunov function for the disturbance error is constructed as Combining Equations (27)-(29), the following equation can be obtained:  (27).
The following inequality is constructed: where κ is the positively defined matrix, and the existence of κ > 0 makes Clearly, the disturbance observer converges exponentially, and the accuracy and speed of convergence depend on the value of κ.
The higher the value of κ, the higher the convergence speed and precision. Let Q = X −1 , then Inequality (33) becomes From Equation (28), according to the Schur complement lemma, we can derive The value of Q can be obtained by solving Inequality (34), and thus the unknown X in Inequality (33) can be obtained.
The USV controller is redesigned to account for disturbances. The time derivative of Equation (18) is: The surge force and yaw moment can be defined as follows: For the stability analysis of the trajectory tracking control law under disturbances, the following Lyapunov function is constructed: Taking the time derivative at both ends of Equation (38), and then substituting the control laws, Equations (36) and (37) yield Since the designed disturbance observer converges, Equation (39) can be rewritten as where ε 1 , ε 2 > 0, V 4 > 0 and V 4 > 0. In a similar way, the designed NTSM control law can converge to b in a finite period of time.
To eliminate the chattering phenomenon arising from the discontinuous sign function, the following saturation function is used to replace the sign function, where φ > 0 and i = 1, 2.

Simulations and Discussion
In this section, the USV model, controller, and disturbance observer are written in MATLAB functions based on the Simulink environment, and numerical simulations are performed using a variable step size to verify the effectiveness of the designed control strategy. First, the trajectory tracking performance was validated under ideal conditions. Under non-ideal conditions, the disturbance caused by the external environment is unknown and cannot be directly measured. Next, constant environmental disturbances were introduced, disturbance observers were used to measure disturbances, and NTSM controllers with disturbance compensation were employed to achieve trajectory tracking. The inclusion of constant environmental disturbances alone is insufficient to prove the observation effect of the disturbance observer for unknown disturbances and cannot reflect real-world scenarios. Therefore, time-varying environmental disturbances were introduced to verify the compensation for the disturbance and the trajectory tracking. The model parameters of the USV can be found in [41] and are shown in Table 1. The controller's control performance was verified using the following two trajectories under three different conditions.

Straight-Line Trajectory Simulation
The following straight-line trajectory was used in the simulation: The initial position of the USV was η = [0, 0, 0], the initial velocity was V = [0, 0, 0], the initial value of e u was 0.5, and a x = a y = 2, a x = a y = 0.5. For the disturbance observer, the parameters κ = diag 0.5 1 5 × 0.005 and Q = 0.0097 0.0103 0.0148 were chosen. The parameters used to design the NTSM controller based on Equations (37) and (42) are listed in Table 2.  Figure 2a shows the straight-line trajectory curve of the underactuated USV without any disturbances, with steady disturbances d 1 , and with time-varying disturbances d 2 .
The solid line is the reference trajectory curve, and the three dotted lines are the actual trajectory curves of the USV under different conditions. From the figure, it can be seen that with the control strategy proposed in this paper, the USV is able to overcome the influence of external environmental disturbances and track a straight trajectory in three different cases. Figure 2b represents the curves of the USV in the AXY plane, the surge (X−axis direction), and the sway (Y−axis direction) positions over time. It can better reflect the change of the trajectory over time. It can be seen from the figure that the USV tracks the reference trajectory in a very short period of time and maintains stable tracking at all times. Since the USV is underactuated and has no thrusters in the sway direction, it can be seen from the figure that it takes more time to track the reference curve in the Y−axis direction than in the X−axis direction. Figure 3 shows the observed curves and the observed error curves of the nonlinear perturbation observer for two different environmental perturbations d 1 and d 2 . It can clearly be seen in Figure 3a,b that the disturbance observer is able to quickly approximate the external unknown environmental disturbances. Figure 3c,d show the errors between the actual disturbances and the observed values, showing that the designed disturbance observer for both the constant disturbances and the time-varying external environmental disturbances is able to estimate the actual disturbance values quickly and accurately. Therefore, the disturbance values observed by the disturbance observer can be used to replace the disturbances caused by wind, waves, and currents in the external environment, thus improving the robustness of the system. Figure 4a,b show the actual position variation curves and the actual velocity variation curves of the USV, respectively, in the three cases. As can be seen from the figures, the position and speed curves under the effect of disturbances have the same pattern as those without disturbances, which further indicates that the controller has an excellent antidisturbance capability. Figure 4c,d show the position error variation curve and velocity error variation curve of the USV, respectively, in the three cases. The position and velocity error curves more clearly reflect the USV tracking reference trajectory. As shown in the figures, there is a large error at the initial stage of navigation, but after a period of intervention both the position error and velocity error approach zero, which shows that the designed controller can effectively track the linear reference trajectory. Figure 5 shows the variation curves for the surge force and yaw moment. The output curve of the controller becomes a smooth curve, maintaining tracking with a short adjustment time.   Figure 3a,b that the disturbance observer is able to quickly approximate the external unknown environmental disturbances. Figure 3c,d show the errors between the actual disturbances and the observed values, showing that the designed disturbance observer for both the constant disturbances and the time-varying external environmental disturbances is able to estimate the actual disturbance values quickly and accurately. Therefore, the disturbance values observed by the disturbance observer can be used to replace the disturbances caused by wind, waves, and currents in the external environment, thus improving the robustness of the system. From the simulation results presented in Figures 2-5, it can be concluded that the control strategy proposed in this study performs well in overcoming external environmental disturbances and in tracking the linear reference trajectory.

Circular Trajectory Simulation
The following circular trajectory was chosen for the circle trajectory simulations:   Figure 3a,b that the disturbance observer is able to quickly approximate the external unknown environmental disturbances. Figure 3c,d show the errors between the actual disturbances and the observed values, showing that the designed disturbance observer for both the constant disturbances and the time-varying external environmental disturbances is able to estimate the actual disturbance values quickly and accurately. Therefore, the disturbance values observed by the disturbance observer can be used to replace the disturbances caused by wind, waves, and currents in the external environment, thus improving the robustness of the system.  Figures 4c and 4d show the position error variation curve and velocity error variation curve of the USV, respectively, in the three cases. The position and velocity error curves more clearly reflect the USV tracking reference trajectory. As shown in the figures, there is a large error at the initial stage of navigation, but after a period of intervention both the position error and velocity error approach zero, which shows that the designed controller can effectively track the linear reference trajectory. Figure 5 shows the variation curves for the surge force and yaw moment. The output curve of the controller becomes a smooth curve, maintaining tracking with a short adjustment time.
(a) (b) The initial conditions of the USV and the parameters of the disturbance observer were consistent with the parameters of the linear trajectory. The parameters used to design the NTSM controller based on Equations (37) and (42) are listed in Table 3.  Figures 6-8 show the simulation curves for the circular trajectory. From the simulation results, it can be seen that for circular trajectories in three different cases, the designed control strategy enabled the USV to overcome the external disturbances to achieve tracking on circular trajectories. Figure 6a illustrates the overall trajectory tracking of the USV in the AXY plane. Figure 6b presents the trajectory tracking curves over time in the surge (X−axis) and sway (Y−axis) directions. The observation approximation effect and estimation errors are presented in Figure 3. Figure 7a shows the six state curves including position and velocity curves during the USV navigation. It can be observed in Figure 7b that, in the simulations with time-varying disturbances, the velocity curve has smaller fluctuations compared with the other two cases. This is because there is a certain error in the observed effect of the disturbance observer for the time-varying disturbances. From the position error curve and velocity error curve in Figure 7c,d, it can be seen that the error has a good convergence pattern, which means that the USV can achieve circular trajectory tracking. Figure 8 shows the variation curves for the surge force and yaw moment. velocity error variation curve of the USV, respectively, in the three cases. The position and velocity error curves more clearly reflect the USV tracking reference trajectory. As shown in the figures, there is a large error at the initial stage of navigation, but after a period of intervention both the position error and velocity error approach zero, which shows that the designed controller can effectively track the linear reference trajectory. Figure 5 shows the variation curves for the surge force and yaw moment. The output curve of the controller becomes a smooth curve, maintaining tracking with a short adjustment time.   From the simulation results presented in Figures 2-5, it can be concluded that the control strategy proposed in this study performs well in overcoming external environmental disturbances and in tracking the linear reference trajectory.   From the simulation results presented in Figures 2-5, it can be concluded that the control strategy proposed in this study performs well in overcoming external environmental disturbances and in tracking the linear reference trajectory. position and velocity curves during the USV navigation. It can be observed in Figure 7b that, in the simulations with time-varying disturbances, the velocity curve has smaller fluctuations compared with the other two cases. This is because there is a certain error in the observed effect of the disturbance observer for the time-varying disturbances. From the position error curve and velocity error curve in Figure 7c,d, it can be seen that the error has a good convergence pattern, which means that the USV can achieve circular trajectory tracking. Figure 8 shows the variation curves for the surge force and yaw moment.      The simulations for the straight-line and circular trajectories indicate that the designed control strategy is able to overcome external environmental disturbances in the process of trajectory tracking.

Conclusions
In this paper, an NTSM controller was designed for the trajectory tracking problem of underactuated USVs in the absence of disturbance, then a nonlinear disturbance observer was devised to observe wind, wave, and current disturbances. The designed control strategy was strictly proved to be asymptotically stable using the Lyapunov stability theory. Finally, the NTSM and the nonlinear disturbance observer were combined, and the output of the disturbance observer was used to replace the actual environmental disturbance. The following conclusions are drawn from the theoretical analysis and numerical simulations of circular and linear trajectories: (1) The trajectory tracking results were obtained by Simulink numerical simulation using the parameters of an existing USV model. In the case of no disturbance, the errors in the linear trajectory and circular trajectory speeds converged to zero quickly while the error in the position results converged to zero within 10 s to follow the the predefined trajectory, which verifies the feasibility of the controller. (2) Numerical simulations of both constant and time-varying external environmental wind, wave, and current disturbances were performed, and estimates were obtained with the designed disturbance observer. In both cases, the disturbance errors converged rapidly to a value close to zero, indicating the capability of the disturbance observer with regard to external disturbances. (3) With constant and time-varying disturbances, the USV completed the trajectory tracking task within 10 s, and the errors in velocity and position were very close to zero. The robustness of the system was improved by incorporating a disturbance observer to estimate environmental disturbances and compensating for external disturbances in the controller.