Collision-avoidance path planning for multi-ship encounters considering ship manoeuvrability and COLREGs

Ship collision prevention has always been a hot topic of research for navigation safety. Recently, autonomous ships have gained much attention as a means of solving collision problems by machine control with a collision-avoidance algorithm. An important question is how to determine optimal path planning for autonomous ships. This paper proposes a path-planning method of collision avoidance for multi-ship encounters that is easy to realize for autonomous ships. The ship course-control system uses fuzzy adaptive proportion-integral-derivative (PID) control to achieve real-time control of the system. The automatic course-altering process of the ship is predicted by combining the ship-motion model and PID controller. According to the COLREGs, ships should take different actions in different encounter situations. Therefore, a scene-identification model is established to identify these situations. To avoid all the TSs, the applicable course-altering range of the OS is obtained by using the improved velocity obstacle model. The optimal path of collision avoidance can be determined from an applicable course-altering range combined with a scene-identification model. Then, the path planning of collision avoidance is realized in the multi-ship environment, and the simulation results show a good effect. The method conforms to navigation practice and provides an effective method for the study of collision avoidance.


Introduction
Ship collisions are the main type of maritime traffic accident [1], and up to 96% of ship collisions are caused by human factors [2]. Eliminating human factors has the potential to improve safety [3], and has therefore gained considerable scholarly attention. To reduce the negative influence of human error on navigation safety, more researchers have been working on automatic collision-avoidance systems to solve collision problems in recent years [4][5][6]. These studies focus mainly on two-ship encounter scenarios, but in practice, multi-ship encounters are the most common. It is necessary to study the problem of collision avoidance in a multi-ship environment, which has more practical value.
A key task in researching collision avoidance for multi-ship encounters is to plan a safe and feasible path, in which avoiding collisions with all obstacles efficiently is important. The difficulties of collision avoidance for multi-ship encounters are mainly in the following aspects: (i) How can we automatically identify the encounter situation, detect the collision risk and determine the scheme of collision avoidance while complying with the International Regulations for Preventing Collisions at Sea (COLREGs) [7]? (ii) How can the compatibility of the collisionavoidance scheme and ship manoeuvrability be ensured?
At present, the commonly used path-planning algorithms of automatic collision avoidance include neural network algorithms, genetic algorithms, artificial potential field methods and game theory methods. A neural network algorithm [8,9] was designed that used the collected information of ship collision motion to learn and train the neural network model and obtained the optimal collision avoidance path. A genetic algorithm [10,11] was used to obtain the global optimal solution through iteration according to the natural evolution process of biological heredity and variation and found an economic and safe collision avoidance path. An artificial potential field method [12,13] was applied to obtain the path under the action of the resultant force through the virtual ship's gravity and repulsion force, which was the ship collision avoidance path. The game theory method [14,15] was used to introduce game theory into the ship dynamic collision-avoidance system to seek the optimal strategy of ship dynamic collision avoidance.
These studies focused on path planning of automatic collision avoidance based on the real-time motion state of ships to obtain the optimal path of collision avoidance, with less consideration to the ship dynamic characteristics and the process of manoeuvring motion. Due to the under-actuated characteristics of ships, whether ships can be effectively controlled to navigate as the setting path needs to be confirmed. In addition, the COLREGs also need to be fully complied with.
One excellent method of model predictive control (MPC) considering ship manoeuvrability and the COLREGS was proposed by Johansen, Perez and Cristofaro [16]. In this method, different trajectories were obtained by discretizing the ship's own (OS) control inputs and selecting different combinations of control inputs. Moreover, the predicted trajectory of the target ships (TSs) was used to evaluate the process of the collision between the OS and TSs, and a trajectory evaluation function was established to obtain the reasonable trajectory of the OS to avoid collision with the TSs. However, if the frequency of the controller inputs is low, the adjustment space of the OS's trajectory is small, and if the frequency of the controller inputs is high, it might lead to higher time consumption.
This study aims to realize collision avoidance for multi-ship encounters with consideration of ship manoeuvrability and the COLREGs. The main contributions of this paper are as follows: (i) The scene-identification model is established according to the COLREGs. (ii) Based on the ship-motion model describing non-linear changes in ship motion and the ship course-control system using fuzzy adaptive proportion-integral-derivative (PID) control, the automatic course-altering process of the ship is deduced. (iii) A path-planning method of automatic collision avoidance for multi-ship encounters is proposed, which provides theoretical bases for the ultimate realization of ship autonomous navigation.
This paper is organized as follows: Section 2 introduces the framework for multi-ship collision avoidance. Section 3 presents the ship-motion model and PID controller for the fuzzy adaptive PID controller design considering manoeuvrability. Section 4 describes the process of path planning of collision avoidance for autonomous ships. Section 5 carries out simulation experiments in

Framework for multi-ship collision avoidance
Before sailing, the captain works out the passage plan. The plan includes path planning from the starting point to the end point of the ship, which effectively avoids static obstacles such as underwater objects, lights and buoys and static obstruction areas such as islands, reefs, shallow points and fishing grounds. In navigation, ships need only to consider the dynamic and static vessels that affect safe navigation. Static vessels are regarded as special dynamic vessels whose speed is equal to zero in this paper. Path planning for multi-ship collision avoidance is local path planning for dynamic obstacle avoidance, which needs to take full account of ship manoeuvring characteristics, ship-control systems and relevant laws and regulations to make the planned path conform to navigation practices. Based on the prediction of the ship manoeuvring motion process and the COLREGs, the framework for multi-ship collision avoidance designed in this paper is shown in the dashed box in Fig. 1.
The data collected in Fig. 1 contain the motion information of the OS and TSs, which includes the ship position, course and speed. The OS information can be obtained through ECDIS, GPS and other navigational aids, and the TS information can be obtained through AIS and radar. The framework for multi-ship collision avoidance shows that: (i) By obtaining the motion information of the OS and TSs, the collision risk of the ship can be detected. If there is no risk of collision, the OS will continue moving on the planned route. Otherwise, the TSs that the OS needs to avoid should be determined further by the closest point of approach (CPA). If the distance to the closest point of approach (DCPA) is less than 1 nm and the time to the closest point of approach (TCPA) is less than 30 min between the OS and TS, the TS is dangerous. The OS should take actions to avoid collision with all dangerous TSs at one time. (ii) Suppose the TSs keep their course and speed.
After determining the TS to be avoided, the ship-motion model and fuzzy adaptive PID control are used to predict the coursealtering process of the OS to avoid collision. According to the predicted process, the applicable course-altering range of the OS is calculated based on the improved velocity obstacle model. Combined with the sceneidentification model and the COLREGs, the optimal path of multi-ship collision avoidance is selected from the applicable course-altering range. The collision-avoidance scheme of the ship is determined on the optimal path, and the collision-avoidance action is taken according to the scheme. (iii) When the OS passes the CPA with the TSs, the OS course is set as the planned course to control the OS to the planned routes. It should be noted that the CPA here refers to the updated CPA after the OS alters her course.

Fuzzy adaptive PID controller design considering manoeuvrability
As ship motion has the characteristics of large inertia, large lag and various external disturbances, ship course control is an uncertain nonlinear control. Traditional PID control, as a linear control, has difficulty meeting the requirements of ship course control. However, fuzzy control, which is combined with traditional PID control, has good robustness and stability. It uses the fuzzy reasoning method to adjust the PID parameters in real time to achieve the real-time control of the system and improve the control effect.

Ship-motion model
OXY is the inertial coordinate system, and oxy is the attached coordinate system, as shown in Fig. 2. (X, Y, ) represents the position and heading angle of the ship in the inertial coordinate system; (u, v, r) represents the velocities in the surge, sway and yaw directions; and δ represents that the rudder angle and starboard rudder are positive.
The mechanism modelling of the ship-motion model is divided into integral models and discrete models. Each item in the separation mathematical model has clear physical significance, and the parameters are easy to determine experimentally, which is convenient for addressing the related problems between the real ship and the model and applicable to ship manoeuvrability prediction [17]. To predict the position and motion state of the ship at any moment, the hydrodynamic separation modelling method and three-degreeof-freedom horizontal plane dynamics model are adopted to model the ship manoeuvring motion. The dynamic equation of the ship motion is as follows: where m is the total mass; m x and m y are added masses; I z and J z are the inertia moment and additional inertia moment, respectively; u, v and r and their derivatives represent the velocity and angular acceleration, respectively; X and Y are hydrodynamic forces in different directions; N is the hydrodynamic force moment; and the subscripts H, P and R represent the bare hull, propeller and rudder, respectively.

PID controller
According to the initial status of the ship motion, the propeller revolutions per minute (RPM) and the angle of the rudder based on the time series, the velocities in the surge, sway and yaw directions at any moment can be calculated through the ship-motion model and fuzzy adaptive PID control. Then the ship position and heading angle at different times can be determined and the ship manoeuvring motion process can be predicted.   A fuzzy adaptive PID control method is adopted to control the ship heading angle, and the shipcourse/track-control system is simulated to control the ship steering process. The control principle is shown in Fig. 3.
The design of a fuzzy controller includes the determination of input and output variables, the design of membership functions and the formulation of fuzzy control rules [18]. The input variables include the course error (E) and error rate (EC) in the system; the output variables are the PID parameters K p , K i and K d . The fuzzy subsets of each input and output variable are designed as {positive big (PB), positive medium (PM), positive small (PS), zero (ZO), negative small (NS), negative medium (NM), negative big (NB)}. The quantization level is set as (-6, +6). The membership function is designed as a normal Gaussian function. The fuzzy control rules of parameters K p , K i and K d are shown in Tables 1-3.

Collision avoidance considering COLREGs
The COLREGs aim to prevent ship collisions and are derived from summarized successful experiences of avoiding collisions and the lessons of countless collision accidents. It is necessary to comply with the COLREGs for both unmanned and human-operated ships. In this section, a pathplanning method of collision avoidance considering the COLREGs is presented.

Scene identification
To clarify the responsibility and actions to be taken by the ship for collision avoidance, the encounter situations between two ships are divided into three categories by the COLREGs according to the status of the encounter: overtaking situations, head-on situations and crossing situations. As required by the rules of the COLREGs and seamanship, the relative bearing 5 • is taken as the dividing line between the head-on situation and the crossing situation, and 112.5 • is taken as the dividing line between the overtaking situation and the crossing situation [19]. By comparing the relative bearing Q of the TS to the OS and the course difference 0T between two ships undergoing an encounter and in sight of one another, the scene-identification model of the encounter is established to identify the encounter situation: where 0 and T are the courses of the OS and TS, respectively. If a risk of collision exists, the category of the current encounter situation can be quickly and accurately determined according to the identification conditions listed in Table 4.
As illustrated in Fig. 4, the encounter situation between the OS and Ship 1 is the head-on situation, and the OS is the give-way vessel to

Collision-risk detection
The checking range (CR) of collision-risk detection, which should be determined first, is the radius of the circle where the ship can detect obstacles in sight or by radar. Obstacles outside the circle with the ship as the centre and the CR as the radius cannot be detected. The minimum visibility of a masthead light is 6 nm in vessels 50 metres or more in length. Normally, the OS and TS may take action to avoid collision by their manoeuvres alone at a distance over 6 nm. Based on the observation distance, the CR can be set as 6 nm and adjusted according to the actual situation. For example, the CR should be increased when in the area of restricted visibility or open water. However, increasing the CR in restricted water does not work. Because there are many ships in restricted water, the encounter situations are complicated and changeable, so the OS must adjust her collision-avoidance actions in real time according to the actual situation. A larger CR means that the number of TSs may increase and that the collision risk may be detected earlier. In addition, in Fig. 5, the circular area with centre B of the TS as the centre and d s as the radius represents the area where the ship cannot pass the TS at a safe distance. Once the OS enters the area, it is considered that a risk of collision exists between the two ships. Take centre An of the OS as the starting point to make tangent line segments AB 1 and AB 2 of the circular area. V 0 and V T are the velocities of the OS and TS, respectively, and V R is the relative velocity of the OS to TS. According to the velocity obstacle theory [20], if the relative velocity V R falls into the velocity obstacle area B 1 AB 2 when the OS and TS keep their current motion state unchanged, then the risk of collision exists. The judgement condition of collision risk can be written as follows: where θ is the angle between the relative velocity V R and the relative position line and θ s is the angle between the tangent line and the relative position line.

Path planning for collision avoidance
The traditional velocity obstacle model directly calculates the applicable direction of the relative velocity based on the real-time velocity of the OS and TS [21], without considering the non-linear motion process of the manoeuvring, and the trajectory of the OS motion is a straight line. Combined with the ship-motion model to depict the non-linear motion process of the course-altering process and the fuzzy adaptive PID course-control system to control the steering process of the OS, the trajectory of the OS motion is curved by using the improved velocity obstacle model. The applicable course-altering range of the OS to the TS means that when the course-altering angle of the OS is within the range, the OS passes the TS safely [22]. For any course-altering angle, as long as the relative velocity of the OS does not belong to the velocity obstacle area of any TS when the course-altering process of the OS is completed, the course-altering angle belongs to the applicable course-altering range. The specific steps of obtaining the applicable course-altering range based on the numerical algorithm are as follows, in which an enumeration method is used.
(i) According to rule 8 of the COLREGs, 'If the circumstances of the case admit, a succession of small alterations of course should be avoided'. Therefore, the minimum course-altering angle in this paper is set at 10 • . (ii) Suppose the altering course to starboard is positive and that to port is negative. According to Table 4, if the OS is the give-way vessel in the crossing situation or the vessel in the head-on situation, the course-altering angle of the OS is set as 10-180 • ; If the OS is the stand-on vessel in the crossing or overtaking situation, the course-altering angle of the OS is set as 0 • ; If the OS is the give-way vessel in the overtaking situation, the coursealtering angle of the OS is set as 10-180 • or -10 • to -180 • . In a multi-ship encounter situation, it is complicated to set the course-altering angle. The principle is to identify the TS within collision risk that will be encountered first and determine the OS's responsibility according to the two-ship encounter situation. For example, if the OS is the give-way vessel to one of the TSs (TS 1) in the crossing situation and the stand-on vessel to another TS (TS 2) in the overtaking situation and will meet TS 1 under collision risk first, the OS should be considered as the give-way vessel. Therefore, the course-altering angle of the OS is set as 10-180 • . When the OS meets TS 2 first, if time permits, the OS will first keep her course and speed until TS 2 passes clear; if time does not permit, the OS will take action to avoid collision with TS 1, and such action will not interfere with TS 2 or cause an imminent danger to TS 2. (iii) List all course-altering angles of the OS at the interval of 1 • . According to the ship-motion model, the position (X 0 (t), Y 0 (t)), heading angle 0 (t) and speed V 0 (t) of the OS at the end of the course-altering process can be predicted by using the fourth-order Runge-Kutta method, where t is the time cost of the course-altering process. (iv) Suppose the TS keeps her course and speed.
The position (X T (t), Y T (t)), heading angle T (t) and speed V T (t) of the TS at the end of the course-altering process of the OS can be predicted. (v) Determine whether the relative velocity direction of the OS belongs to the velocity obstacle area of any TS at the end of the course-altering process. As mentioned above, the judgement condition is θ < θ s . If so, the course-altering angle does not belong to the applicable coursealtering range; otherwise, the course-altering angle belongs to the applicable course-altering range.
In Equations (5) and (6), d CPA is the DCPA between the OS and TS; R T is the distance between the OS and TS. As shown in Equations (5) and (6), if d CPA < d s , then θ < θ s . At the end of the course-altering process, the d CPA between the OS and TS is described as shown in Fig. 5.
The d CPA can be written as: where C RT is the angle of the line between the centre of the OS and TS with the Y-axis and C VR is the angle of the relative velocity line of the OS to TS with the Y-axis. (The angle is the smaller one.) where R ( ) = cos( ) −sin( ) sin( ) cos( ) is the transformation matrix between inertial and attached coordinate systems. The smaller the course-altering angle is, the less time it takes to navigate the path for collision avoidance. Then, the fuel consumption and emissions of the ship can be reduced, and the efficiency of collision avoidance can be improved. Therefore, the path that requires the OS to alter course at the minimum of the applicable coursealtering range can be determined as the optimal path.

Simulation experiments
A wide range of simulation cases for automatic collision avoidance from a single-TS encounter to multi-ship encounters were implemented by using MATLAB software. A fully loaded bulk carrier named the Cape Splendor was selected for simulation. The main ship information is shown in Table 5.

Set-up
In both simulation Case 1 and Case 2, the OS's initial status is designated as position (0, 0), speed 16 kn and course 45 • , and the safe distance between the OS and TS is set as 1 nm. The start point, initial speed and course for the TSs in the different encounters are set randomly, as shown in Tables 6  and 7.

Results and discussion
A simulation of a single-TS encounter in the head-on, overtaking and crossing situations is presented in Case 1; see Figs 6-8. The simulation results-the OS course-altering angles, timing of turning and resuming-are also described in Table 6. In Figs 6-8, the trajectories of the OS and TS are described by the curve. Apparently, the OS can avoid collision with the TS in accordance with the COLREGs, and a smooth path is achieved by considering the manoeuvrability of the OS. In addition, the computation time is affected by the motion state of the OS and TSs.
A simulation of multi-TS encounters between the OS, four moving TSs and two static TSs is presented in Case 2 (see Fig. 9). The simulation results: the course-altering angle of the OS is 26 • , and the timing of turning and resuming of the OS are 30 s and 2370 s, respectively.
In Fig. 9, the trajectories of the TSs including the static TSs can be identified by the TS numbers. The trajectory of the OS is also described by the curve. The DCPA and TCPA of the OS and TS were calculated per second to identify dangerous TSs.  In addition, all dangerous TSs are avoided at one time.
The OS can safely pass with all TSs, and the path for collision avoidance is smooth by considering the OS's dynamic properties and the steering abilities. In addition, the computation time is affected by the motion state of the OS and TSs and the number of TSs.

Conclusion and future research
A mathematical model of ship motion (MMG) and a fuzzy adaptive PID control model are established to describe the non-linear coursealtering process of ship motion. Based on the improved velocity obstacle model, the applicable course-altering range is calculated. Combined with the scene-identification model and the COLREGs, the optimal path of multi-ship collision avoidance is determined. This study proposes a path-planning method of automatic collision avoidance for multi-ship encounters, which could provide a theoretical basis and technical support for automatic collision avoidance and autonomous navigation of ships.
The simulation results indicate that the OS can avoid collisions with multiple TSs automatically under various encounter situations. This method conforms to rules 13 to 17 of the COLREGs and is applicable to the path planning of collision avoidance for multi-ship encounters. In the process of collision avoidance, considering the characteristics of ship motion and control, the planned path is smoother and conforms to the practice of collision avoidance. However, the actual effect of collision avoidance is affected by the following factors: (i) The safe distance between the OS and TS. The earlier the OS takes action to avoid collision if a risk of collision exists in the encounter, the safer it will be. If the safe distance is too small, the OS will take action later, and the risk of collision will be significantly increased. If the safe distance is too large, the OS has to take action frequently, and the navigation distance will increase significantly. (ii) Interference from external environment. In practice, there are deviations between the ship motion information measured by various sensors and the actual data. This may lead to the failure of automatic collision avoidance due to the incorrect data collected. (iii) The uncertainty of the actions of the TS. In the actual navigation process, the movement state of the TS may change at any time or even deviate from the COLREGs, so it is very difficult to accurately predict the movement of the TS.
Considering the above factors, future research can further discuss the meaning of safe passing with the TS under different situations, the environmental interference and the prediction of the uncertain behaviour of the TS.