Path-Following Control Method for Surface Ships Based on a New Guidance Algorithm

: A new type of path-following method has been developed to steer marine surface vehicles along desired paths. Path-following is achieved by a new hyperbolic guidance law for straight-line paths and a backstepping control law for curved paths. An optimal controller has been improved for heading control, based on linear quadratic regulator (LQR) theory with nonlinear feedback control techniques. The control algorithm performance is validated by simulation and comparison against the requirements of International Standard IEC62065. Deviations are within the allowable range of the standard. In addition, the experimental results show that the proposed method has higher control accuracy.


Introduction
Autopilot is the main equipment for ship motion control; it controls the ship's course without the participation of the helmsman [1]. On autopilot, the ship follows the target route automatically, which can effectively reduce ship operating costs [2]. This paper presents a new method for ship track control. The goal of the control system is to follow a preset route with good anti-interference ability [3]. Path-following control systems for marine vehicles are usually constructed as three independent blocks: guidance, navigation and control [4]. Guidance is the action or the system that continuously computes the reference position, velocity and acceleration of the vehicle to be used by the control system [5]. Navigation is the action or the system that directs the vehicle, by which the position, course and traveled distance is determined. The control system determines the necessary forces and moments to achieve a certain objective.
Line of sight (LOS) is the most commonly used guidance algorithm. This algorithm was first applied to track control of surface ships by Mcgookin and Fossen and has been widely studied [6][7][8][9]. The advantage of the LOS guidance algorithm is that it controls the ship's motion by imitating the behavior of the helmsman to eliminate track deviation from the planned route. However, there are some defects in the LOS guidance algorithm. When the distance between the next target waypoint on the target route and the current position of the ship is large, a large track deviation will be produced when the ship tracks the planned route through the guidance algorithm, in addition, the convergence speed of the algorithm is also very slow. In response to this problem, an integral LOS (ILOS) has been proposed and extensively analyzed. Fossen and Lekkas [10] proposed an ILOS based on adaptive control theory that can compensate for drift forces effectively.
Stability analysis is an important topic for navigation and control systems used in autonomous marine vehicles. Proportional-integral-derivative (PID) controllers or proportional derivative controllers are usually used in ship autopilot design [11,12]. In recent 2 of 22 years, improved PID control algorithms have emerged. For example, steering parameters for normal adaptable PID autopilots have been developed during the last decade [13,14]. Dlabac et al. [15] presented a particle swarm optimization (PSO)-based PID controller for ship course-keeping. Recently, nonlinear controllers for autopilot motion control of marine vessels have been reported. Oh and Sun [16] presented a model predictive control for path following of underactuated surface vessels. Guerrero et al. [17] employed an adaptive high-order sliding mode controller for trajectory tracking of autonomous underwater vehicles. Designs based on neural networks [18,19], pole placement technique (PPT) [20], fuzzy logic [21], extended state observer technique (ESO) [22] and some other methods are also used. Wang et al. [23] presented a heading control algorithm based on an H-infinite optimization algorithm to counteract the influence of waves and ensure that ships can turn steadily in rough seas. Sun et al. [24] proposed a feedback linearization optimal heading control algorithm to effectively control a ship's course. Veremey et al. [25] proposed a new approach for the compensative transformation of reference dynamic output controllers. Du et al. [26,27] used adaptive robust nonlinear control to adjust a ship's course and track. Xiang et al. [28] improved the fuzzy logic method and tested it on underwater ships and marine surface vehicles. Xu et al. [29] proposed a vector field guidance law to follow the ship's trajectory. Although most of these methods have good results, there is no standard to verify the control effect of their experiments and the ship model they use is no comprehensive consideration for each type of ship, which cannot effectively verify the results. Liu et al. [30] proposed a nonlinear robust control algorithm based on Backstepping method to control ship straight-path tracking. However, there is no curve path tracking method in this study. Zhao et al. [31] based on Serret-Frenet frame transformation develop a tracking error model and the backstepping controller compensates the nonlinearity of the container ship. Xu et al. [32] proposed an adaptive backstepping controller for pathfollowing control of an underactuated ship based on a nonlinear steering model, which can achieve the effect of path control. But the shortcoming in both two is, they present pretty few control scenarios of the researches to verify the reliability of the algorithm, moreover, the scene of track control is too simple. This paper presents a new path-following control law. The main innovation of this paper is to propose hyperbolic guidance law and apply it to straight-line path-following control. This design improves the convergence of the straight-line path-following control. For curved path-following in the transition between two adjacent straight-line paths, this paper improved a reverse stepping method to calculate heading rate commands to make the system globally asymptotically stable. Compared with the previous research, the extended state observer (ESO) for the controller model is established to estimate and compensate the state in this paper, which can improve the anti-interference ability of the ship in the path following. In the presence of sea current interference, also gives a correction formula. In this paper, linear quadratic regulator (LQR) and nonlinear feedback control are combined to improve the traditional LQR heading controller to improve the control accuracy of heading and yaw rate of the ship. Finally, the track control effect of three different types of ships is verified in simulations and the control effect is evaluated according to International Standard IEC62065 [33].
Section 2 establishes a mathematical model, including ship motion simulation and control and identifies controller parameters. Section 3 describes the design of the heading controller. Section 4 introduces the new guidance algorithm. Section 5 presents analysis of simulation results. Finally, Section 6 contains the conclusions.

Process Plant Model
We describe the ship motion model in five basic compositions, with three degrees of freedom, shown in Figure 1. The model is derived from Newton's laws of motion using linear equations to relate hydrodynamic forces to the respective motions in the horizontal plane. The equations are as follows [4]: where X, Y and N denote external forces and moment, while x g , y g , z g describe the location of the center of gravity. u,v and r denote surge velocity, sway velocity and yaw angular velocity, respectively, . u, r are their derivatives. I z is the yaw moment of inertia, m is the total mass of ship. It is common to let the body frame coordinate origin coincide with the center of gravity; thus, the equations can be rewritten as:  The wave interference model established in this paper consists of a series of square half wave waves. The duration T and height H of each half wave are random numbers related to the Bretschneider wave spectrum [34]. Finally, a square wave interference signal is generated by the wave model, in which the calculation methods of the duration T and the wave height H are as follows:  The hydrodynamic force X is linearized and is assumed to be proportional to the ship linear velocity, u in surge. Let R u denote the linear coefficient of hydrodynamic resistance to forward motion and X thrust denote the thrust provided by the propeller. Thus Equation (4) becomes: m Let τ u denote the time constant of the linear surge response model, K u denote the coefficient of thrust, u max denote maximum forward speed, and X max denote maximum thrust: Substituting Equation (8) into Equation (7) yields: In the same way, for sway response model let τ v = m/R v denote the linear coefficient of hydrodynamic resistance to sway motion, then Equation (5) becomes: For the yaw response model, Equation (6) becomes: where K r is a constant of proportionality, γ is the yaw stability factor, L is the length of the ship, δ a is the real rudder deflection, R v is the linear coefficient of hydrodynamic resistance to lateral motion, R r is the linear coefficient of hydrodynamic resistance to yaw and τ r = I z /R r denotes the time constant of the yaw response model. Simplifying by relating the moment of inertia to the mass and length as a uniformly dense rod to its mass and length, then the moment of inertia can be obtained as I z = mL 2 /12. K r W is the turning moment imparted by wave disturbance, K r is the normalized coefficient of rudder moment, which can be expressed as K r = K r δ max /I z . The wave interference model established in this paper consists of a series of square half wave waves. The duration T and height H of each half wave are random numbers related to the Bretschneider wave spectrum [34]. Finally, a square wave interference signal is generated by the wave model, in which the calculation methods of the duration T and the wave height H are as follows: where Rand b denotes a random number among [−1, 1]. A value of 0.5 for H r is recommended, while A a has alternating sign (i.e., ±1) to describe wave direction, ss means the sea state level, T 0 (ss) and H 0 (ss) are the natural period and significant wave height under sea state ss, respectively. The range of values is shown in Table 1. Referring to the modeling method of wave interference in IEC62065, this paper ignores the influence of wave interference on ship surge motion and sway motion, only adds the wave interference torque of ship's yaw motion to the mathematical model of ship's motion. Rewrite ship yaw Equation (11) as: where δ a is the normalized rudder position obtained by δ a = δ a /δ amax , S f is a Scaling Factor. A value of 20 for the Scaling Factor is recommended.

Control Plant Model
We simplify the process plant model described in the previous section to design the autopilot control algorithm. The simplified model contains only the main physical properties of the process. Notomo [35] proposed a linearized model for ship steering equations, which is given by a simple transfer function between r and δ.
where T and K are the time constant and gain constant, respectively. Neglecting the roll and pitch modes (φ = θ = 0), such that: finally yields: where ψ is the heading angle. The time domain form of Equation (16) is: Notomo's first order model is usually written as: When the straight motion of the ship is unstable or critical stable, nonlinear maneuvering models should be used. A nonlinear term can be added in Equation (18); thus, Notomo's nonlinear first order model can be obtained as: This is the commonly used control plant model for the design of the steering autopilot, in which K v is the coefficient of the nonlinear term.

Controller Parameter Identification
In the above-mentioned control model, some parameters cannot be obtained directly but need to be obtained by system parameter identification. In control applications, the controller performance is bound to the assumptions and approximations of the model. To obtain the corresponding controller parameters more accurately, we apply the forgetting factor least square algorithm to Notomo's nonlinear first order model to identify the ship motion model.
The Recursive Least Square (RLS) algorithm with exponential forgetting is given as follows [36]: where the forgetting factor value of λ is 0.98 < λ < 0.995, Φ(k) is the data vector andθ(k) is the estimated value of the parameter vector. Q(k) and P(k) are the intermediate variable help us getθ(k) we want. Next, referring to the ship motion simulation model, substituting control Equation (19) into ship motion Equation (13), the values of T, K and K v are obtained as follows: To facilitate the identification calculation, Equations (11) and (13) are rewritten in the following form: where According to the recursive formula of the forgetting factor least squares identification algorithm in Equations (20)- (22), the corresponding identification results θ 0 , θ 1 and θ 2 can be obtained. Through θ 0 , θ 1 and θ 2 , the three controller parametersT,K andK v of the nonlinear first-order Notomo model can be solved:

Optimal Heading Controller
This section describes the design of the optimal heading controller. The main goal is to calculate the controller parameters in terms of the Notomo constants obtained by the identification algorithm in the previous section and introduce them in the LQR controller law. Then, nonlinear feedback is added to improve LQR controller to achieve nonlinear control and better control accuracy. In addition, to filter out the influence of sea wave interference on the acquisition of ship heading signal, an extended state observer (ESO) is added to this design to obtain the estimated value of the low-frequency heading signal. Thus, the controller can obtain accurate and fast course control.

LQR Controller
Assume that the heading signal ψ can be obtained by a compass and the yaw rate r can be obtained by a rate gyro or by a state observer. Notomo's first order model in Equation (18) can be written as the state space form: where X = (r, ψ, δ) T is the state vector and u c is the controller input, which denotes the desired rudder rate. A and B are the coefficient matrixes with: T denotes the objective state vector. The goal of the controller design is to converge the state X to the objective X d : X denotes the error vector: where r = r − r d , ψ = ψ − ψ d . The control performance specification can be measured in terms of: where Q is a 3-dimensional diagonal matrix, in which diagonal elements are the weighting factors. R is the weighting factor of the input. The LQR problem is to find the optimal control u c (t) such that J in Equation (34) is minimized, where P is the positive defined solution of the Riccati Equation [37]: where k 1 , k 2 and k 3 are the controller gains obtained by the LQR law. Thus, the representation of the controller can be written as:

Feedback Nonlinearization Compensation
In the controller design here, a nonlinear feedback term is added in the control law for compensating the nonlinear maneuvering of the ship. Notomo's nonlinear first order model can be rewritten as: Comparing with the linear controller law obtained in the previous section, the following equation can be obtained: where δ com is the command rudder angle, K v v can be treated as the feedback term, such that: with δ FL = K v v and the value of K v is obtained from the identification algorithm in the previous section.

Extended State Observer
Both surface ships and underwater vehicles need state observers to process signal data from sensors and navigation equipment. The observer in this paper is designed in terms of the nonlinear ship model and the wave disturbance model. The nonlinear ship model and the wave disturbance model are as follows: where δ n is the rudder offset, ω r and ω ω are the zero-mean Gaussian measurement white noise; ψ ω represents the first-order wave-induced motion, and ς is the relative damping ratio, conventionally assigned a value of 0.075. ω 0 is the wave frequency. Based on Equation (42), the state space equation of the extended state observer is: whereX denotes the estimation of the state,X = δ n ,r, ψ,ξ ω ,ψ ω T and .ξ ω =ψ ω . Γ is the input of the model and Γ = δ + K v v; G is the gain matrix;δ n is the estimation of the rudder offset; Y is the heading signal obtained by the compass with Y = ψ + ψ ω .A, B and C are the coefficient matrixes with: The error of the state vector can be denoted as E =X − X, of which the differential equation is: To keep the asymptotic stability of the error vector, the solution of Equation (47) should be E(t) = E 0 e −kt , where E 0 is the initial error value and k is a scale factor. Thus, all of the eigenvalues of the matrix (A − GC) have negative real parts. The gain matrix G can be found by pole placement in terms of the eigenvalues. In this case, the eigenvector of the matrix (A − GC) is chosen as: P = (P 0 , P 1 , P 2 , P 3 , P 4 ) = (1.5/T, 1.5/T, 1.5/T, 15ςω 0 , 15ςω 0 ) and the gain matrix can be obtained by using the MATLAB function.

Guidance Law
Systems for guidance consist of a waypoint generator with human interface. A new hyperbolic guidance method for straight-line path-following control is presented in this paper. A Lyapunov function analysis [38] is used to prove the stability of this method. For curve guidance, based on the Lyapunov stability function, this paper presents a reverse stepping method to calculate heading rate command and make the system globally asymptotically stable, with a correction formula for current interference.

Error Coordinates
Consider a straight-line path implicitly defined by two waypoints p k = (x k , y k ) T ∈ R 2 and p k+1 = (x k+1 , y k+1 ) T ∈ R 2 , respectively. Also, consider the position of the ship denoted by the point p t = (x t , y t ) T ∈ R 2 . Then the direction of the path can be defined as: Fossen [4] gives the formula to calculate the cross-track error: The calculation of the cross-track error in the transition curved path between two adjacent straight-line paths is complicated. Figure 2 shows two adjacent straight-line paths described by the waypoints p k ,p k+1 and p k+2 . R k+1 is the radius of the transition curve and the cross-track error of the transition curved path can be obtained by:

Straight-Line Path Guidance
The main goal of straight-line path-following control is to eliminate cross-track and heading errors. Hyperbolic guidance will achieve a more rapid convergence of path-following maneuvering because of its smoothing and transition properties. Thus, a hyperbolic guidance methodology is adopted with a hyperbolic tangent function. As shown in Figure 3, the curve OC denotes a hyperbola, of which the asymptote is the straight-line path. The hyperbola equation is: where c k is a constant coefficient with 0 c k > , denoting the rate of approach to the straight-line path. Then the course command can be obtained by: where c χ is the command course and k α is initial heading angle. First, determine the direction of the curved path (clockwise or counterclockwise). Based on Equation (48), the direction α k of the straight-line path p k p k+1 and the direction α k+1 of the straight-line path p k+1 p k+2 can be calculated. Then the direction of the curved path is: here, F k+1 denotes the direction of the curved path, a positive sign means clockwise and a negative sign means counterclockwise. Second, determine the center point of the curved path. The angle between the two adjacent straight-line paths can be obtained in terms of the direction α k , α k+1 and F k+1 .
Then the distance between the center point and the waypoint p k+1 can be determined in terms of the angle γ k+1 and the radius R k+1 .
The angle between the vector from the center point O k+1 to the waypoint p k+1 and North can be obtained in terms of the angle γ k+1 , the direction F k+1 and α k .
Based on the waypoint p k+1 , the direction α O k+1 and the distance D k+1 from the center point O k+1 to the waypoint p k+1 , the coordinate P O k+1 = x O k+1 , y O k+1 of the center point O k+1 can be determined: Finally, the cross-track error can be calculated by: The course angle command is the direction of the vector tangential to the point on the path that is closest to the vehicle. The course angle command can be calculated by: here, χ(t) is the current course.

Straight-Line Path Guidance
The main goal of straight-line path-following control is to eliminate cross-track and heading errors. Hyperbolic guidance will achieve a more rapid convergence of pathfollowing maneuvering because of its smoothing and transition properties. Thus, a hyperbolic guidance methodology is adopted with a hyperbolic tangent function. As shown in Figure 3, the curve OC denotes a hyperbola, of which the asymptote is the straight-line path. The hyperbola equation is: where R c denotes the distance between the origin O and the straight-line and P(t) is the distance from the ship to the planned route at time t with R c > P(t).

Curved Path Guidance
For curved path following, a kinematic controller generates the desired states for motion control. The control method can be designed using a dynamic model of the ship by specifying a reference frame that moves along the path. A Serret-Frenet reference frame [39] is usually chosen.
where r denotes the distance vector.  Then, the position of the ship p t can be denoted by x 0 , R c − P(t) and the angle ζ shown in Figure 3 can be calculated by: where k c is a constant coefficient with k c > 0, denoting the rate of approach to the straightline path. Then the course command can be obtained by: where χ c is the command course and α k is initial heading angle.

Curved Path Guidance
For curved path following, a kinematic controller generates the desired states for motion control. The control method can be designed using a dynamic model of the ship by specifying a reference frame that moves along the path. A Serret-Frenet reference frame [39] is usually chosen. Figure 4 shows an inertia reference frame {i} = (x i , y i , z i ), a body-fixed reference frame {s} = (x s , y s , z s ) and a Serret-Frenet frame {m} = (x m , y m , z m ). The origin O m of {m} is attached to the point on the path that is closest to the vehicle. R denotes the radius of the curved path.
where r denotes the distance vector.  Time differentiation of Equation (60) yields: where v denotes the speed vector. And  The notation H c a/b is adopted in this paper, where {a}, {b} and {c} denote the three different frames and H denotes the coordinate of {a} in frame {b} relative to {c}. Such that: where r denotes the distance vector. Time differentiation of Equation (60) yields: where v denotes the speed vector. And d dt r i s/m can be obtained by: Then the kinematic equations can be obtained: where P is the position deviation, χ is the course deviation, α is the planned course and F indicates the direction of the transition curve. F = 1 means turning clockwise, F = −1 means turning counterclockwise. Thus, goal of the curved path-following controller is to calculate the yaw rate commands, forcing the ship to approach the curved path. This paper presents a reverse stepping calculation method based on the Lyapunov function to obtain the yaw rate commands.
First, calculate the course commands. Consider the Lyapunov function candidate as follows: Time differentiation of Equation (65) yields: .
To satisfy global asymptotic stability (GAS), it is necessary to guarantee that V 1 < 0 as P = 0 and . V 1 = 0 as P = 0. Thus, the following equation is adopted: where k 1 is the scaling factor, with k 1 > 0. Based on Equation (65) and Equation (66), the course commands can be calculated by: Equation (68) suggests that the course command χ c will approach the path direction α to eliminate the course error χ, as the cross-track error is decreasing. However, the path direction α is varying with ship motion during the curved path-following control. Thus, it is necessary to calculate the yaw rate commands. Consider the Lyapunov function candidate: with χ = χ − χ c . Time differentiation of Equation (69) yields: .
where . χ c is the derivative of χ c , indicating the command track angular rate. We neglect the varying of the drift angle β, thus the varying rate course command can be treated as the yaw rate command, approximately. However, this does not fit in the presence of wave disturbance. In the presence of sea current interference, the yaw rate commands need to be adjusted as: where r c denotes the yaw rate command, u g denotes the ship speed over the ground, with direction ϕ g and u f is the current speed through water, with direction ϕ f . Figure 5 is the three-layer control structure of ship track control proposed in this paper. The track control module calculates the current planned navigation section of the ship according to the current ship position information and environmental interference information and calculates the track deviation and heading deviation, then modifies the planned heading angle according to the deviation information, calculates the command heading angle and sends it to the heading control module. According to the current compass signal, rudder angle signal and yaw speed signal, the course control module calculates the course deviation after comparing with the command heading and calculates the command rudder angle through the course control algorithm.

= cos( )
where c r denotes the yaw rate command, g u denotes the ship speed over the ground, with direction g ϕ and f u is the current speed through water, with direction f ϕ . Figure 5 is the three-layer control structure of ship track control proposed in this paper. The track control module calculates the current planned navigation section of the ship according to the current ship position information and environmental interference information and calculates the track deviation and heading deviation, then modifies the planned heading angle according to the deviation information, calculates the command heading angle and sends it to the heading control module. According to the current compass signal, rudder angle signal and yaw speed signal, the course control module calculates the course deviation after comparing with the command heading and calculates the command rudder angle through the course control algorithm.
Finally, the rudder angle control layer drives the rudder to make the actual rudder angle consistent with the command rudder angle, so as to realize the track control of the ship. Finally, the rudder angle control layer drives the rudder to make the actual rudder angle consistent with the command rudder angle, so as to realize the track control of the ship. Figure 6 shows the path-following control overall flow chart:  Figure 6 shows the path-following control overall flow chart:  Figure 6. Path-following control flow chart.

Simulation Results
International Standard IEC62065 is used to test the performance of the path-following control algorithm presented in this paper. Based on the standard, three classes of ship are adopted: class A fast ferry, class B container and class C tanker. See Table 2 for details.

Simulation Results
International Standard IEC62065 is used to test the performance of the path-following control algorithm presented in this paper. Based on the standard, three classes of ship are adopted: class A fast ferry, class B container and class C tanker. See Table 2 for details. The heading controller parameters are given in Table 3:  In control applications, it is important to validate the controller experimentally, this paper takes ship class B as the simulation object and the ship parameters are shown in Table 2. The step steering signal is selected as the input signal and the rotation experiment is used as the experimental method of controller parameter identification. The trajectory is shown in Figure 7 and the simulation data is shown in Table 4. It can be seen from the experimental results that the control model established in this paper meets the ship's turning characteristics and the established model is reliable.
Secondly, the course control algorithms of the three types of ships in Table 2 are verified. For ship class A, the initial speed of the ship is 15.4m/s, the command thrust is 0.67, under sea state 3 and the command heading angle is 30 degrees. As for ship class B, the initial speed is 12.9 m/s, the command thrust is 0.8, under sea state 3 and the command heading angle is 30 degrees. For ship class C, the initial speed of the ship is 5.1m/s, the command thrust is 1, under sea state 3 and the command heading angle is 30 degrees. Figures 8-10 shows that the improved LQR control algorithm in this paper is compared with the traditional LQR algorithm and the simulation experimental chart of course control is obtained. The simulation data is shown in Table 5.
The ships' initial states for the three test scenarios are as follows: Ship A:(u0, v0, r0, ψ0) = (15.4 m/s, 0 m/s, 0 rad/s, 0 deg); Ship B:(u0, v0, r0, ψ0) = (12.9 m/s, 0 m/s, 0 rad/s, 0 deg); Ship C:(u0, v0, r0, ψ0) = (5.1 m/s, 0 m/s, 0 rad/s, 65 deg); In control applications, it is important to validate the controller experiment paper takes ship class B as the simulation object and the ship parameters are s Table 2. The step steering signal is selected as the input signal and the rotation exp is used as the experimental method of controller parameter identification. The t is shown in Figure 7 and the simulation data is shown in Table 4.  It can be seen from the experimental results that the control model establishe paper meets the ship's turning characteristics and the established model is reliab Secondly, the course control algorithms of the three types of ships in Table 2 are verified. For ship class A, the initial speed of the ship is 15.4m/s, the command thrust is 0.67, under sea state 3 and the command heading angle is 30 degrees. As for ship class B, the initial speed is 12.9 m/s, the command thrust is 0.8, under sea state 3 and the command heading angle is 30 degrees. For ship class C, the initial speed of the ship is 5.1m/s, the command thrust is 1, under sea state 3 and the command heading angle is 30 degrees. Figures 8-10 shows that the improved LQR control algorithm in this paper is compared with the traditional LQR algorithm and the simulation experimental chart of course control is obtained. The simulation data is shown in Table 5.    Based on the above experimental results, the following conclusions can be drawn: the improved algorithm combining LQR with feedback nonlinearization control can achieve the function of ship course control, the overshoot, control accuracy and corresponding time are better than the traditional LQR control method. In addition, by adding a state observer can ensure that the ship can sail according to the expected instructions under sea state 3 without frequent steering.
There are three test scenarios used to evaluate performance of the path-following controller. Details of the scenarios are given in Tables 6-8.   Based on the above experimental results, the following conclusions can be drawn: the improved algorithm combining LQR with feedback nonlinearization control can achieve the function of ship course control, the overshoot, control accuracy and corresponding time are better than the traditional LQR control method. In addition, by adding a state observer can ensure that the ship can sail according to the expected instructions under sea state 3 without frequent steering.
There are three test scenarios used to evaluate performance of the path-following controller. Details of the scenarios are given in Tables 6-8.      From Figure 11, we can see that ship class A has a maximum cross-track error of 24.8 m and the maximum course error 11.3 • , which satisfies the requirements set by IEC62065 of setting the course deviation limit to 25 • and the cross-track deviation to 100 m. The experimental results show that this algorithm has the advantage of less steering time.
Results for ship class B are shown in Figure 12, with a maximum cross-track error of 22 m and maximum course error of 1.6 • , which satisfies the requirements of setting the course deviation limit to 15 • and the cross-track deviation to 60 m.
Results for ship class C are shown in Figure 13, where the experimental environment is under rough sea state 5, with maximum cross-track error of 27.24 m and maximum course error of 3.9 • , which satisfies the requirements of setting the course deviation limit to 15 • and the cross-track deviation to 100 m.
Tests of ship class B in the presence of wave disturbance and a simulated current of 5 kn are also performed. The results are shown in Figure 14.  As shown in Figure 14, in the presence of sea state 3 and a simulated current of 5 kn, 30°N and the other requirements for test are the same as those for ship class B listed earlier, the results for ship class B satisfy the IEC62065 requirements with maximum cross-track error of 30.1 m and maximum course error of 3.96°. The experimental result shows that the proposed algorithm has demonstrated good robustness.
To further verify the control effect of the proposed algorithm, additional comparative experiments have been done. For ship class B, the traditional and adaptive PID control To further verify the control effect of the proposed algorithm, additional comparative experiments have been done. For ship class B, the traditional and adaptive PID control algorithms were used for track control, as shown in Figure 15. The experimental results are also compared with traditional LQR controller and the improved LQR control algorithm with nonlinear feedback term proposed in this paper and the track deviations are shown in Figure 16. Specific data are in Table 9. It can be seen from the experimental results that the traditional LQR control method has better tracking effect in the tracking task of direct sail or low speed tracking simple curve. However, it is difficult to guarantee the tracking accuracy in tracking complex task path. The maximum deviation under traditional PID controller, adaptive PID controller, traditional LQR controller and improved LQR controller are as follows: 176.9 m, 48.51 m, 23.32m and 22 m. In terms of stability, the traditional LQR controller performs poorly. And for the improved LQR controller, the deviation is around 0 for more than 3000 s. The performance of the control method proposed in this paper is significantly better than that of the other three control methods.
of direct sail or low speed tracking simple curve. However, it is difficult to guarantee the tracking accuracy in tracking complex task path. The maximum deviation under traditional PID controller, adaptive PID controller, traditional LQR controller and improved LQR controller are as follows: 176.9 m, 48.51 m, 23.32m and 22 m. In terms of stability, the traditional LQR controller performs poorly. And for the improved LQR controller, the deviation is around 0 for more than 3000 s. The performance of the control method proposed in this paper is significantly better than that of the other three control methods.

Conclusions
A new practical guidance and control algorithm for marine vehicles is introduced in this paper. The main innovation is the hyperbolic guidance law used in straight-line pathfollowing control. For curved path-following in the transition between two adjacent straight-line paths, this paper improves the reverse stepping method for the controller to calculate heading rate command to make the system globally asymptotically stable, with a correction formula for sea current interference. Traditional LQR and feedback nonlinear control are combined to improve the accuracy of course control. Different types of ships

Conclusions
A new practical guidance and control algorithm for marine vehicles is introduced in this paper. The main innovation is the hyperbolic guidance law used in straight-line path-following control. For curved path-following in the transition between two adjacent straight-line paths, this paper improves the reverse stepping method for the controller to calculate heading rate command to make the system globally asymptotically stable, with a correction formula for sea current interference. Traditional LQR and feedback nonlinear control are combined to improve the accuracy of course control. Different types of ships are verified in this paper, simulation results based on the International Standard IEC62065 are included to demonstrate system performance. The algorithms satisfy the IEC62065 testing requirements. Three additional experiments verified that the control method has good robustness and good control effect.  Institutional Review Board Statement: "Not applicable" for studies not involving humans or animals.
Informed Consent Statement: "Not applicable" for studies not involving humans.
Data Availability Statement: Data sharing not applicable. No new data were created or analyzed in this study. Data sharing is not applicable to this article.