Abstract
This article proposes a hybrid algorithm that combines Bacterial Foraging (BF) and Particle Swarm Optimization (PSO) to optimize the control parameters: Integral (I) controller plus Fuzzy-like Proportional and Derivative (Fuzzy-like PD) as the Fuzzy Scaling Factors (FSF) of the Fuzzy controller. The fitness function integral of time multiplied absolute error (ITAE) was utilized as a minima criterion to assess the control design effectiveness. The proposed controller is then applied to pilot a UAV Quadcopter model for usage in a variety of agricultural applications, including field observation, crop health monitoring, pesticide spraying, disease detection, etc. The numerical simulations perform the validity of the fast responses, stable and reliable without error.
Keywords
Introduction
Based on expert information, the Fuzzy Logic Controllers (FLC) have the advantage of solving issues that cannot be addressed by human operators. Many control system issues have been successfully addressed by it, and it has even provided better results than other approaches.1–7 In situations where information about the physical process is vague and data is scarce, fuzzy rule models are a good choice. A fuzzy triangular membership function is designed and the controller parameters are optimized in this article. The proposed control integral (I) + proportional derivative (PD) like Fuzzy control comprises the specified gains I and P, D as the inputs Scaling Factors (SF) in Fuzzy Inference System (FIS). 7 Stability is maintained by using PD, and steady-state error is eliminated by using FIS. Although evolutionary algorithms such as Simulated Annealing (SA), Genetic Algorithm (GA), Particle Swarm Optimization (PSO) and Bacterial Foraging (BF) can easily detect the local minima, but it is difficult to detect the global optimization.8–9
PSO10–13 is a population-based heuristic algorithm that is inspired by animal swarm social behavior to detect accurate targets in multi-dimensional space. PSO uses particles (individuals), which are iteratively updated in each iteration, to perform searches. For finding the optimal solution, each particle decides its search direction based on its best previous location (cognitive part) and all other members’ best locations (social part).
In 2002, K. M. Passino 14 proposed a novel bionic algorithm that was inspired by the bacteria foraging behavior of Escherichia-coli bacteria. The algorithm is highly effective for distributed optimization and control design. This algorithm encourages the foraging strategies of the bacteria genes in the evaluation chain, which results in breeding the most effective bacterium for the next generation. The E-coli bacteria foraging progression to global searching capability is characterized by four steps of Chemo-tactic, Swarming, Reproduction and Elimination–Dispersal. In the entire process, the most critical step is reproduction since it maintains a constant population. BF algorithm is excellent for local search; however, it is rarely successful at reaching global solutions because of the random search directions during chemotaxis. Thus, this article proposed the combination of BF and PSO,15–22 which can upgrade the advantages of each algorithm as well as eliminate their drawbacks, for controlling the Quadcopter UAV models via its attitude pilot models.23–27
This improved algorithm modifies the global search efficiency and speeds up the convergence of the shorter operated generation. Several studies have used the minimizing integral of time multiplied absolute error (ITAE) criterion as a reliable performance index criterion,28–31 especially for digital systems and optimization control cost functions. In addition, the proposed controller can solve the control problem in a single step. This means that a shorter operation period is required to achieve full control of an agricultural Quadcopter in terms of smooth manoeuvres, high stability, fast response, and reliability without error.
The remainder of this article is organized as follows: Section 2 presents a quadcopter model that is suitable for use in agricultural fields. In section 3, we will illustrate an optimization algorithm that can be used to find the ideal gains of the controller design: I + PD like Fuzzy. Through its roll/pitch and yaw attitude pilot channels, Section 4 performs the Quadcopter system responses. It also provides the critical information of the proposed algorithm, such as reproduction surface, histogram of local and global best position, and cost function. Finally, Section 5 is the conclusion.
An agriculture Quadcopter model
UAVs, namely drones, have received considerable attention in recent years for their application in a range of fields such as civil information, rescue activities, coastal surveillance missions, and especially in agricultural applications. Its advanced capabilities enable efficient field observation, ensuring accurate and comprehensive data collection. Additionally, the model's crop health monitoring functionalities provide valuable insights into plant growth and identify potential issues. With the integration of pesticide spraying capabilities, the UAV Quadcopter effectively combats pests and maximizes crop yield. Furthermore, the disease detection feature facilitates early identification and intervention, preventing widespread crop damage. The proposed controller designs drastically enhance the performance and efficiency of the UAV Quadcopter in agricultural applications.
A quadrotor or quadcopter is one of the drone's symbolic designs. The quadcopter is a flying aerial vehicle with considerable complexity and flexibility. Its dynamic models were developed based on Euler-Lagrange formalism. In Figure 1, which is derived from [23 and 24], the UAV is depicted using the north, west, and up (NWU) axes relative to generalized earth coordinate systems, as well as a right-hand non-inertial frame for the quadcopter. Its structure can be configured with four rotor-propellers in the cross configuration. Each pair of propellers (1 and 3) rotates clockwise whereas (2 and 4) rotates counter-clockwise, indicating that they turn in opposite directions. One can change the lift force and create motion by varying the rotor speed. As a result, vertical motion is generated by simultaneously increasing or reducing the speeds of all four propellers. Changing the speed of 2 and 4 propellers’ conversely produces roll rotation coupled with lateral motion. Pitch rotation and the corresponding lateral motion result from 1 and 3 propellers’ speeds changing in the opposite direction. Yaw rotation is more subtle, resulting from the difference in the counter-torque between each pair of propellers. Despite having four actuators, the quadcopter remains underactuated and dynamically unstable. Quadcopter control commands are identical to those used in helicopters, including collective, lateral (angle θ), longitudinal (angle φ), and yaw/pedal (angle ψ).

An agricultural Quadcopter model.
Controller design
PID proportional–integral–derivative controller
The PID control, which is implemented in this article, is high efficiency despite possessing a simplistic structure. The system's design can reduce settling time while improving stability. The traditional PID controller combined gain in the Laplace domain is computed from the following Eq. (1).
Where, s is the complex frequency, KP KI and KD are proportional, integral and derivative gains, respectively.
The FLC dynamic behavior is based on a set of linguistic rules and originated from expert knowledge.
7
The designer needs to decide the input and output variables for building a suitable set of fuzzy rules. In this research, we choose the error e(t) and the error rate de(t)/dt as input variables, while the output is considered as

Fuzzification inference system.
Fuzzy controller rule base.
An intelligent control applied to agricultural quadcopter is the PD-like Fuzzy controller. In this way, FLC is utilized as a counterpart to standard PD controller and overcomes its weakness. It is essential to select the input and output variables and the proper controller rules, as illustrated in equation (2).
Where KI is the integral gain while KP and KD are proportional and differential gains which are called scaling factors, e(t) is the error and de(t) is the change in error.
In order to optimize the SF as the inputs of PD-like fuzzy controller (FSF) and the integral I control parameter, the proposed optimization algorithms are presented in the following sub-sections.
PSO algorithm
Recently, the PSO has arisen as one of the most renowned and prevailing tools for optimization. Our goal is to adapt and improve the PSO algorithm for pilot control. Specifically, the PSO algorithm is combined with another effective optimization algorithm to optimally tune the PD controller gains. The PSO implementation process is illustrated by the flow chart in Figure 3. The PSO mathematical equations (3) and equation (4) are briefly described as follows:

Hybrid PSO reinforce BP control algorithm.
Where V is particle velocity, P is the current position, Pbest is local best position while Gbest is global best position; ω is the inertia weighting factor, c1 and c2 are learning rates. The variables r1 and r2 are random distribution values ɛ [0-1]. The following parameters were selected to implement the algorithm: max generation or iteration, population of swarms, inertia weight, and a balance between global and local search. c1 and c2, are known as acceleration coefficients.
The BF algorithm is derived from a search and optimal foraging algorithm that utilizes Escherichia coli (E. coli) bacteria's
14
abilities to survive in a natural changing environment as input. Their motile behavior is crucial to maintaining their effective foraging strategy as their strategy evolves. This is because they need to reshape or even eliminate poor strategies as they pursue food. As the evaluation chain proceeds, the bacteria with the better foraging strategy are propagated and reproduced in next generations. As E. coli bacteria forage, their progression to global searching capability takes place in four stages: Chemo-tactic (
In the first step, Chemo-tactic (
This algorithm has found numerous applications in optimization. Soon after BF algorithm was invented, it has been widely used for optimization in numerous science and technology fields. In this article, we implement the BF algorithm using six parameters as follows: number of bacteria (
Several works15–22 combined the PSO capability of social information exchange with the BF capability of finding new solutions through elimination and dispersal. The combination was called hybrid BF-PSO, which combines the strengths of the two algorithms. To speed up the convergence of optimization methodology, the proposed hBF-PSO algorithm considers the individual best locations and global best locations concurrently when assigning the specified search directions. Identifying the principles of PSO updates the position and velocity of bacteria as well. The chosen information and optimization parameters, such as the dimension of search space (
According to the proposed hBF-PSO algorithm, the most of two important steps are briefly demonstrated in Figure 3:
update local best position and global best position of bacterium by PSO algorithm and reproduction step creates a new population by deleting the weak bacterium while the strong bacterium splits into two, maintaining the same population density.
To build the quadcopter controller, we use the hBF-PSO algorithm to find the optimal values for three parameters: the I integral gains and the PD-like Fuzzy control scaling factor. In the control diagram illustrated in Figure 3, the tracking error e(t) and differential tracking error de(t) are employed as the inputs to the FIS. Three main parameters KI and KP and KD of the PD-like Fuzzy control are then optimally tuned with the ITAE performance index28–31 in terms of the settling time, the rise time, the overshoot and the tracking error of the proposed controller design, as demonstrated in equation (7).
The information and optimization parameters utilized in the hBF-PSO technique are obtained and displayed on Table 2 to present the configuration of the user's experimental controller designs. The I + PD like Fuzzy parameters are set in the range [0-50] and their optimized are displayed on Table 3. The MATLAB software platform is utilized to perform the numerical simulation results. The simulation sampling time is 0.01 s. The most important two steps of the proposed hBF-PSO algorithm are:
reproduction step to maintain the population and, update local and global best position of bacterium by PSO.
Algorithms parameters setup.
The BF-PSO proposed tuning gain results.

Quadcopter pilot control angle Phi (Roll) and Theta (Pitch). Descend order: (a) Histogram of Local best position, (b) Histogram of Global best position, (c) Reproduction surface, (d) Cost function and (e) Roll and Pitch control response.

Quadcopter pilot control angle Psi (Yaw). Descend order: (a) Histogram of Local best position, (b) Histogram of Global best position, (c) Reproduction surface, (d) Cost function and (e) Yaw control response.

Quadcopter rotor speed control. Descend order: (a) Histogram of Local best position, (b) Histogram of Global best position, (c) Reproduction surface, (d) Cost function and (e) Speed control response.
The quadcopter UAV pilot control is handled by three channels: Roll. Pitch and Yaw. Because the quadcopter is asymmetrically actuated, the roll and pitch pilot channels are similar. The quadcopter attitude control acts are displayed in each channel: roll angle and pitch angle are set to −5 degree and Yaw angle is set to 2 degree as shown in Figures. 4 and 5, respectively. Besides, the speed of rotor (m/s) is also performed in Figure 6. The referential transfer functions of quadcopter models are shortly described.
− Roll channel (Lateral) and Pitch channel (Longitudinal): − Yaw channel (Pedal): − Rotor speed control:
Each figure presents five data information in descending order: (a) Histogram of Local best position, (b) Histogram of Global best position, (c) Reproduction 3D surface, (d) Cost function and (e) Control response. Performance results are reached after just 0.2 s for the roll and pitch channel, whereas the Yaw channel takes 0.5 s. When compared to other quadrotor controller design,23,24 this I + PD-like Fuzzy control algorithm achieved a fast response time of nearly 0.2 s, however its performance on the roll and pitch channels in Figure 4 is better without overshoot. Despite not performing as well as the reference on the yaw pilot channel, its response did not show the undershoot in Figure 5. The Figure 6 depicts the DC rotor speed control, which is a critical component for any flying UAV. In comparison to other DC motor control algorithms,18–21 this proposed algorithm achieves the target in less than 0.2 s and is completely stable. Overall, it would be desirable to use the hBF-PSO algorithm to better model a quadcopter pilot.
This article demonstrates that the proposed controller is successfully designed to operate an agricultural quadcopter model by combining integral gain plus proportional derivative gain as scaling factors of fuzzy control to pilot quadcopter's roll, pitch, and yaw channels. The foregoing benefits are further refined to identify the best system parameters using the hBP-PSO algorithm and a minimal criterion cost function. Based on the experimental performances, it can be determined that the attitude quadcopter controls respond quickly, are steady, and are reliable without overshoots and error.
Footnotes
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
