Method for Estimating Canopy Thickness Using Ultrasonic Sensor Technology

: The accurate detection of canopy characteristics is the basis of precise variable spraying. Canopy characteristics such as canopy density, thickness and volume are needed to vary the pesticide application rate and adjust the spray ﬂow rate and air supply volume. Canopy thickness is an important canopy dimension for the calculation of tree canopy volume in pesticide variable spraying. With regard to the phenomenon of ultrasonic waves with multiple reﬂections and the further analysis of echo signals, we found that there is a proportional relationship between the canopy thickness and echo interval time. In this paper, we propose a method to calculate canopy thickness using echo signals that come from ultrasonic sensors. To investigate the application of this method, we conducted a set of lab-based experiments with a simulated canopy. The results show that we can accurately estimate canopy thickness when the detection distance, canopy density, and canopy thickness range between 0.5and 1.5 m, 1.2 and 1.4, and 0.3and 0.6 m, respectively. The relative error between the estimated value and actual value of the simulated canopy thickness is no higher than 8.8%. To compare our lab results with trees in the ﬁeld, we measured canopy thickness from three naturally occurring Osmanthus trees ( Osmanthus fragrans Lour). The results showed that the mean relative errors of three Osmanthus trees are 19.2%, 19.4% and 18.8%, respectively. These results can be used to improve measurements for agricultural production that includes both orchards and facilities by providing a reference point for the precise application of variable spraying.


Introduction
Precise variable spraying is an effective method to reduce pesticide drift and excessive residues, which can achieve the on-demand spraying of pesticides based on canopy characteristics, including density, thickness, and volume. The traditional means of pesticide application using continuous and nonselective spraying have been over-applied and cause drift, giving rise to high residues in crop products and soil [1]. With an emphasis on food quality and environmental safety, a growing number of investigators are focusing on varying applications to reduce the use of pesticides. Precise variable spraying technology is an effective way to reduce pesticide waste and environmental pollution, which includes the automatic adjustment of the nozzle flow rate, the air supply volume, and the distance from nozzles to the tree according to the tree canopy characteristics [2][3][4]. Therefore, the accurate detection of canopy information is an important part of precise spraying development. Information on the thickness, height, volume, canopy density, leaf area density, and bulk density of the tree canopy was obtained through sensor detection technology and a detection method [5]. With the canopy information detection method and system, real-time adjustments of the nozzle flow rate, spraying distance and other parameters are possible, which can effectively improve the utilization rate of pesticides and achieve the goal of reducing pesticides and increasing their effectiveness [6][7][8].
Benefits have resulted from the rapid development of sensor technology, including tremendous progress in crop canopy detection technology from a suite of different sensor types. Many researchers have achieved the detection of canopy information through ultrasonic sensors, laser sensors and LIDAR (light detection and ranging) detection technology. Some of these researchers [9][10][11][12] proposed using the ultrasonic ranging principle to obtain the target volume information for variable spray. For example, Tumbo et al. [9] proposed that the volume of citrus trees could be estimated by ultrasonic sensor arrays, with the distance from the sensor to the target being detected based on the ultrasonic ranging principle and the target canopy volume being calculated by the method of integrating the distance, the installation spacing of adjacent sensors and vehicle travel speed. Zaman et al. [13,14] further investigated the effects of different factors on the tree canopy volume calculation; their results showed that the forward speed of the machine did not have a significant effect on the canopy volume measurement results and the canopy density played an important role in the estimation of canopy volume. Palleja et al. [15] developed a canopy density measurement system with ultrasonic sensors and concluded that the intensity of the ultrasonic echo signal could be used to calculate the canopy density. They found a strong correlation between the intensity of the ultrasonic echo signal and the canopy density during the growing season. Maghsoudi et al. [16] used an array of ultrasonic sensors to obtain the profile of a target tree and used the "integration method" to obtain the canopy volume of a spindle-shaped tree in real time, and thus designed a neural network-based electronic control system for canopy detection and estimation. Li et al. [5] established a quantitative relationship between the energy of ultrasonic echo signals and canopy density based on a multi-layer planar leaf distribution model. Nan et al. [17] proposed calculating the canopy density of target trees based on the ultrasonic sensor echo signals; they built a cylindrical leaf distribution canopy model for a lab experiment and established a mathematic model for canopy density estimation. The results showed that the canopy density value could be calculated by the average voltage of the echo signal and detection distance.
In addition to research on ultrasonic sensor applications, many researchers have also studied the detection methods of tree canopies based on laser sensors and LIDAR. Llorens et al. [18] studied the detection accuracy of canopy characteristics with ultrasonic and LIDAR sensors; both sensors were able to detect crop height, crop width and crop volume. The results indicated that the LIDAR sensor provides more accuracy and detailed information about the tree canopy than the ultrasonic sensor. Palacin et al. [19,20] proposed a real-time canopy volume detection system by using a ground laser sensor and extrapolated the foliage surface base from canopy volume information. The pear trees experiment indicated that the average error of foliar calculation was less than 5%. More studies researched and reviewed the canopy detection technology based on LIDAR and ultrasonic sensors for measuring tree structural characteristics. These studies and reviews demonstrated that it is still necessary to resolve post-processing. Low-cost sensors and canopy detection control systems will help these technologies be put into wide use [21,22]. Different sensor detection technologies are able to achieve certain canopy information detection goals. The LIDAR-based tree canopy information detection technology has a complex system, high hardware cost, and large data computation, and the detection results are affected by the canopy density. The canopy information detection technology based on ultrasonic sensors has obvious advantages in terms of hardware cost, reliability, and practicality [23][24][25]. The detection of canopy information mainly focuses on the presence or absence of targets, the detection of tree volume and shape contour. There are few studies on canopy thickness detection techniques, and most of the objects are spindle-shaped trees with good symmetry, which are not suitable for trees with asymmetric canopies, such as vine canopies.
The objective of this paper is to evaluate the potential of the canopy thickness detection method using an ultrasonic sensor and to verify the feasibility and accuracy of the canopy thickness detection method, which could provide a reference point for the precise application of variable spraying in agriculture. Measured tree canopy parameters can be applied to vary the pesticide application rate, spray flow rate, and air supply volume. These adjustments are necessary for improving precise spray applications in orchard and facility agriculture.

Simulated Canopy Thickness Detection Experimental System
To measure canopy thickness with ultrasonic sensors and to investigate the applicability of this method, we built a simulated canopy thickness detection system ( Figure 1). The system included: simulated canopy, test rig, ultrasonic sensor, 5V DC power supply, oscilloscope and a computer. The simulated canopy thickness detection experiment under different factors was conducted in a laboratory.
The objective of this paper is to evaluate the potential of the canopy thickness d tion method using an ultrasonic sensor and to verify the feasibility and accuracy o canopy thickness detection method, which could provide a reference point for the pr application of variable spraying in agriculture. Measured tree canopy parameters ca applied to vary the pesticide application rate, spray flow rate, and air supply vol These adjustments are necessary for improving precise spray applications in orchard facility agriculture.

Simulated Canopy Thickness Detection Experimental System
To measure canopy thickness with ultrasonic sensors and to investigate the app bility of this method, we built a simulated canopy thickness detection system (Figu The system included: simulated canopy, test rig, ultrasonic sensor, 5V DC power sup oscilloscope and a computer. The simulated canopy thickness detection experiment u different factors was conducted in a laboratory. The MB7092-101 ultrasonic sensor (MaxBotix, USA) used in this experiment transceiver structure, generating an ultrasonic frequency of 42 kHz, resolution of 1 maximum measurement range of 7.65 m, power supply voltage range from 3 V to 5 and sampling frequency of 10 Hz. The diffusion angle of the ultrasonic sensor was m ured to be about 14°. Experimental conditions were determined using both tempera and humidity sensors. During the study, temperatures ranged from 24 to 28 °C and midity ranged from 28 to 45%.
The test rig built in this experiment consisted of a steel profile frame, simulated g leaves, iron wire and nylon wire. The size of the steel profile frame (length × wid height) was 80 cm × 80 cm × 100 cm. The simulated grape leaves used in this experi were heart-shaped with an average length of 7 cm and an average area of 62.07 Leaves were arranged in five layers; each layer was fixed by the iron wire up and d The canopy thickness is the distance from the first layer to the last layer. Each iron could slide freely in front and behind the frame for easy adjustment of canopy thick Each layer has six leaf vines. The spacing between leaf vines was 11 cm. The vine made of leaves strung together by nylon wire. The diameter of nylon wire was 0.467 which had almost no effect on ultrasonic echo signal. The leaves on each vine were ev distributed, and the number of leaves was increased or decreased according to the si The MB7092-101 ultrasonic sensor (MaxBotix, USA) used in this experiment is a transceiver structure, generating an ultrasonic frequency of 42 kHz, resolution of 1 cm, maximum measurement range of 7.65 m, power supply voltage range from 3 V to 5.5 V, and sampling frequency of 10 Hz. The diffusion angle of the ultrasonic sensor was measured to be about 14 • . Experimental conditions were determined using both temperature and humidity sensors. During the study, temperatures ranged from 24 to 28 • C and humidity ranged from 28 to 45%.
The test rig built in this experiment consisted of a steel profile frame, simulated grape leaves, iron wire and nylon wire. The size of the steel profile frame (length × width × height) was 80 cm × 80 cm × 100 cm. The simulated grape leaves used in this experiment were heart-shaped with an average length of 7 cm and an average area of 62.07 cm 2 . Leaves were arranged in five layers; each layer was fixed by the iron wire up and down. The canopy thickness is the distance from the first layer to the last layer. Each iron wire could slide freely in front and behind the frame for easy adjustment of canopy thickness. Each layer has six leaf vines. The spacing between leaf vines was 11 cm. The vines are made of leaves strung together by nylon wire. The diameter of nylon wire was 0.467 mm, which had almost no effect on ultrasonic echo signal. The leaves on each vine were evenly distributed, and the number of leaves was increased or decreased according to the size of the canopy density [5]. The leaf vines were staggered between layers, as shown in Figure 2.
Agriculture 2021, 11, x FOR PEER REVIEW 4 of 16 the canopy density [5]. The leaf vines were staggered between layers, as shown in Figure  2.

Canopy Thickness Detection Principle and Method
Ultrasound can propagate at a constant rate in the same medium and generate reflection when encountering the target obstacle. Based on this property, we can estimate the distance of the target obstacle according to the interval time from being transmitted to being received and the ultrasound propagation speed at the current temperature conditions. The time of ultrasound is generated is denoted as and the time of ultrasonic echo is received is denoted as n T . The interval time is T Δ , and we can obtain the target obstacle distance L from Equation (1): where Tem is the environmental temperature, 0.607 is the temperature compensation factor of sound speed, and 331.5 is the ultrasonic propagation velocity at 0 °C [26]. According to the principle of ultrasonic distance measurement, ultrasound can generate reflection when encountering the target leaves. Since gaps exist among the leaves, ultrasound is able to pass through the gaps and reach the leaves deep in the canopy, creating multiple reflections on the proximal and distal leaves of the canopy. Therefore, the ultrasonic echo signal is the result of multiple reflections of ultrasound passing through multiple target leaves in the path. From further analysis of the ultrasonic echo signal under the condition of certain canopy density, we found that the echo signal contains multiple peaks which correspond to the multiple reflections of ultrasound when encountering the target leaves in the path. Thus, we conclude that the interval time between the first peak and the last peak indicated the distance of passing through target leaves in the path. Based on this inference, we proposed a canopy thickness measurement method based on the interval time of ultrasonic echo peaks. Recording the peak time point of the echo signal as the arrival time of ultrasound, the interval time between the first effective peak and the last effective peak of ultrasonic echo signal is the time required for ultrasound to penetrate the target canopy, as shown in Figure 3. The calculation of canopy thickness D was obtained, as shown in Equations (2)

Canopy Thickness Detection Principle and Method
Ultrasound can propagate at a constant rate in the same medium and generate reflection when encountering the target obstacle. Based on this property, we can estimate the distance of the target obstacle according to the interval time from being transmitted to being received and the ultrasound propagation speed at the current temperature conditions. The time of ultrasound is generated is denoted as T m and the time of ultrasonic echo is received is denoted as T n . The interval time is ∆T, and we can obtain the target obstacle distance L from Equation (1): where Tem is the environmental temperature, 0.607 is the temperature compensation factor of sound speed, and 331.5 is the ultrasonic propagation velocity at 0 • C [26]. According to the principle of ultrasonic distance measurement, ultrasound can generate reflection when encountering the target leaves. Since gaps exist among the leaves, ultrasound is able to pass through the gaps and reach the leaves deep in the canopy, creating multiple reflections on the proximal and distal leaves of the canopy. Therefore, the ultrasonic echo signal is the result of multiple reflections of ultrasound passing through multiple target leaves in the path. From further analysis of the ultrasonic echo signal under the condition of certain canopy density, we found that the echo signal contains multiple peaks which correspond to the multiple reflections of ultrasound when encountering the target leaves in the path. Thus, we conclude that the interval time between the first peak and the last peak indicated the distance of passing through target leaves in the path. Based on this inference, we proposed a canopy thickness measurement method based on the interval time of ultrasonic echo peaks. Recording the peak time point of the echo signal as the arrival time of ultrasound, the interval time between the first effective peak and the last effective peak of ultrasonic echo signal is the time required for ultrasound to penetrate the target canopy, as shown in Figure 3. The calculation of canopy thickness D was obtained, as shown in Equations (2) and (3).
Agriculture 2021, 11, 1011 is the time point of first effective peak of echo signal, is the time point of last effective peak of echo signal, and T Δ is the echo interval time. The ultrasonic signal was recorded by an oscilloscope and a computer. The ultrasonic echo signals and peaks data were calculated using MATLAB 2015b software (Math Works, Natick, MA, USA). Using the filter function and the wave detection function in MATLAB software, the wave information was extracted. The transmitted signals and echo should not be negative in theory. The negative data were treated as zero.

Factor-Level Design
According to the propagation characteristics of ultrasound and the special characteristics of the canopy structure, echo interval time is mainly influenced by the following factors: the detection distance (referred to as the distance from the ultrasonic sensor to the margin of canopy) and the canopy density. The detection distance mainly affects the intensity of echo signal; the canopy density mainly affects the ultrasonic penetration and the intensity of echo signal. The parameters and levels of the experimental factors were determined according to the working conditions of the plant protection application machinery and sampling survey, as shown in Table 1 below. Canopy density refers to the ratio between the total leaf areas in the canopy and the sum of the areas in the frontal projection direction of all leaves. This indicates canopy In Equation (3), T a is the time point of first effective peak of echo signal, T b is the time point of last effective peak of echo signal, and ∆T is the echo interval time.
The ultrasonic signal was recorded by an oscilloscope and a computer. The ultrasonic echo signals and peaks data were calculated using MATLAB 2015b software (Math Works, Natick, MA, USA). Using the filter function and the wave detection function in MATLAB software, the wave information was extracted. The transmitted signals and echo should not be negative in theory. The negative data were treated as zero.

Factor-Level Design
According to the propagation characteristics of ultrasound and the special characteristics of the canopy structure, echo interval time is mainly influenced by the following factors: the detection distance (referred to as the distance from the ultrasonic sensor to the margin of canopy) and the canopy density. The detection distance mainly affects the intensity of echo signal; the canopy density mainly affects the ultrasonic penetration and the intensity of echo signal. The parameters and levels of the experimental factors were determined according to the working conditions of the plant protection application machinery and sampling survey, as shown in Table 1 below. Canopy density refers to the ratio between the total leaf areas in the canopy and the sum of the areas in the frontal projection direction of all leaves. This indicates canopy sparseness, which is an important parameter to consider when assessing canopy characteristics [27]. The calculation of canopy density can be obtained from Equation (4): In Equation (4), n is the total number of leaves in canopy, A i is the area of each leaf, and S is the area in the frontal projection direction of all leaves.

Sampling Method of Detection Points
The beam width of the ultrasonic sensor must be considered for the distribution of test points. The beam width for the MB7092-101 ultrasonic sensor was <20 cm when detection distance was less than or equal to 2 m [5]. Therefore, the detection points were set 20 cm inside the test rig boundary, and the distances between the detection points were 20 cm, as shown in Figure 4.

Sampling Method of Detection Points
The beam width of the ultrasonic sensor must be considered for the distribution of test points. The beam width for the MB7092-101 ultrasonic sensor was <20 cm when detection distance was less than or equal to 2 m [5]. Therefore, the detection points were set 20 cm inside the test rig boundary, and the distances between the detection points were 20 cm, as shown in Figure 4.
To determine the accuracy and reliability of our results and to reduce potential system errors, we implemented a sampling strategy consisting of 9 regularly located detection points (Figure 4). Each detection point was repeatedly measured three times, and results were averaged as the measured value of each detection point. In each set of experiments, 1 maximum value and 1 minimum value were removed from the measured values for 9 detection points, and the remaining measured values were averaged as the measured value for the set of experiments.

Simulated Canopy Thickness Detection Results and Analysis under Different Detection Distances
In pesticide applications, the distance between the sensor and canopy is not fixed during the operation of the pesticide sprayer. To investigate the effect of detection distance on canopy detection thickness, the experiment was carried out under the following conditions: the simulated canopy density was 3 and simulated canopy thickness was 50 cm. The results are shown in Table 2. The data presented in Table 2 and Figure 5 originated from the averaging of nine points and three repetitions, as described in Section 2.3.2. To determine the accuracy and reliability of our results and to reduce potential system errors, we implemented a sampling strategy consisting of 9 regularly located detection points ( Figure 4). Each detection point was repeatedly measured three times, and results were averaged as the measured value of each detection point. In each set of experiments, 1 maximum value and 1 minimum value were removed from the measured values for 9 detection points, and the remaining measured values were averaged as the measured value for the set of experiments.

Simulated Canopy Thickness Detection Results and Analysis under Different Detection Distances
In pesticide applications, the distance between the sensor and canopy is not fixed during the operation of the pesticide sprayer. To investigate the effect of detection distance on canopy detection thickness, the experiment was carried out under the following conditions: the simulated canopy density was 3 and simulated canopy thickness was 50 cm. The results are shown in Table 2. The data presented in Table 2 and Figure 5 originated from the averaging of nine points and three repetitions, as described in Section 2.3.2.
The trend of the canopy thickness obtained based on the canopy thickness detection method when increasing the detection distance is shown in Figure 5.
From Table 2 and Figure 5, it can be seen that the detection distance has a certain influence on the detection results of canopy thickness. With the increase in detection distance, the ultrasonic echo signal intensity decreases, the echo reflection angle increases, the scattering phenomenon on the surface of the canopy increases and the detection thickness of the canopy shows a decreasing trend. When the detection distance is roughly between 0.5 and 1.5 m, the trend of canopy detection thickness is relatively smooth. Therefore, when the canopy density is 3.0, the canopy thickness is 50 cm, and the detection distance is between 0.5 and 1.5 m, the accuracy of the simulated canopy thickness detection results is higher and the detection error is smaller; the maximum relative error is 8.8% compared with the simulated canopy thickness. The simulated canopy density of this group experiment is 3.0; the data of detection thickness came from average of nine points and three repetitions; the absolute error value = |detection thickness − simulated Canopy thickness|; relative error = absolute error value/simulated canopy thickness × 100%.   The trend of the canopy thickness obtained based on the canopy thickness detection method when increasing the detection distance is shown in Figure 5.
From Table 2 and Figure 5, it can be seen that the detection distance has a certain influence on the detection results of canopy thickness. With the increase in detection distance, the ultrasonic echo signal intensity decreases, the echo reflection angle increases, the scattering phenomenon on the surface of the canopy increases and the detection thickness of the canopy shows a decreasing trend. When the detection distance is roughly between 0.5 and 1.5 m, the trend of canopy detection thickness is relatively smooth. Therefore, when the canopy density is 3.0, the canopy thickness is 50 cm, and the detection distance is between 0.5 and 1.5 m, the accuracy of the simulated canopy thickness detection results is higher and the detection error is smaller; the maximum relative error is 8.8% compared with the simulated canopy thickness.

Simulated Canopy Thickness Detection Results and Analysis under Different Simulated Canopy Densities
Canopy density reflects the sparseness of the canopy, which can affect the penetration of the ultrasound and the intensity of echo signals. To investigate the effect of canopy density on canopy detection thickness, an experiment was carried out under the conditions of different simulated canopy densities, with the same detection distance of 1 m and the same simulated canopy thickness of 50 cm. The results are shown in Table 3. The data

Simulated Canopy Thickness Detection Results and Analysis under Different Simulated Canopy Densities
Canopy density reflects the sparseness of the canopy, which can affect the penetration of the ultrasound and the intensity of echo signals. To investigate the effect of canopy density on canopy detection thickness, an experiment was carried out under the conditions of different simulated canopy densities, with the same detection distance of 1 m and the same simulated canopy thickness of 50 cm. The results are shown in Table 3. The data in Table 3 and Figure 6 came from the average of nine points and three repetitions; we have described the method to achieve this in Section 2.3.2. The detection distance of this group experiment is 1 m; the data of detection thickness came from average of nine points and three repetitions; the absolute error value = |detection thickness − simulated Canopy thickness|; relative error = absolute error value/simulated canopy thickness × 100%. The detection distance of this group experiment is 1 m; the data of detection thickness came from average of nine points and three repetitions; the absolute error value =|detection thickness − simulated Canopy thickness|; relative error = absolute error value/simulated canopy thickness × 100%. The trend of canopy thickness obtained based on the canopy thickness detection method when increasing the simulated canopy density is shown in Figure 6.
From Table 3 and Figure 6, it can be seen that the canopy density has a certain influence on the detection results of canopy thickness. With the increase in canopy density, the detection thickness of the canopy shows an increasing trend, which is due to the fact that when the canopy density is below 1.2, the canopy porosity is larger, and the thickness of the simulated canopy is actually less than 50 cm in a small area. With the increase in the canopy density, the simulated canopy thickness tended to be closer to 50 cm, and the detection thickness of the canopy showed an increasing trend with obvious changes. With a canopy density of 1.2 or more, the detection thickness was about 50 cm-which is due to the fact that with the increase in the canopy density, there are always pores in the canopy-ultrasonic waves can penetrate the canopy, and the detection results of the canopy are relatively smooth. With a canopy density of 4, the canopy leaves were denser and so ultrasound penetration decreased, and the detection thickness began to show a downward trend. In general, when the canopy densities were between 1.2 and 4, the canopy detection thickness changed relatively smoothly, and the relative error with the thickness of the simulated canopy of this test remained within 5.2%. Therefore, when the canopy density is between 1.2 and 4, the detection distance is 1 m, and the canopy thickness is 50 cm, the accuracy of the detection results of the simulated canopy thickness is higher and The trend of canopy thickness obtained based on the canopy thickness detection method when increasing the simulated canopy density is shown in Figure 6.
From Table 3 and Figure 6, it can be seen that the canopy density has a certain influence on the detection results of canopy thickness. With the increase in canopy density, the detection thickness of the canopy shows an increasing trend, which is due to the fact that when the canopy density is below 1.2, the canopy porosity is larger, and the thickness of the simulated canopy is actually less than 50 cm in a small area. With the increase in the canopy density, the simulated canopy thickness tended to be closer to 50 cm, and the detection thickness of the canopy showed an increasing trend with obvious changes. With a canopy density of 1.2 or more, the detection thickness was about 50 cm-which is due to the fact that with the increase in the canopy density, there are always pores in the canopy-ultrasonic waves can penetrate the canopy, and the detection results of the canopy are relatively smooth. With a canopy density of 4, the canopy leaves were denser and so ultrasound penetration decreased, and the detection thickness began to show a downward trend. In general, when the canopy densities were between 1.2 and 4, the canopy detection thickness changed relatively smoothly, and the relative error with the thickness of the simulated canopy of this test remained within 5.2%. Therefore, when the canopy density is between 1.2 and 4, the detection distance is 1 m, and the canopy thickness is 50 cm, the accuracy of the detection results of the simulated canopy thickness is higher and the detection error is smaller, and the maximum relative error is 5.2% compared with the simulated canopy thickness.

Canopy Detection Thickness Results and Analysis under Different Simulated Canopy Thicknesses
The simulated canopy thickness mainly affects the ultrasonic penetration distance. We further investigated the canopy detection thickness variation under different simulated canopy thicknesses. The experiment was designed under the conditions of different simulated canopy thicknesses, the same canopy density of 3 and the same detection distance of 1 m. Based on the canopy thickness detection method, this group of ultrasonic signal data collected by the simulated canopy detection system was processed to obtain the canopy thickness detection results, as shown in Table 4. The data in Table 4 and Figure 7 are an average of nine points and three repetitions. We have shown the method for achieving this in Section 2.3.2. The simulated canopy density of this group experiment is 3.0; the data of detection thickness came from average of nine points and three repetitions; the detection distance is 1 m; the absolute error value = |detection thickness − simulated Canopy thickness|; relative error = absolute error value/simulated canopy thickness × 100%.
7 are an average of nine points and three repetitions. We have shown the method for achieving this in Section 2.3.2. The simulated canopy density of this group experiment is 3.0; the data of detection thickness came from average of nine points and three repetitions; the detection distance is 1 m; the absolute error value =|detection thickness − simulated Canopy thickness|; relative error = absolute error value/simulated canopy thickness × 100%.
With the increase in the simulated canopy thickness, the trend of canopy thickness obtained based on the canopy thickness detection method is shown in Figure 7. From Table 4 and Figure 7, it can be seen that the thickness of the simulated canopy has an obvious influence on the detection results of canopy thickness; with the increase in the simulated canopy thickness, the detection thickness of the canopy shows a rising trend, and the change trend is basically consistent with the growth trend of the simulated canopy thickness. When the thickness of the simulated canopy increases to 60 cm, the With the increase in the simulated canopy thickness, the trend of canopy thickness obtained based on the canopy thickness detection method is shown in Figure 7.
From Table 4 and Figure 7, it can be seen that the thickness of the simulated canopy has an obvious influence on the detection results of canopy thickness; with the increase in the simulated canopy thickness, the detection thickness of the canopy shows a rising trend, and the change trend is basically consistent with the growth trend of the simulated canopy thickness. When the thickness of the simulated canopy increases to 60 cm, the detection thickness of the canopy is slightly lower than the thickness of the simulated canopy in this group of tests because the ultrasonic signal is weakened through the canopy, the echo signal intensity becomes weaker, and the echo width becomes narrower. Therefore, with a canopy density of 3.0, detection distance of 1 m, and canopy thickness of 30-60 cm, the detection results of the simulated canopy thickness are more accurate and the detection error is smaller, and the maximum relative error is 4.7% compared with the simulated canopy thickness.

Interaction Experiment Results and Analysis
The average values of the repeated detection results between two factors on canopy thickness were input into the discriminative interaction experiment data table, and the discriminative interaction influence schematic was made by MATLAB data processing to visualize the judgment. Table 5 shows the data of the discriminant interaction between canopy density and simulated canopy thickness from the detection results, and Figure 8 shows the schematic diagram of the discriminant interaction between canopy density and simulated canopy thickness from the detection results. The detection distance of this experiment is 1 m. thickness were input into the discriminative interaction experiment data table, and the discriminative interaction influence schematic was made by MATLAB data processing to visualize the judgment. Table 5 shows the data of the discriminant interaction between canopy density and simulated canopy thickness from the detection results, and Figure 8 shows the schematic diagram of the discriminant interaction between canopy density and simulated canopy thickness from the detection results. The detection distance of this experiment is 1 m.   Table 6 shows the test data of the interaction effect of discriminant canopy density and detection distance on the canopy thickness detection results, and Figure 9 shows the schematic diagram of the interaction effect of discriminant canopy density and detection distance from the canopy thickness detection results. The simulated canopy thickness of this experiment is 50 cm.   Table 6 shows the test data of the interaction effect of discriminant canopy density and detection distance on the canopy thickness detection results, and Figure 9 shows the schematic diagram of the interaction effect of discriminant canopy density and detection distance from the canopy thickness detection results. The simulated canopy thickness of this experiment is 50 cm.  It can be seen in Figure 9 that within the applicable range of canopy density and detection distance derived from the simulated canopy thickness detection experiment, the two lines in the figure are almost parallel to each other. It can be considered that there is no interaction between the two factors of canopy density and detection distance on the canopy detection thickness within the applicable range, or the interaction between the two factors of canopy density and detection distance on the canopy detection thickness can be ignored. Table 7 shows the data table of the interaction effect of canopy thickness and detection distance on canopy thickness, and Figure 10 shows the schematic diagram of the interaction effect of canopy thickness and detection distance on canopy thickness. The can- It can be seen in Figure 9 that within the applicable range of canopy density and detection distance derived from the simulated canopy thickness detection experiment, the two lines in the figure are almost parallel to each other. It can be considered that there is no interaction between the two factors of canopy density and detection distance on the canopy detection thickness within the applicable range, or the interaction between the two factors of canopy density and detection distance on the canopy detection thickness can be ignored. Table 7 shows the data table of the interaction effect of canopy thickness and detection distance on canopy thickness, and Figure 10 shows the schematic diagram of the interaction effect of canopy thickness and detection distance on canopy thickness. The canopy density of this experiment is 3. It can be seen in Figure 9 that within the applicable range of canopy density and detection distance derived from the simulated canopy thickness detection experiment, the two lines in the figure are almost parallel to each other. It can be considered that there is no interaction between the two factors of canopy density and detection distance on the canopy detection thickness within the applicable range, or the interaction between the two factors of canopy density and detection distance on the canopy detection thickness can be ignored. Table 7 shows the data table of the interaction effect of canopy thickness and detection distance on canopy thickness, and Figure 10 shows the schematic diagram of the interaction effect of canopy thickness and detection distance on canopy thickness. The canopy density of this experiment is 3.  It can be seen in Figure 10 that the two lines in the graph are approximately parallel within the applicable range of canopy thickness and detection distance derived from the simulated canopy thickness detection experiment, and it can also be seen that there is no interaction between the two factors of simulated canopy thickness and detection distance Figure 10. Diagram of the interaction between detection distance and canopy thickness.
It can be seen in Figure 10 that the two lines in the graph are approximately parallel within the applicable range of canopy thickness and detection distance derived from the simulated canopy thickness detection experiment, and it can also be seen that there is no interaction between the two factors of simulated canopy thickness and detection distance on the canopy thickness detection results within the applicable range. Additionally, the interaction between the two factors of simulated canopy thickness and detection distance on the canopy thickness detection results can be ignored. The results of the study show that there is no significant interaction between the simulated canopy thickness and detection distance in the canopy thickness detection results.
In summary, the detection distance, canopy density and canopy thickness are within the range of simulated canopy thickness detection test results, and interactions between canopy thickness, detection distance and canopy density were not found. Therefore, the detection distance is between 0.5 and 1.5 m, the canopy density is between 1.2 and 4, and the canopy thickness is between 30 and 60 cm, the canopy thickness detection method of trees has good applicability in the laboratory, and the detection thickness results are more accurate and the detection error is smaller. The maximum relative error between the canopy thickness and the simulated canopy thickness is 8.8%.

Outdoor Experimental Results and Analysis
To verify the applicability and accuracy of canopy thickness detection methods in detecting real tree canopy information, outdoor experimental research on the detection of tree canopy thickness was carried out, and three Osmanthus trees with different canopy densities were selected for this experiment, which were recorded as tree A, tree B and tree C. The canopy densities were about 4.6, 2.3, and 1.5, and the canopy thickness was between 30 cm and 60 cm. Ultrasonic echo signal data were acquired using a tree canopy information detection system at detection distances of 0.5 m, 1 m and 1.5 m, respectively. The tree canopy thickness was calculated based on the canopy thickness detection method, and the canopy thickness was compared with the actual measured canopy thickness. Figure 11 shows the field diagram of the tree canopy thickness detection experiment.

Outdoor Experimental Results and Analysis
To verify the applicability and accuracy of canopy thickness detection methods in detecting real tree canopy information, outdoor experimental research on the detection of tree canopy thickness was carried out, and three Osmanthus trees with different canopy densities were selected for this experiment, which were recorded as tree A, tree B and tree C. The canopy densities were about 4.6, 2.3, and 1.5, and the canopy thickness was between 30 cm and 60 cm. Ultrasonic echo signal data were acquired using a tree canopy information detection system at detection distances of 0.5 m, 1 m and 1.5 m, respectively. The tree canopy thickness was calculated based on the canopy thickness detection (a) Tree A (b) Tree B (c) Tree C Figure 11. Tree A, Tree B, and Tree C canopy detection experiments.
The results of the tree canopy thickness detection are shown in Table 8.  The results of the tree canopy thickness detection are shown in Table 8. The detection thickness is the canopy thickness calculated from the ultrasonic echo signal data acquired by the tree canopy information detection system.
The canopy thickness detection experiment used Osmanthus trees of different densities, and tree canopy detection thickness results when increasing the detection distance relative error variation curve are shown in Figure 12.
As seen in Table 8 and Figure 12, the results showed that the relative error between tree A's canopy thickness detection value and measurement value ranged from 12.2% to 26.3%, and mean relative error was 19.2%. The relative error between tree B's canopy thickness detection value and measurement value ranged from 9.3% to 27.9%, and the mean relative error was 19.4%. The relative error between tree C's canopy thickness detection value and measurement value ranged from 9.4% to 28.1%, and the mean relative error was 18.8%. Compared with the results of the simulated canopy thickness detection experiment, the canopy thickness detection relative error in the Osmanthus tree experiment was bigger than in the simulated canopy experiment, and the relative error value decreased gradually when the detection distance increased.

35 9.4%
The detection thickness is the canopy thickness calculated from the ultrasonic echo signal data acquired by the tree canopy information detection system.
The canopy thickness detection experiment used Osmanthus trees of different densities, and tree canopy detection thickness results when increasing the detection distance relative error variation curve are shown in Figure 12. As seen in Table 8 and Figure 12, the results showed that the relative error between tree A's canopy thickness detection value and measurement value ranged from 12.2% to 26.3%, and mean relative error was 19.2%. The relative error between tree B's canopy thickness detection value and measurement value ranged from 9.3% to 27.9%, and the mean relative error was 19.4%. The relative error between tree C's canopy thickness detection value and measurement value ranged from 9.4% to 28.1%, and the mean relative error was 18.8%. Compared with the results of the simulated canopy thickness detection experiment, the canopy thickness detection relative error in the Osmanthus tree experiment was bigger than in the simulated canopy experiment, and the relative error value decreased gradually when the detection distance increased.

Discussion
Compared with the previous indirect method for the detection of canopy thickness, this paper proposes a direct method for the detection of canopy thickness for the first time. During the canopy-targeted ultrasonic sensor detection, we found that the ultrasonic echo signal reflected from the canopy was different from the signal from the smooth wall target. The echo signal reflected from the smooth wall normally contained one echo peak, which could be used in detection distance calculation; however, the echo signal reflected from the canopy contained multiply echo peaks, which indicates that there are multiple reflections from the canopy. The number of echo peaks and echo interval time are determined by the canopy characteristics. Palleja et al. [15] and Li et al. [5] noticed this multiple reflections phenomenon and studied the relations between ultrasonic echo signals and canopy density; they established a mathematic model for canopy density estimation and included that the canopy density has a strong relation with the detection distance and echo energy. Unlike the previous study, the method of canopy thickness detection in this paper is an extension of the ultrasonic sensor ranging method, and it still uses the ranging principle

Discussion
Compared with the previous indirect method for the detection of canopy thickness, this paper proposes a direct method for the detection of canopy thickness for the first time. During the canopy-targeted ultrasonic sensor detection, we found that the ultrasonic echo signal reflected from the canopy was different from the signal from the smooth wall target. The echo signal reflected from the smooth wall normally contained one echo peak, which could be used in detection distance calculation; however, the echo signal reflected from the canopy contained multiply echo peaks, which indicates that there are multiple reflections from the canopy. The number of echo peaks and echo interval time are determined by the canopy characteristics. Palleja et al. [15] and Li et al. [5] noticed this multiple reflections phenomenon and studied the relations between ultrasonic echo signals and canopy density; they established a mathematic model for canopy density estimation and included that the canopy density has a strong relation with the detection distance and echo energy. Unlike the previous study, the method of canopy thickness detection in this paper is an extension of the ultrasonic sensor ranging method, and it still uses the ranging principle in thickness calculation; the only difference between the canopy thickness calculation and ranging calculation is the interval time definition. The interval time used in the ranging calculation is the time difference between the transmitted wave and the first echo peak, while the interval time in canopy thickness calculation is the time difference between the first echo peak and the last echo peak. So, the basis of canopy thickness detection is the same as the ranging method, and we could infer that the interaction between canopy density and detection distance has no interaction influence on the canopy thickness detection, which was also proven in the interaction experiment results.
The simulated canopy thickness detection experiment indicated that the method of estimating canopy thickness based on ultrasonic echo signals was effective. However, the accuracy, integration and portability of the ultrasonic echo signal detection system requires development and the design of the indoor canopy test bench needs further improvement. Our ability to accurately measure canopy thickness in the field was lower than our simulated canopy experimentation, which is likely due to the complexity of measuring the tree canopy structure with irregular canopy branch growth patterns. With the increase in the detection distance, the reduction in echo interval time is aggravated, so the results of tree canopy thickness detection became smaller. The detection process was influenced by the shaking of branches and leaves caused by outdoor wind and the offset of the measurement angle caused by uneven ground, which resulted in an overall large relative error. This paper proved that the method of canopy thickness detection is effective within certain ranges. In future research, we are able to estimate the canopy density and thickness by ultrasonic sensors. An automatic spraying system could be developed which used canopy density and thickness for the calculation of spray rate and improve the spray deposition uniformity in the tree canopy.

Conclusions
In this work, we propose a method to calculate canopy thickness using echo signals that come from ultrasonic sensors. Additionally, the principle of canopy thickness detection was introduced, and a lab-based experiment using a simulated canopy was carried out. We could accurately estimate canopy thickness when the detection distance, canopy density, and canopy thickness ranged between 0.5and 1.5 m, 1.2 and 1.4 and 0.3 and 0.6 m, respectively. The relative error between the estimated value and actual value of simulated canopy thickness is within 8.8%, which showed that this method has good applicability.
The outdoor detection experiment was carried out with three naturally occurring Osmanthus trees. The results showed that the average relative errors of the detection thickness were 19.2%, 19.4%, and 18.8%, respectively, and the relate error of the outdoor experiment is significantly higher than the lab-based experiment, which illustrates that the canopy thickness detection method using the ultrasonic sensor was also influenced by the distribution of branches and leaves, the levelness of the ground, and the accuracy of the tree canopy thickness measurement.
The substantial feature of this canopy thickness estimation method is that the ultrasonic echo signal is the result of multiple reflections of ultrasonic waves through multiple objects. The echo signal contains multiple peaks (peak) and actually reflects a series of signal feedback from the ultrasonic wave to multiple target objects touched on the path. This method is an extension of the traditional ultrasonic detection method. With further improvements, this method could achieve an accurate detection of canopy information, help to adjust the spraying parameters and apply the optimum dose of pesticide for precision variable spraying in agriculture. This contributes to the reduction in the excessive use and loss of pesticides.