# Online Adaptive Parameter Estimation for Quadrotors
## 2 Adaptive Parameter Estimation
\begin{array}{ccccc}\frac{\dot{x}-\dot{x}_{f}}{k}\\ \frac{\dot{\phi}-\dot{\phi}_{f}}{k}\\ \frac{\dot{\theta}-\dot{\theta}_{f}}{k}\\ \frac{\dot{\theta}-\dot{\theta}_{f}}{k}\\ \frac{\dot{\psi}-\dot{\psi}_{f}}{k}\end{array} \right],\quad Y=\left[ \begin{array} []{ccccc}F_{1f}U_{1}&0&0&0&0&0&0\\ 0&U_{2}&F_{2f}&0&0&0&0\\ 0&0&0&U_{3}&F_{3f}&0&0\\ 0&0&0&0&U_{4}&F_{4f}\\ \end{array} \right],\quad Z=\left[ \begin{array}{c}a_{1}\\ a_{2}\\ a_{3}\\ a_{4}\\ a_{5}\\ a_{6}\\ a_{7}\end{array} \right]. \tag{6}\]  
We can define an auxiliary filtered and 'integrated' regressor matrix \(P\) and a vector \(Q\) as  
\[ \begin{cases}\dot{P}=-\ell P+Y^{T}Y,&P(0)=0\\ \dot{Q}=-\ell Q+Y^{T}X,&Q(0)=0\end{cases}  \tag{7}\]  
where \(P\in\mathbb{R}^{b\times b}\) and \(Q\in\mathbb{R}^{b\times n}\), \(\ell>0\) is a design parameter, and the terms \(\ell P\) and \(\ell Q\) can be taken as the forgetting factors, which can make \(P\) and \(Q\) bounded in a compact set \(\Omega\)[21]. Considering that (7) is a differential equation, we can calculate the solution of (7) as  
\[\left\{ \begin{array}{l}P(t)=\int_{0}^{t}e^{-\ell(t-r)}Y^{T}(r)Y(r)dr\\ Q(t)=\int_{0}^{t}e^{-\ell(t-r)}Y^{T}(r)X(r)dr\end{array} \right.. \tag{8}\]  
Hence, it can be verified that \(P\) and \(Q\) are bounded for any given bounded \(Y\) and \(X\) due to the introduced forgetting factors \(\ell P\) and \(\ell Q\) in (7). One defines an auxiliary vector \(W\in\mathbb{R}^{b\times n}\) calculated based on \(P(t)\), \(Q(t)\) given in (8) as  
\[W(t)=P(t)\hat{Z}-Q(t) \tag{9}\]  
where \(\hat{Z}\) is the estimation for the unknown parameter \(Z\), which can be updated online via the following Equation (12). According to Equations (4) and (8), Equation (9) can be rewritten as  
\[Q=PZ. \tag{10}\]  
Then, the auxiliary matrix \(W\) can be represented as  
\[W=P\hat{Z}-PZ=-P\widetilde{Z} \tag{11}\]  
with the estimated error \(\widetilde{Z}=Z-\hat{Z}\). From Equation (11), one knows that the vector \(W\) can be applied to estimate the unknown matrix \(Z\) as analyzed in [21]. Then, the estimation algorithm of the unknown parameters can be designed as  
\[\dot{\hat{Z}}=-\Gamma W \tag{12}\]  
where \(\Gamma>0\) is a positive learning gain. To solve the parameter estimation convergence, the positive definiteness property of \(P(t)\) should be firstly studied. One defines \(\lambda_{\text{max}}(\cdot)\) and \(\lambda_{\text{min}}(\cdot)\) as the maximum and minimum eigenvalues of the corresponding matrices, respectively. Then, we can obtain the following Lemmas:  
**Lemma 1** ([13]): _The matrix \(Y\) defined in (8) is persistently excited (PE), then the matrix \(P\) defined in (8) is positive definite, i.e., \(\lambda_{\text{min}}(P)>\sigma>0\) for a positive constant \(\sigma\)._  
**Proof of Lemma 1. ** Please refer to [13]. \(\square\)  
**Theorem 1** ([22; 23]): _Consider Equation (5) with adaptation law (12), one supposes that the regressor matrix \(Y\) is PE, then the estimation error \(\widetilde{Z}=\hat{Z}-Z\) exponentially converges to zero with the convergence rate \(\mu=2\sigma/\lambda_{\text{max}}(\Gamma^{-1})\)._  
**Proof of Theorem 1. ** Assume that \(Y\) is PE, one knows \(\lambda_{\text{max}}(P)>\sigma>0\) based on Lemma 1. Choose the Lyapunov function as \(V=\frac{1}{2}\widetilde{Z}^{T}\Gamma^{-1}\widetilde{Z}\), then one knows \(Q=PZ\) and \(W=-P\widetilde{Z}\) according to Equations (9)-(12). Hence, we can obtain the derivative \(\dot{V}\) as  
\[\dot{V}=\widetilde{Z}^{T}\Gamma^{-1}\dot{\widetilde{Z}}=\widetilde{Z}^{T}W=- \widetilde{Z}^{T}P(t)\widetilde{Z}\leq-\mu V \tag{13}\]  
where \(\mu=2\sigma/\lambda_{\text{max}}(\Gamma^{-1})\) is positive for all \(t>0\). From Equation (13), one knows that the exponential convergence of the error \(\widetilde{Z}\) to zero with the rate \(\mu\) is guaranteed, which depends on the excitation level \(\sigma\) and learning rate \(\Gamma\). \(\square\)  
**Remark 1**: _The purpose of this paper is using the adaptive law for estimating parameters online. Therefore, the regressor \(Y\) defined in (6) should be known.