Design of an Obstacle Avoidance Path Control System for Agricultural Drones Based on Laser Sensing Technology

The integration of automation and intelligent equipment in modern agriculture has led to the widespread adoption of unmanned aerial vehicles (UAVs), commonly known as drones. The agricultural drone has become a pivotal tool for tasks such as crop monitoring, precision spraying, and field mapping, offering significant advantages in efficiency, cost-effectiveness, and operational convenience over traditional manual methods. However, the operational environment for an agricultural drone is often complex and cluttered, typically involving low-altitude flight amidst obstacles like trees, poles, uneven terrain, and other field structures. Without a robust and reliable control system for obstacle detection and avoidance, the risk of collisions and catastrophic crashes is high, leading to potential financial loss and operational downtime. Therefore, the development of an effective obstacle avoidance path control system is paramount for the safe and autonomous operation of agricultural drones.

Existing research on path control and obstacle avoidance for agricultural drones presents various approaches, yet often faces challenges. Some methods employ model predictive control (MPC) to plan optimal paths by solving complex optimization problems in real-time. While theoretically sound, these approaches can be computationally intensive, leading to high processing time that may not satisfy the fast reaction requirements in dynamic environments. Other methods utilize vision-based systems and deep learning algorithms to enable perception and autonomous navigation. These systems can struggle with consistency and accuracy, particularly under varying lighting conditions or with complex, unstructured obstacles, sometimes resulting in lower control reliability. To address these limitations, this research presents a comprehensive obstacle avoidance path control system designed specifically for agricultural drones, leveraging the high precision of laser sensing technology for reliable environmental perception and stable flight control.

The core philosophy of the designed system is to achieve precise, real-time control of the agricultural drone‘s flight state—namely its attitude, altitude, and position—based on multi-sensor fusion. A laser rangefinder serves as the primary sensor for accurate altitude measurement and obstacle proximity detection. The system hardware is built around a powerful and redundant flight controller, while the software implements sophisticated filtering and control algorithms to process sensor data and generate stable flight commands. This integrated approach aims to ensure that the agricultural drone can autonomously navigate its predefined mission path while dynamically avoiding unforeseen obstacles, thereby enhancing operational safety and autonomy in agricultural settings.

1. System Architecture and Overall Design

The designed obstacle avoidance path control system is a closed-loop control system. It continuously perceives the state of the agricultural drone and its surrounding environment, compares this state with the desired trajectory, computes necessary corrective actions, and actuates the drone’s motors to follow a safe path. The system architecture can be logically divided into a Hardware Execution Layer and a Software Decision & Control Layer, as outlined in the framework below.

The Hardware Execution Layer is responsible for data acquisition and physical actuation. It centers on a robust flight control unit (FCU) which acts as the system’s brain. This FCU gathers critical data from several peripheral sensor modules: a Global Positioning System (GPS) module for global position and velocity; a laser altimeter for precise height-above-ground measurement; and additional inertial and magnetic sensors (an Inertial Measurement Unit – IMU) embedded within the FCU for attitude and angular rate estimation. The FCU processes this data and outputs Pulse-Width Modulation (PWM) signals to control the speed of the drone’s electronic speed controllers (ESCs) and motors.

The Software Decision & Control Layer, running on the FCU’s processor, contains the intelligence for state estimation and control. It performs several key functions: Sensor Fusion to combine noisy sensor readings into a reliable estimate of the drone’s attitude; Obstacle Detection & Localization primarily using laser data to identify and map nearby obstacles; Path Planning to generate or modify a collision-free flight trajectory in real-time; and Flight Control to calculate the required thrust and torque for each motor to achieve the desired attitude, altitude, and position. The interaction between these layers enables the autonomous, obstacle-aware behavior of the agricultural drone.

2. Hardware System Design

The reliability and performance of the control system are fundamentally dependent on the selection and integration of its hardware components. The hardware platform is designed to provide accurate, low-latency sensor data and reliable computational power for the agricultural drone. The primary components include the Flight Control Unit (FCU), the positioning module, and the laser-based sensing module.

2.1 Flight Control Unit (Pixhawk-based Autopilot)

The heart of the system is a Pixhawk-family open-source flight controller. This FCU was selected for its computational power, redundancy features, and extensive community support, which are crucial for the demanding task of controlling an agricultural drone. A typical architecture employs a dual-processor design for enhanced safety.

  • Main Processor: A high-performance microcontroller, such as an ARM Cortex-M4 or Cortex-M7 (e.g., STM32F4 or STM32F7 series), handles the primary flight control stack, sensor fusion algorithms, navigation, and communication tasks.
  • Fail-safe Co-processor: A separate, independent microcontroller (e.g., a 32-bit ARM Cortex-M3) constantly monitors the main processor’s health. If the main processor fails or becomes unresponsive, the co-processor can take over basic stabilization control, guiding the agricultural drone to a safe landing or hold state, thereby preventing a total crash.

The FCU also integrates a crucial MEMS-based Inertial Measurement Unit (IMU), typically containing a 3-axis gyroscope, a 3-axis accelerometer, and often a 3-axis magnetometer. This integrated IMU provides the raw data for estimating the drone’s orientation.

2.2 High-Precision Positioning Module (GPS/RTK)

For outdoor navigation, a high-grade GPS module is essential. Standard GPS provides positional accuracy in the range of 2-5 meters, which is insufficient for precise path following and obstacle mapping for an agricultural drone. Therefore, this system incorporates a module capable of Real-Time Kinematic (RTK) positioning.

RTK-GPS uses corrections from a fixed base station or a network to achieve centimeter-level accuracy (e.g., 1-2 cm horizontally). A module like the P307 was chosen for its specific advantages relevant to agricultural drone operations:

Feature Benefit for Agricultural Drone
Centimeter-level Accuracy Enables precise swath guidance, accurate return-to-home, and reliable geo-fencing.
Support for Multiple Correction Formats (RTCM, CMR, etc.) Ensures compatibility with various ground station networks commonly used in agriculture.
COAST/SureTrack Technology Maintains high-accuracy positioning for up to 40 minutes after losing the correction signal, crucial for operations in areas with intermittent coverage.
Low Power Consumption, Small Form Factor Minimizes impact on the drone’s flight time and payload capacity.

2.3 Laser-based Sensing Module for Altitude and Obstacle Detection

This is the defining sensor of the proposed system. While the FCU’s barometer can estimate altitude, it is highly susceptible to wind and pressure changes, especially at low altitudes, leading to errors exceeding 1 meter. A laser rangefinder (lidar-lite) provides a direct, accurate measurement of the distance to the ground or to obstacles directly below the drone.

The key specifications of the selected laser sensor make it ideal for an agricultural drone:

  • Measurement Range: Up to 100 meters, which is ample for low-altitude agricultural operations (typically 2-10 meters above crop canopy).
  • Accuracy: Centimeter-level (e.g., ±1-2 cm), far superior to a barometer for height-holding and terrain following.
  • Update Rate: High frequency (e.g., 100+ Hz), allowing for rapid control loop updates.
  • Lightweight and Compact: Weighs less than 25 grams, adding minimal payload.

For basic obstacle avoidance in the flight path, one or more forward-facing or scanning laser sensors can be added. These sensors actively measure the distance to objects in the drone’s heading direction. When a distance reading falls below a predefined safety threshold, the control system interprets it as an obstacle and triggers the avoidance maneuver. The integration of this precise distance data is fundamental to the software control strategies.

3. Software System Design and Control Algorithms

The software architecture implements the core algorithms that transform raw sensor data into stable flight commands for the agricultural drone. The control problem is decomposed into three hierarchical layers: Attitude Control (inner loop), Altitude/Vertical Velocity Control (middle loop), and Position/Horizontal Velocity Control (outer loop). This structure provides stability and manageable tuning.

3.1 Attitude Estimation and Control

Accurate knowledge of the drone’s orientation—roll ($\phi$), pitch ($\theta$), and yaw ($\psi$)—is the foundation of stable flight. The raw data from the gyroscope (angular rates), accelerometer (specific force), and magnetometer (earth’s magnetic field) are noisy and subject to drift. Sensor fusion is required. This system employs an Extended Kalman Filter (EKF), a powerful algorithm for state estimation in nonlinear systems.

The drone’s dynamics and sensor models are nonlinear. The EKF linearizes these models around the current state estimate. The process involves two main steps: Prediction and Update.

1. Prediction Step: The filter predicts the next state based on the previous state and the system dynamics model.

State prediction:
$$ \hat{\mathbf{x}}^-_k = f(\hat{\mathbf{x}}_{k-1}, \mathbf{u}_{k-1}, \mathbf{0}) $$
Covariance prediction:
$$ \mathbf{P}^-_k = \mathbf{F}_k \mathbf{P}_{k-1} \mathbf{F}_k^T + \mathbf{Q}_{k-1} $$
Here, $ \hat{\mathbf{x}} $ is the state vector (containing attitude, velocity, position, etc.), $ f $ is the nonlinear state transition function, $ \mathbf{u} $ is the control input, $ \mathbf{F}_k $ is the Jacobian of $ f $ (linearized state matrix), $ \mathbf{P} $ is the error covariance matrix, and $ \mathbf{Q} $ is the process noise covariance.

2. Update Step: When a new sensor measurement $ \mathbf{z}_k $ arrives, the filter updates its prediction.

Kalman Gain calculation:
$$ \mathbf{K}_k = \mathbf{P}^-_k \mathbf{H}_k^T (\mathbf{H}_k \mathbf{P}^-_k \mathbf{H}_k^T + \mathbf{R}_k)^{-1} $$
State update:
$$ \hat{\mathbf{x}}_k = \hat{\mathbf{x}}^-_k + \mathbf{K}_k (\mathbf{z}_k – h(\hat{\mathbf{x}}^-_k, \mathbf{0})) $$
Covariance update:
$$ \mathbf{P}_k = (\mathbf{I} – \mathbf{K}_k \mathbf{H}_k) \mathbf{P}^-_k $$
Here, $ h $ is the nonlinear measurement function, $ \mathbf{H}_k $ is its Jacobian, $ \mathbf{R}_k $ is the measurement noise covariance, and $ \mathbf{K}_k $ is the Kalman Gain.

The EKF fuses gyroscope data (for short-term accuracy) with accelerometer and magnetometer data (for long-term drift correction) to produce a smooth, accurate estimate of the agricultural drone‘s attitude. This estimated attitude is then used by a Proportional-Integral-Derivative (PID) controller to maintain the desired orientation. The PID control law for roll angle is:
$$ u_\phi = K_{p,\phi} e_\phi + K_{i,\phi} \int e_\phi \, dt + K_{d,\phi} \frac{d e_\phi}{dt} $$
where $ e_\phi = \phi_{desired} – \phi_{estimated} $ is the roll error, and $ K_p, K_i, K_d $ are the controller gains. Similar controllers run for pitch and yaw.

3.2 Altitude and Vertical Velocity Control

Controlling the height of the agricultural drone is critical for spraying efficacy and obstacle clearance. A cascaded PID control structure is used for robustness. The outer loop controls altitude ($z$), and the inner loop controls vertical velocity ($\dot{z}$). This structure adds damping to the system, preventing large oscillations.

The outer-loop (altitude) PID controller takes the desired altitude $z_d$ and the current estimated altitude $z$ (primarily from the laser sensor) to compute a desired vertical velocity $ \dot{z}_d $.
$$ \dot{z}_d = K_{p,z} e_z + K_{i,z} \int e_z \, dt + K_{d,z} \frac{d e_z}{dt}, \quad e_z = z_d – z $$

This $ \dot{z}_d $ becomes the setpoint for the inner-loop (vertical velocity) P or PI controller, which uses the estimated vertical velocity (from the EKF) to compute the throttle command $u_{throttle}$.
$$ u_{throttle} = K_{p,\dot{z}} e_{\dot{z}} + K_{i,\dot{z}} \int e_{\dot{z}} \, dt, \quad e_{\dot{z}} = \dot{z}_d – \dot{z} $$
The throttle command is then mixed with the attitude controller outputs to generate final motor commands. This cascade allows the agricultural drone to smoothly climb, descend, or hold a precise altitude even in the presence of wind gusts.

3.3 Position Control and Obstacle Avoidance Path Planning

The outermost control loop manages the drone’s horizontal position ($x$, $y$). For an agricultural drone on a pre-mission survey or spraying path, the desired trajectory is defined as a series of waypoints. The position controller’s job is to generate desired roll and pitch angles that will move the drone towards its target position.

A standard PID controller in the horizontal plane calculates velocity setpoints based on position error:
$$ \dot{x}_d = K_{p,x} e_x + K_{i,x} \int e_x \, dt + K_{d,x} \frac{d e_x}{dt} $$
$$ \dot{y}_d = K_{p,y} e_y + K_{i,y} \int e_y \, dt + K_{d,y} \frac{d e_y}{dt} $$
where $ e_x = x_d – x $ and $ e_y = y_d – y $. These velocity setpoints are then converted to desired roll and pitch angles through a mapping function that considers the drone’s current state and dynamics.

Obstacle Avoidance Integration: The primary function of the laser-based obstacle sensor is to interrupt this standard position control. When an obstacle is detected within a critical distance $d_{crit}$ in the flight direction, the path planning module is activated. A simple yet effective real-time algorithm is the “potential field” method or a reactive “vector field histogram” approach modified for agricultural drone dynamics.

In essence, the obstacle generates a repulsive “force” or velocity vector pushing the drone away, while the target waypoint generates an attractive “force”. The desired velocity command $(\dot{x}_d^{new}, \dot{y}_d^{new})$ for the position controller becomes the sum of these vectors:
$$
\begin{bmatrix} \dot{x}_d^{new} \\ \dot{y}_d^{new} \end{bmatrix} =
\begin{bmatrix} \dot{x}_d^{att} \\ \dot{y}_d^{att} \end{bmatrix} +
\begin{bmatrix} \dot{x}_d^{rep} \\ \dot{y}_d^{rep} \end{bmatrix}
$$
The attractive velocity $(\dot{x}_d^{att}, \dot{y}_d^{att})$ comes from the standard PID controller towards the next waypoint. The repulsive velocity $(\dot{x}_d^{rep}, \dot{y}_d^{rep})$ is calculated based on the obstacle’s relative position and distance:
$$ \dot{\mathbf{v}}^{rep} = \eta \cdot \frac{1}{d_{obs}^2} \cdot \hat{\mathbf{r}} $$
where $\eta$ is a scaling gain, $d_{obs}$ is the measured distance to the obstacle, and $\hat{\mathbf{r}}$ is a unit vector pointing from the obstacle to the drone. This formulation creates a strong repulsive effect when the agricultural drone is close to an obstacle, guiding it around the obstruction. Once the obstacle is cleared, the repulsive term vanishes, and the attractive term guides it back to its original path. The motion equations of the drone are linearized around its current operating point to ensure the combined velocity commands result in stable and flyable attitude commands.

4. Experimental Validation and Performance Analysis

To validate the performance of the proposed laser sensor-based control system for the agricultural drone, a series of experiments were conducted. The tests focused on evaluating the three core control aspects: attitude stability, altitude holding accuracy, and the effectiveness of the obstacle avoidance maneuver. Comparisons were made against other documented methods to contextualize the results.

4.1 Attitude Control Performance

The response of the attitude control loop was tested by commanding step changes in roll, pitch, and yaw angles. The performance was evaluated based on settling time, overshoot, and steady-state error. The following table summarizes key metrics from the roll angle step response test, comparing the proposed EKF-based PID controller with two other reference methods from literature (Method A: Basic Complementary Filter, Method B: Vision-aided controller).

Control Method Settling Time (for 2% band) Maximum Overshoot Steady-State Error (RMSE)
Proposed System (EKF+PID) 0.8 s 8% 0.015 rad
Method A (Complementary Filter) 1.5 s 22% 0.045 rad
Method B (Vision-aided) 1.2 s 15% 0.030 rad

The data demonstrates that the proposed system offers faster stabilization, lower oscillation, and higher precision in maintaining the desired attitude for the agricultural drone. The superior performance is attributed to the accurate state estimation provided by the EKF, which effectively reduces sensor noise and drift.

4.2 Altitude Holding Accuracy

The altitude hold performance was tested by commanding the agricultural drone to hover at a fixed height of 5 meters above ground level. The laser altimeter provided the feedback. The experiment measured the deviation from the target altitude over a 60-second period. The results are expressed as Root Mean Square Error (RMSE).

Sensor Used for Altitude Control Altitude RMSE Maximum Deviation
Laser Sensor (Proposed System) 0.02 m ±0.05 m
Barometer Only 0.15 m ±0.40 m
Ultrasonic Sensor (at 5m) 0.08 m ±0.20 m

The cascaded PID control loop using the high-precision laser sensor significantly outperforms systems relying solely on barometric pressure or ultrasonic sensors, especially at the operational altitudes of an agricultural drone. The sub-centimeter RMSE is crucial for maintaining consistent spray height and safe terrain following.

4.3 Obstacle Avoidance Maneuver Analysis

A field test was conducted to evaluate the integrated obstacle avoidance system. The agricultural drone was programmed to fly a straight 50-meter path at 3 meters altitude. A vertical obstacle (simulating a pole or tree) was placed midway. The system parameters were set with a detection threshold of 10 meters and an avoidance activation distance of 5 meters. The drone’s actual flight path was logged via the RTK-GPS. Key performance indicators were measured.

Performance Metric Measured Value
Minimum Distance to Obstacle 1.2 m
Path Deviation from Original Line 3.5 m
Time to Re-acquire Original Path 4.8 s
Total Added Path Length 7.2 m

The agricultural drone successfully detected the obstacle, initiated a smooth arcing maneuver to bypass it with a safe clearance, and autonomously redirected itself back to the intended flight path after clearance. The reactive algorithm ensured a stable, collision-free deviation without excessive overshoot or oscillatory behavior. The added time and path length are acceptable trade-offs for guaranteed safety in an agricultural environment.

5. Discussion and Future Work

The design and experimental results confirm that the proposed system, centered on laser sensing technology, provides a robust solution for obstacle avoidance path control for agricultural drones. The integration of high-precision sensors (RTK-GPS, laser altimeter) with sophisticated software algorithms (EKF, cascaded PID, reactive avoidance) addresses key challenges of stability, accuracy, and real-time reactivity. The system demonstrates strong performance in maintaining precise attitude, holding altitude within centimeters, and executing safe, deterministic avoidance maneuvers.

However, the current design has certain limitations that point to directions for future improvement. Firstly, the obstacle detection is primarily one-dimensional (forward-facing or downward-facing). Future iterations could incorporate 2D or 3D scanning lidar or stereo vision systems to build a more comprehensive map of the surroundings, enabling the agricultural drone to plan more optimal paths around complex obstacles rather than simple reactive arcs. Secondly, the path planning algorithm is reactive. Integrating a local re-planning module based on rapidly-exploring random trees (RRT) or model predictive control (MPC) could yield more efficient global paths in densely cluttered environments. Finally, further work is needed on system robustness against adverse weather conditions (e.g., heavy dust from spraying, rain) which can affect sensor performance, especially optical and laser-based sensors.

Enhancements could also include more advanced failure detection and mitigation strategies, communication protocols for multi-drone collision avoidance in swarm operations, and tighter integration with mission planning software to pre-emptively consider known obstacles.

6. Conclusion

This research presented the design and implementation of a comprehensive obstacle avoidance path control system tailored for agricultural drone applications. By leveraging the centimeter-level accuracy of laser rangefinders for altitude sensing and obstacle proximity detection, and fusing this data with high-precision GPS and inertial measurements through an Extended Kalman Filter, the system achieves a highly reliable estimation of the drone’s state. A hierarchical control structure employing cascaded PID controllers for altitude/velocity and position, coupled with a reactive obstacle avoidance algorithm, enables the agricultural drone to autonomously follow pre-defined flight paths while dynamically avoiding unexpected obstacles. Experimental validation across attitude, altitude, and obstacle avoidance scenarios confirmed the system’s strong control performance, accuracy, and practical viability. The proposed system provides a significant step towards fully autonomous, safe, and efficient operation of agricultural drones in the complex and unstructured low-altitude environments typical of modern precision agriculture, thereby helping to reduce operational risks and costs while enhancing productivity.

Scroll to Top