In recent years, the rapid advancement of unmanned aerial vehicle (UAV) technology has led to the widespread adoption of crop spraying drones in agricultural and forestry operations. These spraying UAVs offer significant advantages, such as high efficiency, precise pesticide application, and reduced human exposure to harmful chemicals. However, the attitude control system of crop spraying drones is prone to external disturbances and parameter uncertainties during field operations, which can compromise stability and performance. To address these challenges, this paper proposes a dual-loop sliding mode control strategy, dividing the system into an outer position control loop and an inner attitude control loop based on the underactuated characteristics of crop spraying drones. The outer loop employs an adaptive sliding mode control approach to mitigate disturbances, while the inner loop utilizes integral sliding mode functions and exponential reaching law control to ensure finite-time convergence and enhanced stability. Lyapunov functions are used to prove system stability, and simulations and experiments validate the feasibility of the proposed method for crop spraying drones and spraying UAVs in real-world scenarios.
The dynamics of a crop spraying drone can be modeled based on a quadrotor UAV framework, considering factors like mass, inertia, and external disturbances. The mathematical model is derived from Newton-Euler equations, accounting for translational and rotational motions. The position coordinates in the inertial frame are denoted as $$(x, y, z)$$, and the Euler angles for attitude are $$(\phi, \theta, \psi)$$, representing roll, pitch, and yaw, respectively. The control inputs include $$U_1$$ for vertical motion and virtual controls $$U_2, U_3, U_4$$ for attitude angles. The dynamic equations are given by:
$$ \begin{cases} \ddot{x} = \frac{U_1}{m} (\cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi) – \frac{C_1}{m} \dot{x} + d_x \\ \ddot{y} = \frac{U_1}{m} (\cos\phi \sin\theta \sin\psi – \sin\phi \cos\psi) – \frac{C_2}{m} \dot{y} + d_y \\ \ddot{z} = \frac{U_1}{m} (\cos\phi \cos\theta) – g – \frac{C_3}{m} \dot{z} + d_z \\ \ddot{\phi} = \frac{l C_4}{I_1} U_2 – \beta_1 \dot{\phi} \\ \ddot{\theta} = \frac{l C_5}{I_2} U_3 – \beta_2 \dot{\theta} \\ \ddot{\psi} = \frac{l C_6}{I_3} U_4 – \beta_3 \dot{\psi} \end{cases} $$
where $$m$$ is the total mass, $$l$$ is the arm length, $$I_i$$ are moments of inertia, $$C_i$$ are drag coefficients, and $$d_i$$ represent external disturbances bounded by $$|d_i| \leq D_i$$. This model forms the basis for designing the control strategy for crop spraying drones, ensuring robustness against uncertainties in spraying UAV operations.
For the outer loop position control, the objective is to track desired trajectories while compensating for disturbances. Define the position vector as $$\mathbf{P} = [x, y, z]^T$$, the desired position as $$\mathbf{P}_d = [x_d, y_d, z_d]^T$$, and the control input as $$\mathbf{U}_P = [U_x, U_y, U_z]^T$$. The position error is $$\mathbf{E} = \mathbf{P} – \mathbf{P}_d$$, and a sliding surface is designed as $$\mathbf{s} = \dot{\mathbf{E}} + \lambda \mathbf{E}$$, where $$\lambda > 0$$. Using an adaptive sliding mode control law, the control input is derived as:
$$ \mathbf{U}_P = -\lambda \dot{\mathbf{E}} – \mathbf{C} – \hat{\mathbf{\Theta}} – k \cdot \text{sat}(\mathbf{s}) – \eta \mathbf{s} $$
where $$\mathbf{C}$$ represents the drag and gravity terms, $$\hat{\mathbf{\Theta}}$$ is the estimated disturbance, $$k > 0$$ and $$\eta > 0$$ are gains, and $$\text{sat}(\mathbf{s})$$ is a saturation function to reduce chattering. The adaptive law for disturbance estimation is given by $$\dot{\hat{\mathbf{\Theta}}} = \gamma (\mathbf{s} – \mathbf{D} \mathbf{s} \mathbf{P}_d)$$, with $$\gamma > 0$$. A projection algorithm ensures that $$\hat{\mathbf{\Theta}}$$ remains within bounds, preventing excessive control inputs. This approach enhances the reliability of crop spraying drones in unpredictable environments.
The inner loop attitude control focuses on stabilizing the Euler angles. Define the attitude vector as $$\mathbf{B} = [\phi, \theta, \psi]^T$$ and the desired attitude as $$\mathbf{B}_d = [\phi_d, \theta_d, \psi_d]^T$$. The attitude error is $$\mathbf{B}_e = \mathbf{B} – \mathbf{B}_d$$, and an integral sliding surface is designed as $$\mathbf{s}_a = \dot{\mathbf{B}}_e + \lambda_a \mathbf{B}_e + \Delta \int \mathbf{B}_e dt$$, where $$\lambda_a > 0$$ and $$\Delta > 0$$. Using an exponential reaching law, the control input is:
$$ \mathbf{U}_B = -\mathbf{s}_a – \mathbf{\tau} – K \cdot \text{sat}(\mathbf{s}_a) – \epsilon \mathbf{s}_a $$
where $$\mathbf{\tau}$$ combines reference and disturbance terms, $$K > 0$$ and $$\epsilon > 0$$ are gains. This ensures finite-time convergence and robustness for spraying UAVs. Lyapunov analysis confirms global stability, with $$V = \frac{1}{2} \mathbf{s}^T \mathbf{s} + \frac{1}{2\gamma} \tilde{\mathbf{\Theta}}^T \tilde{\mathbf{\Theta}}$$ showing negative definiteness.

Simulations and experiments were conducted to validate the control strategy for crop spraying drones. The parameters used in the simulation are summarized in Table 1, including mass, inertia, and control gains. The desired trajectory was set as $$\mathbf{P}_d = [-t, t, 5]$$ with a yaw angle of $$\psi = \frac{\pi}{3}$$. The results demonstrate accurate tracking and disturbance rejection, as shown in the position and attitude error plots. The adaptive estimation effectively compensates for external forces, ensuring stable operation of the spraying UAV.
| Parameter | Value | Description |
|---|---|---|
| $$m$$ | 2 kg | Total mass |
| $$l$$ | 0.2 m | Arm length |
| $$I_1, I_2, I_3$$ | 0.02, 0.02, 0.04 Nm | Moments of inertia |
| $$\lambda$$ | 30 | Sliding surface gain |
| $$k$$ | 4 | Control gain |
| $$\eta$$ | 0.2 | Adaptive gain |
| $$K$$ | 25 | Exponential gain |
| $$\epsilon$$ | 0.2 | Reaching law parameter |
| $$C_1$$ to $$C_6$$ | 0.01 to 0.012 | Drag coefficients |
In experimental tests, the crop spraying drone was equipped with a flight control chip (TM4C123GH6PM) and tested in a controlled environment. The drone achieved stable hovering and translational flight, as illustrated in the figures. The results confirm that the proposed control strategy maintains performance under disturbances, making it suitable for real-world applications of spraying UAVs in agriculture.
Further analysis involves evaluating the control performance through error metrics and convergence times. Table 2 summarizes the simulation results for position and attitude tracking, highlighting the effectiveness of the adaptive sliding mode control in reducing errors and ensuring stability for crop spraying drones.
| Metric | Value | Unit |
|---|---|---|
| Position Error (RMS) | 0.05 | m |
| Attitude Error (RMS) | 0.02 | rad |
| Convergence Time | 5 | s |
| Disturbance Rejection | 95% | % |
The adaptive sliding mode control algorithm for crop spraying drones demonstrates significant improvements in handling external disturbances and parameter uncertainties. By integrating saturation functions and projection algorithms, the system minimizes chattering and prevents control input saturation. The inner loop’s finite-time convergence ensures rapid response, which is critical for spraying UAVs operating in dynamic environments. Future work could explore machine learning techniques to further enhance adaptability and real-time performance for crop spraying drones.
In conclusion, this paper presents a robust control framework for crop spraying drones, leveraging adaptive sliding mode techniques to achieve precise attitude and position control. The dual-loop design addresses the underactuated nature of spraying UAVs, while Lyapunov stability analysis provides theoretical guarantees. Simulations and experiments validate the approach, showing its potential for widespread use in agricultural automation. As technology evolves, such control strategies will play a pivotal role in optimizing the efficiency and safety of crop spraying drones.
