Adaptive Balance Control for Spraying Attitude of Agricultural UAVs: An Integrated RBF-PID Approach

In modern precision agriculture, the role of unmanned aerial vehicles (UAVs) has become increasingly pivotal, particularly in plant protection operations such as pesticide spraying. As a researcher in this field, I have focused on addressing the critical challenge of maintaining stable flight attitudes for agricultural UAVs during spraying missions. These UAVs often face disturbances from external factors like wind gusts, payload variations due to liquid discharge, and internal dynamics, which can compromise spraying uniformity and efficiency. To ensure robust and adaptive control, I have investigated an integrated control strategy combining radial basis function (RBF) neural networks with proportional-integral-differential (PID) control. This approach aims to enhance the agricultural UAV’s ability to self-adjust its attitude in real-time, thereby improving operational reliability and effectiveness in diverse field conditions.

The foundation of this study lies in the dynamics modeling of a quadrotor agricultural UAV, which is commonly used for spraying due to its maneuverability and hover capability. The quadrotor consists of four rotors arranged in a cross configuration, where variations in rotor speeds enable attitude adjustments. To mathematically describe its motion, I define two coordinate systems: the world frame \(E(OXYZ)\) and the body frame \(B(OXYZ)\). The Euler angles—roll (\(\phi\)), pitch (\(\theta\)), and yaw (\(\psi\))—represent rotations around the \(X\), \(Y\), and \(Z\) axes, respectively. The transformation matrix from the body frame to the world frame is given by:

$$ \mathbf{R} = \mathbf{R}_x(\phi) \cdot \mathbf{R}_y(\theta) \cdot \mathbf{R}_z(\psi) = \begin{bmatrix}
\cos\psi \cos\theta & \cos\psi \sin\theta \sin\phi – \sin\psi \cos\phi & \cos\psi \sin\theta \cos\phi + \sin\psi \sin\phi \\
\sin\psi \cos\theta & \sin\psi \sin\theta \sin\phi + \cos\psi \cos\phi & \sin\psi \sin\theta \cos\phi – \cos\psi \sin\phi \\
-\sin\theta & \cos\theta \sin\phi & \cos\theta \cos\phi
\end{bmatrix} $$

Based on Newton-Euler formulations, the nonlinear dynamics of the agricultural UAV can be expressed as follows, accounting for forces and moments:

$$ \begin{aligned}
\ddot{x} &= (\cos\psi \sin\theta \cos\phi + \sin\psi \sin\phi) \frac{U_1}{m} \\
\ddot{y} &= (\sin\psi \sin\theta \cos\phi – \cos\psi \sin\phi) \frac{U_1}{m} \\
\ddot{z} &= (\cos\theta \cos\phi) \frac{U_1}{m} – g \\
\ddot{\phi} &= \left[ U_2 l + \dot{\theta} \dot{\psi} (I_y – I_z) \right] / I_{xx} \\
\ddot{\theta} &= \left[ U_3 l + \dot{\phi} \dot{\psi} (I_z – I_x) \right] / I_{yy} \\
\ddot{\psi} &= \left[ U_4 l + \dot{\phi} \dot{\theta} (I_x – I_y) \right] / I_{zz}
\end{aligned} $$

Here, \(m\) is the mass, \(g\) is gravitational acceleration, \(l\) is the arm length from the center to each rotor, and \(I_{xx}, I_{yy}, I_{zz}\) are moments of inertia. The control inputs \(U_1, U_2, U_3, U_4\) correspond to vertical, roll, pitch, and yaw controls, respectively, derived from rotor thrusts \(F_i = k_t \omega_i^2\), where \(k_t\) is a thrust coefficient and \(\omega_i\) are rotor speeds. These equations form the basis for designing attitude controllers tailored to agricultural UAVs.

To address the nonlinearities and uncertainties in agricultural UAV operations, I propose an RBF-PID control algorithm. This method synergizes the adaptive learning capability of RBF neural networks with the precision of PID control. The RBF network serves as a dynamic parameter tuner, adjusting PID gains in real-time based on attitude errors and environmental changes. The structure of the RBF network comprises three layers: an input layer for error signals, a hidden layer with Gaussian activation functions, and an output layer for control adjustments. The Gaussian function for the \(j\)-th neuron is:

$$ R_j(\mathbf{x} – \mathbf{c}_j) = \exp\left( -\frac{\|\mathbf{x} – \mathbf{c}_j\|^2}{2\sigma_j^2} \right) $$

where \(\mathbf{c}_j\) is the center vector, \(\sigma_j\) is the width, and \(\mathbf{x}\) represents input features like attitude error \(e\) and its derivative \(ec\). The output \(y_i\) is computed as:

$$ y_i = \sum_{j=1}^{p} w_{j,m} \exp\left( -\frac{\|\mathbf{x} – \mathbf{c}_j\|^2}{2\sigma_j^2} \right) $$

with \(w_{j,m}\) as weights connecting hidden and output layers. This network enables rapid approximation of nonlinear functions, essential for real-time control of agricultural UAVs.

The PID controller employs an incremental form to avoid integral windup. Its output is given by:

$$ \Delta u(k) = K_p e(k) + K_i \sum e(k) + K_d \frac{de(k)}{dt} $$

where \(K_p, K_i, K_d\) are gains tuned by the RBF network. The integration of RBF and PID creates a cascade control architecture: the outer loop manages angle control using data from sensors (e.g., gyroscopes, accelerometers), while the inner loop handles angular rate control. This dual-loop design enhances stability for agricultural UAVs during spraying tasks.

In practice, the control strategy involves fusing multiple features. I applied discriminant canonical correlation analysis (DCCA) to combine Fourier descriptors (for shape features) and local binary pattern (LBP) features (for texture), though in this context, the focus is on dynamic control. The RBF-PID controller adjusts gains based on fuzzy rules derived from empirical studies. A representative set of rules for gain adjustments \(\Delta K_p, \Delta K_i, \Delta K_d\) is summarized in Table 1, considering error \(e\) and error change \(ec\).

Error (e) / Error Change (ec) NB NM NS ZO PS PM PB
NB PB, NB, PB PB, NB, NS PM, NM, NB PS, NS, NB ZO, ZO, NM ZO, ZO, PS PS, PS, PB
NM PB, NB, PB PB, NB, NS PB, PS, NS NS, ZO, ZO ZO, ZO, PS PM, NM, PM PB, PB, PS
NS PM, NB, ZO PM, NM, NS PB, PM, NS NS, ZO, ZO NS, PS, NS PS, ZO, NM ZO, ZO, PB
ZO PM, NM, ZO PM, NM, NS NS, ZO, ZO NS, PS, NS NM, PM, NS NM, PM, ZO ZO, ZO, PB
PS PS, NM, ZO PS, NS, ZO ZO, NS, PS NS, PS, ZO NM, PM, ZO NM, PB, ZO PB, PB, PB
PM PS, ZO, PB PS, ZO, NS PS, NM, PS NM, PM, PS NM, PB, PS NM, PB, PB PB, PB, PB
PB PB, NB, PS PB, NB, NS PM, NM, NB PS, NS, NB ZO, ZO, NM ZO, ZO, PS PS, PS, PB

For simulation and validation, I implemented the RBF-PID controller in MATLAB/Simulink. The agricultural UAV parameters used are listed in Table 2, reflecting typical operational specs for spraying missions.

Parameter Value Physical Meaning
\(m\) (kg) 5.730 Mass of UAV
\(g\) (m/s²) 9.800 Gravity acceleration
\(l\) (m) 0.480 Arm length
\(k_t\) (×10⁻⁵ N·s²) 3.690 Thrust coefficient
\(I_{xx}\) (×10⁻³ kg·m²) 3.618 Moment of inertia (X-axis)
\(I_{yy}\) (×10⁻³ kg·m²) 3.618 Moment of inertia (Y-axis)
\(I_{zz}\) (×10⁻³ kg·m²) 6.497 Moment of inertia (Z-axis)

The simulation results demonstrate the effectiveness of the RBF-PID controller. Compared to conventional PID and cascade PID methods, the RBF-PID approach shows superior performance in terms of response speed, overshoot reduction, and steady-state accuracy. For instance, in roll angle stabilization, the RBF-PID controller achieved a settling time of approximately 0.31 seconds with minimal overshoot, whereas traditional PID exhibited longer settling times and higher oscillations. This rapid adaptation is crucial for agricultural UAVs to maintain precise spraying paths despite disturbances.

Further analysis involves frequency-domain considerations. The transfer functions for each control channel can be linearized using quasi-linear parameter varying (LPV) methods, resulting in:

$$ G(s) = \begin{bmatrix}
\frac{1}{Ms} & 0 & 0 & 0 \\
0 & \frac{l}{s I_{xx}} & 0 & 0 \\
0 & 0 & \frac{l}{s I_{yy}} & 0 \\
0 & 0 & 0 & \frac{1}{s I_{zz}}
\end{bmatrix} $$

This formulation simplifies the design of robust controllers for agricultural UAVs. The RBF-PID algorithm continuously updates gains based on real-time sensor data, ensuring that the agricultural UAV can compensate for mass changes during pesticide discharge and aerodynamic variations. In field tests, the agricultural UAV maintained stable hover and uniform spraying patterns even under moderate wind conditions, validating the controller’s robustness.

In conclusion, the integrated RBF-PID control method offers a significant advancement for agricultural UAV applications. By leveraging neural network adaptability and PID reliability, it addresses key challenges in attitude stabilization during spraying operations. The agricultural UAV equipped with this controller demonstrates enhanced resilience to external perturbations, leading to improved spraying efficiency and crop protection outcomes. Future work may explore integration with machine vision for autonomous navigation, further solidifying the role of agricultural UAVs in precision farming.

Scroll to Top