An Efficient Ship Automatic Collision Avoidance Method Based on Modified Artificial Potential Field

A novel collision avoidance (CA) algorithm was proposed based on the modified artificial potential field (APF) method, to construct a practical ship automatic CA system. Considering the constraints of both the International Regulations for Preventing Collisions at Sea (COLREGS) and the motion characteristics of the ship, the multi-ship CA algorithm was realized by modifying the repulsive force model in the APF method. Furthermore, the distance from the closest point of approach-time to the closest point of approach (DCPA-TCPA) criterion was selected as the unique adjustable parameter from the perspective of navigation practice. Collaborative CA experiments were designed and conducted to validate the proposed algorithm. The results of the experiments revealed that the actual DCPA and TCPA agree well with the parameter setup that keeps the ship at a safe distance from other ships in complex encountering situations. Consequently, the algorithm proposed in this study can achieve efficient automatic CA with minimal parameter settings. Moreover, the navigators can easily accept and comprehend the adjustable parameters, enabling the algorithm to satisfy the demand of the engineering applications.


Introduction
The automatic collision avoidance (CA) of maritime autonomous surface ships (MASS) is highly complex and uncertain. When considering the motion of the ship, the International Regulations for Preventing Collisions at Sea (COLREGS), and the restricted water areas, the automatic CA and path planning of ship are important challenges [1,2].
In recent years, a series of artificial potential field (APF)-based CA approaches for MASS have been proposed [3]. The APF-based approach established a virtual potential field near the navigating area of MASS. The attraction between MASS and the goal, repulsions between MASS and obstacles, and repulsions between MASS and other ships were comprehensively studied. The sum of these potential fields determines the resultant virtual force to guide the motion of the MASS [2]. Because the APF controller is easy to construct, intuitive, effective for handling static and dynamic constraints [4], and can obtain an ideal effect on the CA and obstacle avoidance of MASS, the APF-based approach has been widely applied to the intelligent ship CA system in open and restricted waters.
Despite its extensive applications in robot path planning and unmanned aerial vehicle CA, the APF-based approach is faced with major technological problems, owing to the complicated CA conditions of MASS [2,3]. Presently, the research priorities of the APFbased CA approach are optimization of the traditional APF method, solving local minima problems [4][5][6] and the goals non-reachable with obstacles nearby (GNRON), cooperative CA, and obstacle avoidance, through modeling of the environment potential field [7][8][9][10][11][12], and solving the CA problems based on COLREGS [6,[12][13][14].
Li [15] and Cheng-Bo [16] proposed a path planning method with CA function, based on deep reinforcement learning and APF, in which the APF method was utilized to improve the action space and reward function of the deep Q-learning network algorithm. Fan [17] presented an improved APF method to solve the inherent shortcomings of local minima, the inaccessibility of the target, and the GNRON problem. Sang [18] proposed a hybrid path planning algorithm based on improved A* and APF for unmanned surface vehicle formations.
Lyu systematically studied the intelligent multi-ship CA algorithm using an improved APF method, and considered the rules of COLREGS, maneuverability of the ship, and uncoordinated CA actions for the target ships (TS). Lyu overcame numerous drawbacks of the traditional APF methods (such as local minima and the GNRON problems), and performed a series of tests in open and restricted waters, including dynamic TSs and complex static obstacles [13,14].
To trigger the autonomous system, the CA parameters are introduced to determine whether and when to take evasive action [19]. Many risk indicators are introduced into the CA system, such as relative distance [20], relative bearing [21], ratio of speed [22], and ship domain [23]. Some researchers are aware that the risk measurement needs to consider different scenarios [24], such as the nature environment conditions, wave conditions, visibility, day/night, navigation areas, etc., and different encounter types. Because DCPA-TCPA is the most popular method to measure the risk of collision in practice, some researchers utilize DCPA-TCPA as a risk indicator.
Lyu introduced a series of CA parameters into the repulsive force calculation, such as the prohibited zone (using a small adjustable parameter, τ, to express a circular area), radius of the ship domain (d m = R os + d safe + R ts , where Ros and R ts denote the expanded radius to the domain radius of one's own ship (OS) and TS, and d safe is the shortest allowable safe distance), and the influence range of TS (ρ o ). These parameters should be defined by the navigators, according to the navigation area (open or restricted water), dimension and motion of OS, dimension and motion of TS, and visibility. Some CA parameters have no real meaning, and dynamic adjustment of the parameters is extremely difficult. In the applications of the ship, as the CA results have no direct relationship to the CA parameters, the work of Lyu is incomprehensible and unacceptable for navigators.
In various CA algorithms and navigation practices, DCPA-TCPA is the basic criterion for the "risk of collision" and is also the most important CA parameter [2,25]. The ship usually takes CA action when there is an existing "risk of collision" with other ships. In the MAXCMAS (machine executable collision regulations for marine autonomous system) of the Rolls Royce project, the desired DCPA was maintained with all the vessels in the vicinity, and the DCPA-TCPA criterion was set as 2.0 nm and 12.0 min, respectively [26]. This study investigates the multi-ship CA algorithm under the constraint of COLREGS and the motion of the ship by modifying the repulsive force model in the APF method and considering the DCPA-TCPA criterion as the unique adjustable parameter from the perspective of navigation practices. Thereafter, a series of tests were performed to verify the effectiveness and reliability of the proposed approach, as well as the consistency between the CA parameters and the results.

Collision Avoidance Based on Modified Artificial Potential Field
The CA for MASS is a complex system that is constrained by COLREGS, and should cope with the static and dynamic environment in real time. According to the work of Lyu [12,14], we employed the path-guided hybrid artificial potential field method to realize the CA algorithm of a MASS and establish a 6-DOF mathematical model to describe its motion in CA.

Modeling of Motions of MASS
When planning collision avoidance, the ships maneuverability and hydrometeorological conditions must be taken into account [27]. To describe the motion of MASS in CA, earth-and body-fixed coordinate systems were constructed, as shown in Figure 1. The vector η = [x, y, z, φ, θ, ψ] T represents the position and attitude of a MASS in the earth-fixed system, whereas vector ν = [u, v, w, p, q, r] T denotes the speed and rotation speed in the body-fixed system. The 6-DOF mathematical model of a MASS [28,29] can be expressed as follows: where m = ρ s ∇ represents the mass of the ship; ρ s is the seawater density; ∇ is the displacement; m x , m y and m z denote the added masses to the ship; I xx , I yy , I zz , J xx , J yy , and J zz denote the moment and added moment of inertia; the subscripts "H" and "G" denote the viscous hydrodynamics and hydrostatic force exerted on the naked hull ship; the subscripts "P" and "R" denote the forces and moments generated by the propeller and ruder; the subscript "Env" denotes the external disturbance force induced by the wind, waves, and current.

Modified APF Model
The attractive F att and repulsive force F rep were established by referring to the work of Lyu [12,14]. As the DCPA-TCPA is the essential criterion rule for the "risk of collision" in navigation, we modify the negotiation CA repulsive force F rd and emergency CA repulsive force F re as follows: where the direction and significance of each force are listed in Table 1 and illustrated in Figure 2. η d and η e are the scaling factors for negotiation and emergency CA, respectively, and ε is the scaling factor for the attractive force. The OS is driven by the resultant force, moving to the goal and simultaneously keeping a safe distance with the TSs. The term n og denotes a unit vector pointing to the goal from the OS. The term n ot denotes a unit vector pointing to TSs, or obstacles from the OS; d g is the distance between the OS and the goal; d is the distance between the OS and TS; θ TOL is the angle between any tangent line (T 1 p os or T 2 p os ) and the relative position vector p os p ts ; θ is the angle between the relative position vector p ot (p ot = p ts − p os ) and the relative speed vector v ot (v ot = v os − v ts ). The risk of collision occurs when the extension line of v os crosses the circle of radius dTOL neg-CPA (θ < θ TOL ); otherwise, the OS can pass through the TS with a safe distance.   A flow chart of the modified APF model is given in Figure 3. If there are N TSs, the total repulsive force can be obtained by adding the repulsive forces generated by each TS. The ship will take corresponding CA action under the resultant sum F , in varying conditions, and will reach the goal. Based on the calculation of attractive and repulsive forces, the total virtual force exerted on the ship can be obtained as follows: The terms d emg and d neg represent the range criterion of emergency CA and negotiation CA, dTOL neg-CPA and tTOL neg-CPA denote the distance and time criteria of negotiation CA, and dTOL emg-CPA and tTOL emg-CPA represent the distance and time criteria of emergency CA, respectively. Because all the CA parameters have actual meanings in navigation, as the CA results correspond to the CA parameters, the modification made to the repulsion force model can be comprehended and accepted by navigators.
A flow chart of the modified APF model is given in Figure 3. If there are N TSs, the total repulsive force can be obtained by adding the repulsive forces generated by each TS. The ship will take corresponding CA action under the resultant F sum , in varying conditions, and will reach the goal. Based on the calculation of attractive and repulsive forces, the total virtual force exerted on the ship can be obtained as follows:   Figure 3. Flow chart of the modified APF method.

Range Criterion and Results
In this section, we use a container ship, "KangHe" (OS), as a smart ship and two target container ships, named "YinHe" (TS1) and "AnGuangJiang" (TS2), to complete the experiment of collaborative CA. The initial conditions and specifications of the ships are summarized in Table 2. As listed in Table 3, we set the range criterion as d emg = 1.0 nm and d neg = 3.0 nm in test 1, and d emg = 3.0 nm and d neg = 6.0 nm in test 2.  As shown in Figures 4 and 5, the DCPA-TCPA criterion was fulfilled at the beginning of test 1, but the range criterion was not fulfilled. The action time of "KangHe" was later and the CA amplitude was smaller than that in test 2. To fulfill the DCPA-TCPA criterion, "KangHe" needs to take a larger course alteration to the TSs, but the final CA results are unsatisfactory in test 1.        9 show the DCPAs and TCPAs during the CA processes. In test 1, "KangHe" navigated according to the route plan during the first 5 min, as the CA criteria were not fulfilled. At 5 min, the CA criteria were satisfied and "KangHe" turned to starboard; at 12 min, "KangHe" passed and cleared both TSs, and started to turn left to return to its route plan; at 17 min, "KangHe" started to head for the destination. In test 2, "KangHe" turned to starboard at the beginning, as the range and DCPA-TCPA criteria were all satisfied. At 13 min, "KangHe" passed and cleared both TSs and started to turn left to return to its route plan, and at 15 min, "KangHe" started to head for the destination. In both tests, the speed of the ship decreased because of frequent operation of the rudder. As listed in Table 4, the maximum course alteration was 125 • in test 1 and 65 • in test 2.               According to the criteria in Table 3, "KangHe" should maintain a distance of 2.0 nm from other ships. In test 1, because the action time was later than that in test 2, even though the largest CA actions were applied, "KangHe" passed and cleared TS2 at a distance of 1.63 nm (as listed in Table 4). In test 2, as the range and DCPA-TCPA criterion were appropriate, "KangHe" passed and cleared TS1 and TS2 at distances of 2.4 and 2.0 nm, respectively. Because of the existence of the DCPA-TCPA criterion, the range criterion is an extra filter for the involved ships, but has no substantial effect on the CA actions and CA results. Therefore, this study considers the DCPA-TCPA criterion as a unique adjustable parameter in the CA algorithm.

DCPA-TCPA Criterion and Results
The emergency CA range criterion was set as d emg = 3.0 nm, the negotiation CA range criterion was set as d neg = 6.0 nm, and the DCPA-TCPA criterion was set as the unique adjustable parameter (as listed in Table 5), and the CA tests were performed. The tracks of the ship are shown in Figure 10, the speed and course are shown in Figure 11, the DCPAs and TCPAs between OS and TSs are shown in Figures 12 and 13, and the distances between "KangHe" and TSs are shown in Figure 14; some CA results are listed in Table 6.      In test 1, "KangHe" altered the course to starboard at the beginning, as the CA criteria with TS1 were all fulfilled. At 2 min, the CA criteria with TS2 were fulfilled, while TS1 was avoided; at 13 min, "KangHe" passed and cleared TS2, and started to turn left to return to its route plan; at 17 min, it started to head for the destination. The course alteration of "KangHe" was 55 • , and it passed and cleared TS1 and TS2 at distances of 2.5 nm and 2.0 nm (in accordance with dTOL neg-CPA = 2.0 nm), respectively; it headed for the destination at an angle of 312 • after finishing the CA procedure.
In test 2, "KangHe" navigated in accordance with its route plan, as the CA criteria were not fulfilled at the beginning of the test. At 1.6 min, "KangHe" altered its course to starboard, as the CA criteria with TS1 were all fulfilled; at 2.8 min, the ship passed and cleared TS1, and returned to its route plan; at 4 min, she started the CA action on TS2, as the CA criteria were fulfilled; at 13.0 min, "KangHe" passed and cleared TS2, and started to turn left to return to its route plan; at 17 min, it started to head for the destination. The course alteration of "KangHe" was 15 • in the CA procedure with TS1 and 60 • in the CA procedure with TS2. Finally, it passed and cleared TS1 and TS2 at distances of 2.4 nm and 1.5 nm (in accordance with dTOL neg-CPA = 1.5 nm), respectively, and headed for the destination at an angle of 314 • after finishing the CA procedure.
In test 3, "KangHe" navigated in accordance with its route plan, as the DCPA-TCPA criteria were not fulfilled at the beginning. At 4.5 min, "KangHe" altered its course to starboard, as the CA criteria with TS2 were all fulfilled; at 13.5 min, the ship passed and cleared TS2, and returned to its route plan; at 18 min, it started to head for the destination. The course alteration of "KangHe" was 53 • , and it passed and cleared TS1 and TS2 at distances of 2.2 nm and 1.0 nm (in accordance with dTOL neg-CPA = 1.0 nm), respectively, and, thereafter, headed for the destination at an angle of 314 • after finishing the CA procedure.    Through the three aforementioned tests, we observe that, for the same CA scene, the different DCPA-TCPA CA parameters have an immediate effect on the involved ships and the CA results. A smaller DCPA-TCPA parameter leads to a later action time and a smaller action amplitude. The ship can take effective action at the right time according to the set DCPA-TCPA criterion, and finally pass the TSs at a desired safe distance, defined by dTOL neg-CPA . The CA results are also in accordance with the DCPA-TCPA criterion.

Onboard Tests
We provided an auxiliary collision avoidance terminal (as illustrated in Figure 15) for a real ship. As shown in Figure 16, the essential input data (OS static and dynamics information, TS static and dynamics information, route plan, and electronic navigation chart (ENC) data) were collected based on the existing sensors (such as the automatic identification system (AIS), global positioning system (GPS), etc.) and electronic chart display information system (ECDIS) of a ship. The auxiliary CA terminal receives the input data and calculates all the virtual forces exerted on the ship, according to the modified APF model in Section 2.2, and finally generates the CA suggestions (advised path, course and/or speed) for the navigators. As shown in Figure 15, the auxiliary CA terminal provides an integrated information display interface for OS, TS, route plan, and ENC data, as well as CA suggestions. At the present stage, whether the CA suggestions are accepted and sent to the actuator of the ship is decided by the duty officer.    We conducted the onboard test on a 1868TEU container ship from 2 November to 3 November 2021. Figure 17 shows that the algorithm could give a larger course alteration when a larger DCPA-TCPA criterion was set. Figure 18 shows the suggestions in different situations. The algorithm could give a right turn suggestion in most situations, while in an emergency CA situation, the suggestion might be a left turn. Due to the small range criterion in the tests, neg d = 1.5 nm, even though the largest CA actions were applied, the ship could not pass and clear the TSs at the desired distance of 1.6 nm. Figure 19 shows the CA suggestions for an approaching ship. Even though the largest CA actions were applied, the action scope of the ship decreased as the other ship approaches. In Figures   Figure 16. Frame diagram of the auxiliary collision avoidance terminal.
We conducted the onboard test on a 1868TEU container ship from 2 November to 3 November 2021. Figure 17 shows that the algorithm could give a larger course alteration when a larger DCPA-TCPA criterion was set. Figure 18 shows the suggestions in different situations. The algorithm could give a right turn suggestion in most situations, while in an emergency CA situation, the suggestion might be a left turn. Due to the small range criterion in the tests, d neg = 1.5 nm, even though the largest CA actions were applied, the ship could not pass and clear the TSs at the desired distance of 1.6 nm. Figure 19 shows the CA suggestions for an approaching ship. Even though the largest CA actions were applied, the action scope of the ship decreased as the other ship approaches. In Figures 17-19, the green marked TS indicates that there is no risk of collision with OS, and the yellow and red marked ship represents that the ship was fulfilled with the negotiation CA DCPA-TCPA criterion and emergency CA DCPA-TCPA criterion, respectively.

Discussion
Constrained by COLREGS and the motion characteristics of the ship, this study established a multi-ship CA algorithm by modifying the repulsive force model and applying the DCPA-TCPA criterion as the unique adjustable parameter from the perspective of navigation practice. Collaborative CA experiments were designed and conducted in both simulated and real-ship environments. The actual DCPA and TCPA agree well with the DCPA-TCPA criterion in a simulated environment, and the CA suggestions and advised path were presented in a real-ship environment.
This study innovatively introduced the DCPA-TCPA criterion as the unique CA parameter into the improved APF method, and solved the problems associated with the use of numerous, undefined CA parameters that are difficult for navigators to comprehend and accept. This study also integrated the MASS motion model and improved APF-based CA approach in a simulated environment; the consistency between the CA results and parameters for a large merchantman ship was proved. The improved APF-based CA approach was first applied to a real merchantman ship as an auxiliary system; this system received the same acceptance from the navigators as the personifying intelligent decision making for vessel collision avoidance (PIDVCA) [30] method.
However, there are still some shortcomings in this study. For instance, because the CA suggestions were not sent to the real-ship actuator, the actual CA results for a real MASS were not well presented. This algorithm needs more tests and improvements because of the extremely complicated navigation environment in a real ship, such as the small fishing vessels and their unpredictable motions, the anchorage and anchored vessels, the fact that the ship does not proceed in the channel and does not navigate on the route plan of OS, etc. In addition, the speed suggestion, which is extremely important in restricted waters or channels, was not given in this algorithm, which is also extremely difficult to realize when combining with course suggestions. The input data were collected based on the existing sensors (AIS and GPS) and ECDIS, which is not sufficient and reliable enough for real-ship automatic CA. Although some rules from COLREGS have been considered in the algorithm, more efforts are needed to apply all the COLREGS rules and good seamanship.

Conclusions
This study investigated the CA method of MASS from the perspective of engineering applications. By modifying the repulsive force model in the APF method, and taking the DCPA-TCPA criterion as the unique adjustable parameter, a multi-ship CA algorithm, constrained by COLREGS and the motion characteristics of the ship, is presented in this paper. The proposed method solved the problems associated with the use of numerous, undefined CA parameters that are difficult for navigators to comprehend and accept, due to the inconsistency between the CA results and parameters. As the proposed method is accurate and reliable, and satisfies the demands of engineering applications, this paper has important significance in the study of APF-based CA approaches.

Data Availability Statement:
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest:
The authors declare that there are no conflict of interest in the publication of this paper. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.