The operation of quadrotor drones in real-world environments is fundamentally challenged by atmospheric disturbances, with wind being the most prevalent and impactful. To ensure mission success and operational safety, the flight control system of a quadrotor drone must exhibit exceptional disturbance rejection capabilities and high control precision. Traditional control methods often fall short when faced with the complex, non-linear dynamics of a quadrotor drone coupled with stochastic environmental noise. This article presents an intelligent control strategy that leverages a Genetic Algorithm (GA) to optimize the rule base of a Fuzzy PID controller, thereby enhancing the autonomous adaptation and robustness of the quadrotor drone control system. A comprehensive wind disturbance model, derived from the statistical characteristics of natural wind, is integrated into the simulation to rigorously test the algorithm’s performance. The entire system is modeled and simulated within the MATLAB/Simulink environment.

The core challenge in controlling a quadrotor drone under wind disturbance lies in its inherent characteristics: it is an under-actuated, highly coupled, and non-linear system. The control input for the quadrotor drone is limited to the thrust and torque generated by varying the speeds of its four rotors, yet it must independently control six degrees of freedom (position and orientation). This under-actuation, combined with strong cross-coupling between rotational and translational motions, makes the quadrotor drone susceptible to external forces like wind. A sophisticated control algorithm for the quadrotor drone must not only stabilize the inherent dynamics but also actively compensate for unmeasurable and time-varying disturbances.
Mathematical Modeling of Wind Disturbance
To create a realistic test environment, the stochastic nature of natural wind must be captured mathematically. Wind is not a constant force; it exhibits continuity, burstiness, gradual changes, and randomness. Therefore, the total wind velocity $V(t)$ acting on the quadrotor drone is modeled as a weighted superposition of four fundamental components: steady wind $V_b$, gust wind $V_g$, ramp wind $V_r$, and random wind $V_n$.
The steady wind represents a constant baseline velocity:
$$V_b = K$$
where $K$ is a constant value.
The gust wind models a sudden, temporary increase in speed, characterized by a cosine function:
$$
V_g(t) =
\begin{cases}
0, & t < t_1 \\[0.5em]
\frac{V_{g_{max}}}{2} \left\{1 – \cos\left[2\pi\left(\frac{t – t_1}{T_g}\right)\right]\right\}, & t_1 \leq t \leq t_1 + T_g \\[0.5em]
0, & t > t_1 + T_g
\end{cases}
$$
where $V_{g_{max}}$ is the peak gust velocity, $t_1$ is the gust start time, and $T_g$ is the gust period.
The ramp wind simulates a gradual increase and decrease in wind speed:
$$
V_r(t) =
\begin{cases}
0, & t < t_{r1} \text{ or } t > t_{r2} + t_{r3} \\[0.5em]
V_{r_{max}} \frac{t – t_{r1}}{t_{r2} – t_{r1}}, & t_{r1} \leq t \leq t_{r2} \\[0.5em]
V_{r_{max}}, & t_{r2} < t \leq t_{r2} + t_{r3}
\end{cases}
$$
where $V_{r_{max}}$ is the peak ramp velocity, $t_{r1}$ and $t_{r2}$ are the start and end times of the increase, and $t_{r3}$ is the duration of the constant peak.
The random wind captures the turbulent, stochastic component:
$$V_n(t) = V_{n_{max}} \cdot \text{Rand}(-1, 1) \cdot \cos(\omega_n t + \phi_n)$$
where $V_{n_{max}}$ is the amplitude, $\text{Rand}(-1,1)$ is a uniformly distributed random number, $\omega_n$ is the average fluctuation frequency, and $\phi_n$ is a random phase.
The composite wind model is then:
$$V(t) = \alpha_1 V_b + \alpha_2 V_g(t) + \alpha_3 V_r(t) + \alpha_4 V_n(t)$$
with the constraint $\alpha_1 + \alpha_2 + \alpha_3 + \alpha_4 = 1$. The weights $\alpha_i$ allow the simulation of various wind conditions relevant to quadrotor drone operation.
The disturbing force $F_w$ exerted by this wind on the quadrotor drone is derived from momentum theory. Considering a constant air density $\rho$ and an effective frontal area $S$ of the drone, the force is proportional to the square of the wind velocity:
$$F_w = \frac{1}{2} \rho C_d S V(t)^2 = k V(t)^2$$
where $C_d$ is the drag coefficient and $k$ is a lumped constant. This quadratic relationship highlights the significant impact of higher wind speeds on the dynamics of the quadrotor drone.
Dynamic Model of the Quadrotor Drone
We consider an “X-configuration” quadrotor drone. Two coordinate frames are defined: the Earth-Inertial frame $E\{O_E, X_E, Y_E, Z_E\}$ and the Body-fixed frame $B\{O_B, X_B, Y_B, Z_B\}$. The attitude of the quadrotor drone is described by the Euler angles $\boldsymbol{\Theta} = [\phi, \theta, \psi]^T$ (roll, pitch, yaw). The rotation matrix from frame $B$ to frame $E$ is:
$$
\mathbf{R}_B^E =
\begin{bmatrix}
c\theta c\psi & s\phi s\theta c\psi – c\phi s\psi & c\phi s\theta c\psi + s\phi s\psi \\
c\theta s\psi & s\phi s\theta s\psi + c\phi c\psi & c\phi s\theta s\psi – s\phi c\psi \\
-s\theta & s\phi c\theta & c\phi c\theta
\end{bmatrix}
$$
where $c\cdot$ and $s\cdot$ denote $\cos(\cdot)$ and $\sin(\cdot)$, respectively.
Assuming the quadrotor drone as a rigid body and applying Newton-Euler formalism, the translational and rotational dynamics are derived. The translational dynamics in the inertial frame are:
$$
M \ddot{\mathbf{p}} = \mathbf{R}_B^E
\begin{bmatrix}
0 \\
0 \\
F_{total}
\end{bmatrix} –
\begin{bmatrix}
0 \\
0 \\
Mg
\end{bmatrix} – \mathbf{R}_B^E \gamma_t (\mathbf{R}_E^B \dot{\mathbf{p}})
$$
where:
- $M$ is the total mass of the quadrotor drone.
- $\mathbf{p} = [x, y, z]^T$ is the position vector.
- $F_{total} = \sum_{i=1}^{4} k \omega_i^2$ is the total thrust from the four rotors ($k$ is the thrust coefficient, $\omega_i$ is rotor speed).
- $\gamma_t = \text{diag}(\gamma_{tx}, \gamma_{ty}, \gamma_{tz})$ is the translational drag coefficient matrix.
- The last term represents the air resistance in the inertial frame.
The rotational dynamics in the body frame are:
$$
\mathbf{I} \dot{\boldsymbol{\Omega}}^B + \boldsymbol{\Omega}^B \times (\mathbf{I} \boldsymbol{\Omega}^B) = \boldsymbol{\tau} – \gamma_r \boldsymbol{\Omega}^B – \boldsymbol{\omega}_r \times (\mathbf{I} \boldsymbol{\omega}_r)
$$
where:
- $\mathbf{I} = \text{diag}(I_{xx}, I_{yy}, I_{zz})$ is the inertia matrix of the quadrotor drone.
- $\boldsymbol{\Omega}^B = [p, q, r]^T$ is the angular velocity vector in the body frame.
- $\boldsymbol{\tau} = [\tau_\phi, \tau_\theta, \tau_\psi]^T$ is the control torque vector.
- $\gamma_r = \text{diag}(\gamma_{r\phi}, \gamma_{r\theta}, \gamma_{r\psi})$ is the rotational drag coefficient matrix.
- $\boldsymbol{\omega}_r$ accounts for gyroscopic effects due to rotor rotation.
The control inputs for the quadrotor drone, related to rotor speeds, are:
$$
\begin{bmatrix}
F_{total} \\
\tau_\phi \\
\tau_\theta \\
\tau_\psi
\end{bmatrix}
=
\begin{bmatrix}
k & k & k & k \\
0 & -lk & 0 & lk \\
-lk & 0 & lk & 0 \\
\kappa & -\kappa & \kappa & -\kappa
\end{bmatrix}
\begin{bmatrix}
\omega_1^2 \\
\omega_2^2 \\
\omega_3^2 \\
\omega_4^2
\end{bmatrix}
$$
where $l$ is the arm length and $\kappa$ is the rotor torque coefficient. This equation defines the mapping from the four rotor speeds to the net force and torques controlling the quadrotor drone.
Fuzzy PID Controller Design for the Quadrotor Drone
To handle the non-linearity and uncertainty, a Fuzzy Logic-based PID controller is designed for the attitude control loops (roll, pitch, yaw) of the quadrotor drone. The structure of the Fuzzy PID controller for one attitude channel is shown below. It takes the tracking error $e$ and the error derivative $\dot{e}$ as inputs and outputs real-time adjustments $\Delta K_p, \Delta K_i, \Delta K_d$ to the base PID parameters.
The fuzzy sets for both inputs and outputs are defined as: {Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (ZE), Positive Small (PS), Positive Medium (PM), Positive Big (PB)}. The universes of discourse are normalized to the interval $[-6, 6]$. The initial rule base, which is later optimized for the quadrotor drone, is typically built from expert knowledge relating error states to necessary control actions. A subset of the initial rule table for $\Delta K_p$ is presented below:
| $\dot{e}$ \ $e$ | NB | NM | NS | ZE | PS | PM | PB |
|---|---|---|---|---|---|---|---|
| NB | PB | PB | PM | PM | PS | ZE | ZE |
| NM | PB | PB | PM | PS | PS | ZE | NS |
| NS | PM | PM | PM | PS | ZE | NS | NS |
| ZE | PM | PM | PS | ZE | NS | NM | NM |
| PS | PS | PS | ZE | NS | NS | NM | NM |
| PM | PS | ZE | NS | NM | NM | NM | NB |
| PB | ZE | ZE | NS | NM | NM | NB | NB |
The final PID gains applied to the quadrotor drone are:
$$K_p = K_{p0} + \Delta K_p, \quad K_i = K_{i0} + \Delta K_i, \quad K_d = K_{d0} + \Delta K_d$$
where $K_{p0}, K_{i0}, K_{d0}$ are the initial baseline PID gains for the quadrotor drone.
Genetic Algorithm Optimization of Fuzzy Rules
While the fuzzy PID controller offers adaptability, its performance for a specific quadrotor drone under specific disturbances like wind heavily depends on the rule base. Manually tuning 49 rules (7×7) for three outputs is impractical. Therefore, a Genetic Algorithm is employed to automatically learn and optimize the rule base, giving the quadrotor drone controller a self-improving capability.
1. Chromosome Encoding: Each fuzzy output set (NB, NM, …, PB) is assigned a 3-bit binary code (e.g., 000, 001, …, 110). Since there are 49 rules and each rule has 3 outputs ($\Delta K_p, \Delta K_i, \Delta K_d$), one complete rule base is encoded as a binary string (chromosome) of length $49 \times 3 \times 3 = 441$ bits.
2. Fitness Function: The performance of a candidate rule set (chromosome) is evaluated by simulating the closed-loop quadrotor drone system under the defined wind disturbance. The fitness function $J$ must reflect the control objective: minimize attitude error under disturbance. We use the Integral of Absolute Error (IAE):
$$J = \int_{0}^{T} |e(t)| dt = \int_{0}^{T} |\theta_{desired}(t) – \theta_{actual}(t)| dt$$
A lower $J$ indicates better disturbance rejection for the quadrotor drone, hence a higher fitness. The fitness for selection is defined as $F = 1 / (J + \epsilon)$ to ensure a positive, maximizing objective.
3. Genetic Operators:
- Selection: Roulette wheel selection is used, where the probability $P_i$ of selecting chromosome $i$ from a population of size $N$ is proportional to its fitness: $$P_i = \frac{F_i}{\sum_{j=1}^{N} F_j}$$
- Crossover: A multi-point crossover is applied. Points are randomly selected at rule boundaries, and segments are exchanged between two parent chromosomes to create offspring. The crossover probability is set high (e.g., $p_c = 0.8$).
- Mutation: Each bit in the offspring chromosome has a small probability (e.g., $p_m = 0.01$) of being flipped (0 to 1 or 1 to 0). This introduces new genetic material into the population.
4. Algorithm Flow: The GA runs for a predefined number of generations. In each generation, the quadrotor drone model is simulated for every individual (rule set) in the population, its fitness is calculated, and selection, crossover, and mutation produce a new generation. The best-performing rule set for the quadrotor drone emerges over generations.
Simulation Results and Analysis
The proposed algorithm is implemented in MATLAB/Simulink. The parameters for the quadrotor drone model are based on a real platform, as listed in the table below:
| Parameter | Symbol | Value | Unit |
|---|---|---|---|
| Mass | $M$ | 1.39 | kg |
| Arm Length | $l$ | 0.23 | m |
| Thrust Coefficient | $k$ | $8.0 \times 10^{-7}$ | N·s² |
| Drag Coefficient (Rot.) | $\gamma_r$ | diag(0.3, 0.3, 0.2) | N·m·s |
| Inertia (Ixx, Iyy, Izz) | $\mathbf{I}$ | $(8.6, 8.6, 15.23) \times 10^{-5}$ | kg·m² |
The composite wind disturbance $V(t)$ is generated with equal weights ($\alpha_i=0.25$) to create a complex profile with steady, gusty, and random components, providing a rigorous test for the quadrotor drone controller.
Experiment 1: Performance of the Optimized Controller. The GA was run for 50 generations with a population of 40. The optimized fuzzy rule set was deployed in the Fuzzy PID controller. The quadrotor drone was commanded to maintain attitude setpoints ($\phi_{des}=10^\circ$, $\theta_{des}=15^\circ$, $\psi_{des}=20^\circ$) while subjected to the wind disturbance. The results show that the quadrotor drone stabilized effectively. Although small oscillations persisted due to the continuous random wind component, the amplitude was minimal, and the quadrotor drone accurately tracked the commanded angles, demonstrating strong disturbance rejection.
Experiment 2: Comparative Analysis. To quantify the improvement, the performance of the GA-optimized Fuzzy PID controller was compared against a standard Fuzzy PID controller with a manually designed, conventional rule base. The comparison metric is the Integral of Absolute Error (IAE) for each attitude angle over the simulation period. The results are summarized below:
| Controller Type | Roll IAE (deg·s) | Pitch IAE (deg·s) | Yaw IAE (deg·s) | Total IAE |
|---|---|---|---|---|
| Standard Fuzzy PID | 4.82 | 6.15 | 3.91 | 14.88 |
| GA-Optimized Fuzzy PID | 1.23 | 1.87 | 0.95 | 4.05 |
| Improvement | ~74% | ~70% | ~76% | ~73% |
The time-domain responses clearly show the superior performance of the optimized controller for the quadrotor drone. The standard Fuzzy PID controller exhibited larger overshoot, longer settling time, and sustained oscillations in the presence of wind gusts. In contrast, the quadrotor drone controlled by the GA-optimized system showed significantly damped oscillations, faster recovery from gusts, and overall tighter regulation around the setpoint. This demonstrates that the Genetic Algorithm successfully evolved a rule base specifically tailored to mitigate the effects of the complex wind disturbance model on the non-linear dynamics of the quadrotor drone.
Conclusion
This article presented an intelligent control framework to enhance the flight performance of a quadrotor drone operating in windy conditions. The key contribution is the integration of a Genetic Algorithm with a Fuzzy PID controller to form an adaptive, self-optimizing control system for the quadrotor drone. By encoding the fuzzy rule base into a genetic chromosome and using the quadrotor drone’s attitude tracking error under a realistic wind disturbance as the fitness metric, the algorithm autonomously discovers high-performance control rules. The wind disturbance model, incorporating steady, gust, ramp, and random components, provides a comprehensive and challenging test environment. Simulation results conclusively demonstrate that the GA-optimized controller achieves a reduction of approximately 73% in total attitude error compared to a standard fuzzy PID controller, significantly improving the disturbance rejection capability and control precision of the quadrotor drone. This method offers a promising pathway for developing more autonomous and robust flight control systems for quadrotor drones intended for operation in complex, real-world atmospheres. Future work involves implementing this algorithm on actual quadrotor drone hardware and investigating more efficient evolutionary strategies to reduce the computational cost of online adaptation.
