## 3 Implemented Controllers
### Optimisation Results and Simulation  
All implemented controllers are optimised via the BB-BC algorithm, described in Appendix B. The cost function of BB-BC is defined as  
\[\text{ISE}=\int{(e_{x}^{2}+e_{y}^{2})dt}. \tag{12}\]  
In the equation above, errors are defined for two axes as \(e_{x},e_{y}\) of the UAV. The error values are explained in Equation (6), and integral square error (ISE) is selected for the performance criteria of the optimisation algorithm. In the BB-BC algorithm, the population size is chosen as 50, and the maximum iteration number is selected as 200 for the optimisation process of each controller. The BB-BC optimisation algorithm is used to tune \(K_{c}\), \(T_{i}\), and \(T_{d}\) for the PID controller, and the \(K_{c}\), \(K_{d}\), \(K_{0}\), and \(K_{1}\) parameters for fuzzy-based controllers are tuned using BB-BC, separately. It is noticed that \(\alpha\) and \(\zeta\) are defined empirically. The BB-BC approach evaluation over simulated data is performed within the Matlab environment [44]. The computation times for the controllers are measured between 1 and 4 ms; these values are negligible considering the sampling time in real-time and simulation experiments. The selected controllers and their parameters are in the Python environment [45]. Control signals \(v_{x}\) and \(v_{y}\) are constrained between -12 m/s and 12 m/s during the BB-BC search.  
In Table 2, parameters of the controllers and the best performance criteria (ISE) obtained by BB-BC are listed. For tuning to the parameters of each controller, the position reference points are \(x_{ref}=1.1\) m and \(y_{ref}=0.52\) m for BB-BC optimisation.  
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**Controller** & \multicolumn{2}{c}{**Parameters**} & **ISE** \\ \hline PID & \(K_{c}=0.0472\), \(T_{i}=0.0052\), \(T_{d}=0.0445\) & & 82,133.4 \\ T1-FPID & \(K_{c}=0.019\), \(K_{d}=0.0019\), \(K_{0}=0.0001\), \(K_{1}=30\) & & 55,128.2 \\ IT2-FPID & \(K_{c}=0.019\), \(K_{d}=0.0019\), \(K_{0}=0.0001\), \(K_{1}=30\), (\(\alpha=0.25\), \(\zeta=0.5\)) \({}^{\star}\) & 36,371.9 \\ \hline \hline \end{tabular} \({}^{\star}\): These parameters have been selected before BB-BC.  
\end{table}
Table 2: Tuned parameters and their performance criteria results.  
Figure 6: The control surface differences between T1-FPID and IT2-FPID.  
The optimised controllers are tested on the simulation model, and the results can be seen in Figure 7. In the simulation, the reference signals are defined as 1.1 m for the x-axis and 0.52 m for the y-axis. They are the same as the references given in the controller parameter optimisation process using BB-BC.  
These simulation results show that the IT2-FPID controller leads to the best results, with no overshoot, the slightest steady-state error, and the rise time. In addition, T1-FPID gives a smoother response than the PID controller. Considering the compared controllers, they do not have the same system responses in both axes due to the fact that the feedbacks of the UAV in both axes have different levels of noise. The aim of choosing different levels of noise is that the payload is not connected to the CoM of the UAV, and it will have a directly different effect on the axes. Oscillation and steady-state errors seen in Figure 7 are caused by the Gaussian disturbances added to the simulation model in the testing stage to show the robustness of the compared controllers against external disturbances. Gaussian distribution parameters for the x and y axis are defined as \(N(0,5)\) and \(N(0,15)\), respectively. After testing the controllers in the simulation, the controllers are implemented in the UAV.