# Trajectory Tracking with Adaptive Robust Control for Quadrotor
## 4 Adaptive Controller and Robust Mechanisms Design
Thus, the reference model is:  
\[\bar{\Theta}_{m}^{c}(t)=\frac{\omega_{n}^{2}}{s^{2}+2\zeta\omega_{n}s+\omega_ {n}^{2}}\bar{\Theta}_{c}(t) \tag{15}\]The adjustment mechanism should minimize a cost function that was defined as  
\[J=\frac{1}{2}\vec{e}_{\Theta^{c}_{m}} \tag{16}\]  
with \(\vec{e}_{\Theta^{c}_{m}}=\vec{\Theta}^{c}_{m}(t)-\vec{\Theta}(t)\), and the vector \(\vec{\Theta}^{c}_{m}(t)=[\theta^{c}_{m},\theta^{c}_{m},\psi^{c}_{m}]\) Thus, combining (14) with (15) and calculating the partial derivatives with respect to \(\hat{k}^{al}_{p\Theta}\) and \(\hat{k}^{al}_{d\Theta}\) it is obtained  
\[\frac{\partial\epsilon_{\vec{\Theta}_{m}}}{\partial\hat{k}^{al}_{ p\Theta}} = \left(\frac{C_{2}}{s^{2}+(C_{2}\hat{k}^{al}_{d\Theta}-C_{1})s+C_{ 2}\hat{k}^{al}_{p\Theta}}\right)(\vec{\Theta}(t)-\vec{\Theta}^{c}_{m}(t)) \tag{17}\] \[\frac{\partial\epsilon_{\vec{\Theta}_{m}}}{\partial\hat{k}^{al}_{ d\Theta}} = \left(\frac{C_{2}s}{s^{2}+(C_{2}\hat{k}^{al}_{d\Theta}-C_{1})s+C_ {2}\hat{k}^{al}_{p\Theta}}\right)(\vec{\Theta}(t)-\vec{\Theta}^{c}_{m}(t)) \tag{18}\]  
In general, the expressions (17) and (18) cannot be used due to the unknown parameters \(k^{al}_{p\[PERSON]}\) and \(k^{al}_{d\Theta}\), but let us defined an optimal case given by  
\[s^{2}+(C_{1}+C_{2}\hat{k}^{al}_{d\[PERSON]})s+C_{2}\hat{k}^{al}_{p\Theta}=s^{2}+ 2\zeta\omega_{n}s+\omega_{n}^{2} \tag{19}\]  
After this approximation, the differential equations for the adaptive control law obtained are  
\[\hat{k}^{al}_{p\[PERSON]} = -\gamma_{1l}\bigg{(}\frac{C_{2}}{s^{2}+2\zeta\omega_{n}s+\omega_ {n}^{2}}(\vec{\Theta}(t)-\vec{\Theta}^{c}_{m}(t))\bigg{)}(\epsilon_{\vec{ \Theta}^{c}_{m}}) \tag{20}\] \[\hat{k}^{al}_{v\Theta} = -\gamma_{2l}\bigg{(}\frac{sC_{2}}{s^{2}+2\zeta\omega_{n}s+\omega_ {n}^{2}}(\vec{\Theta}(t)-\vec{\Theta}^{c}_{m}(t))\bigg{)}(\epsilon_{\vec{ \Theta}^{c}_{m}}) \tag{21}\]  
From this, we propose a robust adjustment mechanism with the MIT rule and first-order sliding-mode (MIT-SM) [28; 31]. Thus, the sliding manifold is defined as \(\sigma_{\Theta}=\vec{\Theta}^{c}_{m}(t)-w_{l}+k_{\Theta}\vec{e}_{\Theta_{m}}\), where \(w_{l}=[w_{x},w_{y},w_{z}]\), that is, the sliding-manifold is denoted for the three angle of movement of the unmanned aerial vehicle, thus, \(w_{x}\) corresponds to angular rate in \(x\)-axis, \(w_{y}\) corresponds to angular rate in \(y\)-axis, and \(w_{x}\) that corresponds to angular rate in \(z\)-axis. \[\hat{k}^{al}_{p\Theta} = -\gamma_{1l}\bigg{(}\frac{C_{2}}{s^{2}+2\zeta\omega_{n}s+\omega_ {n}^{2}}(\vec{\Theta}(t)-\vec{\Theta}^{c}_{m}(t))\bigg{)}(\beta_{p\Theta}\, \text{sign}(\sigma_{\Theta})) \tag{22}\] \[\bar{\Theta}(t)=\frac{(\hat{k}_{p\Theta}^{al}+\hat{k}_{d\Theta}^{al}s)C_{2}}{ s^{2}+(C_{2}\hat{k}_{d\Theta}^{al}-C_{1})s+C_{2}\hat{k}_{p\Theta}^{al}}\bar{ \Theta}_{c}(t) \tag{14}\]0  
where the gains \(\beta_{p\Theta},\beta_{v\Theta}\) are defined as positive. The first-order sliding mode generates the undesired chattering effect. Thus, we propose an MIT rule with twisting (MIT-Twisting) to reduce the chattering effect [31]. The twisting technique needs to know the values of \(\sigma_{\Theta}\) and \(\hat{v}_{\Theta}\), to calculate such variables [32]. It is necessary to define a first-order robust differentiator which is given by:  
\[\bar{\Theta}(t)=\frac{(\hat{k}_{p\Theta}^{al}+\hat{k}_{d\Theta}^{al}s)C_{2}}{ s^{2}+(C_{2}\hat{k}_{d\Theta}^{al}-C_{1})s+C_{2}\hat{k}_{p\Theta}^{al}}\bar{ \Theta}_{c}(t) \tag{14}\]1 \[\bar{\Theta}(t)=\frac{(\hat{k}_{p\Theta}^{al}+\hat{k}_{d\Theta}^{al}s)C_{2}}{ s^{2}+(C_{2}\hat{k}_{d\Theta}^{al}-C_{1})s+C_{2}\hat{k}_{p\Theta}^{al}}\bar{ \Theta}_{c}(t) \tag{14}\]2  
where \(x_{0}\rightarrow\sigma_{\Theta}\) and \(x_{1}\rightarrow\sigma_{\Theta}\). The values of \(\lambda_{1},\lambda_{2}>0\).