## 3 Simulation and Experimental Validation
### Numerical Validation on a Robotic System
#### 3.1.2 Example 2: Discontinuously Changing Setpoint
: _The Simulink support package for Parrot Minidrones has undergone extensive validation, demonstrating high accuracy in approximating the real-time behavior of these drones._  
**Remark 6**. : _According to the right-hand rule, which is the standard convention in aeronautics, the altitude axis \(Z_{b}\) is defined as negative in the upward direction. This ensures consistency with the body-fixed coordinate system, where the \(X_{b}\)-axis points forward and the \(Y_{b}\)-axis points to the right of the drone [25]._  
As in the previous examples, the analytical design of the thrust PID controller is omitted. Instead, the default gains provided by the MATLAB's toolbox, together with the control scheme discussed above, are used to achieve take-off and landing of the Parrot Rolling Spider depicted in Figure 2.4 It is important to mention that the default thrust PID  
Figure 2.5 Schematic of a generic quadcopter [25]. Figure 2.6 Preview of the VRML environment in the Simulink Support Package for Parrot Minidrones [25]. controller has the form of (2) but works in discrete time, with the following gains: \(K_{P}=0.8\), \(K_{I}=0\), \(K_{D}=0.3\), and \(N=50\). In practice, this results in a PD controller. Before implementing the hybrid PID controller on the Parrot Rolling Spider in real-time, simulations were conducted using the MATLAB toolbox. In these simulations, the drone was required to take off and stabilize at an altitude of \(x_{sp1}=1\) m. Then, at \(t=3\) s, the setpoint was increased to \(x_{sp2}=1.4\) m. At \(t=6\) s, the setpoint was decreased to \(x_{sp3}=0.7\) m, followed by a final setpoint change to \(x_{sp4}=0.2\) m at \(t=8\) s. The landing was completed by turning off the motors at \(t=10\) s.  
The four cases considered were the (1) original PID, (2) hybrid PID with \(\alpha=0.5\), (3) hybrid PID with \(\alpha=1\), and (4) hybrid PID with \(\alpha=2\). The results are presented in Figures 17-22. **Remark 7**. : _As expected, from Figures 15-22, it can be observed that the drone reaches the setpoints more smoothly when the hybrid controller is used, requiring less effort from the actuators and consequently saving energy. Furthermore, it is evident that smaller values of \(\alpha\) result in a slower response towards the setpoint. It is important to note that the PID gains remain the same for all cases, as mentioned above._  
Figure 2.7 Parrot Rolling Spider. Figure 2.8 Altitude response of the drone compared to the reference trajectory in different PID control strategies. Figure 2.9 Behavior of the rotor input \(u_{2}\) under the influence of different PID controllers. Figure 7:0 Behavior of the rotor input \(u_{3}\) under the influence of different PID controllers. The same flight scheme was applied to the Parrot Rolling Spider in real-time with two control schemes: (1) the default PID provided by the MATLAB toolbox and (2) the hybrid PID controller with \(\alpha=1\). The real-time flight data are presented in Figures 23-27. Figure 7:1 Behavior of the rotor input \(u_{4}\) under the influence of different PID controllers. Figure 7:2 States of the hybrid system and the exponential reference. Figure 7:3 Behavior of the rotor input \(u_{3}\) under the influence of different PID controllers. Figure 7:4 Behavior of the rotor input \(u_{1}\) under the influence of different PID controllers. Figure 7:5 Behavior of the rotor input \(u_{2}\) under the influence of different PID controllers.