# Fuzzy Risk Evaluation and Collision Avoidance Control of Unmanned Surface Vessels
## 3 Design of Smart Collision Avoidance Control System for USVs
### Trajectory Tracking Procedure of the Controlled USV
#### 3.4.1 USV Model and Nonlinear \(H_{2}\) Controller  
The controlled USV can be modeled [16] as  
\[\mathbf{M}_{\eta}(\eta)\ddot{\eta}+\mathbf{C}_{\eta}(\beta,\eta)\dot{\eta}+ \mathbf{D}_{\eta}(\eta)\dot{\eta}=\tau_{\eta}+\tau_{d\eta} \tag{52}\]  
where \(\mathbf{M}_{\eta}\) (\(\eta\)) is a rigid-body inertial matrix including added mass, \(\mathbf{C}_{\eta}\) (\(\beta\),\(\eta\)) is a Coriolis and centripetal matrix, including added mass and \(\mathbf{D}_{\eta}\) (\(\eta\)) is a damping matrix, \(\tau_{\eta}\) is the control command, and \(\tau_{d\eta}\) represents the overall internal and external disturbances of the controlled USV. As shown in Figure 15, \(\eta=[x\ y\ y\ ]^{T}\) denotes the position (\(x\) and \(y\)) and heading angle (\(\psi\)) of the controlled USV in _Earth-frame_ coordinate system. \(\beta=[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:  
\[\mathbf{e}=\left[\begin{array}{c}\dot{\dot{\eta}}\\ \dot{\eta}\end{array}\right]=\left[\begin{array}{c}\dot{\eta}-\dot{\eta}_{d} \\ \eta-\eta_{d}\end{array}\right] \tag{53}\]  
where \(\eta_{d}=[x_{d}\), \(y_{d}\), \(\psi_{d}]\) is the collision avoidance trajectory in _Earth-frame_ which is obtained by using the depicted method in the above sections.  
Figure 14: The relationship between input and output of the speed reduction generator.  
Based on the controlled USV in (52) and tracking errors in (53) and referring to [16], the optimal nonlinear controller can be derived as:  
\[\tau_{\eta 2}=\mathbf{T}_{2}(\mathbf{e},t)+\rho_{2}{}^{-1}\mathbf{u}_{2}^{*}( \mathbf{e},t) \tag{54}\]  
where  
\[\mathbf{T}_{2}(\mathbf{e},t)=\mathbf{M}_{\eta}(\eta)(\tilde{\eta}_{d}-\rho_{2} ^{-1}\Gamma_{2}\tilde{\eta})+\mathbf{N}_{\eta}(\beta,\eta)(\tilde{\eta}_{d}- \rho_{2}^{-1}\Gamma_{2}\tilde{\eta}) \tag{55}\]  
and \(\Gamma_{2}\in\mathbb{R}^{3\times 3}\) is a designable positive definite matrix, which can be chosen mathematically,  
\[\mathbf{N}_{\eta}(\beta,\eta)=\mathbf{C}_{\eta}(\beta,\eta)+\mathbf{D}_{\eta}(\eta) \tag{56}\]  
\[\mathbf{u}_{2}^{*}(\mathbf{e},t)=-\frac{1}{a_{2}}\big{[}\begin{array}{cc}Q_ {211}&Q_{222}\end{array}\big{]}\mathbf{e} \tag{57}\]  
As to weighting matrices \(Q_{211}\) and \(Q_{222}\) and control parameters: \(a_{2}\), \(q_{211}\) and \(\rho_{2}\), they are expressed as  
\[\begin{array}{c}\rho_{2}=a_{2}q_{211}\\ a_{2}>0\end{array} \tag{58}\]  
\[\begin{array}{c}Q_{211}=q_{211}I_{3\times 3}>0\\ q_{211}>0\\ Q_{222}>0\end{array} \tag{59}\]  
Figure 16: The flowchart of the proposed collision avoidance control system with a power allocation design.  
Figure 15: USV in Earth-frame and body-frame.