Skip to Content
AlgorithmsAlgorithms
  • Brief Report
  • Open Access

16 May 2026

10 Pages

Fuzzy PID Speed Control System for Sprayer Vehicles Based on Canopy Density

,
,
and
1
College of Agricultural Engineering and Food Science, Shandong University of Science and Technology, Zibo 255000, China
2
Department of Engineering, Harper Adams University, Newport TF10 8NB, UK
3
Nanjing Institute of Agricultural Mechanization, Ministry of Agriculture and Rural Areas, Nanjing 210014, China
*
Author to whom correspondence should be addressed.

Abstract

This study proposes an intelligent spraying vehicle speed control system integrating real-time canopy density detection with a fuzzy PID control algorithm. Utilizing LiDAR-acquired 3D point cloud data for canopy density calculation, the system dynamically adjusts PID parameters through fuzzy logic to achieve coordinated optimization of vehicle speed and spray volume. Based on the designed canopy density prediction model, a MATLAB/Simulink co-simulation framework integrating canopy perception with vehicle dynamics was established. Simulation results based on the MATLAB/Simulink platform demonstrate that the fuzzy PID controller achieves superior performance compared to conventional PID control. While maintaining a tracking accuracy of ±0.15 m/s, the proposed controller reduces speed overshoot by 5.8 percentage points. The developed control system ensures optimal speed tracking under varying canopy conditions, providing an extensible technical framework for intelligent sprayer vehicles.

1. Introduction

Precision spraying technology serves as a crucial approach to achieving sustainable agricultural development, effectively reducing pesticide overuse and minimizing environmental pollution [1,2] while ensuring efficient weed and pest control. Conventional sprayers typically employ uniform application methods, often resulting in excessive chemical usage in sparse canopy areas and insufficient dosing in dense regions [3,4]. In recent years, dynamic variable-rate spraying technology based on 3D canopy modeling has emerged as a research focus [5]. By real-time monitoring of crop canopy architecture [6], disease distribution, and growth status, this approach dynamically adjusts spray volume, nozzle activation, and operating speed, significantly improving pesticide utilization efficiency [7].
Recent advancements in precision canopy management have integrated 3D reconstruction and intelligent spraying technologies to optimize agricultural input [8,9,10,11]. In canopy modeling, UAV-based Structure-from-Motion (SFM) techniques have achieved high-resolution reconstructions of crops like maize and soybean [12], while multi-view sensor fusion has improved accuracy in orchard canopies. Further developments in multi-sensor systems enabled simultaneous volume measurement and disease detection, significantly reducing chemical usage [13]. For spray control, studies have demonstrated the efficacy of depth-sensing technologies, such as Kinect-based Leaf Wall Area mapping and RGB-D robotic systems [14]. Decision-making frameworks have also evolved, with targeted systems like multispectral-based powdery mildew control [15] and NDVI-optimized fungicide application achieving over 65% chemical reduction. Recent innovations, including swing-fan spray robots and [16] LiDAR-UAV integration, further highlight the potential for autonomous, input-efficient crop protection.
To address these advancements, this study proposes an intelligent speed regulation system integrating LiDAR-based real-time canopy density detection with a fuzzy PID control algorithm. By dynamically adjusting the spraying vehicle’s travel speed, the system optimizes chemical application. Based on the designed canopy density prediction model, a MATLAB 2022b/Simulink co-simulation framework integrating canopy perception with vehicle dynamics was established. Innovatively combining 3D point cloud density computation with fuzzy logic inference, this approach resolves adaptability limitations of conventional methods in nonlinear scenarios, providing a scalable technical solution for precision orchard spraying.

2. Materials and Methods

2.1. Variable-Rate Sprayer

The variable-rate sprayer primarily consists of three components: propulsion system, multi-channel air delivery system, and variable-rate spraying system. The vehicle adopts a self-propelled four-wheel sprayer platform equipped with full hydraulic power steering, HST drive system, cable-operated continuously variable transmission, throttle regulator, and braking system, with an operational speed range of 0–5.6 km/h. The multi-channel air delivery system mainly includes high-pressure water pipes, water distributors, and eight blowers (four on each side). The spraying system is mainly composed of a computer, LiDAR, microcontroller, relays, solenoid valves, and nozzles, with the computer, microcontroller and relays installed in an electrical control box.

2.2. Sprayer Speed Control System

The sprayer speed control system mainly consists of a vehicle propulsion system, environmental perception system, spraying control system and navigation control system, as shown in Figure 1.
Figure 1. The speed control system of the pesticide application vehicle.
The Robosense RS-LiDAR-16 sensor acquires canopy volume information. Mounted on the sprayer at an adjustable height of 1.2 m above ground, the sensor’s scanning range is set to −30° to 0° to scan the entire canopy while minimizing scanning of non-canopy objects, with its field of view fully covering the canopy. The computer controller processes all sensor data in real-time, with its high-performance computing capability meeting the real-time requirements of canopy volume detection and speed control. During operation, the computer processes the canopy volume information transmitted by the laser sensor in real time, calculates the required spray volume, and outputs the results to the microcontroller. The microcontroller then activates the motor at corresponding frequencies to control the throttle linkage motor angle on the sprayer, thereby achieving variable-rate spraying. The navigation control system issues control commands to the CAN bus, which are received and executed by both the propulsion control system and spraying control system.

2.3. Variable-Rate Spraying Control Strategy

2.3.1. Canopy Volume Calculation

This study proposes an accurate measurement method for fruit tree canopy volume based on 3D laser scanning. A laser scanning sensor serves as the core data acquisition device, featuring ±15 mm ranging accuracy and 25 Hz scanning frequency, making it suitable for 3D measurement tasks in complex environments.
The sensor employs CAN bus protocol for real-time data transmission. The measurement system is installed on a self-propelled four-wheel sprayer with travel speed maintained at 0.3–0.5 m/s. The sensor is mounted at 1.2 m height with a pitch angle of 15° to optimize canopy scanning coverage.
The data processing pipeline commences with the parsing and validation of raw hexadecimal data, followed by its conversion from polar to Cartesian coordinates as a fundamental preprocessing step.
x = r ⋅ sin θ ⋅ cos φ ,
y = r ⋅ sin θ ⋅ sin φ ,
z = r ⋅ cos θ ,
where r represents measurement distance, θ pitch angle, and φ azimuth angle.
To enable quantitative analysis of tree architecture, this study performed a multi-stage processing pipeline on the raw point cloud data. The procedure consisted of three main phases: preprocessing, structural segmentation, and volumetric quantification, as shown in Figure 2.
Figure 2. Tree canopy volume calculation flowchart.
First, the point cloud was preprocessed to reduce noise and interpolate data gaps. Denoising was achieved using a statistical outlier removal filter (search radius: 0.1 m; standard deviation multiplier: 1.5), and missing regions were reconstructed using local linear interpolation, thereby enhancing data continuity for the subsequent steps.
Next, the tree structure was sequentially segmented following a stem-to-crown approach. The trunk was initially extracted via cylinder fitting or hierarchical clustering, and its central axis was used to align the global coordinate system. Once the trunk was removed, the remaining crown points were separated through horizontal grid partitioning or Euclidean clustering within the established coordinate framework.
Finally, crown volume was quantified using a slice-based integration method with polynomial surface fitting. The segmented crown was sliced perpendicular to the trunk axis at 0.1 m intervals. For each slice, a 2D convex hull was constructed via Delaunay triangulation. A fifth-order polynomial was fitted to each hull contour to generate a smooth cross-sectional profile. The total crown volume was then calculated by integrating these fitted areas along the vertical axis. The calculation of vehicle movement during spraying and tree canopy volume is shown in Figure 3. The polynomial fitting formula is as follows [17]:
P x   =   a 5 x 5 +   a 4 x 4 +   a 3 x 3 +   a 2 x 2 +   a 1 x +   a 0 ,
Figure 3. Spraying vehicle movement and tree canopy volume chart.
Numerical integration for cross-sectional area calculation:
A = ∫ x 1 , x 2 P ( x ) d x ,
Trapezoidal rule for total volume computation:
V = ∑ ( A i + A i + 1 ) ⋅ Δ z 2 ,

2.3.2. Spray Dosage Calculation

The optimal spray dosage for fruit trees ranges from 0.1 to 0.13 L/m3 [18]. In the host computer system, after completing the canopy slice volume calculation, the system generates real-time motor control signals based on duty cycle formulas. With a 0.9 m spacing between the LiDAR and spray nozzles, the vehicle requires approximately 0.75 s to traverse the detection area when operating at maximum speed (1.2 m/s).

2.3.3. Vehicle Speed Control Strategy

The system employs a hierarchical control architecture to achieve precise sprayer operation control. The main controller utilizes an Intel NUC 11 industrial computer (equipped with an i7-1165G7 processor). Core execution devices include the following.
The control system is centered around an ABB ACS880 series variable-frequency drive, utilizing a PID control strategy enhanced by a fuzzy compensation algorithm to achieve smooth stepless speed regulation of the vehicle within a range of 0.5 to 5 km/h. The PID speed control principle is shown in Figure 4. A Danfoss EV220B solenoid valve array dynamically adjusts the travel speed based on real-time spraying demand, ensuring a consistent spray volume per unit area with a control precision of ±5%. Furthermore, an integrated RTK-GNSS positioning module provides high-precision (±2 cm) real-time positioning, supporting automated path-tracking functionality.
Figure 4. Vehicle speed PID control schematic diagram.
The system’s software, developed in C++, implements a modular architecture with four core functional modules: (1) data acquisition, operating at a sampling frequency of 100 Hz; (2) point cloud processing, which employs a ground point cloud segmentation algorithm based on the PCL library; (3) a control algorithm module featuring an enhanced fuzzy PID controller; and (4) an execution output module that regulates the throttle linkage motor with a modulation accuracy of 0.1%. The system adjusts vehicle speed automatically according to the vegetation point cloud data received from laser radar. Specifically, the density-speed relationship (Equation (7)) is used to calculate the target speed vref based on the detected vegetation density, thereby achieving intelligent and precise speed control.
v r e f = v min + ( v max − v min ) ⋅ ( 1 − σ )
where vmax and vmin represent the maximum and minimum permitted vehicle speeds, respectively. σ represents the normalized canopy density, defined as the ratio of point cloud points within the canopy volume to the total scanning points in the detection zone. This parameter was calibrated experimentally by correlating LiDAR-derived volume with manual measurements of foliage mass. To maintain a constant spray dosage per unit canopy volume (Dv), the vehicle speed is inversely adjusted: higher density (σ → 1) triggers deceleration (vref → vmin), whereas lower density (σ → 0) allows acceleration (vref → vmax), ensuring Dv = Q/(v·A) remains constant, where Q is flow rate and A is swath width.
All modules communicate via CAN bus to facilitate data exchange and real-time control.
This study develops an enhanced fuzzy-PID hybrid control algorithm for precise speed regulation of orchard sprayers, utilizing velocity error e(k) as the input variable to dynamically adjust PID parameters through a Mamdani-type fuzzy inference system. The controller employs a 5 × 5 fuzzy rule matrix as shown in Figure 5 and the centroid defuzzification method. Additionally, it adopts an online parameter self-tuning mechanism and optimizes the adjustment coefficients ΔKp, ΔKi, and ΔKd through the genetic algorithm [19,20]. By effectively integrating fuzzy logic with conventional PID control, this hybrid strategy successfully addresses nonlinear control challenges in complex orchard terrains, demonstrating improved precision, faster response, and enhanced spraying uniformity across varying topographic conditions while maintaining robust operational performance.
Figure 5. Fuzzy control algorithm.

3. Simulation and Analysis

3.1. Simulation Model Establishment of Spray Vehicle Speed Control

The simulation is based on the 3WP-500 sprayer model. The developed simulation model is shown in Figure 6, and it mainly consists of: (1) a canopy density generation module, (2) a vehicle dynamics module, and (3) a fuzzy logic-based PI speed regulation module. The canopy density generator was implemented in MATLAB to simulate a 300 m × 40 m orchard plantation with six rows of trees spaced at 8 m intervals. Each tree was assigned randomized canopy dimensions and density parameters to create realistic vegetation heterogeneity [21]. The resulting canopy distribution pattern is presented in the top-view schematic diagram (Figure 7). In the figure, the density of the plant canopy is represented by the shade of color and the size of the volume.
Figure 6. Simulation Model of Spray Truck Speed Control.
Figure 7. Top-down view of tree canopy distribution.
As illustrated in Figure 8, the developed fuzzy PID control module takes canopy density and dimensional parameters (length, height, and volume) as inputs. The fuzzy inference system incorporates a 7 × 7 rule base to dynamically adjust the PID parameters (Kp, Ki, and Kd) based on real-time operating conditions [22]. The optimized control signals are then processed by the PID controller to achieve precise speed regulation.
Figure 8. Fuzzy PID Control Module.
The vehicle dynamics module integrates five key components: the Vehicle VCU System, Vehicle Engine Module, Transmission Control Module, Vehicle Dynamics Module, and Wheels and Tires subsystem [23]. These modules are interconnected via standardized interfaces to establish a closed-loop simulation platform that accurately reproduces longitudinal dynamic responses of sprayer vehicles across varying terrain conditions [23]. The system provides a reliable virtual testbed for developing and validating control algorithms while supporting real-time parameter tuning. Its modular architecture ensures strong extensibility to accommodate complex operational scenarios in precision agriculture applications.

3.2. Analysis of Simulation Results

As demonstrated in Figure 9 and Figure 10, the simulation analysis reveals distinct canopy density characteristics between the left and right sides, with both raw and smoothed density curves presented for comparison. The developed canopy generation model successfully produces asymmetric density distributions, exhibiting variations not only between opposing sides but also within each individual side.
Figure 9. Density Curve of Dual-sided Spraying. (a) Analysis of spray density on the left side. (b) Analysis of spray density on the right side.
Figure 10. Comparison of spray density on both sides.
The spray density coefficient for the left-side trees ranges from 0.5 to 1.0, with a mean value of 0.75 ± 0.14, while the corresponding value for the right side is 0.73 ± 0.15. A moderate positive correlation (r = 0.68) is observed between the bilateral densities, and this asymmetric distribution poses a significant challenge for the coordinated optimization of the control system. Through mean filtering, the system effectively suppresses random noise in the density signal, thereby providing reliable input data for control decision-making.
To validate the control algorithm performance, comparative tests were conducted on the sprayer vehicle’s speed response using both conventional PID and fuzzy PID control strategies. Figure 11 shows the speed tracking curves of the two control strategies under the same operating conditions. The conventional PID control exhibited significant overshoot (maximum 12.3%) at canopy density transition points (70 m, 130 m, and 190 m positions). In contrast, the fuzzy PID control reduced overshoot to 5.8% through real-time parameter adaptation. Notably, during the high-density segment (l = 120–150 m), the fuzzy PID controller effectively suppressed speed fluctuations caused by load variations by strengthening integral action, while conventional PID showed noticeable adjustment lag.
Figure 11. Comparison of PID and Fuzzy PID Speed Control. (a) Vehicle speed based on PID control. (b) Vehicle speed based on fuzzy PID control.
Regarding the speed regulation performance of the sprayer, the system achieved high-precision speed tracking control. As shown in Figure 12, when the set speed varied within the range of 2.5–5.5 km/h, the root mean square error of the actual speed tracking was 0.124 m/s, with an overall tracking accuracy exceeding 95%. The system demonstrated excellent steady-state accuracy and disturbance rejection capability. When the canopy density was in the high-value region (>0.7), the vehicle speed decreased by 20–30%; in the low-value region (<0.4), the speed increased by 10–20%. This indicates a negative correlation between the application density and the actual speed. Experimental results show that the designed fuzzy PID speed control system can simultaneously account for both canopy density and canopy volume characteristics during spraying operations, thereby effectively improving application uniformity. It should be noted that the current study relies on simulated canopy data generated under ideal conditions. Factors such as wind-induced canopy movement and sensor occlusion in dense foliage, which could affect real-world deployment, were not fully accounted for in the simulation phase.
Figure 12. Graph showing the relationship between tree canopy density and vehicle speed. (a) Relationship between canopy density and speed. (b) Comparison of spraying density and actual speed.

4. Conclusions

This study presents an integrated canopy density mapping and fuzzy PID control system that achieves precise speed regulation through three key technological innovations: (1) a developed canopy density prediction model enabling spatial canopy density identification; (2) a MATLAB Simulink simulation framework incorporating canopy density inputs, fuzzy PID speed control modules, and vehicle dynamics modules to output sprayer speed variation curves; (3) simulation results demonstrating superior performance versus conventional PID control, maintaining tracking accuracy (±0.15 m/s) while reducing speed overshoot by 5.8%.
The proposed system effectively resolves the inherent conflict between vehicle dynamic response and variable canopy loading—where traditional control systems must compromise between stability (excessive overshoot) and responsiveness (regulation lag). By dynamically adjusting control parameters based on real-time canopy density, our approach ensures optimal speed tracking across varying canopy conditions, establishing an extensible technical framework for intelligent sprayer vehicles. Despite the promising simulation results, challenges remain in synchronizing the LiDAR data acquisition rate with the real-time response of the hydraulic propulsion system, particularly under rapid canopy transitions. Future work will focus on deploying the proposed system on a physical prototype to validate its performance under actual orchard conditions, including varying terrain slopes and GPS-denied environments.

Author Contributions

Conceptualization, Methodology, Writing—Original Draft, Y.W.; Writing—review and editing, N.E.; Formal analysis, Investigation, F.A.C.; Formal analysis, Supervision, C.J. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by China Scholarship Council. The APC was waived.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

This research was funded by China Scholarship Council.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Xu, S.; Zheng, S.; Rai, R. Dense object detection based canopy characteristics encoding for precise spraying in peach orchards. Comput. Electron. Agric. 2025, 232, 110097. [Google Scholar] [CrossRef] [Scilit]
  2. Campbell, C.; Al-Mallahi, A.; Watson, W. Automatic imaging system mounted on boom sprayer for crop scouting using an off-the-shelf RGB camera. Comput. Electron. Agric. 2022, 193, 106690. [Google Scholar] [CrossRef] [Scilit]
  3. Sanchez, P.R.; Zhang, H. Precision spraying using variable time delays and vision-based velocity estimation. Smart Agric. Technol. 2023, 5, 100253. [Google Scholar] [CrossRef] [Scilit]
  4. Nguyen, N.T.A.; Pham, C.C.; Lin, W.-C. Development of a line following autonomous spraying vehicle with Machine vision-based leaf density estimation for cherry tomato greenhouses. Comput. Electron. Agric. 2023, 215, 108429. [Google Scholar] [CrossRef] [Scilit]
  5. Nan, Y.; Zhang, H.; Zheng, J.; Yang, K.; Yang, W.; Zhang, M. Research on profiling tracking control optimization of orchard sprayer based on the phenotypic characteristics of tree crown. Comput. Electron. Agric. 2022, 192, 106455. [Google Scholar] [CrossRef] [Scilit]
  6. Luo, S.; Wen, S.; Zhang, L.; Lan, Y.; Chen, X. Extraction of crop canopy features and decision-making for variable spraying based on unmanned aerial vehicle LiDAR data. Comput. Electron. Agric. 2024, 224, 109197. [Google Scholar] [CrossRef] [Scilit]
  7. Garcia-Ruiz, F.; Campos, J.; Llop-Casamada, J.; Gil, E. Assessment of map based variable rate strategies for copper reduction in hedge vineyards. Comput. Electron. Agric. 2023, 207, 107753. [Google Scholar] [CrossRef] [Scilit]
  8. Liu, H.; Du, Z.; Shen, Y.; Du, W.; Zhang, X. Development and evaluation of an intelligent multivariable spraying robot for orchards and nurseries. Comput. Electron. Agric. 2024, 222, 109056. [Google Scholar] [CrossRef] [Scilit]
  9. Zhang, R.; Lian, S.; Li, L.; Zhang, L.; Zhang, C.; Chen, L. Design and experiment of a binocular vision-based canopy volume extraction system for precision pesticide application by UAVs. Comput. Electron. Agric. 2023, 213, 108197. [Google Scholar] [CrossRef] [Scilit]
  10. Li, Q.; Xue, Y. Real-time detection of street tree crowns using mobile laser scanning based on pointwise classification. Biosyst. Eng. 2023, 231, 20–35. [Google Scholar] [CrossRef] [Scilit]
  11. Zhang, Q.; Chen, Z.; Zhou, Z.; Wang, L.; Liao, Q.; Yang, C.; Yang, J. 3D terrestrial LiDAR for obtaining phenotypic information of cigar tobacco plants. Comput. Electron. Agric. 2024, 226, 109424. [Google Scholar] [CrossRef] [Scilit]
  12. Liu, X.; Liu, X.; Li, Y.; Yuan, J.; Song, L.; Li, H.; Wu, M. Estimation model of canopy stratification porosity based on morphological characteristics: A case study of cotton. Biosyst. Eng. 2020, 193, 174–186. [Google Scholar] [CrossRef] [Scilit]
  13. Liu, F.; Hu, P.; Zheng, B.; Duan, T.; Zhu, B.; Guo, Y. A field-based high-throughput method for acquiring canopy architecture using unmanned aerial vehicle images. Agric. For. Meteorol. 2021, 296, 108231. [Google Scholar] [CrossRef] [Scilit]
  14. Hejazipoor, H.; Massah, J.; Soryani, M.; Vakilian, K.A.; Chegini, G. An intelligent spraying robot based on plant bulk volume. Comput. Electron. Agric. 2021, 180, 105859. [Google Scholar] [CrossRef] [Scilit]
  15. Oberti, R.; Marchi, M.; Tirelli, P.; Calcante, A.; Iriti, M.; Tona, E.; Hočevar, M.; Baur, J.; Pfaff, J.; Schütz, C. Selective spraying of grapevines for disease control using a modular agricultural robot. Biosyst. Eng. 2016, 146, 203–215. [Google Scholar] [CrossRef] [Scilit]
  16. Nasir, F.E.; Tufail, M.; Haris, M.; Iqbal, J.; Khan, S.; Khan, M.T. Precision agricultural robotic sprayer with real-time Tobacco recognition and spraying system based on deep learning. PLoS ONE 2023, 18, e0283801. [Google Scholar] [CrossRef] [Scilit]
  17. Zhang, J.; Chen, Y.; Gu, C.; Li, Z.; Huang, J.; Lv, X.; Zhang, S.; Qiu, W. A variable-rate spraying method fusing canopy volume and disease detection to reduce pesticide dosage. Comput. Electron. Agric. 2025, 237, 110606. [Google Scholar] [CrossRef] [Scilit]
  18. Chen, Y.; Zhu, H.; Ozkan, H. Development of a variable-rate sprayer with laser scanning sensor to synchronize spray outputs to tree structures. Trans. ASABE 2012, 55, 773–781. [Google Scholar] [CrossRef] [Scilit]
  19. Khan, H.; Khatoon, S.; Gaur, P.; Khan, S.A. Speed control comparison of wheeled mobile robot by ANFIS, Fuzzy and PID controllers. Int. J. Inf. Technol. 2022, 14, 1893–1899. [Google Scholar] [CrossRef] [Scilit]
  20. Wang, T.; Wang, H.; Hu, H.; Lu, X.; Zhao, S. An adaptive fuzzy PID controller for speed control of brushless direct current motor. SN Appl. Sci. 2022, 4, 71. [Google Scholar] [CrossRef] [Scilit]
  21. Liu, Y.; Ru, Y.; Duan, L.; Qu, R. Model and design of real-time control system for aerial variable spray. PLoS ONE 2020, 15, e0235700. [Google Scholar] [CrossRef] [Scilit]
  22. Maghfiroh, H.; Ramelan, A.; Adriyanto, F. Fuzzy-PID in BLDC motor speed control using MATLAB/Simulink. J. Robot. Control. JRC 2021, 3, 8–13. [Google Scholar] [CrossRef] [Scilit]
  23. Zha, Y.; Deng, J.; Qiu, Y.; Zhang, K.; Wang, Y. A survey of intelligent driving vehicle trajectory tracking based on vehicle dynamics. SAE Int. J. Veh. Dyn. Stab. NVH 2023, 7, 221–248. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.