## 3 Controller Design  
In this section, the distributed controller is designed to meet the requirements of connectivity-preserving and collision avoidance. To satisfy these requirements, nonlinearly transformed error surfaces are introduced as follows:  
\[q_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(e_{ij,1}+e_{ij,2}), \tag{20}\] \[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\] (21) \[u_{i,e} =u_{i}-\tilde{\beta}_{i,1}-\gamma_{1}\tanh(\alpha_{i,1}),\] (22) \[v_{i,e} =v_{i}-\tilde{\beta}_{i,2}-\tanh(\alpha_{i,2}),\] (23) \[r_{i,e} =r_{i}-\tilde{\beta}_{i,3}-\gamma_{1}\tanh(\alpha_{i,3}),\] (24) \[\omega_{i,1} =\tilde{\beta}_{i,1}-\beta_{i,1},\] (25) \[\omega_{i,2} =\tilde{\beta}_{i,2}-\beta_{i,2},\] (26) \[\omega_{i,3} =\tilde{\beta}_{i,3}-\beta_{i,3} \tag{27}\]  
where \(c_{ij}=1\) if the \(i\)th USV and the \(j\)th USV are neighbors, otherwise \(c_{ij}=0\). \(e_{ij,1}\) and \(e_{ij,2}\) will be explained later. \(\psi_{ij,a}\) is the approach angles expressed as:  
\[\psi_{ij,a}=[\arctan(g_{ij,1},g_{ij,2})-\psi_{j}]\tanh(g_{ij,3})+\psi_{j}, \tag{28}\]  
where  
\[g_{ij,1} =\rho_{ij}\,\sin(\lambda_{ij})-\rho_{ij,d}\,\sin(\lambda_{ij,d}), \tag{29}\] \[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]0 (30) \[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]1  
\(\gamma_{ij}\) is a positive constant, \(\beta_{i,h}\), \(h=1,2,3\), is virtual control and \(\tilde{\beta}_{i,h}\), \(h=1,2,3\), is the signal derived from the following first-order low-pass filters \(l_{i,h}\hat{\beta}_{i,h}+\tilde{\beta}_{i,h}=\beta_{i,h}\), and \(l_{i,h}>0\) is constant. \(\alpha_{i,h}\), \(h=1,2,3\), is a time-varying and bounded auxiliary variable derived to deal with the underactuated problem and input saturation. Inspired by the proposed asymmetric BLF method in [26], a nonlinearly transformed formation error combined with modified BLF was developed to achieve the connectivity preservation and the collision avoidance. Error surfaces \(e_{ij,1}\) and \(e_{ij,2}\) are defined as follows:  
\[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]2 \[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]3  
where  
\[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]4 \[\psi_{i,e} =\sum_{j=0,j\
eq i}^{n}c_{ij}(\psi_{i}-\psi_{ij,a}),\]5  
\(a_{ij,1}=\underline{R}-\rho_{ij,d}\), \(a_{ij,2}=\underline{L}-\rho_{ij,d}\), \(\rho_{ij,e}=\rho_{ij}-\rho_{ij,d}\), \(\lambda_{ij,e}=\lambda_{ij}-\lambda_{ij,d}\), \(b_{ij,1}=\underline{\theta}-\lambda_{ij,d}\) and \(b_{ij,2}=\overline{\theta}-\lambda_{ij,d}\). **Remark 3**. : _The error surfaces \(e_{ij,1}\) and \(e_{ij,2}\) are introduced to realize the connectivity preservation and the collision avoidance. According to definition of objective (1) \(\underline{R}<\rho_{ij}<\underline{L}\), then \(\underline{R}-\rho_{ij,d}<\rho_{ij,e}<\underline{L}-\rho_{ij,d}\). From definition of \(a_{ij,1}=\underline{R}-\rho_{ij,d}\) and \(a_{ij,2}=\underline{L}-\rho_{ij,d}\), such that \(a_{ij,1}<\rho_{ij,e}<a_{ij,2}\). One notes that \(a_{ij,1}<0\) and \(a_{ij,2}>0\), thus \(\rho_{ij,e}>a_{ij,1}\) if \(\rho_{ij,e}<0\) and \(\rho_{ij,e}<a_{ij,2}\) if \(\rho_{ij,e}>0\). It holds that the connectivity preservation and the collision avoidance are achieved as \(\rho_{ij,e}>a_{ij,1}\) if \(\rho_{ij,e}<0\) and \(\rho_{ij,e}<a_{ij,2}\) if \(\rho_{ij,e}>0\). From Equation (32), the definition of \(e_{ij,1}\) implies \(-a_{ij}<\rho_{ij,e}<a_{ij}\). According to the definition of \(a_{ij}\), \(\rho_{ij,e}<a_{ij,2}\) if \(\rho_{ij,e}>0\), \(a_{ij,1}<\rho_{ij,e}\) if \(\rho_{ij,e}<0\). Then the distance constraint \(\underline{R}<\rho_{ij}<\underline{L}\) can be satisfied. The angle constraint \(\underline{\varrho}<\lambda_{ij}<\overline{\theta}\) is similar to the distance constraint._  
A distributed controller using the nonlinearly transformed error is presented.