# Adaptive Neural Network Control of Zero-Speed Vessel Fin Stabilizer Based on Command Filter
## 3 Controller Design and Stability Analysis
### Control Law Design
From (29) and (30), it is obtained that  
\[\dot{z}_{1}=z_{2}+\alpha_{1}^{0}+\phi_{1}\lambda_{1}+k_{1}s_{1} \tag{31}\]  
Further, the virtual control law \(\alpha_{1}^{0}\) is designed as  
\[\alpha_{1}^{0}=-s_{2}-k_{1}z_{1}-\phi_{1}\lambda_{1} \tag{32}\]  
\(\alpha_{1}^{0}\) is the virtual control law, which is used to stabilize the error \(z_{1}\). According to the Lyapunov theorem and command filter design framework, \(\alpha_{1}^{0}\) is designed as the form of Equation (32). Substituting (32) into (31), we get  
\[\dot{z}_{1}=\bar{z}_{2}-k_{1}\bar{z}_{1} \tag{33}\]  
Choose the Lyapunov function as follows:  
\[V_{1}=\frac{1}{2}\bar{z}_{1}^{2} \tag{34}\]  
According to (33), the time derivative of \(V_{1}\) is  
\[ \begin{split}&\dot{V}_{1}=\bar{z}_{1}\dot{z}_{1}\\ &=\bar{z}_{1}(\bar{z}_{2}-k_{1}\bar{z}_{1})\\ &=-k_{1}\bar{z}_{1}^{2}+\bar{z}_{1}\bar{z}_{2}\end{split}  \tag{35}\]  
According to (24), (26) and (28), the time derivative of \(\bar{z}_{2}\) is  
\[ \begin{split}&\dot{\bar{z}}_{2}=\dot{z}_{2}-\dot{s}_{2}\\ &=\dot{x}_{2}-\dot{u}_{1}-\lambda_{2}-\dot{s}_{2}\\ &=W^{*\mathrm{T}}\psi(x)+bu+\mathrm{e}-\dot{\alpha}_{1}-\dot{ \lambda}_{2}-\dot{s}_{2}\end{split}  \tag{36}\]  
From (30), \(s_{1}\) is the compensation dynamic of the filter error \(\alpha_{1}-\alpha_{1}^{0}\). However, there is not filter error since the control input \(u\) occurs. Therefore, the compensation dynamic \(s_{2}\) is designed as follows:  
\[\dot{s}_{2}=-k_{2}s_{2} \tag{37}\]  
where \(k_{2}\) is the design parameter and is greater than 0. Substituting (25) and (37) into (36), one has  
\[ \begin{split}&\dot{z}_{2}=W^{*\mathrm{T}}\psi(x)+bu+\mathrm{e}- \dot{\alpha}_{1}-\dot{b}\Delta u+\phi_{2}\lambda_{2}+k_{2}s_{2}\\ &=\dot{b}u+bu-\dot{b}\Delta u+W^{*\mathrm{T}}\psi(x)+\mathrm{e}- \dot{\alpha}_{1}+\phi_{2}\lambda_{2}+k_{2}s_{2}\\ &=\dot{b}v+\dot{b}u+W^{*\mathrm{T}}\psi(x)+\mathrm{e}-\dot{\alpha }_{1}+\phi_{2}\lambda_{2}+k_{2}s_{2}\\ &=\dot{b}v+\dot{b}\Delta u+W^{*\mathrm{T}}\psi(x)+\mathrm{e}- \dot{\alpha}_{1}+\phi_{2}\lambda_{2}+k_{2}s_{2}\\ &=bv+\dot{b}\Delta u+W^{*\mathrm{T}}\psi(x)+\mathrm{e}-\dot{ \alpha}_{1}+\phi_{2}\lambda_{2}+k_{2}s_{2}\end{split}  \tag{38}\]  
Substituting (51)-(57) into (50) yields  
\[\dot{V}_{2}\leq-k_{1}\tilde{z}_{1}^{2}-k_{2}\tilde{z}_{2}^{2}+\frac{ \sigma_{1}}{2}\|W\|^{2}-\frac{\sigma_{1}}{2}\|\tilde{W}\|^{2}+\frac{1}{4}\| \tilde{W}\|^{2}+\|L\psi(x)\|^{2}+\frac{\sigma_{2}|b|}{2}\beta^{2}\] \[-\frac{\sigma_{2}|b|}{2}\beta^{2}+\frac{\sigma_{3}}{2}b^{2}-\frac {\sigma_{3}}{2}\tilde{b}^{2}+\frac{1}{2}\tilde{b}^{2}+\frac{1}{2}\|Leu\|^{2}+ \frac{1}{2}\tilde{z}_{2}^{2}+\frac{1}{2}\tilde{b}^{2}+\frac{1}{2}\tilde{e}^{2}\] \[+\frac{1}{2}\dot{e}^{2}-L\tilde{e}^{2}\] \[\leq-k_{1}\tilde{z}_{1}^{2}-\left(k_{2}-\frac{1}{2}\right)\tilde {z}_{2}^{2}-\left(\frac{\sigma_{1}}{2}-\frac{1}{4}\right)\|\tilde{W}\|^{2}-(L -1)\tilde{e}^{2}-\frac{\sigma_{2}|b|}{2}\beta^{2} \tag{58}\] \[-\left(\frac{\sigma_{3}}{2}-\frac{1}{2}\right)\tilde{b}^{2}+ \frac{\sigma_{1}}{2}\|W\|^{2}+\|L\psi(x)\|^{2}+\frac{\sigma_{2}|b|}{2}\beta^{ 2}+\frac{\sigma_{3}}{2}b^{2}\] \[+\frac{1}{2}\|[PERSON]\|^{2}+\frac{1}{2}\dot{e}^{2}\] \[\leq-cV+M\]  
where \(c=\min\Bigl{\{}k_{1},k_{2}-\frac{1}{2},\frac{\sigma_{1}}{2}-\frac{1}{4},L-1, \frac{\sigma_{2}|b|}{2},\frac{\sigma_{3}}{2}-\frac{1}{2}\Bigr{\}}\), \(M=\frac{\sigma_{1}}{2}\|W\|^{2}+\|Le\psi(x)\|^{2}\)\(+\frac{\sigma_{2}|b|}{2}\beta^{2}+\frac{\sigma_{3}}{2}b^{2}+\frac{1}{2}\|Leu\|^{2}+ \frac{1}{2}\dot{e}^{2}\).