## 3 Controller Design
### Disturbance Observer  
The disturbance of the external environment cannot be ignored in the actual navigation of underactuated USVs. In order to eliminate the influence of disturbances on the controller, a nonlinear disturbance observer [40] was introduced to estimate the unknown disturbances and compensate for disturbances in the controller, to achieve high-quality control of the closed-loop system. \[\left\{ \begin{array}{l}\dot{\mathbf{Z}}=\mathbf{L}(\mathbf{CV}+\mathbf{DV}- \boldsymbol{\tau})-\mathbf{L}\mathbf{d}\\ \mathbf{d}=\mathbf{Z}+\mathbf{P}\end{array} \right. \tag{27}\]  
\(\mathbf{L}\) and \(\mathbf{P}\) can take the following forms:  
\[\mathbf{L}=\mathbf{X}^{-1}\mathbf{M}^{-1} \tag{28}\]  
\[\mathbf{P}=\mathbf{X}^{-1}\mathbf{V} \tag{29}\]  
The nonlinear disturbance observer was constructed using Equations (26)-(28), where \(\mathbf{X}\) is an invertible matrix which can be solved for via linear matrix inequality (LMI). The stability of the disturbance observer is proved in the next subsection. If the disturbance errors converge, then the disturbance observer is stable, and it can be used for controller design. Proof of the Disturbance Observer  
The Lyapunov function for the disturbance error is constructed as  
\[\mathbf{V}_{3}\mathbf{=}\mathbf{d}\mathbf{X}^{\text{T}}\mathbf{M}\mathbf{X} \mathbf{\tilde{d}} \tag{30}\]  
Combining Equations (27)-(29), the following equation can be obtained:  
\[ \begin{array}{l}\dot{\mathbf{V}}_{3}=\mathbf{\dot{d}}\mathbf{X}^{\text{T}} \mathbf{M}\mathbf{\tilde{d}}+\mathbf{d}^{-\text{T}}\mathbf{M}\mathbf{X} \mathbf{\tilde{d}}\\ =-\mathbf{d}^{-\text{T}}\mathbf{M}^{-1}\mathbf{X}^{-\text{T}}\mathbf{X}^{- \text{T}}\mathbf{M}\mathbf{\tilde{d}}-\mathbf{d}^{-\text{T}}\mathbf{M} \mathbf{X}\mathbf{X}^{-1}\mathbf{M}\mathbf{X}\mathbf{X}^{-1}\mathbf{M}^{-1} \mathbf{\tilde{d}}\\ =-\mathbf{\tilde{d}}^{-\text{T}}\left(\mathbf{X}+\mathbf{\tilde{x}}^{\text{T} }\right)\mathbf{\tilde{d}}\end{array}  \tag{31}\]where \(\vec{\mathbf{d}}=\mathbf{d}-\hat{\mathbf{d}}\) is the disturbance error. Since it is assumed in this study that the perturbation changes slowly, it can be considered that \(\dot{\mathbf{d}}=0\). The observation error equation is obtained by combining with Equation (27). \[\dot{\vec{\mathbf{d}}}+\mathbf{L}\tilde{\mathbf{d}}=0 \tag{32}\]  
The following inequality is constructed:  
\[\mathbf{X}+\mathbf{X}^{\mathrm{T}}\geq\kappa \tag{33}\]  
where \(\kappa\) is the positively defined matrix, and the existence of \(\kappa^{\prime}>0\) makes \(\dot{\mathbf{V}}_{3}\leq-\vec{\mathbf{d}}\cdot\vec{\mathbf{x}}=-\kappa^{ \prime}\mathbf{V}_{3}\) valid. Clearly, the disturbance observer converges exponentially, and the accuracy and speed of convergence depend on the value of \(\kappa\). The higher the value of \(\kappa\), the higher the convergence speed and precision. Let \(\mathbf{Q}=\mathbf{X}^{-1}\), then Inequality (33) becomes  
\[\mathbf{Q}^{\mathrm{T}}+\mathbf{Q}-\mathbf{Q}^{\mathrm{T}}\kappa\mathbf{Q}\geq 0 \tag{34}\]  
From Equation (28), according to the Schur complement lemma, we can derive  
\[\left[ \begin{array}{cc}\mathbf{Q}^{\mathrm{T}}+\mathbf{Q}&\mathbf{Q}^{ \mathrm{T}}\\ \mathbf{Q}&\kappa^{-1}\end{array} \right]\geq 0 \tag{35}\]  
The value of \(\mathbf{Q}\) can be obtained by solving Inequality (34), and thus the unknown \(\mathbf{X}\) in Inequality (33) can be obtained. The USV controller is redesigned to account for disturbances. The time derivative of Equation (18) is:  
\[\left\{ \begin{array}{l}\dot{S}_{1}=e_{u}+\frac{\beta_{1}p_{1}}{q_{1}}\frac{( m_{22}v-d_{11}u+\tau_{3}+d_{1})-m_{11}u_{d}}{m_{11}}(e_{u})^{\frac{p_{1}}{q_{1}}-1} \\ \dot{S}_{2}=\dot{e}_{v}+\beta_{2}\left(\frac{p_{2}}{q_{2}}\right)(\dot{e}_{v} )^{\frac{p_{2}}{q_{2}}-1}\Big{\{}\frac{m_{22}u_{d}-m_{11}u}{m_{22}m_{33}}[(m_{ 11}-m_{22})uv-d_{33}r+\tau_{r}+d_{3}]\\ \quad\quad+\frac{1}{m_{22}}\big{(}-m_{11}\dot{u}r-d_{22}\dot{v}\big{)}-\Gamma \Big{\}}\end{array} \right.