A LiDAR Sensor-Based Spray Boom Height Detection Method and the Corresponding Experimental Validation

Sprayer boom height (Hb) variations affect the deposition and distribution of droplets. An Hb control system is used to adjust Hb to maintain an optimum distance between the boom and the crop canopy, and an Hb detection sensor is a key component of the Hb control system. This study presents a new, low-cost light detection and ranging (LiDAR) sensor for Hb detection developed based on the principle of single-point ranging. To examine the detection performance of the LiDAR sensor, a step height detection experiment, a field ground detection experiment, and a wheat stubble (WS) height detection experiment as well as a comparison with an ultrasonic sensor were performed. The results showed that the LiDAR sensor could be used to detect Hb. When used to detect the WS height (HWS), the LiDAR sensor primarily detected the WS roots and the inside of the WS canopy. HWS and movement speed of the LiDAR sensor (VLiDAR) has a greater impact on the detection performance of the LiDAR sensor for the WS canopy than that for the WS roots. The detection error of the LiDAR sensor for the WS roots is less than 5.00%, and the detection error of the LiDAR sensor for the WS canopy is greater than 8.00%. The detection value from the LiDAR sensor to the WS root multiplied by 1.05 can be used as a reference basis for adjusting Hb, and after the WS canopy height is added to the basis, the value can be used as an index for adjusting Hb in WS field spraying. The results of this study will promote research on the boom height detection method and autonomous Hb control system.


Introduction
In recent years, as the level of agricultural mechanization in China has increased, boom sprayers have become the primary implements for spraying operations in fields due to their relatively good nozzle atomization performance, relatively large operating widths, and relatively high operating efficiency [1][2][3]. Since a boom sprayer sprays over a relatively wide area and field surfaces are uneven [4], unwanted boom motions typically occur when the sprayer tires pass over uneven terrain in the field, which can change the spraying height, cause the sprayer to fail to meet the operating requirements [5], and result in problems, such as the uneven deposition and distribution of droplets [6,7]. Thus, to improve the uniformity of the application of pesticides and reduce droplet drift during the field spraying process, it is necessary to maintain an optimum distance between the boom and the crop canopy [8][9][10]. It is vitally important to monitor and adjust the distance between the boom and the crop canopy in real-time.
The boom moves primarily by swinging and rotating the boom sprayers. These are the main movement forms that affect the deposition and distribution of droplets in fields. Researchers in China and abroad have conducted a series of studies on the effects of boom movement on the deposition and distribution of droplets and found that a significant difference between the two ends of spray boom can lead to a high coefficient of variation for the distribution of droplets. The number of droplets deposited by a sprayer with a boom swing of 0.3 m can reach three times that deposited by a normal spraying process [11,12]. Langenakens et al. studied the influence of the boom height vibration on droplet deposition and distribution through simulation methods. The results showed that the horizontal movement of the boom caused the variation coefficient of the droplet distribution to change between 20% and 600%, and the vertical vibration of the boom caused the variation coefficient of the droplet distribution to change between 0% and 1000% [13]. The boom height (H b ) can be detected in real-time with sensors, Table 1 lists the sensors currently used to detect the boom motion parameters. The ultrasonic sensors are the primary sensors used to detect H b , and the acceleration sensors are used to measure boom vibration. Based on the sensors in Table 1, some sensor systems are developed to effectively detect H b , which makes it possible to adjust the boom of a sprayer to follow the ground contour, thus maintaining the distance between the boom and ground or distance between the boom and the crop canopy within a stable range as the sprayer passes through an area with a complex and varied terrain. Each John Deere sprayer uses three ultrasonic sensors and one tilt sensor to achieve automatic detection of the position and attitude of the boom. Each Case sprayer uses ultrasonic sensors and adjusting wheels to control H b . Each Amazone sprayer achieves autonomous control and intelligent adjustment of the height and posture of the boom through tilt and ultrasonic sensors.  [14,15] Ooms et al. [16,17] Jeon et al. [18] Tilt sensor Boom tilt angle The sensor was installed in the middle of the boom to measure the boom tilt angle Easy to install Need to convert the tilt angle into the boom height Cui et al. [14,15] Qiu et al. [19] Acceleration sensor Boom displacement The sensor was installed at both ends and the middle of the boom to measure the vertical and horizontal vibration displacement of the boom It can analyse the vibration characteristics of the boom

High installation requirements
Wang et al. [20] Herbst et al. [21] Touch Sensor Boom height The sensor was installed at both ends and the middle of the boom to detect the boom height through contact rod deformation Fast response and less external interference The sensor contact rod will damage the crop Wang et al. [22] displacement sensor Boom displacement The sensor was installed at the connection of the boom and the suspension to detect the displacement of the boom relative to the swing rod and the damper It can detect the swing displacement of the boom High installation requirements Cui et al. [11] Ultrasonic sensor-based autonomous H b control systems have been developed. Cui et al. [14,15] developed an automatic H b control system based on a digital signal Sensors 2021, 21, 2107 3 of 20 processor (DSP) and proposed a signal processing method that integrates limit filtering, data smoothing, and an optimum weight-based data fusion algorithm. This system can effectively control changes in H b and meet field operating requirements. Magalhães et al. [23] controlled changes in H b using a fractional proportional-integral-derivative (PID) control technique that was more suitable for H b control than conventional PID control techniques. Tahmasebi et al. [24,25] controlled the boom movement using a robust intelligent control method based on active torque control (ATC). This method can effectively impede the swing and vibration of a boom relative to its suspension system. However, these autonomous H b control systems perform relatively well on flat terrain and plains with large areas of farmland but are unsuitable for high-speed, complex operating settings. Complex farmland grounds require that autonomous H b control systems have relatively high response speeds; however, ultrasonic sensors are prone to disturbance from external factors during the H b detection process, and there are bottlenecks in the research on signal processing algorithms for ultrasonic sensors for high-speed or complex operating settings. As boom sprayers are becoming increasingly large and efficient, it is urgently necessary to make breakthroughs in signal processing algorithms for H b detection sensors or to develop new sensors suitable for H b detection.
The objective of this research was to develop a new, low-cost light detection and ranging (LiDAR) sensor for H b detection based on the principle of single-point ranging. A step height detection experiment, a field ground detection experiment, and a wheat stubble (WS) height detection experiment as well as a comparison with an ultrasonic sensor were performed to evaluate the detection performance of the LiDAR sensor. Meanwhile, a H b detection method based on the LiDAR sensor was proposed to adjust the boom height for spraying on WS fields. The results of this study support research on boom height detection method and autonomous H b control system. This paper is structured in five sections, as follows: Section 1 introduces the previous work and the purpose of the research. Section 2 provides the LiDAR sensor design, experimental platform design for H b detection and the detection performance experiment for the LiDAR sensor. Section 3 presents the field test results. Section 4 discusses the test results. Section 5 presents the conclusions.

LiDAR Sensor Design
Compared to ultrasonic sensors, LiDAR sensors have advantages, such as a higher measurement precision, a higher response speed, and a higher interference resistance. In this study, a new LiDAR sensor suitable for H b detection was developed based on a lowcost, small-sized, low-power single-point laser rangefinder, TFmini Plus, manufactured by Benewake Co., Ltd. (Beijing, China), which measures distances based on the time-offlight (ToF) principle. During the measurement process, the sensor periodically outwardly transmits a modulated near-infrared wave that is reflected upon contact with an object. The ToF is calculated by determining the difference in phase between the incident and reflected waves. On this basis, the distance from the tested target is determined. This single-point ranging sensor is composed primarily of a front shell, a transmitting lens, a receiver lens, a circuit board, screws, lenses, an ultrasonic welded structure, a back shell, a tail cable, a tail cable fastener, location columns, a mounting hole, a barbed structure, a protective shield, mounting grooves, and a partition structure (Figure 1a). Equipped with a unique optical and electrical design, this sensor can measure distances in a stable, accurate, and highly sensitive manner. The parameter indicators of the LiDAR sensor are shown in Table 2.

Sensor Check
The LiDAR sensor needs to be checked prior to use. Figure 2 shows a photograph o the experimental setting for checking the LiDAR sensor. The LiDAR sensor was placed i an unobstructed, open space. A computer was connected via a universal serial bus (USB serial port to a current signal acquisition card. The computer interface could display th current signal output by the LiDAR sensor in real time. A paper box was used as an objec for detection in the experiment. A tape measure was placed directly below the central axi of the beam transmitted by the LiDAR sensor to record the distance over which the pape box moved. During the experiment, the paper box was placed directly in front of the sen sor. The paper box was moved at distance intervals of 10 cm within the measuring rang (0.1-2 m) of the LiDAR sensor. The current signal output by the LiDAR sensor was rec orded when the paper box was moved. Three repeats were performed for each process The average of the three measurements was used to fit a detected distance-output curren curve.  The single-point LiDAR sensor outputs signals at the transistor-transistor logic (TTL) level and thus has a limited signal transmission distance. H b detection sensors installed at the two ends of a boom transmit signals over a distance exceeding 10 m, but the TTL transmission mode cannot ensure signal validity. To address this problem, a signal processing module was developed based on an STM32F103RCT6 single-chip microcomputer (SCM). This module can convert the signal output of the LiDAR sensor to a 4-20 mA signal output. Figure 1b shows the circuit board of this module. This signal processing module primarily consists of a main control module, a power module, and a current module. The main control module, composed of an ST STM32F103RCT6 SCM with a 72-MHz central processing unit (CPU) and 1-MB flash memory, is capable of simultaneously supporting serial port and controller area network (CAN) communication. The program download module has a serial wire debug (SWD) download interface that allows the user to develop and debug programs. The power module uses MPS MP1584DN and AMS AMS1117-3.3 switch mode voltage regulators and can supply a 12 V direct current (DC) and output 5 V and 3.3 V. The current output module, composed of a Texas Instruments voltage-to-current converter chip, is capable of converting a sensor signal to a 4-20 mA current signal output. During operation, the power module converts a 12 V DC input voltage to 5 V and 3.3 V to supply power to the main control and current output modules. The main control module acquires the distance information measured by the LiDAR sensor through communication at the TTL level via the serial port and subsequently converts it to a voltage signal and outputs it to the current output module via a pin of the SCM. The current output module converts the voltage signal to a current signal output. The detection range of the LiDAR sensor of 0.1-12 m corresponds to a current signal range of 4-20 mA. To improve the stability and accuracy of the output current signal in the signal conversion process, a PID control algorithm was incorporated into the signal conversion algorithm. In addition, to enhance the ranging performance of the LiDAR sensor in complex operating conditions, an adaptive algorithm for multiple application settings and targets was added to the signal conversion process, and multiple adjustable configurations and parameters were included. These measures can ensure that the LiDAR sensor performs well in ranging operations in complex settings and meets agricultural requirements in complex applications. Finally, the LiDAR sensor was encapsulated to facilitate the mounting and protection, as shown in Figure 1c,d. The boom sprayers often operate in complex field conditions. The encapsulated sensor was subjected to environmental temperature testing at −40 to 85 • C, vibration testing, and Ingress Protection 67 testing to determine if it could meet the operating requirements.

Sensor Check
The LiDAR sensor needs to be checked prior to use. Figure 2 shows a photograph of the experimental setting for checking the LiDAR sensor. The LiDAR sensor was placed in an unobstructed, open space. A computer was connected via a universal serial bus (USB) serial port to a current signal acquisition card. The computer interface could display the current signal output by the LiDAR sensor in real time. A paper box was used as an object for detection in the experiment. A tape measure was placed directly below the central axis of the beam transmitted by the LiDAR sensor to record the distance over which the paper box moved. During the experiment, the paper box was placed directly in front of the sensor. The paper box was moved at distance intervals of 10 cm within the measuring range (0.1-2 m) of the LiDAR sensor. The current signal output by the LiDAR sensor was recorded when the paper box was moved. Three repeats were performed for each process. The average of the three measurements was used to fit a detected distance-output current curve.

Experimental Platform Design for H b Detection
The detection performance of the LiDAR sensor was mainly affected by the moving speed and the uneven wheat stubble canopy. To investigate the effect of moving speed and uneven wheat stubble canopy on the detection performance of the LiDAR sensor, an experimental platform for H b detection by the LiDAR sensor was constructed, as shown in Figure 3c. This experimental platform was composed primarily of a sensor fixation bar, a sliding track, a stepper motor, a synchronous belt, a sliding block, a stepper motor driver, and a controller. The total length of the experimental platform was 6.5 m. The effective length of the sliding track was 6.0 m. The sliding track was fixed in a bridge mode. The sliding block, with a length of 0.3 m, was used to fix the sensor fixation bar. Four CZ-7166 limit switches (Testo Instruments International Trading (Shanghai, China) Co., Ltd.), including two outer limit switches and two inner limit switches, were set at the two ends of the sliding track. The two outer limit switches, which served as safety limit switches, prevented the sliding block from impacting the two ends of the sliding track. The two inner limit switches, which served as position limit switches, limited the range of movement of the sliding block to 5 m. Of the mobile devices, the KH-01 stepper motor controller (Relong Automation Equipment (Zhejiang, China) Co., Ltd.) precisely controlled the HB80D stepper motor (Hongbaoda Industry (Shenzhen, China) Co., Ltd.) via the HB860D driver (Hongbaoda Industry Co., Ltd.) to drive the sliding block to steadily move along the track. The speed and range of the sliding block could be precisely controlled. During the experiment, to accurately record H b values detected by the LiDAR sensor at different locations in the horizontal direction, an S85-MH-5-Y03-OOI laser rangefinder with a measuring range of 10 m and a current signal output of 4-20 mA (Datalogic Industrial Automation Company Ltd. (Shenzhen, China)) was fixed at one end of the sliding platform. The laser-reflecting plate and the LiDAR sensor were placed at the same horizontal location. The laser rangefinder recorded the horizontal location of the LiDAR sensor by measuring the location of the laser-reflecting plate. An SG-AD-Modbus-8I data acquisition card (DAC) (Sange Electronic Technology (Tianjin, China) Co., Ltd.) was used to simultaneously collect measurement data from the laser rangefinder and the LiDAR sensor. The DAC communicated with the upper computer via a RS485 serial port. A general acquisition system for analogue signals designed by Zhai et al. [26] that can collect experimental data and store the data in a database to facilitate subsequent experimental analysis was used in the upper computer.

Step Detection Experiment
To examine the effects of the movement speed of the LiDAR sensor (VLiDAR) o detection performance, a step detection experiment was designed. In this experimen paper boxes (0.30 m × 0.20 m × 0.10 m) were stacked to form a flight of eight step shown in Figure 3a. The LiDAR sensor was fixed at one end of the sensor fixation ba could detect vertically downward ( Figure 3a). Prior to the experiment, the sliding b of the experimental platform for Hb detection was manually pushed to change the dist detected by the LiDAR sensor. A tape measure was used to measure the distance o LiDAR sensor from the ground and each step, and the corresponding measurements recorded. During the experiment, the center of the step-like ground for detection placed on a straight line parallel to and at a horizontal distance of 1.0 m from the c line of the track of the sliding platform. The sliding block was used to drive the Li sensor to move along a straight line at a uniform speed. The LiDAR sensor was loc directly above the surface of the steps for detection at the site throughout its move with the sliding block. In addition, the position limit switches were used to contro LiDAR sensor in such a way that the LiDAR sensor took measurements at distance i vals of 5.0 m. According to the experimental design in Zhai et al. [26], the measurem taken by the LiDAR sensor when moving at a speed of 0.05 m/s were treated as true ues. The sliding block was controlled to move at speeds of 0.3, 0.6, 0.9, and 1.2 m/s measurements taken by the LiDAR sensor when moving at various speeds were colle Three repeats were performed for each test. The average of the three measurements t by the LiDAR sensor was used as the ultimate measured value.

Step Detection Experiment
To examine the effects of the movement speed of the LiDAR sensor (V LiDAR ) on the detection performance, a step detection experiment was designed. In this experiment, 70 paper boxes (0.30 m × 0.20 m × 0.10 m) were stacked to form a flight of eight steps, as shown in Figure 3a. The LiDAR sensor was fixed at one end of the sensor fixation bar and could detect vertically downward (Figure 3a). Prior to the experiment, the sliding block of the experimental platform for H b detection was manually pushed to change the distance detected by the LiDAR sensor. A tape measure was used to measure the distance of the LiDAR sensor from the ground and each step, and the corresponding measurements were recorded. During the experiment, the center of the step-like ground for detection was placed on a straight line parallel to and at a horizontal distance of 1.0 m from the center line of the track of the sliding platform. The sliding block was used to drive the LiDAR sensor to move along a straight line at a uniform speed. The LiDAR sensor was located directly above the surface of the steps for detection at the site throughout its movement with the sliding block. In addition, the position limit switches were used to control the LiDAR sensor in such a way that the LiDAR sensor took measurements at distance intervals of 5.0 m. According to the experimental design in Zhai et al. [26], the measurements taken by the LiDAR sensor when moving at a speed of 0.05 m/s were treated as true values. The sliding block was controlled to move at speeds of 0.3, 0.6, 0.9, and 1.2 m/s. The measurements taken by the LiDAR sensor when moving at various speeds were collected. Three repeats were performed for each test. The average of the three measurements taken by the LiDAR sensor was used as the ultimate measured value.

Field Ground Detection Experiment
A field ground detection experiment was performed in a rotary-tilled field, as shown in Figure 3b. In this experiment, the distance between the signal transmission plane of the LiDAR sensor and the ground was measured. The experimental platform for H b detection was placed in a rotary-tilled field. The distance between the LiDAR sensor and the ground was set to 1.4 m. Soil was manually heaped to produce a small slope, approximately 0.5 and 0.4 m in length and height, respectively, on the ground that was a horizontal distance of 1.0 m from the centre line of the track of the sliding platform to simulate an undulating surface. The sliding block was used to drive the LiDAR sensor to move over 5.0 m along a straight line at a uniform speed directly above the horizontal line of the small slope, as shown in Figure 3b. During the experiment, a tape measure was first used to measure the distance between the LiDAR sensor and the ground at intervals of 0.1 m. Then, V LiDAR was adjusted to 0.05 m/s. The measurements taken by the LiDAR sensor when moving at this speed were treated as the true values. Finally, the sliding block was controlled to move at speeds of 0.3, 0.6, 0.9, and 1.2 m/s. The measurements taken by the LiDAR sensor at various speeds were collected. Three repeats were performed for each test. The average of the three measurements taken by the LiDAR sensor was used as the ultimate measured value.

Height Detection Experiment in a WS Field
The autumn crops are generally planted without tillage after harvesting wheat in China. It is necessary to spray pesticides and remove weeds before no-tillage planting. To examine the effects of WS canopies on the H b detection performance of the LiDAR sensor, an H b detection experiment in a post-harvest WS field was designed, as shown in Figure 3d. Before the experiment, an unharvested wheat plot 5.0 m long and 0.3 m wide was randomly selected. A harvester was then used to harvest the wheat in the plot. The header height of the harvester was set to 0.35, 0.25, and 0.15 m for areas a, b, and c of the plot, respectively, as shown in Figure 3d. Post-harvest areas a, b, and c were 1.5, 2.2, and 1.3 m in length, respectively. During the experiment, the experimental platform for H b detection was first placed in each WS area in such a way that the LiDAR sensor was directly above the selected WS canopy. After the experimental platform was placed, the LiDAR sensor was moved to the starting position. A tape measure was used to measure the distances of the LiDAR sensor from the WS canopy and the ground at intervals of 0.1 m until the LiDAR sensor moved to its final position. Subsequently, V LiDAR was adjusted to 0.05 m/s, and the measurements taken by the LiDAR sensor when moving at this speed were treated as the true values. Finally, the sliding block was controlled to move at speeds of 0.3, 0.6, 0.9, and 1.2 m/s. The measurements taken by the LiDAR sensor at these speeds were collected. Three repeats were performed for each test. The average of the three measurements taken by the LiDAR sensor was used as its ultimate measurement.

Comparison of the LiDAR Sensor and an Ultrasonic Sensor
The ultrasonic sensors are the main type of sensor used to detect H b . To better illustrate the feasibility of using the LiDAR sensor to detect H b , an experiment was designed to compare the LiDAR sensor with an ultrasonic sensor. A knapsack boom sprayer was selected for the experiment. The boom of this sprayer was 21 m in length and was divided into three sections, namely, left, middle, and right sections. The left and right sections of the boom were each further divided into two sections. The extension and contraction of the boom was controlled by a hydraulic cylinder (Figure 4). One LiDAR sensor and one ultrasonic sensor were placed at the left, middle, and right sections of the boom to monitor the changes in H b in each section in real-time.
into three sections, namely, left, middle, and right sections. The left and the boom were each further divided into two sections. The extension a the boom was controlled by a hydraulic cylinder (Figure 4). One LiDA ultrasonic sensor were placed at the left, middle, and right sections of the the changes in Hb in each section in real-time.   Figure 5. During the experiment, the tank of the sprayer was filled half full with water. The height of the nozzle of the sprayer head was set to 110 cm above ground. The signal transmission plane of the LiDAR sensor and the nozzle were set on the same horizontal plane. The sprayer was mounted on a tractor. The Chinese standard GB/T 20183.3-2006 "Equipment for crop protection-Spraying equipment-Part 3: Test methods for volume/hectare adjustment systems of agricultural hydraulic pressure sprayers" is considered, which requires that the speed during the test be 1.5 m/s to 2.5 m/s, and studies have usually sprayed at a moving speed of 1.9 m/s in recent years [27]. The sprayer was operated at speeds of 2.0 m/s. The experiment was repeated three times. The changes in H b during each test were recorded.

2021, 21, x FOR PEER REVIEW
The experiment was performed in a rotary-tilled field (4 (560 m × 240 m) with a WS height (HWS) of 20 cm at the N Precision Agriculture, Beijing, China, as shown in Figure 5. tank of the sprayer was filled half full with water. The height head was set to 110 cm above ground. The signal transmissio and the nozzle were set on the same horizontal plane. The tractor. The Chinese standard GB/T 20183.3-2006 "Equipment ing equipment-Part 3: Test methods for volume/hectare adj tural hydraulic pressure sprayers" is considered, which requir test be 1.5 m/s to 2.5 m/s, and studies have usually sprayed a in recent years [27]. The sprayer was operated at speeds of 2 repeated three times. The changes in Hb during each test were

Acceleration Data Processing
The K-means clustering algorithm was used to process data. The algorithm first selects k objects at random from da tering centres, calculates the distance between each object and ing to the mean value of each clustering object, and re-divide according to the minimum distance. Then, the algorithm re-ca cluster. This process is repeated until each cluster no longer c

Acceleration Data Processing
The K-means clustering algorithm was used to process the LiDAR sensor detection data. The algorithm first selects k objects at random from data objects as the initial clustering centres, calculates the distance between each object and these central objects according to the mean value of each clustering object, and re-divides the corresponding objects according to the minimum distance. Then, the algorithm re-calculates the average of each cluster. This process is repeated until each cluster no longer changes [28,29]. Usually, the criteria for the K-means algorithm use the squared error criterion function, which is defined as: where E is the sum of the squared error in the data set of all the LiDAR sensor detection values, C i is the cluster of LiDAR sensor detection values, x is the LiDAR sensor detection value, and x i is the average value of cluster C i . k is the number of clusters.
Our previous study contains more details on this process [30]. The flow chart of the H b calculation based on the K-means clustering algorithm is shown in Figure 6. During the working process, the H b detection system reads the three LiDAR sensor signals in real-time, and it first judges the validity of the sensor detection signal. If the detection signal is abnormal, it will judge whether the sensor has entered the blind zone. Once the LiDAR sensor has entered the blind zone, the system will send a data exception command. Otherwise, the system will convert the obtained data into H b values every 1 s and store them in an array form and then call the K-means clustering algorithm to preprocess the acquired H b detection data, ultimately obtaining accurate H b detection values.  Figure 6. Flow chart of Hb calculation based on the K-means clustering algorithm.

Sensor Check
The Hb values measured by the LiDAR sensor for the left, middle, and rig of the boom were fitted to the output current data. Figure 7 shows the fitted cu left, middle, and right sections of the boom. The R 2 values of the equations 0.9996, and 0.9998, respectively. Evidently, the three LiDAR sensors show go and meet the operating requirements.

Sensor Check
The H b values measured by the LiDAR sensor for the left, middle, and right sections of the boom were fitted to the output current data. Figure 7 shows the fitted curves for the left, middle, and right sections of the boom. The R 2 values of the equations are 0.9994, 0.9996, and 0.9998, respectively. Evidently, the three LiDAR sensors show good linearity and meet the operating requirements.
The Hb values measured by the LiDAR sensor for the left, middle, and right of the boom were fitted to the output current data. Figure 7 shows the fitted curve left, middle, and right sections of the boom. The R 2 values of the equations ar 0.9996, and 0.9998, respectively. Evidently, the three LiDAR sensors show good and meet the operating requirements.  Figure 8 shows the distances detected by the LiDAR sensor when moving at speeds. As demonstrated in Figure 8, the distances detected by the LiDAR sens moving at different speeds can reflect the changes in the step height. However tances detected by the LiDAR sensor at the junctions of the ground and the uppe of the flight of steps formed by paper boxes differ from the true values. In addi difference becomes increasingly prominent as VLiDAR increases. This is because t of spread of the beam transmitted by the LiDAR sensor is 3.6°. As the LiDAR senso to directly above each junction of the ground and the upper surface of the flight

3.2.
Step Detection Experiment Figure 8 shows the distances detected by the LiDAR sensor when moving at different speeds. As demonstrated in Figure 8, the distances detected by the LiDAR sensor when moving at different speeds can reflect the changes in the step height. However, the distances detected by the LiDAR sensor at the junctions of the ground and the upper surface of the flight of steps formed by paper boxes differ from the true values. In addition, this difference becomes increasingly prominent as V LiDAR increases. This is because the angle of spread of the beam transmitted by the LiDAR sensor is 3.6 • . As the LiDAR sensor moves to directly above each junction of the ground and the upper surface of the flight of steps, the beam transmitted by the LiDAR sensor partially reaches the ground and partially reaches the upper surface of the flight of steps, thus affecting the distance detected by the LiDAR sensor. As the detection of the LiDAR sensor moves from the ground to the upper surface of the flight of steps, there is a detection delay in the LiDAR sensor. Moreover, as V LiDAR increases from 0.3 to 0.9 m/s, the detection delay increases. As V LiDAR increases from 0.9 to 1.2 m/s, the detection delay decreases. This is because as V LiDAR increases, there is a decrease in the amount of data sampled over the same distance of movement, and the low amount of sampled data increases the detection delay. The junction between the ground and the upper surface of the flight of steps is relatively small. When moving at a speed of 1.2 m/s, the LiDAR sensor is unable to detect the junction; therefore, the detection delay is reduced. As the LiDAR sensor moves from the upper surface of the flight of steps to the ground, the distances detected by the LiDAR sensor are between those from the ground and the upper surface of the flight of steps. This is because the large difference between the heights of the ground and the upper surface of the flight of steps at this junction increases the probability for the beam transmitted by the LiDAR sensor to reach the sides of the flight of steps. A low V LiDAR leads to a high probability that the beam transmitted by the LiDAR sensor reaches the sides of the flight of steps.
ground, the distances detected by the LiDAR sensor are between those from the and the upper surface of the flight of steps. This is because the large difference b the heights of the ground and the upper surface of the flight of steps at this junc creases the probability for the beam transmitted by the LiDAR sensor to reach the the flight of steps. A low VLiDAR leads to a high probability that the beam transm the LiDAR sensor reaches the sides of the flight of steps.  Figure 9 shows the distances from the field ground detected by the LiDAR s different detection speeds. As demonstrated in Figure 9, the distances detected by DAR sensor can reflect the changes in the slope of the field ground well. Thus, the sensor can be used to detect changes in Hb in rotary-tilled fields. Compared to th of steps used in the step detection experiment, the height of the surface of the slop field varies gently. There is no notable detection delay as VLiDAR increases. Howe distances detected by the LiDAR sensor at the slope differ from the true values. I tion, this difference increases as VLiDAR increases. This is because as VLiDAR increase is a decrease in the amount of sampled data. The low amount of sampled data redu detection accuracy of the LiDAR sensor and, thereby, increases its detection error  Figure 9 shows the distances from the field ground detected by the LiDAR sensor at different detection speeds. As demonstrated in Figure 9, the distances detected by the LiDAR sensor can reflect the changes in the slope of the field ground well. Thus, the LiDAR sensor can be used to detect changes in H b in rotary-tilled fields. Compared to the flight of steps used in the step detection experiment, the height of the surface of the slope in the field varies gently. There is no notable detection delay as V LiDAR increases. However, the distances detected by the LiDAR sensor at the slope differ from the true values. In addition, this difference increases as V LiDAR increases. This is because as V LiDAR increases, there is a decrease in the amount of sampled data. The low amount of sampled data reduces the detection accuracy of the LiDAR sensor and, thereby, increases its detection error. Figure 10 shows the distances detected by the LiDAR sensor at different H WS and V LiDAR values. As demonstrated in Figure 10, when H WS remains unchanged, there is a small change in the distance detected by the LiDAR sensor as V LiDAR increases from 0.05 to 1.2 m/s. This suggests that when H WS remains unchanged, V LiDAR has less of an impact on the distance detected by the LiDAR sensor. As H WS increases, the distance detected by the LiDAR sensor increases. The detected distances can reflect the changes in H WS . However, the distance detected by the LiDAR sensor is between the ground and the surface of the WS canopy. In addition, there is no notable pattern between the changes in the distance detected by the LiDAR sensor and H WS . This finding suggests that H WS affects the distance detected by the LiDAR sensor and that the distance detected by the LiDAR sensor is between the ground and the surface of the WS canopy.  Figure 10 shows the distances detected by the LiDAR sensor at different VLiDAR values. As demonstrated in Figure 10, when HWS remains unchanged, th small change in the distance detected by the LiDAR sensor as VLiDAR increases from 1.2 m/s. This suggests that when HWS remains unchanged, VLiDAR has less of an im the distance detected by the LiDAR sensor. As HWS increases, the distance detecte LiDAR sensor increases. The detected distances can reflect the changes in HWS. H the distance detected by the LiDAR sensor is between the ground and the surfa WS canopy. In addition, there is no notable pattern between the changes in the detected by the LiDAR sensor and HWS. This finding suggests that HWS affects the detected by the LiDAR sensor and that the distance detected by the LiDAR sens tween the ground and the surface of the WS canopy.   Figure 10 shows the distances detected by the LiDAR sensor a VLiDAR values. As demonstrated in Figure 10, when HWS remains un small change in the distance detected by the LiDAR sensor as VLiDAR in 1.2 m/s. This suggests that when HWS remains unchanged, VLiDAR has l the distance detected by the LiDAR sensor. As HWS increases, the dista LiDAR sensor increases. The detected distances can reflect the change the distance detected by the LiDAR sensor is between the ground an WS canopy. In addition, there is no notable pattern between the chan detected by the LiDAR sensor and HWS. This finding suggests that HWS detected by the LiDAR sensor and that the distance detected by the L tween the ground and the surface of the WS canopy. To further analyse the distribution of the distance detected by the LiDAR sensor within the WS canopy, the distances detected by the LiDAR sensor at different H WS values were subjected to a cluster analysis using the K-means clustering analysis algorithm, and the results are shown in Figure 11. The clustering results show that the detection signal transmitted by the LiDAR sensor partially reaches the inside of the WS canopy and partially reaches the WS roots and that the signal reflection sites are distributed in a random manner. Since the post-harvest wheat straws are thin-walled circular tubes, the WS canopy exhibits a sparse, porous structure that absorbs the detection beam and, thereby, causes the reflection sites of the signal transmitted by the laser within the WS canopy to change. Moreover, due to tillering, there are many branches at the WS roots near the ground, resulting in a relatively high density at the WS roots. Most of the signals transmitted by the LiDAR sensor reach the WS roots. Consequently, the distances from the WS detected by the LiDAR sensor are close to those from the ground.

WS Height Detection Experiment
Sensors 2021, 21, x FOR PEER REVIEW To further analyse the distribution of the distance detected by the LiDAR within the WS canopy, the distances detected by the LiDAR sensor at different HW were subjected to a cluster analysis using the K-means clustering analysis algorith the results are shown in Figure 11. The clustering results show that the detectio transmitted by the LiDAR sensor partially reaches the inside of the WS canopy a tially reaches the WS roots and that the signal reflection sites are distributed in a manner. Since the post-harvest wheat straws are thin-walled circular tubes, the W opy exhibits a sparse, porous structure that absorbs the detection beam and, causes the reflection sites of the signal transmitted by the laser within the WS ca change. Moreover, due to tillering, there are many branches at the WS roots n ground, resulting in a relatively high density at the WS roots. Most of the signa mitted by the LiDAR sensor reach the WS roots. Consequently, the distances from detected by the LiDAR sensor are close to those from the ground. To analyse the effects of HWS on the detection performance of the LiDAR se the WS roots and canopy, the mean errors of the distances detected by the LiDAR from the WS roots and canopy in areas a, b, and c were statistically analysed, results are shown in Figure 12. As demonstrated in Figure 12, for each area, the me of the distances detected by the LiDAR sensor from the WS roots is lower than th distances detected by the LiDAR sensor from the WS canopy. As HWS decreases, th detection errors of the LiDAR sensor for both the WS roots and canopy in each ar ually decrease. The maximum and minimum detection errors of the LiDAR senso WS roots are 3.08% and 1.40%, respectively. There are no significant changes in th tion error of the LiDAR sensor between areas a and b. However, the detection erro LiDAR sensor for area c is notably lower than those for areas a and b. This is be areas a and b, the WS canopy is relatively high, and the litter layer at the WS ro been relatively insignificantly damaged during the harvesting process. In contrast c, the litter layer had been relatively significantly damaged during the harvesting so the beam transmitted by the LiDAR sensor mostly reaches the WS roots. As To analyse the effects of H WS on the detection performance of the LiDAR sensor for the WS roots and canopy, the mean errors of the distances detected by the LiDAR sensor from the WS roots and canopy in areas a, b, and c were statistically analysed, and the results are shown in Figure 12. As demonstrated in Figure 12, for each area, the mean error of the distances detected by the LiDAR sensor from the WS roots is lower than that of the distances detected by the LiDAR sensor from the WS canopy. As H WS decreases, the mean detection errors of the LiDAR sensor for both the WS roots and canopy in each area gradually decrease. The maximum and minimum detection errors of the LiDAR sensor for the WS roots are 3.08% and 1.40%, respectively. There are no significant changes in the detection error of the LiDAR sensor between areas a and b. However, the detection error of the LiDAR sensor for area c is notably lower than those for areas a and b. This is because in areas a and b, the WS canopy is relatively high, and the litter layer at the WS roots had been relatively insignificantly damaged during the harvesting process. In contrast, in area c, the litter layer had been relatively significantly damaged during the harvesting process, so the beam transmitted by the LiDAR sensor mostly reaches the WS roots. As a consequence, the detection error of the LiDAR sensor for the WS roots is demonstrably lower in area c than areas a and b. For the WS canopies, the maximum and minimum detection errors of the LiDAR sensor are 18.11% and 7.65%, respectively, and the detection error of the LiDAR sensor changes considerably in areas a, b, and c. This is because as H WS decreases, there is an increase in the density of the WS canopy. In addition, the presence of a relatively large amount of litter below a relatively low WS canopy improves the ability of the WS canopy to reflect the laser beam and, thereby, increases the detection accuracy of the LiDAR sensor for the WS canopy. s 2021, 21, x FOR PEER REVIEW the LiDAR sensor changes considerably in areas a, b, and c. Th creases, there is an increase in the density of the WS canopy. In a a relatively large amount of litter below a relatively low WS cano of the WS canopy to reflect the laser beam and, thereby, increase of the LiDAR sensor for the WS canopy. To investigate the effects of VLiDAR on the detection performa for the WS roots and canopy in each area, the detection errors of th at different speeds for the WS roots and canopy in each area were marizes the results. As demonstrated in Table 3, VLiDAR has a grea tion performance of the LiDAR sensor for the WS canopy than each area. For the WS roots in areas a, b, and c, the maximum de DAR sensors are 4.66%, 3.67%, and 2.44%, respectively, and the m are 2.43%, 2.45%, and 0.68%, respectively. For the WS canopies maximum detection errors of the LiDAR sensors are 20.02%, 12. tively, and the minimum detection errors are 16.80%, 11.48%, a When HWS remains unchanged, VLiDAR has a slight impact on the LiDAR sensor for the WS roots and canopy. In addition, when VL To investigate the effects of V LiDAR on the detection performance of the LiDAR sensor for the WS roots and canopy in each area, the detection errors of the LiDAR sensor moving at different speeds for the WS roots and canopy in each area were analysed. Table 3 summarizes the results. As demonstrated in Table 3, V LiDAR has a greater impact on the detection performance of the LiDAR sensor for the WS canopy than that for the WS roots in each area. For the WS roots in areas a, b, and c, the maximum detection errors of the LiDAR sensors are 4.66%, 3.67%, and 2.44%, respectively, and the minimum detection errors are 2.43%, 2.45%, and 0.68%, respectively. For the WS canopies in areas a, b, and c, the maximum detection errors of the LiDAR sensors are 20.02%, 12.84%, and 8.50%, respectively, and the minimum detection errors are 16.80%, 11.48%, and 6.65%, respectively. When H WS remains unchanged, V LiDAR has a slight impact on the detection errors of the LiDAR sensor for the WS roots and canopy. In addition, when V LiDAR remains unchanged, as the WS canopy height decreases, the detection errors of the LiDAR sensor for the WS roots and canopy decrease. In summary, V LiDAR has a small impact on the detection performance of the LiDAR sensor for the WS roots and canopy. However, V LiDAR has a greater impact on the detection performance of the LiDAR sensor for the WS canopy than that for the WS roots. H WS has a greater impact on the detection performance of the LiDAR sensor for the WS roots and canopy. Similarly, H WS has a greater impact on the detection performance of the LiDAR sensor for the WS canopy than that for the WS roots. H WS and V LiDAR affect the detection error of the LiDAR sensor for the WS roots but to a relatively small extent. The detection error of the LiDAR sensor for the WS roots is less than 5.00% in all the cases (the maximum detection error is 4.66%). and the detection error of the LiDAR sensor for the WS roots is greater than 8.00% (the minimum detection error is 8.50%). Figure 13 shows the H b values detected by the LiDAR and ultrasonic sensors in the rotary-tilled and WS fields, respectively. As demonstrated in Figure 13, the H b values detected by the two sensors show similar trends. Currently, ultrasonic sensors are the main type of sensor used to detect H b , and detection data from ultrasonic sensors can reflect changes in H b well, which further demonstrates that LiDAR sensors can satisfactorily reflect changes in H b and can be employed to detect changes in H b . In addition, the H b values detected by the two sensors in the rotary-tilled field are basically the same, whereas there is a difference between the H b values detected by the two sensors in the WS field. Moreover, in the WS field, the H b values detected by the LiDAR sensor were lower than those detected by the ultrasonic sensor. For a boom sprayer, H b changes less in the middle section of the boom than at the two ends of the boom. The changes in H b monitored by the two sensors for the middle section of the boom can reflect the distances detected within the canopy. Figure 13b,e show the H b values detected by the two sensors in the middle section of the boom. As demonstrated in Figure 13b,e, the distance detected by the LiDAR sensor is lower than that of the ultrasonic sensor within the WS canopy, and the distances detected by the LiDAR sensor for the WS canopy fluctuate to a relatively large extent, which further demonstrates that the distances detected by LiDAR sensor for the WS canopy include the WS canopy and roots. the canopy. Figure 13b,e show the Hb values detected by the two sensors in the middle section of the boom. As demonstrated in Figure 13b,e, the distance detected by the LiDAR sensor is lower than that of the ultrasonic sensor within the WS canopy, and the distances detected by the LiDAR sensor for the WS canopy fluctuate to a relatively large extent, which further demonstrates that the distances detected by LiDAR sensor for the WS canopy include the WS canopy and roots.

Discussion
The comprehensive analysis of the results obtained from the step and field ground detection experiments shows that VLiDAR affects the detection accuracy of the LiDAR sensor and that there is a delay in the detection signal of the LiDAR sensor when there is a significant step-like change in the distance detected by the LiDAR sensor. However, in the field ground detection experiment, a relatively small detection delay is found in the Li-DAR sensor for the slope at which the distance detected by the LiDAR sensor changes continuously. This result suggests that significant changes in the crop canopy height during spraying operations can affect the detection accuracy of the LiDAR sensor. When developing an Hb detection system, we must develop a signal compensation algorithm to address the signal-delay problem found in the LiDAR sensor. Moreover, there is a decrease in the number of sampling points for detection signals when the LiDAR sensor operates at high speeds. Low amounts of sampled data also affect the detection accuracy of the LiDAR sensor. Thus, it is necessary to study high-speed sampling algorithms to increase the number of effective sampling points for the LiDAR sensor. Currently, the ultrasonic sensors are the primary sensors used to detect Hb. There is also a delay in the detection signal of the ultrasonic sensor as the detection speed increases [26]. Meanwhile, there are bottlenecks in the research on signal processing algorithms for ultrasonic sensors for high-speed or complex operating settings. Compared to ultrasonic sensors, the LiDAR

Discussion
The comprehensive analysis of the results obtained from the step and field ground detection experiments shows that V LiDAR affects the detection accuracy of the LiDAR sensor and that there is a delay in the detection signal of the LiDAR sensor when there is a significant step-like change in the distance detected by the LiDAR sensor. However, in the field ground detection experiment, a relatively small detection delay is found in the LiDAR sensor for the slope at which the distance detected by the LiDAR sensor changes continuously. This result suggests that significant changes in the crop canopy height during spraying operations can affect the detection accuracy of the LiDAR sensor. When developing an H b detection system, we must develop a signal compensation algorithm to address the signal-delay problem found in the LiDAR sensor. Moreover, there is a decrease in the number of sampling points for detection signals when the LiDAR sensor operates at high speeds. Low amounts of sampled data also affect the detection accuracy of the LiDAR sensor. Thus, it is necessary to study high-speed sampling algorithms to increase the number of effective sampling points for the LiDAR sensor. Currently, the ultrasonic sensors are the primary sensors used to detect H b . There is also a delay in the detection signal of the ultrasonic sensor as the detection speed increases [26]. Meanwhile, there are bottlenecks in the research on signal processing algorithms for ultrasonic sensors for high-speed or complex operating settings. Compared to ultrasonic sensors, the LiDAR sensors have advantages, such as a higher measurement precision, a higher response speed, and a higher interference resistance. The cost of the newly developed LiDAR sensor is approximately $46, which is less than half the price of an existing ultrasonic sensor for boom height detection. The newly developed LiDAR sensor supports research on the boom height detection method and autonomous H b control systems for high-speed or complex operating settings.
During the wheat harvest, the height of the harvester header can be changed according to terrain changes, and such height changes of the harvester header can lead to the irregularity of the WS canopy. The detection position of the ultrasonic sensors is the surface of the WS canopy [28]. The irregularity of the WS canopy effects the detection accuracy of the ultrasonic sensor. To improve the accuracy of boom height detection, a signal processing method must be added to pre-process the ultrasonic sensor data. For LiDAR sensors, the WS height detection and a comparison of the LiDAR and ultrasonic sensors experiments shows that the LiDAR sensor primarily detected the WS roots and the inside of the WS canopy. V LiDAR and H WS has a greater impact on the detection performance of the LiDAR sensor for the WS canopy than that for the WS roots. The detection height values between the boom and WS roots are less affected by the irregularity of the WS canopy. The detection error of the LiDAR sensor for the WS roots is less than 5.00% (the maximum detection error is 4.66%). Thus, in a spraying operation, it is possible to first classify the detection data obtained by the LiDAR sensor for the WS roots and canopy in a field using the K-means clustering algorithm and to subsequently increase the value detected for the WS roots by 5% as a reference basis for adjusting H b and add the height of the WS canopy to this basis as an index for adjusting H b . This method can reduce the effects of an uneven WS canopy on the detection accuracy of the LiDAR sensor, which is more suitable for H b detection in WS field spraying.
In recent years, as boom sprayers are becoming increasingly large and efficient, it is urgently necessary to make breakthroughs in signal processing algorithms for H b detection sensors or to develop new sensors for H b detection. Future studies would focus on developing automatic H b control systems based on the LiDAR sensor designed in this study and conducting field experiments at high speeds and universal experiment of different crop canopies at different stages.

Conclusions
In this study, a new, low-cost LiDAR sensor for H b detection was developed based on the principle of single-point ranging. The results obtained from a step height detection experiment, a field ground detection experiment, and a WS height detection experiment as well as a comparison of the LiDAR sensor developed in this study with an ultrasonic sensor showed that the LiDAR sensor could satisfactorily reflect changes in H b and be used to detect H b . The LiDAR sensor will promote research on the boom height detection method and autonomous H b control systems for high-speed or complex operating settings. The distances detected by the LiDAR and ultrasonic sensors differed within the WS canopy, and the LiDAR sensor primarily detected the WS roots and the inside of the WS canopy. The K-means clustering algorithm can be used to classify the heights detected for the WS roots and canopy in a field. In spraying operations, the detection value from the LiDAR sensor to the WS root multiplied by 1.05 can be used as a reference basis for adjusting H b , and after the WS canopy height is added to the basis, the value can be used as an index for adjusting H b . This method can reduce the effects of an uneven WS canopy on the detection accuracy of the LiDAR sensor, which is more suitable for H b detection in WS field spraying.