**2. Materials and Methods**

The proposed scheme combines a Cascaded-PID with a Fuzzy algorithm that is responsible for calculating the PID gains. In the so-called fuzzy controller, the control strategy is described through linguistic rules that imprecisely connect various situations with the actions taken. Different from the traditional PID controller, a formal mathematical model of the plant is not necessary. Approximately knowing the UAV's behavior when exposed to different inputs is enough for defining the fuzzy rules, which is a feasible task to UAV specialists. Therefore, these linguistic rules that define the control strategy represent the linguistic model of the plant. Note that Fuzzy and the PID can provide an effective solution to the system's non-linearity. As a result, the system can accurately converge to the desired position in fewer iterations.

In the beginning, suitable PID values may be defined for the PID controller. As time goes by, such gains are updated dynamically by the Fuzzy algorithm, whose rules are only dependent on the position error and its derivative.

Figure 1 depicts the designed iterative learning control algorithm, along with the real-time management of Fuzzy gain computation. The UAV Desired Position is the commanded waypoint that the UAV should go to. The desired position can be changed at any time during the process, allowing the system to follow a moving goal or a trajectory, for example.

It is important to note that one independent Fuzzy Logic controller must be set for each control axis (x, y and z). In this work, the methods, figures and tables will be only relative to the x-axis to avoid unnecessary repetition.

**Figure 1.** Scheme of fuzzy addition to the PID controller.
