## 3 Results and Discussion  
### Simulation Experiments  
Let us consider the problem of searching locally best gains of the altitude PID-type controller of Bebop 2 unmanned aerial vehicle. Default gains are not made available by the Parrot company, hence the problem of finding the best gains (summarized in Table 4) has been treated at the prototyping  
Figure 7: Simplified block diagram of measurement and control signal architecture used during the experiments with in-flight tuning of controllers. stage. After development of the 3D model of this UAV (with bumpers) in the Blender software, it was implemented in the ROS/Gazebo environment, giving the physical dimensions, mass and moments of inertia from the real flying robot to its virtual counterpart embedded in the virtual Aerolab scenery. This enabled reliable preliminary experiments to be conducted in the simulator. The research purposes were set as:  
* recognizing the nature of optimized function \(J=f(k_{P},k_{D})\) for its various structures (\(\alpha=\) var, \(\beta=\) var),
* validation if given gain ranges of \(k_{P}\) and \(k_{D}\) (for a constant, very small value of \(k_{I}=0.0003\)) are safe (i.e., if the closed-loop control system is stable),
* comparative analysis of the effectiveness of GLD and FIB methods. In the first phase of the research, more than 33 hours of simulation tests were conducted. The results are presented in Figure 8. The same dynamics of the desired reference signal was set as in [26] for the FIB method. Every 12 seconds the UAV changed periodically the flight altitude (1.2\(\rightarrow\)1.9\(\rightarrow\)1.2 m). The value of \(J\) was being recorded for 10 sec repeatedly. For each combination of \(k_{P}\) and \(k_{D}\) gains, the \(J\) value was averaged from 5 trials. The results of 400 combinations of \((k_{P},k_{D})\) were recorded for three various \(J\) functions. In none of the 2000 trials, the UAV model showed dangerous behavior, and as expected: higher values of \(k_{P}\) correspond to a better quality of reference signal tracking (lower values of \(J\)). In the second phase of the research, the effectiveness of the GLD and FIB methods was compared for three initial values of the \(k_{D}\) and three \(J\) function structures. The very promising results are presented in Figure 8 and Table 5. Both methods effectively explore the gains space (\(k_{P}\), \(k_{D}\)) in search for smaller values of \(J\), avoiding the local minima (they do not \"get stuck\" in there)--see Figure 8 (right column). Depending on the set \(k_{Dinit}\) gain value, both the methods yield in similar \(k_{P}\) values, but various \(k_{D}\), slowing down the expected tracking dynamics respectively (for larger values of \(\beta\)). It is particularly noteworthy to compare the signals for subsequent set values of \(\beta\) (Figure 9). Bearing in mind the diversity of UAV applications, it is possible to shape the \"energy policy\", i.e., through an introduction of larger values of \(\beta\), one obtain a smooth, slower trajectory of the altitude signal, with a smaller control signal amplitudes (for which the \(\beta\) is punishing), which is conducive to extend the flight time. In relation to the FIB method, an additional time of 96 sec (corresponding to 8 iterations of the auto-tuning algorithm), allows the GLD method in subsequent iterations only to slightly improve the value of the \(J\) performance index (respectively by 1.62%, 0.78%, and 2.10%). The introduction of the second bootstrap is justified in the FIB method (improvement by respectively: 11.92%, 4.95%, 1.40%), while in the case of the GLD method, just only one bootstrap provides similar results. The listings from the altitude controller auto-tuning process are available for both methods in the supplementary materials at the AerLab webpage.