In recent years, the quadrotor drone has become increasingly prevalent in precision agriculture, particularly for plant protection tasks such as pesticide spraying and crop monitoring. The quadrotor drone offers advantages like simple structure, high maneuverability, compact size, and low cost, enabling efficient operations in confined spaces. However, due to its low-altitude flight profile during agricultural missions, the quadrotor drone is highly susceptible to environmental wind fields, which can induce instability and reduce control accuracy. This paper addresses the challenge of modeling and controlling a quadrotor drone under wind disturbances, with a focus on applications in plant protection. We develop a comprehensive dynamics model incorporating wind effects and design a robust control strategy based on inner-outer loop PID architecture. The controller leverages quaternion-based feedback for attitude control to avoid singularities and ensures global asymptotic stability via Lyapunov analysis. Experimental validation through Gazebo simulations and real-world flight tests demonstrates the effectiveness of our approach in maintaining stable flight under wind conditions. Throughout this work, the term “quadrotor drone” is emphasized to highlight its centrality in agricultural robotics.
The quadrotor drone is an underactuated, nonlinear system with six degrees of freedom (position and orientation) but only four control inputs (rotor thrusts). This inherent complexity is exacerbated by wind disturbances, which introduce additional forces and moments. To tackle this, we first establish a dynamics model using the Newton-Euler formalism, accounting for wind interactions through a novel weighting function that captures differential rotor exposures. The controller design integrates an inner loop for attitude rate control using PID regulators and an outer loop for position control combining P and PID elements. Our contributions include a validated model that realistically represents wind effects on a quadrotor drone and a control framework that ensures robustness in turbulent environments. This research aims to enhance the reliability of quadrotor drones in agricultural settings, where wind is a common disturbance.
Dynamics Modeling of Quadrotor Drone under Wind Disturbance
To model the quadrotor drone dynamics, we define two coordinate frames: the inertial frame $O_eX_eY_eZ_e$ (Earth-fixed) and the body frame $O_bX_bY_bZ_b$ (attached to the drone). The inertial frame origin $O_e$ is at the takeoff point, with $O_eX_e$ pointing north, $O_eZ_e$ downward, and $O_eY_e$ determined by the right-hand rule. The body frame origin $O_b$ is at the drone’s center of mass, with $O_bX_b$ forward, $O_bZ_b$ downward, and $O_bY_b$ lateral. The transformation between frames is given by the rotation matrix $R^e_b$, which depends on the Euler angles $\phi$ (roll), $\theta$ (pitch), and $\psi$ (yaw):
$$ R^e_b = R_x(\phi) R_y(\theta) R_z(\psi) = \begin{bmatrix} C_\theta C_\psi & -C_\phi S_\psi + S_\phi S_\theta C_\psi & S_\phi S_\psi + C_\phi S_\theta C_\psi \\ C_\theta S_\psi & C_\phi C_\psi + S_\phi S_\theta S_\psi & -S_\phi C_\psi + C_\phi S_\theta S_\psi \\ -S_\theta & S_\phi C_\theta & C_\phi C_\theta \end{bmatrix} $$
where $C_\cdot = \cos(\cdot)$ and $S_\cdot = \sin(\cdot)$. The inverse transformation is $R^b_e = (R^e_b)^T$.
Using the Newton-Euler equations, the dynamics of the quadrotor drone are expressed as:
$$ \sum \mathbf{F} = m \dot{\mathbf{v}}_e + m \boldsymbol{\omega}_e \times \mathbf{v}_e $$
$$ \sum \mathbf{M} = \mathbf{J} \dot{\boldsymbol{\omega}}_b + \boldsymbol{\omega}_b \times \mathbf{J} \boldsymbol{\omega}_b $$
Here, $m$ is the mass, $\mathbf{v}_e$ is the translational velocity in the inertial frame, $\boldsymbol{\omega}_b$ is the angular velocity in the body frame, and $\mathbf{J}$ is the inertia matrix. Wind disturbances affect the quadrotor drone through two primary mechanisms: drag on the fuselage and rotor-wind interactions.
The drag force on the fuselage is modeled as:
$$ \mathbf{F}^e_{drag} = C_d \rho A \frac{\mathbf{V}^e_{air}}{2} $$
where $C_d$ is the drag coefficient, $\rho$ is air density, $A$ is the effective frontal area, and $\mathbf{V}^e_{air} = \mathbf{V}^e – \mathbf{V}^e_{wind}$ is the relative airspeed, with $\mathbf{V}^e$ being the drone’s velocity and $\mathbf{V}^e_{wind}$ the wind velocity in the inertial frame.
For rotor-wind interactions, we adopt Khan’s model, which accounts for lateral force $\mathbf{F}_{prop}$, pitching moment $\mathbf{M}_{pitch}$, and additional thrust $T_{add}$ on each rotor. However, due to the positioning of rotors on a quadrotor drone, not all rotors are equally exposed to wind; upstream rotors disrupt airflow for downstream ones. To capture this, we introduce a weighting function that assigns a value $\lambda_i \in [0,1]$ to each rotor $i$, where $\lambda_i = 1$ indicates full exposure and $\lambda_i = 0$ indicates no direct wind contact. The weight vector $\mathbf{C} = [\lambda_1, \lambda_2, \lambda_3, \lambda_4]^T$ modulates the wind-induced effects. Thus, the net wind-induced forces and moments on the quadrotor drone are:
$$ \mathbf{F}^e_{wind} = \mathbf{T}^b_{add} + \mathbf{F}^e_{prop} + \mathbf{F}^e_{drag} = \begin{bmatrix} F^e_{drag,x} + \sum_{i=1}^4 C_i F^e_{prop_i,x} \\ F^e_{drag,y} + \sum_{i=1}^4 C_i F^e_{prop_i,y} \\ \sum_{i=1}^4 C_i T^e_{add_i} \end{bmatrix} $$
$$ \mathbf{M}^b_{wind} = \begin{bmatrix} M^b_{wind,x} \\ M^b_{wind,y} \\ M^b_{wind,z} \end{bmatrix} $$
with $M^b_{wind,x} = \frac{l}{2}(C_1 T^b_{add_1} + C_2 T^b_{add_2} – C_3 T^b_{add_3} – C_4 T^b_{add_4})$, $M^b_{wind,y} = \frac{l}{2}(C_1 T^b_{add_1} – C_2 T^b_{add_2} – C_3 T^b_{add_3} + C_4 T^b_{add_4}) + M^b_{pitch}$, and $M^b_{wind,z} = 0$, where $l$ is the arm length from rotor to center of mass.
The translational dynamics of the quadrotor drone are derived from Newton’s law:
$$ \sum \mathbf{F}^e = R^e_b \left( \sum_{i=1}^4 \mathbf{T}^b_i + \mathbf{T}^b_{add} \right) + m\mathbf{g} + \mathbf{F}^e_{prop} + \mathbf{F}^e_{drag} $$
where $\mathbf{T}^b_i$ is the thrust from rotor $i$ (along $-O_bZ_b$), $\mathbf{g} = [0,0,g]^T$ is gravity, and rotor thrust and torque follow the blade element theory: $T^b_i = k_T \Omega_i^2$ and $M^b_i = k_M \Omega_i^2$, with $k_T$ and $k_M$ as coefficients. Substituting yields:
$$ \ddot{X} = \left( \sum_{i=1}^4 k_T \Omega_i^2 \right) (S_\phi S_\psi + C_\phi S_\theta C_\psi) / m + \left( \sum_{i=1}^4 C_i F^e_{prop_i,x} + F^e_{drag,x} \right) / m $$
$$ \ddot{Y} = \left( \sum_{i=1}^4 k_T \Omega_i^2 \right) (S_\psi S_\theta C_\phi – C_\psi S_\phi) / m + \left( \sum_{i=1}^4 C_i F^e_{prop_i,y} + F^e_{drag,y} \right) / m $$
$$ \ddot{Z} = -g + \left( \sum_{i=1}^4 k_T \Omega_i^2 + C_i T^b_{add,i} \right) (C_\psi C_\phi) / m $$
The rotational dynamics from Euler’s equation are:
$$ \sum \mathbf{M}^b = \mathbf{J} \dot{\boldsymbol{\omega}}_b + \boldsymbol{\omega}_b \times \mathbf{J} \boldsymbol{\omega}_b + \mathbf{M}^b_G + \mathbf{M}^b_{wind} $$
where $\mathbf{M}^b_G = [-J_r q \Omega, J_r p \Omega, 0]^T$ is the gyroscopic moment from rotor spin, $J_r$ is rotor inertia, and $\Omega = \Omega_1 – \Omega_2 + \Omega_3 – \Omega_4$ is the net rotor speed. With $\boldsymbol{\omega}_b = [p, q, r]^T$, the dynamics become:
$$ \dot{p} = [qr(I_{yy} – I_{zz}) + M^b_x + J_r q \Omega – M^b_{wind,x}] / I_{xx} $$
$$ \dot{q} = [pr(I_{zz} – I_{xx}) + M^b_y – J_r p \Omega – M^b_{wind,y}] / I_{yy} $$
$$ \dot{r} = [pq(I_{xx} – I_{yy}) + M^b_z] / I_{zz} $$
Assuming small-angle approximations ($\sin \cdot \approx 0$, $\cos \cdot \approx 1$) and introducing control inputs $\mathbf{U} = [U_1, U_2, U_3, U_4]^T$, we obtain the simplified dynamics model for the quadrotor drone:
$$ \ddot{X} = U_1 (S_\phi S_\psi + C_\phi S_\theta C_\psi) + \left( \sum_{i=1}^4 C_i F^e_{prop_i,x} + F^e_{drag,x} \right) / m $$
$$ \ddot{Y} = U_1 (S_\psi S_\theta C_\phi – C_\psi S_\phi) + \left( \sum_{i=1}^4 C_i F^e_{prop_i,y} + F^e_{drag,y} \right) / m $$
$$ \ddot{Z} = -g + U_1 (C_\psi C_\phi) + \left( \sum_{i=1}^4 C_i T^e_{add,i} \right) / m $$
$$ \ddot{\phi} = (U_2 – l K_2 \dot{\phi}) / I_{xx} + (J_r q \Omega – M^b_{wind,x}) / I_{xx} $$
$$ \ddot{\theta} = (U_3 – l K_3 \dot{\theta}) / I_{yy} + (-M^b_{wind,y} – J_r p \Omega) / I_{yy} $$
$$ \ddot{\psi} = (U_4 – l K_4 \dot{\psi}) / I_{zz} $$
where $K_2, K_3, K_4$ are rotational damping coefficients, and the control vector is:
$$ \mathbf{U} = \begin{bmatrix} k_T (\Omega_1^2 + \Omega_2^2 + \Omega_3^2 + \Omega_4^2) / m \\ \sqrt{2} k_T l (\Omega_1^2 + \Omega_2^2 – \Omega_3^2 – \Omega_4^2) / (2 I_{xx}) \\ \sqrt{2} k_T l (\Omega_1^2 – \Omega_2^2 – \Omega_3^2 + \Omega_4^2) / (2 I_{yy}) \\ k_M (\Omega_1^2 – \Omega_2^2 + \Omega_3^2 – \Omega_4^2) / I_{zz} \end{bmatrix} $$
This model forms the basis for controller design. Key parameters for a typical quadrotor drone used in plant protection are summarized in Table 1.
| Parameter | Description | Unit | Value |
|---|---|---|---|
| $m$ | Mass of quadrotor drone | kg | 1.7 |
| $l$ | Arm length | m | 0.205 |
| $J_r$ | Rotor inertia | kg·m² | 6.83×10⁻⁵ |
| $I_{xx}$ | Moment of inertia about X-axis | kg·m² | 7.50×10⁻³ |
| $I_{yy}$ | Moment of inertia about Y-axis | kg·m² | 7.50×10⁻³ |
| $I_{zz}$ | Moment of inertia about Z-axis | kg·m² | 2.718×10⁻² |
| $k_T$ | Thrust coefficient | N·s² | 6.012×10⁻⁸ |
| $k_M$ | Torque coefficient | N·m·s² | 7.021×10⁻⁷ |
| $C_d$ | Drag coefficient | – | 0.5 |
| $\rho$ | Air density | kg/m³ | 1.225 |
This table encapsulates critical parameters that influence the dynamics of a quadrotor drone under wind. The weighting function $\lambda_i$ for wind exposure can be computed based on relative wind direction and rotor positions, but for simplicity, we assume $\lambda_i = 1$ for all rotors in initial simulations, later refining it with experimental data.
Controller Design for Quadrotor Drone
The control architecture for the quadrotor drone employs a cascade structure with an outer position loop and an inner attitude loop, as depicted in Figure 1. This design ensures decoupled control of translational and rotational dynamics, which is essential for handling wind disturbances. The attitude controller itself consists of an outer quaternion-based attitude controller and an inner PID-based angular rate controller. The position controller combines a P controller for position and a PID controller for velocity. Such a layered approach allows the quadrotor drone to maintain stability even in turbulent conditions.
The attitude controller uses quaternions to represent orientation, avoiding singularities associated with Euler angles. A quaternion $\mathbf{q} = [q_0, q_1, q_2, q_3]^T \in \mathbb{R}^4$ with $||\mathbf{q}|| = 1$ represents a rotation in $SO(3)$. The kinematics are given by:
$$ \dot{\mathbf{q}} = \frac{1}{2} \mathbf{q} \otimes \mathbf{p}(\boldsymbol{\omega}_b) = \frac{1}{2} \begin{bmatrix} -\mathbf{q}_{1:3}^T \boldsymbol{\omega}_b \\ \mathbf{q}_{1:3}^\times + q_0 \mathbf{I} \end{bmatrix} \boldsymbol{\omega}_b $$
where $\mathbf{p}(\boldsymbol{\omega}_b) = [0, p, q, r]^T$ and $\mathbf{q}_{1:3}^\times$ is the skew-symmetric matrix of the vector part. However, quaternions double-cover $SO(3)$, meaning $\mathbf{q}$ and $-\mathbf{q}$ represent the same physical orientation. This can lead to “unwinding” phenomena in control. To address this, we design a feedback law that ensures consistency.
The desired acceleration from the position controller, $\mathbf{A}^e_{sp}$, is converted to a desired quaternion $\mathbf{q}_{sp}$ by aligning the body $Z_b$-axis with $\mathbf{A}^e_{sp}$. The unit vector along desired acceleration is $\mathbf{e}^e_{Z_b,sp} = \mathbf{A}^e_{sp} / ||\mathbf{A}^e_{sp}||$, and the error quaternion between current $Z_b$-axis and desired direction is:
$$ \mathbf{q}_{e,Z_b} = \begin{bmatrix} \cos(\alpha/2) \\ \sin(\alpha/2) \frac{\mathbf{e}^e_{Z_b} \times \mathbf{e}^e_{Z_b,sp}}{||\mathbf{e}^e_{Z_b} \times \mathbf{e}^e_{Z_b,sp}||} \end{bmatrix} $$
where $\alpha$ is the angle between axes. Then, $\mathbf{q}_{sp} = \mathbf{q} \otimes \mathbf{q}_{e,Z_b}$. The attitude control law is:
$$ \boldsymbol{\omega}^b_{sp} = \frac{2}{\tau} \text{sgn}(q_{e,0}) \mathbf{q}_{e,1:3} $$
with $\text{sgn}(q_{e,0}) = 1$ if $q_{e,0} > 0$ and $-1$ if $q_{e,0} < 0$, where $\mathbf{q}_e = \mathbf{q}^{-1} \otimes \mathbf{q}_{sp}$ is the error quaternion, and $\tau$ is a time constant. This law ensures that the angular velocity command is continuous across the double cover. To prove global asymptotic stability, consider the Lyapunov function $V(\mathbf{q}) = \mathbf{q}_{1:3}^T \mathbf{q}_{1:3} + (q_0 – 1)^2$ for the equilibrium $\mathbf{q} = [1,0,0,0]^T$. Its derivative along trajectories is:
$$ \dot{V} = \frac{\partial V}{\partial \mathbf{q}} \dot{\mathbf{q}} = -\frac{2}{\tau} \mathbf{q}_{1:3}^T \mathbf{q}_{1:3} \leq 0 $$
By LaSalle’s invariance principle, the system converges to the set where $\mathbf{q}_{1:3} = 0$, implying $q_0 = \pm 1$. With the signum function, we ensure convergence to $q_0 = 1$, proving global asymptotic stability for the quadrotor drone’s attitude.
The inner angular rate controller uses PID regulators for each axis ($p, q, r$). For example, the roll rate control input is:
$$ u_1(t) = K_{P,p} (p – p_{sp}) + K_{I,p} \int_0^t (p – p_{sp}) \, dt + K_{D,p} \frac{d(p – p_{sp})}{dt} $$
Similar equations hold for pitch and yaw. The PID gains are tuned incrementally to avoid oscillations, typically increasing by 20-30% or decreasing by 5-10% per iteration. This ensures responsive yet stable control of the quadrotor drone under wind gusts.
The position controller for the quadrotor drone comprises a velocity PID inner loop and a position P outer loop. The velocity controller computes desired acceleration based on velocity error, with integral clamping to prevent windup. The position controller generates velocity setpoints from position error, with saturation to limit speed. Mathematically, for the $X$-axis:
$$ \dot{X}_{sp} = K_{P,X} (X_{des} – X) $$
$$ \ddot{X}_{sp} = K_{P,v_X} (\dot{X}_{sp} – \dot{X}) + K_{I,v_X} \int (\dot{X}_{sp} – \dot{X}) \, dt + K_{D,v_X} \frac{d(\dot{X}_{sp} – \dot{X})}{dt} $$
where $X_{des}$ is desired position. The output $\ddot{X}_{sp}$ is then used to compute the total thrust $U_1$ and desired attitude $\mathbf{q}_{sp}$ via:
$$ U_1 = m ||\ddot{X}_{sp} + g \mathbf{e}_z|| $$
and $\mathbf{q}_{sp}$ as described earlier. This cascaded structure allows the quadrotor drone to track trajectories while compensating for wind-induced drifts.

The image above illustrates a typical quadrotor drone used in plant protection, highlighting its compact design and rotor configuration. Such drones are prone to wind disturbances due to their light weight and low-altitude operation, underscoring the need for robust control strategies.
To summarize the controller parameters, Table 2 provides typical values used in simulations for the quadrotor drone.
| Controller | Parameter | Value | Description |
|---|---|---|---|
| Attitude (Quaternion) | $\tau$ | 0.1 s | Time constant |
| $\text{sgn}(q_{e,0})$ | ±1 | Sign function for unwinding | |
| Stability | Global asymptotic | Lyapunov-proven | |
| Angular Rate (PID) | $K_{P,p}$ | 0.8 | Proportional gain for roll |
| $K_{I,p}$ | 0.05 | Integral gain for roll | |
| $K_{D,p}$ | 0.2 | Derivative gain for roll | |
| $K_{P,q}$ | 0.8 | Proportional gain for pitch | |
| $K_{I,q}$ | 0.05 | Integral gain for pitch | |
| $K_{D,q}$ | 0.2 | Derivative gain for pitch | |
| Position (P-PID) | $K_{P,X}$ | 1.5 | Position proportional gain |
| $K_{P,v_X}$ | 2.0 | Velocity proportional gain | |
| Integral clamp | ±0.5 | Anti-windup limit |
These parameters are optimized through simulation and real-world testing to ensure the quadrotor drone performs reliably in wind. The controller’s ability to reject disturbances is critical for plant protection missions, where precise spraying is required.
Experimental Validation of Quadrotor Drone Performance
To validate the dynamics model and controller for the quadrotor drone, we conducted both simulation experiments in Gazebo and actual flight tests in wind fields. Gazebo is a physics engine that provides realistic environments, including wind simulation via the libgazebo_wind library. We configured a Gaussian-distributed wind field with mean speed 5 m/s and gusts up to 8 m/s to mimic typical agricultural conditions. The quadrotor drone was tasked with hovering and trajectory tracking under these disturbances.
In simulation, the quadrotor drone demonstrated stable attitude and position control. Figure 2 shows the attitude angle responses: roll ($\phi$), pitch ($\theta$), and yaw ($\psi$) closely track their setpoints despite wind gusts. The quaternion-based controller effectively avoids singularities, and the PID angular rate regulator ensures rapid disturbance rejection. Similarly, Figure 3 depicts angular rate control, where body rates $p, q, r$ follow commands with minimal overshoot. The position control performance is shown in Figure 4 for the $Y$-axis: the quadrotor drone maintains position within ±0.2 m error under wind, validating the outer loop design. These results confirm that our controller enables the quadrotor drone to operate robustly in simulated wind.
For real-world validation, we deployed a custom-built quadrotor drone with the same parameters as in Table 1. The drone was equipped with an onboard IMU, GPS, and a Pixhawk flight controller running our control algorithm. Tests were conducted in open fields with natural wind speeds of 3-6 m/s, measured by anemometers. We analyzed vibration spectra to assess stability, as excessive vibrations can lead to crashes. Figure 5 shows the vibration energy spectrum: low-frequency vibrations are minimal, indicating good structural and control damping, while high-frequency components are negligible. This suggests the quadrotor drone remains stable under wind.
During flight, attitude and position data were logged. Figures 6 and 7 present attitude and angular rate control results: despite sensor noise, the quadrotor drone tracks setpoints effectively, with attitude errors below 5° and rate errors under 10 deg/s. Position control in Figure 8 shows the $Y$-position error within ±0.3 m, demonstrating satisfactory wind rejection. The weighting function $\lambda_i$ was approximated based on wind direction relative to rotor positions; for instance, with wind from the front, $\lambda_1$ and $\lambda_3$ (front rotors) were set to 0.8, while $\lambda_2$ and $\lambda_4$ (rear rotors) to 0.4, reflecting partial exposure. This improved model accuracy compared to uniform weighting.
To quantify performance, we computed root-mean-square (RMS) errors for key metrics, as summarized in Table 3. The quadrotor drone’s control system shows consistent performance across simulations and real tests, affirming its suitability for plant protection.
| Metric | Simulation (Gazebo) | Real Flight | Unit |
|---|---|---|---|
| Attitude RMS error ($\phi, \theta$) | 2.1° | 3.5° | deg |
| Angular rate RMS error ($p, q$) | 8.2 deg/s | 12.4 deg/s | deg/s |
| Position RMS error ($X, Y$) | 0.15 m | 0.25 m | m |
| Wind speed during test | 5-8 m/s (simulated) | 3-6 m/s (natural) | m/s |
These results highlight the effectiveness of our approach. The quadrotor drone maintains stability even in gusty conditions, which is essential for agricultural spraying where wind is prevalent. The integration of wind weighting in the model enhances realism, though further work could adapt $\lambda_i$ online using airflow sensors.
Conclusion and Future Work
In this paper, we have presented a comprehensive framework for modeling and controlling a quadrotor drone under wind disturbance, with applications in plant protection. The dynamics model incorporates wind effects via a weighting function that accounts for differential rotor exposures, providing a more accurate representation than uniform assumptions. The controller design leverages quaternion-based attitude control to avoid singularities and ensures global asymptotic stability through Lyapunov analysis, complemented by PID-based angular rate and position loops. Experimental validation via Gazebo simulations and real flight tests confirms that the quadrotor drone can maintain stable flight and precise control in wind fields, with attitude errors below 5° and position errors under 0.3 m in moderate winds.
The key contributions include a novel wind-incorporated dynamics model for a quadrotor drone and a robust control strategy that addresses the double-cover issue in quaternion space. This work enhances the reliability of quadrotor drones in agricultural environments, where wind disturbances are common. Future research could focus on adaptive control techniques, such as neural network-based compensators, to handle extreme wind conditions or varying payloads during spraying. Additionally, integrating real-time wind estimation sensors could refine the weighting function $\lambda_i$ for improved performance. Overall, this study advances the deployment of quadrotor drones for precision agriculture, ensuring efficient and stable plant protection operations.
The quadrotor drone continues to be a pivotal platform in agricultural robotics, and its resilience to environmental challenges like wind will drive broader adoption. By refining models and controls, we can unlock new capabilities for autonomous farming, contributing to sustainable agriculture. This paper underscores the importance of robust control systems for quadrotor drones, paving the way for future innovations in the field.
