Modified Vector Field Path-Following Control System for an Underactuated Autonomous Surface Ship Model in the Presence of Static Obstacles

: A modified path-following control system using the vector field method for an underactuated autonomous surface ship model is proposed in the presence of static obstacles. With this integrated system, autonomous ships are capable of following the predefined path, while avoiding the obstacles automatically. It is different from the methods in most published papers, which usually study path-following and obstacle collision avoidance, separately. This paper considers the coupled path following and collision avoidance task as a whole. Meanwhile, the paper also shows the heading control design method in the presence of static obstacles. To obtain a strong stability property, a nonlinear autopilot is designed based on the manoeuvring tests of the free-running ship model. The equilibrium point of the controller is globally exponentially stable. For the guidance system, a novel vector field method was proposed, and the proof shows the coupled guidance and control system is uniform semi-global exponentially stable (USGES). To prevent the obstacles near the predefined path, the proposed guidance law is augmented by integrating the repelling field of obstacles so that it can control the ship travel toward the predefined path through the obstacles safely. The repelling field function is given considering the obstacle shape and collision risk using the velocity obstacle (VO) algorithm. The simulations and ship model test were performed to validate the integrated system of autonomous ships.


Introduction
Autonomous ships have been drawing significant attention recently. The most important reasons for the rapid development of autonomous ships are safety and economic benefit. The risk of maritime transportation is quantified based on various types of total ship losses [1], but as reported by Allianz Global Corporate and Specialty [2], about 75% to 96% of marine accidents can be ultimately attributed to human error. Autonomous shipping can significantly improve safety by reducing human factors.
For autonomous vehicles, the guidance system and control system are two basic lowlevel systems. They are closely related to transient motion behaviour, such as path following [3], path tracking [4], and path manoeuvring [5]. Therefore, there are two fundamental systems that determine the overall performance [6]. The fundamental requirement of autonomous ships is that they can follow the predefined path fully autonomously or remotely. Guidance systems calculate the desired course or heading angles for the autonomous ships. Their objective is to guide the ships approaching the desired path.
One of the most widely used guidance laws for autonomous ships is line of sight (LOS). It has been reported in many papers, as can be seen in [7][8][9][10][11][12][13]. The classical LOS is a typical three-points geometry method [6]. A constant look-ahead distance usually needs to be previously defined for LOS. To improve the robustness, it can also be defined as a function of the cross-track error [14]. Follow-up work can be found in [15]. The LOS was also used for the positioning control of the over-actuated autonomous underwater vehicle (AUV) under the effects of ocean current and model uncertainties in [16,17]. A revised version, integral LOS, was proposed to compensate for the environmental disturbance in [16][17][18][19], and its stability was also proved. Considering the varying environmental disturbance, Fossen and Lekkas [20] proposed an adaptive ILOS for the path-following control of marine ships.
The vector field guidance law is a mathematical method. The main idea is to build a vector space, where all the vectors point to the path smoothly. Therefore, if the ship follows the vectors in the space, it will converge to the predefined path finally. Compared with the LOS guidance law, the vector field is a mathematical method with a flexible structure. For the vector field methods, only a vector function needs to be defined, meanwhile, it can also be designed with the specific tasks, for example, collision or desired direction. It was widely used for unmanned aerial vehicles [21][22][23][24]. For example, Lawrence et al. [25] proposed a Lyapunov-based vector field and proved the global asymptotic stability. Global uniform bounded stability of vector field guidance law of an unmanned aerial vehicle (UAV) following arbitrary curves was proved by Wang et al. [26]. Recently, it was modified and employed for the path-following control of marine ships and underwater vehicles [27][28][29].
For a closed-loop control system, the global exponential stable (GES) is the strongest property [30,31], because it can guarantee additional robustness and performance properties of the control system. However, it cannot be achieved for marine ships, because the error dynamic function is local [32][33][34]. Fossen and Pettersen [32] presented a uniform semi-global exponential stability (USGES) proof for the line-of-sight (LOS) guidance law, and the proof extended the previous results that only guarantee global-exponential stability [34]. In this paper, a time-varying vector field guidance law is proposed, and the equilibrium point is uniform semi-global exponential stable.
For marine surface ships, it is inevitable to encounter obstacles at sea. A collision avoidance system is one of the basic systems for autonomous ships because it makes the ship capable of taking action to local sensor information, [35,36]. It also guarantees that the ship sails safely in unknown or dynamic environments. To improve the safety of autonomous ships, an intelligent decision-making system using fuzzy logic was proposed by Perera et al. [37][38][39]. Statheros et al. [40] summarized the recent works on collision avoidance for autonomous vehicles. The velocity obstacle (VO) algorithm was employed to prevent the collision of marine ships at seas by Huang et al., [41,42]. Kuwata et al. [43] extended the VO for the ship's navigation by considering the International Regulations for Preventing Collisions (COLREGs). Mou et al. [44] proposed a collision-avoidance system based on the collected AIS data.
The contribution of this paper is to extend the vector field path-following control system for an underactuated autonomous surface ship model in the presence of static obstacles. The proposed system considers the coupled path-following and collision avoidance task as a whole. It is different from the most well-established methods in the literature, where the path-following control and collision avoidance control are usually treated separately. Classical collision avoidance usually emphasized on the minimize the collision risk by assuming the ship are fully controlled. However, few papers explore the autopilot design for autonomous ships in the presence of static obstacles. In this paper, a nonlinear heading controller was designed considering the manoeuvrability of the underactuated surface ship. While different forms of sliding mode controllers have been used [26], a classical sliding mode controller with global exponential stability (GES) is employed here. For the guidance system, a time-varying vector field guidance law was proposed and proved to be uniform semi-global exponential stable (USGES). This guidance law was extended using a risk-based repelling field method. The resulted guidance laws can control the ship to avoid obstacles near the path. The proposed system generates the repelling vectors around the obstacle, which guide the ship to travel away from the obstacles. The repelling field function is given considering the obstacle shape and collision risk using the velocity obstacle (VO) algorithm.

Path-Following Control System
This section will briefly describe the kinematics and control objects of the pathfollowing of marine ships. As presented in Figure 1, a typical control system includes the guidance law and autopilot. The guidance law provides the desired angle for the autopilot, and the autopilot will steer the rudder of the ship to track the path.
. Without a loss of generality, a straight path-following control system for marine autonomous surface ships is considered, as presented in Figure 2. In order to simplify the problem, some assumptions and physical constraints were made: Assumption 1. The motion of the ship is described in three degrees of freedom: surge, sway and yaw. Assumption 2. The ship is underactuated in its configuration space. Assumption 3. The ship is treated as a rigid body and the maximum rudder angle is 35 degrees. From Figure 2, the cross-track error can be calculated: given: The cross-track error ye can be obtained from Equation (1): Obviously, the control object is to make the cross-track error converge towards zero. It is given as follows: where ψ is the yaw angle. Differentiation of (3), and further simplified by substituting (5), results as where the phase β is the drift angle [6]. U is the ground speed of a ship, ( . For notational simplicity, the time t is omitted.
To obtain strong stability properties, a nonlinear sliding mode controller based on the first-order nonlinear Nomoto model was used for the heading control. The Nomoto model with bounded bias term is given [46]: Tr n r n r K b where b0 ≤ bmax is a bounded bias term. 3 1 , , and K T n n are the Nomoto constants. δ is the rudder angle. Notice that, 1 1 n = for a stable ship. The parameters can be obtained using the free-running model test in real-time [47]. With the Nomoto model, the sliding surface is defined as . ψ is the heading error. λ is a constant [6]. Assume that σ:= r-s, and substitute it into (7) gives: Then, the control law can be obtained as where Kd > 0 is the feedback control gain. η ≥ bmax is a positive design gain [30]. The Lyapunov function can be used to prove that the equilibrium point is globally exponentially stable (GES) (Theorem 4.10 in [29]). The detailed proof can be found in [6,22,48].
In this part, Nomoto parameters will be estimated using system identification based on the manoeuvring tests. The free-running manoeuvring tests were carried out using a scaled ship model (1/65.7) with one propeller and one rudder, as presented in Figure 3. The ship is 2.58 m in length, and 0.43 m in breadth. The designed draft is 0.14 m. To measure the motion of the ship, various sensors and actuators were used and synchronized using the LabView platform. LabView is a graphical programming environment widely used for data acquisition and control application. It includes the software platform and hardware.
Here, a compactRIO with various modules are used in the free-running ship model. The typical sensors, such as an internal measurement unit, yaw rate sensor, electrical motors, server motor industrial Wi-Fi unit, are given in Figure 4. The 20 20 −   zigzag manoeuvring tests, as suggested by ITTC [49], were conducted in the tank of Laboratory National de Civil Engineering (LNEC). The results are presented in Figure 5. Then, the least square support vector machine (LS-SVM), [50,51], was employed to identify the parameters. More details can be found in [46]. One test is used to estimate the parameters, as shown in Figure 5a. The results agree well with the training test. The obtained values of the Nomoto parameters are given: T = 7.7515, n3 = 0.0669, K = 0.1129. To validate the results, a new 20 20 −   zigzag manoeuvring test was chosen as a test set. This test was not used for the training. The validation result is presented in Figure 5b. The prediction agrees well with the tests. In the training and validation process, the heading angle is the integration of the yaw rate, which is the prediction of the obtained Nomoto model. Therefore, in order to eliminate the accumulated error due to the integration, one step prediction is adopted when calculating the yaw heading.

Time-Varying Vector Field Guidance Law
As discussed above, the guidance system plays an important role in autonomous ships. It calculates the desired heading or course angle based on the orthogonal distance between the ship and the path. In a simple word, the guidance law plays the same role as an experienced sailor. In this section, a vector field guidance law is used for the pathfollowing control of the underactuated marine surface ship. The vector field method is a novel guidance law for marine ships. Its main principle is to generate vector space around the path to be followed, and all the vectors point to the path smoothly, as presented in Figure 6. The vectors usually denote the desired travelling direction (course angle) for the autonomous vessels. If the ship follows the vectors, it will ultimately converge to the predefined path.
The function for the generation of vectors is important because it determines the quality of the vectors, such as the distribution and strength of vectors, the convergence rate, etc. Meanwhile, it also indirectly determines the performance of the guidance system of underactuated autonomous ships. Here, a vector field is given: where ( ) As discussed above, the low-level controller is GES and can track the desired heading angle perfectly. Then, substituting (11) into (6) It can be further simplified as To prove the stability of the guidance law, the Lyapunov method is used and the Lyapunov candidate is: The time derivative is: , according to Theorem 4.8 by Khalil [30], the equilibrium point is uniformly stable. As discussed in [48,52], the function, ( , )

Risk-Based Obstacle Collision Avoidance System
An obstacle avoidance control system is proposed for autonomous surface ships. Usually, the desired path should be planned with a global world map, so the ship can travel safely. However, it cannot neglect the obstacle near the path, which was not displayed on the map, for example, large sea animals or floating marine structure, etc. The obstacle avoidance system can make the autonomous ship respond to the dynamic local sensor information and guide the ship safely to avoid the obstacles.
Assuming that there is one obstacle near the path, to avoid the obstacle, the directions of the vector need to be changed. Here, a repelling field function is used to generate the vector with the angle, r ψ . When the ship is near the obstacle, the vector will control the ship travel away from the obstacle with the aid of the heading controller. Figure 7 shows the principle of the collision avoidance system for autonomous surface ships. A repelling field function is used to generate a heading angle r ψ . If neglecting the path-following task, the ship tracks this heading angle r ψ , which will guide the ship to travel away from the obstacle. Meanwhile, the vector field guidance law will generate the heading angle v ψ which attracts the ship moving toward the path. The final resulted heading angle, d r v ψ ψ ψ = + , is given in Figure 7. Obviously, the repelling function needs to be defined carefully, so the ship can travel toward the path smoothly, and meanwhile, avoiding the obstacle. The repelling function is given as where, where x σ and y σ are deviations in the x and y directions. It can be observed that the repelling function in Equation (17) defines a collision area around the obstacle. Once the ship enters the areas, the repelling field will work, but there is a disadvantage of this method: that the repelling field method will push the ship away from the obstacle, even though the ship will not collide with the obstacles. To solve this problem, a collision risk will be introduced in the following part. Collision risk is introduced by employing the principle of the VO algorithm, where the velocity of the obstacle is zero. The general definition of the velocity obstacle for a ship in the presence of a static obstacle is given: Definition: The velocity obstacle (VO) for a ship in the presence of the obstacles is the set of all relative speed of the ship to obstacles that will result in a collision.
In other words, if the ship chooses a velocity from the VO set, the ship collides with the obstacle eventually. To define the collision in mathematical terms, let a ray starting from the ship, located at p , go in the direction of v which is defined as Usually, the collision position is defined using the Minkowski addition [41,44]. Here, to simplify the problem, ship safety domains [53] can be used for reference to defined a conflict position (ConfP), as presented in Figure 8. The conflict position (ConfP) is the area surrounded by a red elliptical line. The velocity obstacle (VO) can be defined as  As can be observed, the VO region has the geometric shape of a cone, and the Equation (20) can be represented as (21) where ( ) ⋅ is the vector dot product. Left P and Right P are vectors perpendicular to the left and right edges of the cone, respectively. As presented in Figure 9, the velocity obstacle cone splits the space into four regions [43]. These are region V1, to avoid the obstacle while seeing it on the right, region V2, to avoid the obstacle while seeing it on the left, and region V3 which is where the ship moves away from the obstacles. The vectors, Left P and Right P , are given [54]: where α is the angle between the centre line and the cone edges, which is given as where e is the distance of the centre of ConfP to the edge of the VO region. ( ) θ R is the rotation matrix. As discussed above, a collision risk-based obstacle avoidance guidance law can be defined as (24) where N is the number of obstacles. ( ) i f p is the collision risk and defined as

Case Study
To validate the proposed system, the simulation and model tests were carried out in this section. The simulation tests were carried out in Matlab software platform using a laptop with i7-6700HQ CPU and 16G RAM. In the simulations, static obstacles avoidance was considered, and the obstacles are near the predefined path. The information about the position and size of obstacles are assumed to be available in advance. In the real application, these data can be obtained from marine Radar. The model test was carried out in a swimming pool using the ship model introduced in the previous section.

Nonlinear Manoeuvring Model
A nonlinear manoeuvring model was used in the simulation, which is a modified version of Abkowitz model, and was validated with the manoeuvring tests [55]. The values of the hydrodynamic coefficients can be found in [55]. The time derivatives ofu， v and r are given: where the nondimensionalized forces and moments are given:

Single Static Obstacle
In the simulation, one static obstacle near the path is considered. When the obstacle is round, as presented in Figure 10a,b, the deviations are set as, The trajectory of the ship in the simulation is given in Figure 10. The blue vectors show the desired heading angle, generated using the repelling function. In Figure 10a, a simulation around static obstacle is given, where the collision risk switches on. The trajectory of the ship is more practical compared with the trajectory in Figure 10b, where the collision risk control was switched off. The obstacle collision avoidance system switches off when the collision risk is zero, which can be observed from the partial enlargement in Figure 10a. When the collision risk control is switched off, as shown in Figure 10b, the obstacle collision avoidance system will push the ship away from the obstacle until it arrives at a safe distance, which is defined by the Gaussian function, as defined in Equations (17) and (18). From Figure 10b, the collision avoidance system without considering the collision risk will inevitably result in some overshoots, which increases fuel consumption. The computational cost and path length are given in Table 1. Obviously, the path length is shorter when considering the collision risk.  The simulation with a rectangular static obstacle near the path is presented in Figure  10 c,d. An asymmetric repelling field is used in the simulation. In Figure 10c, the collision risk control is switched on. The resulted trajectory is more reasonable, and the heading angle generated using the repelling vector field is zero when the ship is located outside the velocity obstacle area. The trajectory with a large oscillation is presented in Figure 10d. It results from alternative actions of repelling field and vector field, where repelling field generated the heading angle that pull the ship away from the obstacle, while the vector field provides the opposite effect. As can be observed, the proposed method can control the ship to avoid the obstacles, meanwhile, the path-following task is also an important factor. The traditional obstacle avoidance system usually only emphasizes how to minimize the collision risk [56,57]. Therefore, the collision avoidance methods will take the ship to travel away from obstacles and neglect the path-following task. The proposed method considers both tasks, path-following and obstacle avoidance, at the same time.
In the beginning, the ship travels at a high speed, then the ship will reduce its speed to avoid the obstacles. During the collision avoidance, the ship travels at a constant speed. Figure 11 shows the heading angle and surge speed (desired versus true) in four cases. The ship tracks the desired heading angle, as presented in Figure 11. It demonstrates that the autopilot works well in the simulations. When the collision risk control is switched off, the underactuated surface ship takes a long time to converge to the desired heading angle, which is due to the alternative actions of repelling field and vector field guidance laws. This phenomenon is more obvious in Figure 11d. Figure 11. Heading angle, surge speed (desired versus true) from the simulations: (a) round obstacle with collision risk; (b) round obstacle without collision risk; (c) rectangular obstacle with collision risk; and (d) rectangular obstacle without collision risk. Figure 12 presents the rudder angles, cross-track errors in the simulations. The chattering due to the sliding mode control is diminished using the saturation function. The collision risk can reduce the rudder oscillations and have smaller cross-track errors, as presented in Figure 12a,c. In Figure 12b,d, the cross-track errors increase a bit when the ship approaches the obstacle. This is because that the repelling vector field plays a major role in the guidance system, and almost completely cancels the effect of the vector field guidance law.

Multi Static Obstacles
The simulations on path-following and obstacle avoidance control are carried out in the presence of two static obstacles. Both round and rectangular obstacles are considered in the simulations.
The , respectively. According to the above discussion, collision risk plays an important role in the obstacle collision avoidance system. Therefore, collision risk control was switched on in the following simulation. Figure 13 shows the trajectories of the ship in the simulations. In Figure 13a, the simulation with two round obstacles is studied. From the partial enlargement of Figure 13, the desired heading angle due to the repelling field is zero when the ship is out of the VO area. In other words, the collision risk of the ship is zero. Only the vector field guidance law will work and the ship will follow the desired heading angle generated by the guidance system. It will converge to the path. When the ship enters the VO area of the second obstacle, the collision risk is nonzero, as presented in Figure 13. The simulation with two rectangular obstacles is presented in Figure 13b. From this Figure Cross-track error, y e can control the ship travelling towards the predefined path and avoid the static obstacles. The computational cost and path length during the simulations are given in Table 2.
(a) (b) Figure 13. Path-following simulation with multi static obstacles: (a) round obstacles; and (b) rectangular obstacles.  Figure 14 shows the heading angle and surge speed in the simulations. The crosstack error and rudder angle are presented in Figure 15. As can be observed, the rudder angle changes significantly in the second case due to the different shape of the obstacles. The cross-tack errors converge to zero in both cases.

Collision Avoidance Test Using Ship Model
The collision avoidance test is carried out using a free-running ship model, which was described in Section 2. The sensors and actuators are installed on the ship model, as presented in Figure 4. The control system is programmed in Labview platform. The test was carried out in a swimming pool, as described in Figure 16. The maximum length is 50 m and the width is 20 m, the depth is 1.2-1.8 m.
The path-following and collision avoidance were carried out using a scaled marine surface ship model. Here, only one obstacle was considered due to the limited geometry dimension of the swimming pool. The obstacle was assumed to be located in the middle of the swimming pool. The ship will travel from the northeast to the southwest corner of the swimming pool. Before tests, the battery was charged fully, and the draft of the ship model was adjusted to the designed value. The rudder and propeller were checked and tested in manual operation. The sensors were initiated and were calibrated to zero, such as the Differential Global Positioning System (DGPS), inertial measurement unit (IMU), and wind sensor. During the model tests, the revolutions per minute (RPM) was set as constant. At the beginning of the tests, the ship model was released with zero rudder angle and constant RPM. If the ship cannot go straight, it is necessary to change the position of the weights in the ship model.  . Figure 17 presents the trajectories of the ship model in the test. Considering the safety, it is better to set a larger variance of the repelling function, because of the environmental disturbance, for example, the wind and wave are large for a scaled ship model. As shown in the Figure, the collision avoidance method can control the underactuated ship model to avoid the collision. Figure 18 shows the heading angle and rudder angle during the test. The initial heading angle is set to zero. From the figure, the heading angle approaches zero when the ship passes the obstacle.
. Figure 17. The path following and collision avoidance test using a free-running ship model.

Conclusions
This paper proposes an integrated path-following and risk-based obstacle collision avoidance system using the vector field method for underactuated autonomous surface vehicles. It is different from the obstacle avoidance methods in most published papers, which usually treat the path-following and obstacle collision avoidance separately. This paper considers the coupled path following and collision avoidance task. Meanwhile, the stability of the guidance and control system was analysed using the Lyapunov stability theory. For the control system, a sliding mode control was designed based on a nonlinear steering model. To obtain the steering model, the manoeuvring tests were carried out using a free-running ship model, and the collected data were used to estimate the values of the parameters using the LS-SVM. The equilibrium point of the heading error dynamic equations is GES. For the guidance system, the vector field guidance law was used and the stability proof of USGES was given. To avoid the obstacle near the path, the proposed guidance law was extended using a repelling function. The resulting heading angle can control the ship's travel away from the obstacles, which meanwhile, is converging to the predefined path when the collision risk is zero. Simulations and model tests were carried out to test the integrated system. From the simulation tests, it can be concluded that the collision risk plays an important role in the system. It can avoid the overshoot in collision avoidance, and the resulting trajectory of the underactuated ship model is more practical. Considering the expensive cost of testing on a full-scale ship, the proposed system was only validated using a scaled ship model. The test shows that the ship model can follow the predefined path and avoid colliding with the obstacles. In the future, the parameters of the proposed system can be optimized based on the specified task or environmental disturbance. More model tests in large areas with more complex environmental disturbance, such as dynamic obstacle, wind, waves, can be carried out for validation.