## 3 Controller Design
### Attitude Controller Design Based on Quaternion
#### 3.2.2. Design of Fast and Robust Feedforward PD Controller Based on the Learning Rate
\begin{array}{ll}\dot{V}_{p1}&=s_{p}^{\mathrm{T}}\Big{(}\overline{\hat{d}}_ {p}-\overline{\hat{d}}_{p}-k_{3}s_{p}-\big{(}\hat{D}_{p}+\delta_{p}\big{)} \mathrm{sign}(s_{p})\Big{)}\\ &=s_{p}^{\mathrm{T}}\Big{(}\overline{\hat{d}}_{p}-k_{3}s_{p}-\big{(}\hat{D}_{p }+\delta_{p}\big{)}\mathrm{sign}(s_{p})\Big{)}\\ &\leq-k_{3}\|s_{p}\|^{2}-\delta_{p}\|s_{p}\|+\sum\limits_{i=1}^{3}|s_{i}| \Big{(}\left|\overline{\hat{d}}_{i}\right|-\hat{D}_{i}\Big{)}\\ &\leq-k_{3}\|s_{p}\|^{2}-\delta_{p}\|s_{p}\|+\sum\limits_{i=1}^{3}|s_{i}| \widetilde{D}_{i}\end{array}  \tag{60}\]Since it has been proved that the estimation error \(\widetilde{D}_{p}\) and the sliding mode surface \(s_{p}\) are bounded, then \(\sum\limits_{i=1}^{3}\left(|s_{i}|\widetilde{D}_{i}\right)\) is also bounded. The above inequality can be further rewritten as  
\[ \begin{array}{l}\dot{V}_{p1}\leq-\delta_{p}\left\|s_{p}\right\|+\sum\limits_ {i=1}^{3}|s_{i}|\widetilde{D}_{i}\\ \leq-\lambda_{p1}\dot{V}\frac{1}{p1}+\Delta_{p1}\end{array}  \tag{61}\]  
where \(\lambda_{p1}=\sqrt{2}\delta_{p}\), \(\Delta_{p1}=\sum\limits_{i=1}^{3}|s_{i}|\widetilde{D}_{i}\). According to (61), by using the Lyapunov stability criterion and Lemma 1, it can be concluded that the sliding mode manifold converges to zero in finite time. Once the end of the phase is reached, the error variable will converge to zero in a finite time along the sliding mode surface. The above proves the error convergence characteristic of the position subsystem in finite time. **Theorem 2. **_Consider the attitude subsystem (32), where the quaternion-based feedforward PD controller (50) is used. Then, the quaternion error \(\widetilde{Q}=\left[\widetilde{q}_{0}\quad\widetilde{q}_{v}^{\mathsf{T}} \right]^{T}\) and angular velocity error \(\widetilde{\omega}\) converge to 0 progressively, which also ensures that the transformed Euler angle tracking error \(\eta_{2c}\) converge to 0 asymptotically._  
**Proof of Theorem 2. ** The Lyapunov function is designed as  
\[V_{\Theta}=V_{\Theta 1}+V_{\Theta 2} \tag{62}\]  
where \(V_{\Theta 1}=\widetilde{\omega}^{\mathsf{T}}I_{\mathsf{tr}}\widetilde{\omega}\), \(V_{\Theta 2}=k_{P}Q_{c}^{\mathsf{T}}Q_{c}\). \(\square\)  
According to the cross-product rule, \(a\cdot(a\times c)=c\cdot(a\times a)=0\), and as a result, \(\widetilde{\omega}^{\mathsf{T}}\widetilde{\omega}\times(l_{\mathsf{tr}} \widetilde{\omega})=0\), \(\widetilde{q}_{v}^{\mathsf{T}}\widetilde{q}_{v}^{\times}=\left[0\quad 0 \quad 0\right]^{\mathsf{T}}\). Let \(\omega_{d}=0\); then, \(\widetilde{\omega}=\omega-R(\widetilde{Q})\omega_{d}=\omega\), and \(\dot{\widetilde{\omega}}=\dot{\omega}\). By taking the derivative of \(V_{\Theta 1}\) and \(V_{\Theta 2}\) separately, we obtain  
\[ \begin{array}{rl}\dot{V}_{\Theta 1}&=\widetilde{\omega}^{\mathsf{T}}I_{ \mathsf{tr}}\dot{\widetilde{\omega}}\\ &=\widetilde{\omega}^{\mathsf{T}}(f_{\Theta}+\tau_{v\Theta}+d_{\Theta})\\ \end{array}  \tag{63}\]  
\[ \begin{array}{rl}\dot{V}_{\Theta 2}&=2k_{P}Q_{c}^{\mathsf{T}}\dot{Q}_{c}=2k_{P} \Big{[}1-\widetilde{q}_{0}\quad\widetilde{q}_{v}^{\mathsf{T}}\Big{]}\Big{[}- \dot{\widetilde{q}}_{0}\quad\dot{\widetilde{q}}_{v}^{\mathsf{T}}\Big{]}^{ \mathsf{T}}\\ &=2k_{P}\Big{[}1-\widetilde{q}_{0}\quad\widetilde{q}_{v}^{\mathsf{T}}\Big{]} \Big{[}\dot{\widetilde{q}}_{v}^{\mathsf{T}}\widetilde{\omega}\quad(G \widetilde{\omega})^{\mathsf{T}}\Big{]}^{\mathsf{T}}\\ &=k_{P}(1-\widetilde{q}_{0})\widetilde{q}_{v}^{\mathsf{T}}\widetilde{\omega}+ \kappa_{P}\widetilde{q}_{v}^{\mathsf{T}}(\widetilde{q}_{0}I_{3}+\widetilde{q}_ {v}^{\times})\widetilde{\omega}\\ &=k_{P}\widetilde{q}_{v}^{\mathsf{T}}\widetilde{\omega}\end{array}  \tag{64}\]  
According to the above calculation, the derivative of the Lyapunov function can be obtained. Then, the controller (50) is substituted into (63) to obtain the following equation:  
\[