Trajectory Tracking Predictive Control for Unmanned Surface Vehicles with Improved Nonlinear Disturbance Observer

: The motion of unmanned surface vehicles (USVs) is frequently disturbed by ocean wind, waves, and currents. A poorly designed controller will cause failures and safety problems during actual navigation. To obtain a satisfactory motion control performance for the USVs, a model predictive control (MPC) method based on an improved Nonlinear Disturbance Observer (NDO) is proposed. First, the USV model is approximately linearized and MPC is designed for the multivariable system with constraints. To compensate for the influence of disturbances, an improved NDO is designed where the calculation time for MPC is reduced. Finally, comparison simulations are conducted be-tween MPC with the original NDO and MPC with an improved NDO, and the results show that they have similar performances to the USVs. However, the proposed method has fewer parameters that need to be tuned and is much more time-saving compared to MPC with a traditional NDO.

MPC has been developed as an advanced optimization control algorithm based on the superiorities of feedback correction and rolling optimization.MPC has low requirements for the model, and it can solve constrained and multivariable problems.Although the computational load increases with fractional order, presently the development of microprocessors has made it possible for such computation.Predictive compensator-based event-triggered MPC with an NDO strategy has been proposed, and the trajectory tracking control problem of USV subject to input constraints, external disturbances, and cyberattacks has been addressed [14].However, the output constraints are considered in this paper, and the NDO has been discretized with an approximate discretization method.The adaptive line-of-sight algorithm was developed to obtain an expected heading angle.In addition, MPC was applied to reduce the lateral error, where the sideslip angle compensation was considered [25].In addition, to obtain accurate state variables in real time, a linear extended-state observer was designed to overcome the influence of environmental disturbances and the nonlinearity of the model.However, the linearization still caused certain deviations in model disturbance estimation.To adjust the controller parameters, the MPC controller has been used to carry out both control allocation and trajectory tracking in real time [26].Furthermore, it has concurrently optimized closed-loop performance with reinforcement learning-based and system-identification methods.To convert chance constraints into deterministic convex constraints, a convex conditional value of risk approximation has been introduced [27].The converted constraints were further transformed into second-order cone constraints.Then, to account for the external disturbances and fulfill physical constraints, a stochastic model predictive control (SMPC) scheme was used to design the controller.The authors in [28] designed the path planning and control of the USVs simultaneously to overcome the disadvantage of the "first-planning-thentracking" structure, and the artificial potential field and MPC were combined to solve the planning and tracking problem.The authors in [29] proposed the finite control set model predictive control (FCS-MPC).The more practical control commands formed a limited set of control, namely the thruster propulsion angle and speed of the USV.In addition, a fast and safe collision-avoidance system was designed according to the basics of FCS-MPC, which was applicable to varying environments.The authors in [30], to guarantee precise and stable trajectory tracking performance for AUVs, proposed a novel control architecture based on model-free control principles.The combination of intelligent PID and PD feedforward control had good performance for trajectory tracking accuracy, disturbance rejections, and initial tracking error compensations.The authors in [31], to solve the surgemotion tracking control problem of an autonomous undersea vehicle (AUV) with system constraints, proposed an adaptive backstepping control scheme.Both a state feedback control scheme and an output feedback control scheme were developed for AUVs with deferred output constraints.The authors in [32], to pay more attention to the characteristics of flexibility and accessibility, proposed a fusion framework of field theoretical planning and an MPC algorithm.In addition, the trajectory smoothness and collision-avoidance constraints under a complex environment were considered.The authors in [33], to solve the fault-tolerant trajectory tracking control problem of twin-propeller non-rudder USVs subject to propeller faults, proposed an adaptive fault-tolerant trajectory tracking control scheme by utilizing the excellent nonlinearity approximation performance of neural networks.The authors in [34], to achieve autonomous cooperative formation control of underactuated USVs in a complex ocean environment, adopted a dual MPC approach based on a virtual trajectory.The authors in [35] showed that time-varying external disturbances affected the accuracy of trajectory tracking.To ensure trajectory tracking accuracy, a reduced-order extended-state observer and the super-twisting second-order sliding mode controller were proposed.The authors in [36], to solve the lumped uncertainties caused by input quantization, actuator faults, and dead zones, proposed an adaptive sliding mode tracking controller for USVs with predefined time performance.In the control design, adaptive control gains were established based on barrier functions.In addition, a predefined time-adaptive SMC scheme was adopted by introducing an auxiliary function.The authors in [37], to set the velocity of the USV converge to zero at the berth, adopted an interpolation approach to densify the waypoints at the end of the berthing trajectory.In addition, to improve computational performance during the USV berthing, an eventtriggered adaptive horizon MPC approach was adopted.
Controllers are usually poorly tuned to USV motion systems, and the disturbancerejection performance of controllers is not satisfactory due to disturbances from ocean waves, wind, and currents.Therefore, an improved NDO-based MPC method for trajectory tracking control of USVs is proposed in this paper.First, the MPC is designed for USV trajectory tracking.Then, an NDO is designed to estimate the disturbance of ocean wind, waves, and currents, which has fewer parameters.In addition, Lyapunov stability is analyzed for the overall system.Finally, the proposed method is verified by simulation experiments.The main contributions of this work can be summarized as follows: the output constraints are considered in this paper, and the NDO has been discretized with an approximate discretization method; the disturbances are compensated for by an improved NDO, and better trajectory tracking performances are obtained for USVs; also, with the improved NDO, calculation time is saved compared with the traditional NDO.
The rest of the paper is structured as follows: Section 2 introduces the USV kinematics model and dynamic model.In Section 3, the improved NDO-based MPC is designed for the USV, and Lyapunov stability is analyzed for the overall system.Comparison simulations and discussion of the results is performed in Section 4. Section 5 presents the conclusions.

State-Space Model of Unmanned Surface Vehicles
In general, the kinematics modeling of USVs is represented by the North-East-Down coordinate system, while the dynamics model is built in the ship coordinate system.The North-East-Down coordinate system is also called the geodetic coordinate system or the inertial coordinate system.It is usually used as the reference system, and any point on the sea can be used as the origin of the system.The ship coordinate system changes with the motion of the ship and can describe the force, moment, linear velocity, and angular velocity of a USV in various degrees of freedom.
To simplify the model, a USV model is utilized with three degrees of freedom for trajectory tracking control.The motions of yaw, surge, and sway are the most important for the trajectory tracking of the USVs, so the roll, pitch, and heave of the USVs are ignored.Thus, the USV model can be represented in the ship coordinate system and the geodetic coordinate system.This is shown in Figure 1.
Three degrees of freedom of motion model for USVs.
In Figure 1, it can be seen the North-East-Down coordinate system is represented by E N O E , and the coordinate system for the ship is described by XOY .The kinematics and dynamics model of the ship can be represented as: where x y η represents the x , y position and heading angle vector of the USV in the inertial coordinate system; x and y represent the position of the ship with regard to the North-East-Down coordinate system,  represents the yaw angle information of the USV; u v r υ is the vector of the velocity and angular velocity for the USV in the ship coordinate system; u , v , and r are the surge velocity, sway velocity, and yaw an- gular velocity of USV, respectively;  u ,  v , and  r represent the surge thrust, sway thrust, and yaw moment, which are the control inputs of the system; According to Equations ( 3) and ( 4), the reduced kinematics and dynamics equations can be represented as: ( ) For the USVs, there are constraints for the actuators and the outputs.In addition, they are described as follows.
The increment constraints for inputs can be represented as: where c N denotes the control horizon.The upper and lower-limit constraints for inputs can be represented as: The outputs of speed increment constraints can be represented as: The outputs of speed upper and lower-limit constraints can be represented as: The terminal equality constraint can be represented as: where η denotes the vector to be controlled, and r η denotes the reference trajectory.

Nonlinear Disturbance Observer-Based Model Predictive Control
In this section, NDO-based MPC is designed for the three-degrees-of-freedom kinematics and dynamics of a USV with the state-space model.The design schematic diagram of NDO-based MPC is shown in Figure 2. According to Equations ( 1) and ( 2), the state-space equation for the ship can be rewritten as: From Equation ( 12), the matrixes R, C, and D are nonlinear variables, which gives the model strong nonlinearity.

Discrete Linearization of an Unmanned Surface Vehicle Model
USV is a complex system with large inertia and time-delay characteristics.During navigation, it is subjected to various forces such as thrust, hydrodynamic force, hydrostatic force, and external disturbances.Therefore, the USV model has obvious nonlinear characteristics.In this paper, a simplified model of the USV is applied, and the uncertainty is dealt with by the NDO together with the disturbances from the ocean environment.In addition, the model is linearized.
In this paper, the NDO is designed to compensate for the disturbance.Therefore, a linear model of the USV is sufficient for MPC design, where the uncertainty from the linearization of the USV model can be solved with an NDO.Therefore, the model is linearized first and then discretized.Finally, the optimal control sequence is obtained according to the linear model predictive control.
The linearization of a nonlinear system can be divided into approximate linearization and exact linearization.Among them, the approximate linearization method is relatively simple with high applicability but low accuracy.The precision of the accurate linearization method is high, but it should be noted that a special case analysis of a single system is difficult and has poor universality.
The reference trajectory is represented in Equation ( 13) with environmental disturbances.The first-order Taylor expansion can be obtained at any point ( , ) r r x u ; then approximate linearization is achieved by leaving the higher-order terms.This can be seen in Equation (14).
Subtract Equation ( 13) from ( 14), and the following equation can be achieved.(15) and The discrete form for Equation ( 15) is shown as follows: y Cx (16) where , T is the discretization step.

Objective Function Design
To ensure that the USV can track the trajectory smoothly and quickly, the cost function shown in Equation ( 17) is applied, which concerns the increments of the control variables and the errors of the system states.
where Q and R are the weight matrixes for tracking errors and increments of the con- trol variables, respectively; and p N is the prediction horizon.
is the variable of the increments of the control variables, so it can be obtained as follows: The new state-space equation is represented as: where x N denotes the number of state variables.Therefore, the system prediction outputs can be calculated as follows: where

Nonlinear Disturbance Observer Design of Unmanned Surface Vehicles
To make MPC for a USV more applicable, a nonlinear disturbance observer is designed, which can estimate and compensate for the external environmental disturbance received by the USV.Therefore, the stability and anti-disturbance performance is improved for the USV, while capsizing and unnecessary navigation accidents are avoided for the USV.
According to the mathematical model of the USV, the state equation is designed as follows: where 0 K is a three-dimensional positive definite matrix; the estimated disturbance values ˆd τ can be specifically written as It can be seen from Equation ( 12) that υ of a USV can be obtained directly, but the derivative term of the speed state variable  υ cannot be obtained directly.Therefore, it is necessary to improve the disturbance observer.The variable β can be selected as the in- termediate assignment variable of the observer, which is expressed as follows: Then, ) Therefore, the new equation of the improved NDO is: ) ) The improved equation avoids the calculation of  υ and simplifies the calculation process.Therefore, it can improve calculation efficiency and save calculation time.
Equation ( 24) is in a continuous form, and cannot be directly used for MPC design.Therefore, it is discretized with the approximate discretization method: and

Stability Analysis of the Model Predictive Control of Unmanned Surface Vehicles
To verify the stability of the USV control system under MPC, the Lyapunov function defined as 0 ( ) V k is selected: If the control horizon c N is defined to be equal to the prediction horizon p N , the above equation can be simplified as follows: The quadratic function is always greater than 0, so its positive definiteness is proven: Then, we only need to prove that 0 ( ) V k is decreasing, then its stability is proven.
( 1) min 1 1 1 The terminal equation constraint is: Furthermore, Therefore, V k , and the stability of MPC is proven.

Stability Analysis of the Nonlinear Disturbance Observer of Unmanned Surface Vehicles
To verify the stability of the NDO and ensure that it can be applied to the trajectory tracking control system, it is necessary first to define the variable of the difference between the observer's estimated value and the actual value of the external disturbance to the USV: Considering the kinematic Equations ( 2), ( 24) and ( 33) of the USV, then by calculating the derivative of time on both sides of Equation ( 27), the formula can be represented as follows: From Equation (34), one can calculate the derivative of both sides of Equation ( 33) with respect to time, and simplify it to obtain: The Lyapunov method is used to verify the stability of the disturbance observer, and the appropriate Lyapunov function is selected as follows: According to Equation ( 35), the derivative of both sides of Equation ( 36) with respect to time can be obtained as follows: According to Young's inequality theory, and  1 0 a , d C is the limit of the disturbance change rate.
From Equations ( 37) and ( 38), this can be written as inequality: . Equation (39) can be abbreviated as follows: According to Equation ( 36), d V is always greater than 0, and from (41), the result can be obtained as follows: According to Equation (42), it shows that the Lyapunov function d V stays in a closed ball of some radius whose origin is the center of the sphere.In addition, it is uniformly ultimately bounded.In addition, the radius of the sphere is . According to Equation (36), it can be found that the disturbance estimation error variable According to Equation (40), as long as the appropriate observer parameters 1 a and 0 K can be selected, an arbitrarily small error convergence radius  d R can be obtained.
In other words, NDO can estimate the external environmental disturbance suffered by the USV according to an arbitrarily small error, and the estimation accuracy depends on the selected parameters.

Results and Discussions
To verify the influence of the improved NDO-based MPC, it is applied for trajectory tracking control of a USV called CyberShip II.The tracking errors and performance of the USV are shown in this section.In addition, the computational efficiency of the improved NDO is verified.

Simulation Results and Analysis
In MATLAB 2021a, NDO-based MPC for trajectory tracking control of a USV is compared with MPC without an observer.Simulations with different disturbances are performed to verify the anti-disturbance and robustness performances.The performances of the improved NDO are discussed.
The composite model of external disturbances meets the requirements of Level 3 sea conditions.The specific external wind, wave, and current disturbances settings are as follows: where wave transfer function      Figure 3 shows that the improved NDO-based MPC has better disturbance-rejection performance than MPC without an observer when the reference trajectory is a circle.It also can be seen from the simulations that both methods can track the reference trajectory.However, the former can track the reference trajectory smoothly, while the latter fluctuates a lot.The surge position error range of MPC without an observer for trajectory tracking control is −0.1 to 0.1 m; the sway position error range is −0.1 to 0.1 m; and the yaw angle error range is −0.05 to 0.05.Although the surge position error range of the NDObased MPC is −0.005 to 0.005 m, the sway position error range is −0.005 to 0.005 m and the yaw angle error range is −0.005 to 0.005.Figure 4 shows the comparisons of the two trajectory tracking methods with disturbances when the reference trajectory is sinusoidal.In addition, the improved NDO-based MPC has lower tracking errors than MPC without an observer.The surge position error range of MPC without an observer for trajectory tracking control is −0.05 to 0.05 m; the sway position error range is −0.02 to 0.02 m; and the yaw angle error range is 0.00 to 0.05.Although the surge position error range of NDO-based MPC is 0.05 to 0.05 m, the sway position error range is 0.02 to 0.06 m, and the yaw angle error range is 0.000 to 0.005.Figure 5 shows that the improved NDO has better performance than the unimproved NDO in terms of the calculation time with disturbances.
We do not have a real ship for this experiment.To overcome this shortage, the ship parameters were changed when we did some comparisons between different methods to ensure the robustness of the proposed method.The USV model has uncertainty, so three methods were used for trajectory tracking for the USV with different model parameters.The three methods are unimproved NDO-based MPC, improved NDO-based MPC, and MPC without NDO.Figure 6 shows that the improved NDO and unimproved NDO effectively reduce the roughness caused by model uncertainty.In addition, the unimproved NDO has similar performance of tracking errors compared to the improved NDO-based MPC.
In addition, a comparison of the calculation time of two NDOs with disturbances is shown in Table   are used to evaluate the tracking effect and steady-state performance.The smaller the values of IAE and RMSE, the better the control performance of the scheme applied.In addition, the comprehensive performance comparisons of the position and speed tracking errors of the two methods are shown in Table 2. Table 2 shows the IAE and RMSE of the two methods.1, the calculation time of the improved NDO is much lower than that of the traditional NDO.The average calculation time of the improved NDO is 0.0020, and it is 0.0024 for the traditional NDO.The maximum single calculation time of the improved NDO is 0.0046, and it is 0.0064 for the traditional NDO.The results show that, compared with the traditional NDO, the average calculation time of the improved NDO is decreased by 16.67%, and the maximum individual calculation time is decreased by 28.13%.
From Table 2, the IAE and RMSE of NDO-based MPC are lower than the MPC without an observer.NDO-based MPC effectively enhances the anti-disturbance performance of the system.MPC without observer trajectory tracking control has the characteristics of the predictive model, rolling optimization, and feedback correction, which can resist external disturbances and model mismatches to some extent.
With the data shown in Tables 1 and 2, NDO-based MPC is superior to MPC without an observer for trajectory tracking control in terms of position and speed tracking errors.
The NDO is designed to estimate the external disturbances suffered, to improve the anti-disturbance performance of the USV.Therefore, the comparison of estimated values of the NDO and actual disturbances is shown in Figure 7.

Conclusions
In this paper, an improved NDO-based MPC for trajectory tracking is proposed to guarantee the stable motion of a USV, which suffers various disturbances from the ocean wind, waves, and currents.MPC is used to optimize the system torque based on the measured position and speed state variables.Then, the NDO is designed to estimate the disturbances, and the estimated torque is compensated for in the controller.Estimation errors can converge to zero in a finite time.The simulation results show that NDO-based MPC can effectively compensate for external disturbances and obtain good tracking and disturbance-rejection performance.The proposed method has a similar tracking performance to the USVs with the MPC based on unimproved NDO, but the improved NDO-based MPC is far quicker.However, due to the linearization of the model of the USV, the method only shows good performance in a near-neighbor area around the operation point.For large-difference operation points, the parameters need to be retuned.

C
and moment caused by the time-varying external disturbances.υ ; and ( ) D υ is the nonlinear hydrodynamic damping matrix.The detailed information for the matrixes is shown as follows:

Figure 2 .
Figure 2. Schematic diagram of MPC based on a nonlinear observer.
the estimated values of surge disturbance, sway disturbance, and yaw direction disturbance.
as the center of the sphere.At the same time, it can also be known that if the external environmental disturbance value d τ of USV is an arbitrary unknown constant value, then the boundary of the disturbance charge rate is 0 d C  .According to Equation (39), the observer estimation error value  d τ can converge to the origin.

 0. 1 T
, which is set as the simulation sampling time; set as the control horizon.

and 0 
rep- resent wave frequency, wave strength gain, and damping constant, respectively; random white-noise dis- turbances, then the noise power is set to 0.01, 0.005, and 0.1, respectively.The simulation results of improved NDO-based MPC for trajectory tracking control and traditional MPC with disturbances, when the reference trajectory is a circle, are shown in Figure3.The comparisons of improved NDO-based MPC for trajectory tracking control and traditional MPC with disturbances, when the reference trajectory is sinusoidal, are shown in Figure4.The calculation times between the two NDO methods with disturbances are shown in Figure5.The trajectory tracking errors of the three trajectory tracking methods with different parameters are shown in Figure6.

Figure 3 .
Figure 3. Comparisons of improved NDO-based MPC for trajectory tracking control and traditional MPC with disturbances when the reference trajectory is a circle.

Figure 4 .
Figure 4. Comparisons of improved NDO-based MPC for trajectory tracking control and traditional MPC with disturbances when the reference trajectory is sinusoidal.

Figure 5 .
Figure 5.Comparison of the calculation time between the two NDO methods with disturbances.

Figure 6 .
Figure 6.Trajectory tracking errors of the three trajectory tracking methods with different parameters.

Figure 7 .
Figure 7.Comparison of estimated values of the NDO and actual disturbances.

Figure 7
Figure 7 shows the relationship between the estimated values of the NDO and the actual values of the disturbance.The NDO has good estimation performance in terms of the disturbances, including surge disturbance force, sway disturbance force, and yaw disturbance force.

Author Contributions:Funding:
Conceptualization, H.F.; methodology, H.F. and S.Z.; software, W.Y.; validation, W.Y., R.C., and S.Z.; writing-original draft preparation, W.Y. and S.Z.; writing-review and editing, H.F., R.C., and S.Z.All authors have read and agreed to the published version of the manuscript.This research was funded by the National Natural Science Foundation of China, grant number 52271313; Innovative Research Foundation of Ship General Performance, grant number 21822216; Fundamental Research Funds for the Central Universities, grant number XK2040021004025.Institutional Review Board Statement: Not applicable.Informed Consent Statement: Not applicable.Data Availability Statement: Not applicable.
. It shows the average calculation time and maximum single calculation

Table 1 .
Comparison of the calculation time of the two methods.

Table 2 .
Comparison of position and velocity errors of the two methods.