Fuzzy Risk Evaluation and Collision Avoidance Control of Unmanned Surface Vessels

: In this investigation, a smart collision avoidance control design, which integrates a collision avoidance navigation and a nonlinear optimal control method, is developed for unmanned surface vessels (USVs) under randomly incoming ships and ﬁxed obstacle encounter situations. For achieving collision avoidance navigation, a fuzzy collision risk indicator and a fuzzy collision avoidance acting timing indicator are developed. These two risk indicators can offer effective pre-alarms for making the controlled USVs to perform dodge actions in time when obstacles appear. As to nonlinear optimal control law, it provides a precise trajectory tracking ability for the controlled USVs to follow a collision avoidance trajectory, which is generated via a smart collision avoidance trajectory generator. Finally, a power allocation method is used to transform the desired control law into available actuator outputs to guide the USVs to follow a desired collision avoidance trajectory. From simulation results, the proposed collision avoidance strategy reveals a promising collision avoidance performance and an accurate trajectory tracking ability with respect to ﬁxed objects and randomly moving ships under the effect of environmental ocean disturbances.


Introduction
Merchant shipping is the lifeblood of the world economy, and 90% of world trade is seaborne. Eleven billion tons cargo, of which the value is approximately US$14 trillion, was shipped internationally in 2019 [1]. Shipping traffic has increased dramatically in recent years. The shortage of seafarers, rising wage costs, and rising insurance fees continue to be painful areas for shipping companies. In 2020, there were 1.6 million seafarers around the world, and they were trapped working on 50 thousand merchant ships with limited space to keep the physical distance needed to help stop the spread of the COVID-19 pandemic [2]. The move to unmanned surface vessels (USVs) from human manipulation has accelerated because of the pandemic, reducing human power, and keeping costs down. In addition, major types of maritime accidents are ship collisions, and about 75% to 96% of these were caused by human-made errors [3], such as lack of experience or due to negligence. However, over few past centuries, ship collision avoidance totally depended on seafarers' experiences. Fortunately, the explosion of artificial intelligence and sensing technologies have revealed the potential of using USVs to eliminate human-made errors. The farsighted international marine technology group, Kongsberg, and the Norwegian chemical company, Yara International, cooperated to design the world's first fully electric and autonomous container ship, Yara Birkeland, in 2017. This vessel was launched in 2020 and will gradually move from manned operation to fully autonomous operation by 2022 [4]. After this successful outcome, Kongsberg and the global maritime industry group Wilhelmsen founded a joint venture, Massterly, which is the world's first autonomous shipping company, in 2018. Massterly offers the entire value chain for autonomous ships for customers, including vessel design, control systems, logistic services, vessel operations, and so on [5,6]. This new and cost-effective commercial shipping operation model is expected to increase the investment of research resources into USVs. Additionally, military activities at sea are also increasing. Militaries have displayed a growing interest in deploying USVs for patrols, mine warfare sweep missions, anti-submarine missions, and other dangerous missions. A military unmanned surface vessel that is equipped for fire-fighting and environmental protection has been developed [7]. Defense organizations expect that with the rising accessibility of USVs for military activities, and that many dangerous activities that need to be completed by humans can be replaced. Due to the growing commercial and military interest, designs of control algorithms have become the hot topic in the field of developing smart USVs, as they are the most important part to achieve a welldeveloped USV. Control algorithms for smart USVs essentially include a navigation system, a control law, and a collision avoidance methodology, which needs to perfectly comply with maritime rules and regulations. Over the past few decades, numerous researchers have proposed static optimized collision avoidance trajectory algorithms through geometric analyses between ships or by integrating collision avoidance trajectory algorithms with linear controllers [8,9], such as PI or PID controllers. These types of algorithms basically do not model dynamic information between ships into their designs. These designs are only capable of avoiding collisions under certain operating conditions and cannot be used in practical applications. However, these types of collision avoidance algorithm designs are still the main methods in the field of USV collision-avoidance research. To the best knowledge of the authors, there are limited studies that consider nonlinear dynamic information of ships or that integrate collision avoidance algorithms with a nonlinear controller. Korean researchers, in June 2020, proposed a method that integrates a collision avoidance methodology with a simplified nonlinear ship model-the Noorbin mathematic model: T .. r + r + αr 3 = Kδ, where δ is the rudder angle, r is the angular deflection rate, and T, K, and α are parameters of ship dynamics [10]. Although the simplified nonlinear ship model was used, this paper is still a rare example to be applied in the collision avoidance design of ships. This achievement brought collision avoidance research of USVs into the next chapter; however, this result is only a small step forward for the collision avoidance design of USVs, since the model that was proposed in this paper did not include hull resistance, the hydro-elasticity effect, ocean environmental disturbance (wind, waves, and ocean current), and COLREGs rules into the design. This developed methodology can be predicted to unacceptably work in the global ocean environment. Based on these depicted reasons, this paper aims to propose a smart collision avoidance control system for USVs that is able to work well in the challenging global ocean environment. For solving the above-mentioned technical issues and to deliver a satisfactory collision avoidance performance for USVs, a smart collision avoidance system that integrates a collision risk index, a collision avoidance act timing indicator, a collision avoidance trajectory generator, and an optimal nonlinear control for complying with COLREGs rules [11] is developed in this paper. The collision avoidance problem of USVs contains two sub-problems: conflict detection and conflict resolution. Solving the problem of conflict detection is to determine if a risk of collision exists and the timing needed to perform the right evasion act. The actions that must be taken to solve the conflict resolution problem have been proposed in [12]. The collision risk index mainly depends on two key parameters, which are distance to closest point of approach (DCPA) and time to closest point of approach (TCPA) [13,14]. By using this developed collision risk indicator, the risk of collision will be visualized as a collision circle zone around the ship itself, and a collision alarm will be triggered when a target ship enters the collision circle zone. The collision avoidance act timing indicator mainly depends on three key parameters, which are the velocity of USV, the heading angle of the target ship and the modified relative distance. By using this developed collision avoidance act timing indicator, the speed of the controlled USV will be decreased to the level of no collision. After the collision alarm is been triggered, an instantaneous collision avoidance trajectory will be generated using the cubic spline interpolation method [15]. Based on this collision avoidance trajectory, an optimal nonlinear control system [16] is then adopted to guide the USV to precisely follow the desired course under the effects of environmental disturbances. This paper is organized as follows: in Section 2, the actions for collision avoidance of USVs are discussed; in Section 3, the proposed smart collision avoidance control design for USVs is derived; in Section 4, the simulation results of two scenarios: a crossing situation and multiple fixed obstacles, are shown and discussed; in the last section, the major conclusions of this design are stated.

International Regulations Preventing Collisions at Sea
The International Regulations for Preventing Collisions at Sea 1972 (COLREGs) were announced as a convention of the International Maritime Organization on 20 October, 1972. This regulation applies to all vessels on the high seas and in all waters connected therewith that are navigable by seagoing vessels. The five main rules of this regulation [11], Rule 13-overtaking, Rule 14-head-on situation, Rule 15-crossing situation, Rule 16action by give-way vessel, and Rule 17-action by stand-on vessel, which are related to collision avoidance will be used for verifying the collision avoidance control design in this investigation.
Based on Rules 13, 14, and 15, when a vessel in sight of another, there are three meeting situations: (a) head-on, (b) crossing, and (c) overtaking, as illustrated in Figure 1.  As shown in Figure 2, the relative bearings (RBs) of these three meeting situations [17] can be defined as: Region

Methods of Collision Avoidance
A sailing vessel can monitor the relative information of other surrounding vessels, such as the location of target ships or obstacles, using the automatic identification system (AIS) and automatic radar plotting aids (ARPA), respectively.
After acquiring all the data, the sailors of the vessels will make their decision to avoid collision. There are two main methods to avoid collisions:
Reduction of speed.
If there is sufficient sea-room, alteration of course alone is the most effective action to take [11].

Alteration of Course
According to Rules 16 and 17, the effective actions that need to be taken by each ship in the three meeting situations are shown in Table 1. When altering course cannot effectively avoid a collision, such as when there is insufficient sea-room, vessels must decrease their speeds to avoid collision or allow more time to assess the situation.
As illustrated in Figure 3a,b, when a ship sails at the same period, but in (b) the ship creates ample space by reducing its speed to successfully avoid collision.

Stage of Collision for Vessels
The stage of collision can be divided into four stages using the relative distance of ships. Table 2 shows the responsibility of stand-on and give-way vessels in each stage.

Design of Smart Collision Avoidance Control System for USVs
As illustrated in Figure 4, a smart collision avoidance control system that complies with COLREGs can be divided into four phases: Phase 1: Information acquisition of the controlled vessel and surrounding ships. Phase 2: Decision-making procedure. Phase 3: Generation of a collision avoidance course. Phase 4: Trajectory tracking procedure of a controlled USV. The design of the proposed smart collision avoidance control system will be introduced separately by following the four phases in Figure 4

Information Acquisition of the Controlled Vessels and Surrounding Ships
The controlled USV can acquire real-time information of two ships using AIS and ARPA. Acquired information includes the heading angle of the controlled USV (C o ), target ship (C T ), and the velocity of the controlled USV and target ship, V o , and V T , respectively, as shown in Figure 5.
In Figure 5, The relative velocity (V TO ) between these two encountered ships can be expressed as: The relative heading angle (C TO ) can be expressed as follows: The relative distance between the two encountered ships is expressed as: The true bearing (φ) of other ship relative to the controlled USV is formulated as (4).
, , The relative bearing (RB) of the controlled USV to target ship is described as (5).
Distance to closest point of approach (DCPA) and time to closest point of approach (TCPA) are: Figure 5. Geometric relation between two encountered ships.

Fuzzy Collision Risk Indicator
In this section, a fuzzy based collision risk index, µ CRI ∈ [0,1], will be developed for evaluating the probability of the controlled USV with respect to arbitrary randomly incoming ships. When µ CRI = 0, this represents that a collision between two vessels will not occur. In contrast, µ CRI = 1, represent that collision between two vessels will occur, even if all possible actions have been made.
Initially, the proposed fuzzy collision risk indicator was designed based on DCPA and TCPA. However, the maneuverability of the controlled USVs was inherently affected by their length in practice. Taking this issue into account, the DCPA of this proposed collision risk indicator for different types of USVs should be modified. Assuming that the lengths of the controlled USV is L O and target ship is L T , the modified DCPA with respect to these two lengths can be represented as: where L S denotes the total lengths of the two ships with adjustable design weights 1.5 and 0.5 for the controlled USV and target ship, respectively. This leads to: In this study, a real USV measuring 1.72 m is used as the research object. The universe of discourse of DCPA L is [−3, 20] and the universe of input of TCPA is [−5, 350]. Based on these two parameters, the 3D profile of the fuzzy collision risk identifier, which can be used to determine the level of collision risk, µ CRI , when two ships are under an encounter situation is shown in Figure 6.

Fuzzy Collision Avoidance Acting Timing Indicator
The fuzzy collision avoidance act timing indicator is designed to estimate the level of residual time, µ CA , to allow the controlled vessel to take an evasion action. This indicator has three input parameters: 1. the velocity of the controlled USV, V O ; 2. The heading angle of the target ship, C O ; and 3. the modified relative distance, D L , which is a function of the total length, L S . D L can be expressed as: This proposed fuzzy collision avoidance act timing indicator with two inputs, D L and true bearing (ϕ) are shown in Figure 7: According to COLREGs, alteration of sailing course alone is the first action to take. Vessels are allowed to decrease their speed when alteration to the sailing course will not be effective in avoiding collision. Based on the expert experiences of captains, altering the sailing course is the most preferable method when the detected indices are µ CRI ≥ 0.3 and µ CA ≥ 0.7. Decreasing the speed is the only avoidance method when the detected indices are µ CRI ≥ 0.8 and µ CA ≥ 0.7.

Collision Point and Collision-Free Circle Zone
Collision avoidance trajectories are generated by collision points and collision avoidance circle zones in this investigation. A collision point is generated using real-time information of two encountered ships. Geometrically translating DCPA in the heading direction of the controlled USV until it intersects with the target ship's path, this intersection point is defined as the collision point(x cp n , y cp n ), as shown in Figure 8. By using the collision point in Figure 8, a collision circle zone and a collision avoidance waypoint can then be illustrated, as shown in Figure 9. The collision circle zone, which is located in front of the controlled USV, is constructed using two parameters, ξ and b. ξ represents the parallel offset from the collision point to the center of the collision circle zone, which is perpendicular to the controlled USV's heading. If ξ > 0, the center of the collision circle zone is on the left side of the controlled USV, otherwise it is on the right side.
ξ can be expressed as: where ζ can be obtained from the output of the collision circle zone generator, and L S is determined from Equation (9). B, which represents the radius of the collision circle zone, can be expressed as: where p can be obtained from the output of the collision circle zone generator. The collision circle zone generator is built up using the fuzzy interference system. Input variables are assigned as the relative bearing (RB) and the historical data from experienced captains [18]. The inferred results of ζ and p are shown as Figures 10 and 11, respectively.
The collision avoidance waypoint is the point in the collision circle zone that intersects with the line segment that connects the center of the collision circle zone and the collision point; this line segment can be expressed as a linear equation. The angle between the original heading route and the new collision avoidance route is inferred as ς, which means that the controlled USV can avoid the collision by turning a degree of ς.

Optimal Collision Avoidance Waypoint
For determining the optimal collision avoidance waypoints, a schematic diagram is illustrated in Figure 12 based on the original designated initial waypoint (x S , y S ), the end waypoint (x E , y E ), z is the slope from initial and end waypoint, the center of the collision circle zone x C n , y C n , the radius of collision circle zone is b n , the area of collision circle zone is O n , and collision avoidance waypoint is (x cap n , y cap n ). Observing the collision avoidance waypoint in the first and second collision circle zones can determine that the second collision avoidance waypoint (x cap 2 , y cap 2 ) is within the collision circle zone and a new optimal collision avoidance waypoint needs to be determined that is outside the zone.   For solving the optimal searching problem, the famous oscillatory particle swarm optimizer (OSC-PSO) [19,20] was adopted to determine the new optimal collision avoidance waypoint. If there are n number of collision avoidance waypoints, then the particle's variable parameter equals n. The number of particles will affect the convergence rate of searching for the optimal waypoint. The fitness function (f ) is selected by applying OSC-PSO as follows: where Equation (14) is used to evaluate whether the collision avoidance waypoint enters the collision circle zone or not.
If the following two conditions are true simultaneously, the iteration process of OSC-PSO will be terminated because non-collision trajectories that are not in the collision circle zone are determined.

1.
The number of iterations equals the maximum number of iterations; 2.
M = 0, which means that the collision avoidance waypoint is outside the collision circle zone.

Optimal Collision Free Trajectory
Once the optimal collision avoidance waypoints are determined, a new desired trajectory with a collision avoidance property should be defined. In this investigation, the cubic spline interpolation method [15] was used to generate this desired collision avoidance trajectory. Cubic spline interpolation method is produced using multiple third-order polynomials, and each route is generated by two waypoints and two third-order polynomials, which are shown as follows: where (x d ( ), y d ( )) is the position in the path, and a 4 , a 3 , a 2 , a 1 , d 4 , d 3 , d 2 , and d 1 are coefficients that need to be identified. is a variable of the position in the path, which can be obtained by Equation (49). First order differential equation of Equations (15) and (16) with respect to are described as follows.
Therefore, the velocity of the path can be calculated as follows: . .
The second order differential equations with respect to of Equations (15) and (16) are: There are three conditions that must be satisfied when using the cubic spline interpolation method to generate a 2D trajectory: Condition 1: the trajectory generated by waypoints (x k , y k ) and (x k + 1 , y k + 1 ) has to satisfy Equations (25) and (26).
Condition 2: To make the trajectory more smoothly, it has to satisfy Equations (27) and (28).
where g and h are: h = y S y 1 y 2 y 2 0 0 y 3 y 3 0 0 . . . y n y E T In g and h, the initial waypoints are defined as x S ∈ {x 1 , x" 1 } and y S ∈ {y 1 , y" 1 }, and the end waypoints can be defined by the velocity and acceleration as x E ∈ {x n , x" n } and y E ∈ {y n , y" n }.
Because A( 1 , . . . , n ) is nonsingular, the matrix inversion can be used to find the optimal solutions of the coefficient vectors of c and s as (41) and (42).
By using (15), (16), (30), and (31), a 2D collision avoidance trajectory can be generated with respect to the optimal collision avoidance waypoint for the controlled USV. To ensure the original trajectory and the new collision free trajectory connect to each other smoothly, the position, velocity, and acceleration of the connected point of the instantaneous waypoint at the original trajectory must be the same as those of the new no collision waypoint. As shown in Figure 13, i is the connected point, the red line is the original trajectory, and the blue line is the new collision avoidance trajectory; thus, the condition that must satisfy the common waypoint of these two lines can be expressed as follows: Equation (43) can be further presented as: To allow the controlled USV sail on ocean with a reference velocity U ref , we reformulated (22) as the following: where (t k ) = k is the initial condition of the differential Equation (49). Let the reference velocity, U ref be the input of the first-order system below, where T is a time constant, and the initial condition is U d = 0. It is easy to get the result lim t→∞ (U re f − U d (t)) = 0 from (50).

Fuzzy Reduction Speed Generator
The alternative way to develop a collision avoidance indicator is the design of a fuzzy-based speed reduction generator. The proposed speed reduction generator was built using the level of the sailing velocity after deceleration, and the amount of time was taken for this drop in velocity, as shown in Figure 14. When the speed reduction generator was triggered, an optimal velocity (V d ) will replace U d in (49) and (50) to avoid a collision.

Trajectory Tracking Procedure of the Controlled USV
As shown in Figure 4, design of a smart collision avoidance control system in the third phase will be divided into two sub-sections: 1. USV model and nonlinear H 2 controller, and 2. Power allocation for actuators: Z-type twin propulsors, respectively.

USV Model and Nonlinear H 2 Controller
The controlled USV can be modeled [16] as where M η (η) is a rigid-body inertial matrix including added mass, C η (β,η) is a Coriolis and centripetal matrix, including added mass and D η (η) is a damping matrix, τ η is the control command, and τ dη represents the overall internal and external disturbances of the controlled USV. As shown in Figure 15, η = [x y ψ ] T denotes the position (x and y) and heading angle (ψ) of the controlled USV in Earth-frame coordinate system. β = [u v r] T denotes the linear velocities with surge (u) and sway (v), and angular velocity (r) of USV in body-frame. Based the above depicted fuzzy indicators and collision avoidance trajectory generator, a collision avoidance control system which integrates an optimal nonlinear control law for guiding the controlled USV precisely to track a collision avoidance trajectory can be illustrated as revealed in Figure 16. In this design, transformation of the optimal nonlinear control commands and outputs of actuators are analyzed as well.
Define the tracking error vector between the controlled USV and the optimal collision avoidance waypoints as follows: where η d = [x d , y d , ψ d ] is the collision avoidance trajectory in Earth-frame which is obtained by using the depicted method in the above sections.  Based on the controlled USV in (52) and tracking errors in (53) and referring to [16], the optimal nonlinear controller can be derived as: where and Γ 2 ∈ R 3×3 is a designable positive definite matrix, which can be chosen mathematically, As to weighting matrices Q 211 and Q 222 and control parameters: a 2 , q 211 and ρ 2 , they are expressed as ρ 2 = a 2 q 211 a 2 > 0 (58)

Power Allocation Design for Actuators
Two Z-type twin propulsors are used as the actuators for the controlled USV to realize the desired optimal nonlinear control command τ η 2 mentioned above in this research. The relationship between thrust and the desired control force τ η 2 for the used Z-type twin propulsors is defined as follows: where f ∈ R 2 and α ∈ R 2 are the thrust input vector and the rotation angle vector, which can be expressed as follows: Besides, T ∈ R 3×4 which is the transformation matrix between the desired control force and the actuators [21] can be expressed as follows: where l x1 and l y1 represent the moment arm from the first propulsor to the hull, and l x2 and l y2 represent the moment arm from the second propulsor to the hull. The thrust of each propulsor can be expressed in the x-axis and y-axis directions as follows: where i = 1, 2, . . . , n represent the amount of adopted propulsors. Substituting (63) into (60), it yields where T is the constant matrix, and f e is the thrust vector, which represents the x-axis and y-axis components of the thruster. In (64), T ∈ R r×n , where r < n, belongs to the overdrive control problem. From the above formulation, the power allocation problem of this USV with actuators can be defined as the following constrained optimization problem: where W is a given positive definite matrix. Solving the (65) by using Lagrangian multipliers [21], we have: where λ is the solvable Lagrangian multiplier. The gradient of (66) with respect to f e and λ can be found as The optimal values of f e and λ can be calculated by setting (67) as zero.
Rearranging the first equation of (68), the following result can be obtained: Substituting (69) into the second equation of (68), Lagrangian multiplier λ can be solved as follows: Substituting (70) into (69), and we get where Transforming f e from (71) to obtain the output of the actuator, it yields where α i is the deflection angle of the used actuators, f i is the output of thrust, and i = 1, 2, . . . , n is the number of used actuators.

Simulation Results
A 1.72m USV which is a real design in our lab (Lab 611 of SNAME NCKU) is employed to verify the collision avoidance control performance of this proposed method. The specification of this developed USV is indicated in Table 3 and Figure 17. In all simulation scenarios, modelling uncertainties are considered due to changes of the controlled USV's mass, and 5-10% variations are added in inertia matrix M η and Coriolis matrix C η . According to the practical situation, ocean disturbances such as wind, wave, and current are considered in the simulation process as well. Based on these setting, for the controlled USV, collision avoidance performance of this proposed collision avoidance control system will be verified by using: 1. A crossing situation for the controlled USV with randomly incoming ships and 2. a case with several fixed obstacles. Besides, triggered levels for the collision risk is µ CRI = 0.3 and the residual time is µ CA = 0.7.

Scenario 1: Crossing Situations
In this scenario, a crossing situation that a target ship appears in region B of Figure 2 and heads to the controlled USV is adopted. According to Table 1, the controlled USV is a give-way ship that shall take action to avoid the collision, and the target ship is a stand-on ship and just keeps on her course and speed.
The testing conditions for scenario 1 is listed in Table 4. The simulation result of scenario 1 without the collision avoidance treatment is shown in Figure 18. Obviously, a collision will occur between point 12 and point 13 if no evasion action is taken. For solving this collision problem, the proposed smart collision avoidance control system is used, and the simulation result with the aid of this proposed method is displayed in Figure 19. In Figure 19, the black line is the optimal collision avoidance trajectory which was generated by using (45)-(49) and (51) of the proposed smart collision avoidance control system. As to the blue line, it represents the tracking trajectory of the controlled USV which is guided by using the optimal nonlinear control law τ η 2 = T 2 (e,t) + ρ 2 −1 u 2 *(e,t) in (54). The red line is the sailing trajectory of the target ship. Figure 20 is the enlarged figure of the red dash block in Figure 18 for showing the detailed position and attitude of these two encountered vessels (the controlled USV and the incoming ship) during the crossing situation. From Figures 18 and 20, they reveal the fact that no collision occurs in this crossing situation after an effective evasion was taken. In this scenario, the controlled USV took a right turn by following COLREGs rules. This achievement strongly relies on the precisely trajectory tracking ability of the optimal nonlinear control law because it guides the controlled USV to sail along the no collision trajectory with a pinpoint accuracy. This promising property can be easily found from the tracking errors of x-axis, y-axis, and heading angle e x , e y and e ψ shown in Figures 21-23, respectively. In these figures, e x , e y , and e ψ converge to nearly zero due to an effective trajectory tracking performance delivered by the optimal nonlinear control law.       Figures 24 and 25 show comparisons of the level of collision risk, µ CRI , and the relative distance with/without using the proposed collision avoidance system. The collision risk index µ CRI reduces significantly after applying the smart collision avoidance system. From Figure 24, a µ CRI > 0.8 can be found after 30 s. If no collision avoidance action is taken, an inevitable collision will occur about 75 s (µ CRI = 1 and the relative distance = 0, black dash line). To avoid this collision, an effective decision: taking a right turn at 52 s, which satisfies COLREGs rules, is made by this proposed collision avoidance system for the controlled USV. From the blue solid line of Figures 24 and 25, the collision risk index µ CRI decreases rapidly and a minimum positive relative distance of 10.6 m > the required total distance L S = 1.5L O + 0.5L T in (9) can be obtained after applying the smart collision avoidance control system, and this implies that no collision will occur in this crossing situation.

Scenario 2: Multiple Fixed Obstacles
In this scenario, multiple fixed obstacles that appear on the sailing course of the controlled USV is adopted. The testing conditions for scenario 2 is listed in Tables 5 and 6. For solving this collision problem, the proposed smart collision avoidance control system is used, and the simulation results with the aid of this proposed method are shown in Figure 26. In Figure 26, the black line is the optimal collision avoidance trajectory, which was generated by using (45)-(49) and (51), of the proposed smart collision avoidance system. The blue line represents the tracking trajectory of the controlled USV, which is guided by using the optimal nonlinear control law τ η 2 = T 2 (e,t) + ρ 2 −1 u 2 * (e,t) in (54). Figure 26 reveals the fact that there is no collision that takes place in this scenario after an effective evasion was taken. This achievement strongly relies on the precise tracking ability of the optimal nonlinear control law, because it guides the controlled USV to sail along the no-collision trajectory with pinpoint accuracy. This promising property can be easily found from the tracking errors of the x-axis, y-axis, and heading angles e x , e y and e ψ , shown in Figures 27-29, respectively. In these figures, e x , e y , and e ψ converge to nearly zero due to the effective trajectory tracking performance delivered by the optimal nonlinear control law.     Figure 30 shows the history of the velocity of the controlled USV. The final sailing velocity was generated as approximately 2.5 m/s, which is close to the specified final velocity in the testing conditions. This implied that the controlled USV is able to reach the desired velocity without scarifying velocity during the collision avoidance stage.

Conclusions
In this paper, an integration design that integrates a collision risk indicator, a fuzzy collision avoidance act timing indicator, a collision avoidance trajectory generator, a nonlinear optimal control law and a power allocation for the real-time collision avoidance of a controlled USV is proposed. This proposed method has the potential to guide a controlled USV to take the correct evasive actions based on COLREGs rules. From the simulation results of two scenarios, which often appear in an ocean environment where the controlled USV sails, a very promising collision avoidance performance can be found from this proposed collision avoidance design with the help of the optimal collision avoidance trajectory generator and the precise trajectory tracking ability of the used nonlinear optimal control design after signals were triggered by the proposed fuzzy collision risk indicator and fuzzy collision avoidance act timing indicator. In the near future, this proposed collision avoidance method will be installed in a real developed USV with a length of 1.72 m, and the collision avoidance verification will be examined in Anping Harbor, Tainan, Taiwan.