# Output Feedback Tracking Control for Vessel with Collision-Avoidance and Performance Constraints
## 4 Collision-Avoidance Switch Control Strategy
### Dynamic Calculation of Collision Risk  
The vessel is defined as its own vessel (OV), and its position and yaw and speed are \((x,y,\psi)\) and \(\
u\). Other vessels or obstacles are considered to be the target vessel (VS), and  
Figure 3: Different vessel encounter situations.  
Figure 2: The structure of the collision-avoidance switch control (CASC) strategy.  
their position and yaw and speed are defined as \((x_{t},y_{t},\psi_{t})\) and \(v_{t}\). \(T_{B}\) is the true bearing of the TV from the OV, and TC is the true course of the OV, which is defined as follows:  
\[T_{B}=atan2(y_{t}-y,x_{t}-x). \tag{22}\]  
The relative relationship between OV and TV is given in Figure 4.  
The function of collision risk index \(C_{ri}\) is defined as follows:  
\[\begin{split} C_{ri}&=\{D_{cpa},T_{cpa},\rho,K,Q\} \\ &=[a_{Dcpa},\kappa_{Tcpa},\kappa_{D},\alpha_{K},\alpha_{Q}]\times[u _{dcpa},u_{tcpa},u_{D},u_{K},u_{D}],\end{split} \tag{23}\]  
where \(D_{cpa}\) is the closest point of the approach, \(T_{cpa}\) is the time to the closest point of the approach, \(Q=T_{B}-\psi\) is the true bearing, and \(K\) is the speed ratio between the two vessels. \(\rho\) is the distance, defined as  
\[\rho=\sqrt{(x_{t}-x)^{2}+(y_{t}-y)^{2}} \tag{24}\]  
Next, the functions \(D_{cpa},T_{cpa},K\), and \(Q\) will be introduced one by one.  
(1) The membership function of \(D_{cpa}\) is as follows:  
\[u_{dcpa}= \left\{\begin{array}{ll}1,&D_{cpa}\leq d_{1},\\ \{1-\sin[\frac{\pi}{d_{2}-d_{1}}(D_{cpa}-\frac{d_{2}+d_{1}}{2})]\}/2,&d_{1}<D_{ cpa}<d_{2},\\ 0,&d_{2}<D_{cpa},\end{array}\right. \tag{25}\]  
\[d_{1}= \left\{\begin{array}{ll}1.1-\frac{Q}{180^{\circ}}\times 0.2,&0^{\circ} \leq Q\leq 112.5^{\circ},\\ 1-\frac{270^{\circ}-Q}{180^{\circ}}\times 0.8,&112.5^{\circ}\leq Q\leq 247.5^{ \circ},\\ 1.1-\frac{360^{\circ}-Q}{180^{\circ}}\times 0.4,&247.5^{\circ}\leq Q\leq 360^{ \circ},\end{array}\right. \tag{26}\]  
where \(d_{1}\) represents the smallest safe encounter distance between OV and TV, and \(d_{2}\) denotes the minimum distance between the own ship and the target ship, \(d_{2}=2d_{1}\).  
Figure 4: Different encountering situations.  
(2) The membership function of \(T_{cpa}\) is as follows:  
\[u_{tcpa}= \left\{\begin{array}{ll}1,&|T_{cpa}|\leq t_{1},\\ \left(\left(t_{2}-|T_{cpa}|\right)/\left(t_{2}-t_{1}\right)\right)^{2},&t_{1}<|T _{cpa}|\leq t_{2},\\ 0,&d_{2}<T_{cpa},\end{array}\right. \tag{27}\]  
where \(t_{2}\) denotes the time that the vessel sails from the current position to the point with the minimum distance, \(t_{1}\) is the time that the vessel sails from the point of evasive actions to the closest point of approach, and \(t_{1}\) and \(t_{2}\) are calculated from the following equations:  
\[t_{1}= \left\{\begin{array}{ll}\sqrt{(d_{1}^{2}-D_{cpa}^{2})}/v_{ot},&|T_{ cpa}|\leq t_{1},\\ (d_{1}-D_{cpa})/v_{ot},&D_{cpa}>d_{1}\\ \end{array}\right. \tag{28}\] \[t_{2}= \sqrt{(d_{2}^{2}-D_{cpa}^{2})}/v_{ot};\]  
\(v_{ot}\) is the relative speed between the two ships.  
(3) The function \(u_{D}\) is given as  
\[u_{D}= \left\{\begin{array}{ll}1,&\rho\leq d_{1},\\ (d_{2}-\rho/d_{2}-d_{1})^{2},&d_{1}<\rho<d_{2},\\ 0,&d_{2}\leq\rho,\end{array}\right. \tag{29}\]  
(4) The function \(u_{K}\) is given as  
\[u_{K}=\frac{1}{1+\frac{2}{k\sqrt{K^{2}+1+2K|\sin(|\psi-\psi_{L}|)}}}. \tag{30}\]  
(5) The function \(u_{Q}\) is given as  
\[u_{Q}=0.5*[\cos(Q-19^{\circ})+\sqrt{440/289+\cos^{2}(Q-19^{\circ})}]-5/17, \tag{31}\]  
where \(0\leq Q\leq 360\).  
The function of collision risk index \(C_{ri}\) is formulated as  
\[C_{ri}=[\alpha_{Dcpa},\alpha_{Tcpa},\alpha_{D},\alpha_{K},\alpha_{Q}]\times[u _{dcpa},u_{tcpa},u_{D},u_{K},u_{D}], \tag{32}\]  
where \(\alpha_{Dcpa}\), \(\alpha_{Tcpa}\), \(\alpha_{D}\), \(\alpha_{K}\) and \(\alpha_{Q}\) are weight coefficients, and their value ranges are \([0,1]\). The sum of \(\alpha_{Dcpa}\), \(\alpha_{Tcpa}\), \(\alpha_{D}\), \(\alpha_{K}\) and \(\alpha_{Q}\) is 1.