# Trajectory Tracking with Adaptive Robust Control for Quadrotor
## 4 Adaptive Controller and Robust Mechanisms Design
### Trajectory Following  
The control objective is for the quadrotor to follow a predefined trajectory generated by a trajectory planner to develop an adequate flight plan for the quadrotor. In Section 3, the trajectory to follow and the trajectory planner are described mathematically. The angles with more dynamics to follow the desired trajectory are the pitch and roll angles, these angles change between \(\pm 10^{\circ}\), and the yaw angle is \(5^{\circ}\) during the trajectory. Figure 4 presents the response of the adaptive controller with the different adjustment mechanisms proposed in this work; significant oscillations over the desired position are appreciated in axis-\(x\) by the adaptive controller based on the MIT, MIT with sliding modes (MIT-SM), and MIT with twisting (MIT-Twisting). The adjustment mechanism MIT with high order sliding mode (MIT-HOSM) presented smaller oscillations, and the convergence time to the desired reference is less than the adjustment mechanism MIT, MIT-SM, and MIT-Twisting; see Figure 4.  
Figure 3: Robust adaptive control scheme. Figure 5 presents the results obtained with the PD adaptive controller and the adjustment mechanism based on the MIT and sliding mode techniques. Oscillations are appreciated before converging to the desired reference with the adjustment mechanism based on MIT, MIT with sliding mode (MIT-SM), and MIT with twisting (MIT-Twisting). On the other hand, the adjustment mechanism MIT with high order sliding mode presented a better response with minor oscillations and convergence to the desired position in less time over the \(y\) axis. In Figure 6, a top perspective or top 3D view is presented to appreciate the oscillations mentioned before the desired trajectory (reference) that is followed by the quadrotor; in this figure, the PD adaptive control with the four different adjustment mechanisms proposed in this work is represented. Figure 7 presents a 3D image that represents the flight of the quadrotor with the PD adaptive controller with the different adjustment mechanisms proposed in this work. Figure 4: Trajectory following in axis-x. Figure 5: Trajectory following in axis-y. In this work, the \(\mathcal{L}_{2}\)-norm [33] is used to know the error and control signal response in a numerical form. Thus, the definition of the \(\mathcal{L}_{2}[\bar{e}_{\Theta_{m}}]\) correspond to analyze error signals and the \(\mathcal{L}_{2}[u_{\Theta}]\) correspond to controller output signals:  
\[\mathcal{L}_{2}[\bar{e}_{\Theta_{m}}]=\sqrt{\frac{1}{T-t_{0}}\int_{t_{0}}^{T} \|\bar{e}_{\Theta_{m}}\|^{2}dt} \tag{30}\]  
\[\mathcal{L}_{2}[u_{\Theta}]=\sqrt{\frac{1}{T-t_{0}}\int_{t_{0}}^{T}\|u_{\Theta }\|^{2}dt} \tag{31}\]  
Figure 8 presents the results obtained with the PD adaptive controller with the adjustment mechanism based on the methodology MIT rule and the theory by sliding modes (MIT-SM), twisting (MIT-Twisting), and high order sliding mode (MIT-HOSM). Considering the analysis with the \(\mathcal{L}_{2}[\bar{e}_{\Theta_{m}}]\) to know the error presented in the pitch angle, the adjustment mechanism with MIT rule the error in pitch angle is bigger than MIT with sliding mode (MIT-SM), MIT with twisting (MIT-Twisting), and MIT with high order sliding modes (MIT-HOSM). Then, the adaptive controller based on the MIT with high order sliding mode (MIT-HOSM) presented a more minor error than MIT, MIT-SM, and MIT-Twisting (see Table 1). Figure 6: 3D Trajectory following responses (Top perspective). Figure 7: 3D Trajectory following responses. Figure 8: Pitch angle responses. On the other hand, for pitch angle, the PD adaptive controller, which applied a bigger control response to achieve the control objective, is the adjustment mechanism based on the MIT rule. The controller that applied smaller effort to achieve the control objective is MIT's adjustment mechanism based on MIT's adjustment mechanism with high order sliding mode.