# Simulation of a Quadrotor under Linear Active Disturbance Rejection
## 3 Controller Design
### Adaptive Control Optimizes PD Controller Parameters  
**Theorem 1. **_Considering the nonlinear system in this paper, the pseudo control input is selected as Equation (24) and the following adaptive law is adopted to make the assumption valid._  
\[\hat{K}_{p}=\varpi_{p}\big{[}\omega_{p}K_{p}(v_{1}-z_{1})\big{]}/\widetilde{K} _{p} \tag{25}\]  
\[\hat{K}_{d}=\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2})]/\widetilde{K}_{d} \tag{26}\]  
Considering that the adaptive rate mentioned in Equations (25) and (26) will have singularities, the adaptive rate is rewritten as:  
\[\hat{K}_{p}=\int\limits_{0}^{T}\Big{\{}\varpi_{p}\big{[}\omega_{p}K_{p}(v_{1} -z_{1})\big{]}/\widetilde{k}_{p}\Big{\}}dt+K_{p0} \tag{27}\]  
\[\hat{K}_{d}=\int\limits_{0}^{T}\Big{\{}\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2}) ]/\widetilde{k}_{d}\Big{\}}dt+K_{d0} \tag{28}\]  
where \(\hat{K}_{p}\) and \(\hat{K}_{d}\) are the estimated value of the PD controller parameters, \(\widetilde{K}_{p}=K_{p}-\hat{K}_{p}\), \(\widetilde{K}_{d}=K_{d}-\hat{K}_{d}\) are estimation errors. **Proof of Theorem 1. ** Construct a positive definite Lyapunov function:  
\[V(t)=\frac{1}{2}\kappa_{t}^{2}+\frac{1}{2}\widetilde{K}_{p}\varpi_{p}^{-1} \widetilde{K}_{p}+\frac{1}{2}\widetilde{K}_{d}\varpi_{d}^{-1}\widetilde{K}_{d} \tag{29}\]  
Taking the derivative of Equation (29), we can obtain:  
\[\dot{V}(t)=\kappa_{i}\dot{\kappa}_{i}+\widetilde{K}_{p}\varpi_{p}^{-1}\dot{ \widetilde{K}}_{p}+\widetilde{K}_{d}\varpi_{d}^{-1}\dot{\widetilde{K}}_{d} \tag{30}\]  
Substitute Equation (24) into Equation (29) to obtain:  
\[\dot{V}(t) =\kappa_{i}\big{[}-\varepsilon\kappa_{i}+K_{p}(v_{1}-\hat{z}_{1}) +K_{d}(v_{2}-\hat{z}_{2})\big{]}+\widetilde{K}_{p}\varpi_{p}^{-1}\dot{ \widetilde{K}}_{p}+\widetilde{K}_{d}\varpi_{d}^{-1}\dot{\widetilde{K}}_{d} \tag{31}\] \[=-\varepsilon\kappa_{i}^{2}+\kappa_{i}K_{p}(v_{1}-\hat{z}_{1})+ \kappa_{i}K_{d}(v_{2}-\hat{z}_{2})+\widetilde{K}_{p}\varpi_{p}^{-1}\dot{ \widetilde{K}}_{p}+\widetilde{K}_{d}\varpi_{d}^{-1}\dot{\widetilde{K}}_{d}\]  
where the tracking error approaches zero, Equation (31) can be rewritten as:  
\[\dot{V}(t)=-\varepsilon\kappa_{i}^{2}+\kappa_{i}K_{p}(v_{1}-\hat{z}_{1})+ \kappa_{i}K_{d}(v_{2}-\hat{z}_{2})-\widetilde{K}_{p}\varpi_{p}^{-1}\dot{ \widetilde{K}}_{p}-\widetilde{K}_{d}\varpi_{d}^{-1}\dot{\widetilde{K}}_{d} \tag{32}\]  
Putting the adaptive rate Formula (27) and Formula (28) into Formula (32), we can obtain:  
\[\dot{V}(t)= -\varepsilon\kappa_{i}^{2}+\kappa_{i}K_{p}(v_{1}-\hat{z}_{1})+ \kappa_{i}K_{d}(v_{2}-\hat{z}_{2})-\widetilde{K}_{p}\varpi_{p}^{-1}\varpi_{p} \big{[}\omega_{p}K_{p}(v_{1}-z_{1})\big{]} \tag{33}\] \[\hat{K}_{d}=\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2})]/\widetilde{K}_{d} \tag{26}\]0  
Simplified to obtain:  
\[\hat{K}_{d}=\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2})]/\widetilde{K}_{d} \tag{26}\]1  
where \(\varepsilon\) is a positive parameter, the constructed Lyapunov function \(V(t)\) is a monotonically decreasing function, which can be obtained by:  
\[\hat{K}_{d}=\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2})]/\widetilde{K}_{d} \tag{26}\]2According to Equation (35), the system is critically stable, but it cannot be proved that the system is asymptotically stable. Therefore, the asymptotic stability in engineering should be studied and analyzed. \(\square\)  
**Theorem 2** (Barbalat's Theorem). : _If \(\kappa(t)\) is a continuously differentiable function, satisfying:_  
\[\hat{K}_{d}=\varpi_{d}[\omega_{d}K_{d}(v_{2}-z_{2})]/\widetilde{K}_{d} \tag{26}\]3  
_This proves that the whole system is asymptotically stable._  
Proof. : If \(\kappa(t)\) is a differentiable function, then \(\lim_{t\to\infty}\kappa(t)=C\) (\(C\) is a constant) if \(\ddot{\kappa}(t)\) is bounded, then \(\lim_{t\to\infty}\dot{\kappa}(t)=0\).