*4.1. Multi-Ship Collision Avoidance Control for the Miami Port*

For this case study, two controllable vessels are chosen, moving in parallel to each other and encountering an obstacle vessel moving into the port of Miami. For the performance evaluation of the two controllers, two scenarios are created; the first contains a head-on encounter type, while the second an overtaking maneuver that changes into a crossing encounter as time progresses. In the first scenario, the two controlled vessels are leaving the port of Miami at a course of 110◦, when they encounter a single obstacle on their starboard side, which, in turn, is looking to enter the port. In the second scenario, the two controlled vessels are overtaking an obstacle vessel on her port side when, suddenly, she turns portside in order to enter the port of Miami, crossing into their intended path. The challenge posed by the two scenarios is that the two controllable vessels should maintain a safe distance between each other and the obstacle vessel, while also navigating smoothly and without unnecessary deviation from their original course. It should also be noted that the obstacle vessel is non-controllable and, therefore, follows a predetermined path, without considering other vessels.

The response of the MPC controller utilizing straight-line prediction models (hereby referred to as 'MPC-SLP') for the first scenario is shown in the left column of the subfigures within Figure 7 for the 3-, 9-, 10-, and 16.5-min timesteps. The response of the proposed MPC controller utilizing RBF prediction models (hereby referred to as 'MPC-RBFP') for the same scenario and same time instances are shown in the right column of the subfigures within Figure 8. Next, the responses of MPC-SLP and MPC-RBFP for the second scenario are shown in the left and right subfigure columns of Figure 8, respectively, for the 6-, 12-, 13.5-, and 17-min timesteps. In the aforementioned response figures, the red and blue dotted lines denote the original, undisturbed trajectory for controlled vessels 1 & 2, respectively, while the black dotted line shows the predetermined path that the obstacle ship will follow as the simulation progresses. Next, the red and blue dashed lines denote the trajectory that the controlled vessels intend to follow, as calculated by the current MPC iteration, while the black dashed line shows the current trajectory prediction of the obstacle ship, as utilized by the MPC controller. The grey dashed circles have a radius of *dmin* and denote the safe ship domain for the two controlled vessels; should any vessel enter another's domain at any time, a collision risk arises. Lastly, the red-colored and blue-colored rectangles mark the controlled vessels 1 & 2 positions, respectively, while the grey rectangle marks the obstacle ship's position; it should be noted that the markers are

not to-scale with the real dimensions of the vessels, since they have been enlarged for graphical convenience.

**Figure 7.** Scenario 1. The left subfigure column refers to the MPC-SLP scheme, while the right to the MPC-RBFP scheme. Subfigures (**a1**,**b1**) refer to time instance 3 , (**a2**,**b2**) to 9 , (**a3**,**b3**) to 10 , and finally, (**a4**,**b4**) to 16.5 .

**Figure 8.** Scenario 2. The left subfigure column refers to the MPC-SLP scheme, while the right to the MPC-RBFP scheme. Subfigures (**a1**,**b1**) refer to time instance 6 , (**a2**,**b2**) to 12 , (**a3**,**b3**) to 13.5 , and finally, (**a4**,**b4**) to 17 .

#### *4.2. Discussion*

Firstly, in order to assist the discussion in this subsection, distance plots are generated for the controlled vessels that are in closest proximity with the obstacle ship for each scenario (see Figure 9). In addition, the performance metrics for each controller in each scenario are shown in Table 4.

**Figure 9.** Distance plots for scenarios 1 & 2. The left subfigure column refers to the MPC-SLP scheme, while the second to the MPC-RBFP scheme. Note that for scenario 1 (**a1**,**b1**) and for scenario 2 (**a2**,**b2**), the MPC-SLP violates the lower limit on distance from CPA; therefore, its trajectories are deemed unsafe.



(1) As calculated by Equation (14). (2) As calculated by Equation (26). (3) As calculated by Equation (12). (4) As calculated by Equation (24).

For the head-on encounter of scenario 1, the correct trajectory prediction of the obstacle ship proves vital for the success of the proposed scheme. Considering timestep 3 (see Figure 7(a1,b1)), the MPC-RBFP scheme is already applying evasive control actions, since the correct inference of the general direction of the obstacle ship has given rise to a

possible collision risk in the near future. In contrast, the MPC-SLP controller does not apply any control actions yet, because, based on the straight-line prediction model that it utilizes, the obstacle vessel will continue north and, thus, remain well clear of the controlled vessels. For the same reason, it takes MPC-SLP another 5 minutes in order to correctly assess the collision risk and apply decisive control actions, but by then it is too late; by timestep 9 (see Figure 7(a3,b3)), controlled vessel 2 reaches its CPA with the obstacle ship, with a DCPA of 680 m for controlled vessel 2, well below the acceptable minimum distance *dmin*, as shown in Figure 9(a1). In contrast, the MPC-RBFP controller generates a smooth, safe, and consistent trajectory, owed to the correct trajectory prediction of the obstacle vessel. Not only does it reach an acceptable DCPA of 751 m for controlled vessel 2, but it also manages to apply consistent control actions and not significantly deviate from the original course, as shown in Table 4**.**

Next, the performance of the two controllers is assessed in an overtaking/crossing encounter in scenario 2. Here, the effect of the used trajectory prediction models is once again eminent: At timestep 6 (see Figure 8(a1,b1)), MPC-RBFP calculates a sharp control move to port-side for controlled vessel 1 in anticipation of the obstacle ship's crossing towards the port of Miami; in contrast, MPC-SLP applies a lower rate of steering for controlled vessel 1, because the straight-line trajectory prediction places its CPA with the obstacle ship at a later time instance. This failure to correctly place the CPAs has adverse effects on vessel 2 trajectory too, since it is displaced unnecessarily to the left in false anticipation of a collision risk. In addition, the obstacle ship crosses into the domain of controlled vessel 1 (see Figure 8(a2)) once it changes course towards the Miami port at timestep 8 . On the other hand, the MPC-RBFP scheme places controlled vessel 1 in a better position to narrowly evade the breach of its safe domain (see Figure 8(b2)) throughout the simulation. This performance is owed to the trajectory that the RBF model generated for the obstacle vessel, placing its predicted CPA much closer to the real CPA for both controlled vessels. Moreover, it should be noted that for scenario 2, unnecessary deviations from the original course are avoided for controlled vessel 2, as indicated by the total deviation values in Table 4. In general, the proposed method achieves a lower overall cost for the generated trajectories, as shown in Table 4, while obtaining a certain degree of cooperation between the two vessels, where one makes way for the other in anticipation of their upcoming evasive maneuvers. Moreover, the results show that the proposed method exhibits robust characteristics against environmental effects, which are modeled as input noise in the vessel dynamic model for the scope of the simulations, while accounting for COLREGs. Lastly, the average CPU time evaluation of the MPC calculation was recorded as 7s for both scenarios, which is well within the allocated simulation controller timestep *tcst* of 60 s, proving, in fact, that the proposed method is scalable to a greater number of controlled and obstacle vessels.

#### **5. Conclusions**

In this paper, a multi-ship MPC controller utilizing RBF obstacle ship trajectory prediction models trained on real AIS data is proposed for the collision avoidance task in busy ports or waterways. The proposed method is compared to an MPC controller using straight-line obstacle ship trajectory prediction models for a real simulation case for the port of Miami. The simulations have shown that the incorporation of a trajectory prediction model with a moderate degree of accuracy greatly benefits the performance of a collision avoidance controller; this is due to the fact that a collision risk can be detected earlier and in time, so that it can be accommodated by the slow maneuvering dynamics of larger vessels such as container ships. Moreover, this early detection enables the planning of a more economic trajectory for the controlled vessels and enables their better cooperation.

**Author Contributions:** The authors' individual contributions, are summarized below: M.P.: Conceptualization; Data curation; Formal analysis; Investigation; Methodology; Software; Validation; Writing—original draft, Writing—review and editing. M.S.: Conceptualization; Data curation; Investigation; Methodology; Software; Visualization; Writing—original draft, Writing—review

and editing. H.S.: Conceptualization; Formal analysis; Supervision; Writing—original draft, Writing review and editing. A.A.: Conceptualization; Formal analysis; Funding acquisition; Methodology; Project administration; Resources; Supervision; Writing—original draft, Writing—review and editing. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research is co-financed by Greece and the European Union (European Social Fund-ESF) through the Operational Programme «Human Resources Development, Education and Lifelong Learning 2014–2020» in the context of the project "Cooperative distributed adaptive model predictive control methods using computational intelligence" (MIS 5050291).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** In this work, the publicly available AIS dataset provided by the Marine Cadastre service (www.marinecadastre.gov, accessed on 25 July 2021) has been used for trajectory modeling purposes.

**Conflicts of Interest:** The authors declare no conflict of interest. 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.

#### **References**

