# 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.2 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 \(\mathbf{\tau}_{\eta 2}\) mentioned above in this research. The relationship between thrust and the desired control force \(\mathbf{\tau}_{\eta 2}\) for the used Z-type twin propulsors is defined as follows:  
\[\mathbf{\tau}_{\eta 2}=\mathbf{T}\mathbf{f}(\mathbf{\alpha}) \tag{60}\]  
where \(\mathbf{f}\in\mathbb{R}^{2}\) and \(\mathbf{\alpha}\in\mathbb{R}^{2}\) are the thrust input vector and the rotation angle vector, which can be expressed as follows:  
\[\mathbf{\alpha}=[ \begin{array}{cc}a_{1}\end{array} ,\;a_{2}\end{array}]^{T}\;\;,\;\;\mathbf{f}=[ \begin{array}{cc}f_{1}\end{array} ,\;f_{2}\end{array}]^{T} \tag{61}\]  
Besides, \(\mathbf{T}\in\mathbb{R}^{3\times 4}\) which is the transformation matrix between the desired control force and the actuators [21] can be expressed as follows:  
\[\mathbf{T}=\left[ \begin{array}{cccc}1&0&1&0\\ 0&1&0&1\\ -l_{y1}&l_{x1}&-l_{y2}&l_{x2}\end{array} \right] \tag{62}\]  
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:  
\[F_{xi}=f_{i}\cos\alpha_{i}\;,\;\;\;F_{yi}=f_{i}\sin\alpha_{i} \tag{63}\]  
where \(i=1,2,\ldots,n\) represent the amount of adopted propulsors. Substituting (63) into (60), it yields  
\[\tau_{n2}=\left[ \begin{array}{cccc}1&0&1&0\\ 0&1&0&1\\ -l_{y1}&l_{x1}&-l_{y2}&l_{x2}\end{array} \right]\left[ \begin{array}{c}F_{x1 }\\ F_{y1}\\ F_{x2}\\ F_{y2}\end{array} \right]=\mathbf{T}\mathbf{f_{e}} \tag{64}\]  
where \(\mathbf{T}\) is the constant matrix, and \(\mathbf{f_{e}}\) is the thrust vector, which represents the \(x\)-axis and \(y\)-axis components of the thruster. In (64), \(\mathbf{T}\in\mathbb{R}^{r\times 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:  
\[ \begin{split}\min_{\mathbf{f_{e}}}&\left\{J=\mathbf{f_{e}}^{T} \mathbf{W}\mathbf{f_{e}}\right\}\\ \text{subject to}:\tau_{\eta 2}-\mathbf{T}\mathbf{f_{e}}=0\end{split}  \tag{65}\]  
where \(\mathbf{W}\) is a given positive definite matrix. Solving the (65) by using Lagrangian multipliers [21], we have:  
\[L(\mathbf{f_{e}},\mathbf{\lambda})=\mathbf{f_{e}}^{T}\mathbf{W}\mathbf{f_{e}}+\bm {\lambda}^{T}(\tau_{\eta 2}-\mathbf{T}\mathbf{f_{e}}) \tag{66}\]  
where \(\lambda\) is the solvable Lagrangian multiplier. The gradient of (66) with respect to \(\mathbf{f_{e}}\) and \(\mathbf{\lambda}\) can be found as  
\[ \begin{split}\
abla_{\mathbf{f_{e}},\mathbf{\lambda}}L(\mathbf{f_{e} },\mathbf{\lambda})=&\left(\frac{\partial L}{\partial\mathbf{f_{e}}} \frac{\partial L}{\partial\mathbf{\lambda}}\right)\\ &=(2\mathbf{W}\mathbf{f_{e}}-\mathbf{T}^{T}\mathbf{\lambda},\tau_{ \eta 2}-\mathbf{T}\mathbf{f_{e}})\end{split}