Next Article in Journal
Efficacy of Sweet Potato Transplanting Machine for Different Cultivation Systems in Northern China
Previous Article in Journal
Cropland Expansion Mitigates the Supply and Demand Deficit for Carbon Sequestration Service under Different Scenarios in the Future—The Case of Xinjiang
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

On-Line Detection Method and Device for Moisture Content Measurement of Bales in a Square Baler

1
Intelligent Equipment Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
2
Nanjing Research Institute of Agricultural Mechanization, Ministry of Agriculture and Rural Affairs, Nanjing 210014, China
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Agriculture 2022, 12(8), 1183; https://doi.org/10.3390/agriculture12081183
Submission received: 7 July 2022 / Revised: 4 August 2022 / Accepted: 8 August 2022 / Published: 9 August 2022
(This article belongs to the Section Agricultural Technology)

Abstract

:
Aiming to address the problems of low detection accuracy and poor stability due to the weak anti-interference ability of the bridge circuit and operational amplifier circuit, and the influence on the capacitance of the bulk density and temperature of the straw bale, an on-line detection device for the moisture content of straw bales in a square baler was developed based on the capacitance method. The device integrates a capacitance sensor, pressure sensor, and temperature sensor. The optimal structure size of the capacitor plate was determined through the simulation test of the capacitor sensor plate structure. A moisture content monitoring system based on the MATLAB language is built, and the moisture content detection model was constructed based on the backpropagation neural network (BPNN) algorithm. Finally, a test bench for a square baling machine was designed, and a performance verification test of the moisture content detection device was carried out. The simulation results of the capacitor plate show that when the length, width, and spacing of the capacitor plate are 148.6, 47.7, and 5.1 mm, respectively, the detection sensitivity of the capacitor plate is the highest. The modeling results show that the R2, RMSE, and RPD of the BPNN model are 0.986, 0.008998, and 5.99, respectively, with solid data fitting ability and high prediction accuracy. The bench test results show that for the samples having moisture content between 13.1 and 28.04%, the coefficient of determination R2 of the fitting curve between the predicted value of moisture content and the actual value is 0.949. The relative error range of the predicted value of moisture content is −6.51–8.66%, and the absolute error range is −1.63–1.72%. The on-line detection device for moisture content of straw bales has good accuracy and stability.

1. Introduction

Straw is an important biomass resource in agricultural production, as it is rich in various minerals and organic matter and has a great utilization value [1,2]. Currently, a significant number of crop straws cannot be fully scientifically and effectively utilized in agricultural production. This has caused serious problems regarding ecological environment pollution. Improving the comprehensive utilization level of crop straws through scientific and technological means can effectively alleviate environmental pollution problems and the lack of resources, and thus play an important role in sustainable agricultural development. To collect crop straws efficiently, farmers load straw stacks into square balers, which are pressed into dense bundles, for convenient transportation and storage [3,4]. Moisture content is an important index for straw utilization, and determines the finished product quality to a certain extent. Monitoring straw bale moisture content during bundling operations is helpful to obtain dry matter quality, which is an important index to measure the nutritional components of straw bales. Additionally, monitoring straw bale moisture content can provide a basis for the quantity of preservatives added. It can also avoid resource waste caused by straw decay and the degradation of straw quality as a result of the addition of excessive preservatives [5,6]. Moreover, the realization of on-line detection for straw bale moisture content has important practical significance for improving the intelligence level of the baler and promoting more efficient comprehensive utilization of straw. Therefore, it is necessary to investigate an on-line detection method for bales’ moisture content in square balers.
Currently, there are many kinds of on-line detection methods for bales’ moisture content in balers, divided into resistance, capacitance, and near-infrared, according to different detection principles [7,8,9]. Among these, James Falbo designed an on-line detection device for moisture content of square bales based on the resistance method, which placed the plane of detection plate on one side and increased the accuracy of detection results by adding additional detection plates [8]. This method has apparent obstacles to the measurement of high moisture content materials. Kevin J. Hamilton monitored the moisture content of square bales using near-infrared sensors [5]. This method has the problems of redundancy of test data and difficulty in real-time calculation. Jeffery S. Roberts arranged the capacitive sensor plates on both sides of the round baler [9]. Although the device can sense a larger area to be tested, it is easily affected by external interference factors in the detection process. Considering the technical difficulty, sensitivity, and cost, the principle of capacitance detection is more widely used in the field of on-line detection of moisture content of agricultural materials. However, it is necessary to overcome the influence of external factors in the research process.
Scholars at home and abroad began to study the main factors affecting the accuracy of capacitance detection. Through a series of tests, it was confirmed that the bulk density and temperature of the measured materials had a significant influence on capacitance. Wan Lin developed a water content detection device that can monitor the capacitance and temperature of rice synchronously by using the fin-type double-plate detection method and established a neural network NARX prediction model of rice water content based on a quantitative conjugate gradient algorithm [10]. Niu Zhiyou realized the high-precision measurement of pellet feed by monitoring the capacitance, bulk density, and temperature of pellet feed [11]. The above research results show that the multi-sensor data fusion method can effectively reduce the measurement error of moisture content caused by factors such as compactness and temperature of the measured materials. However, the experimental research on on-line detection of moisture content of bales in balers is rarely carried out, and the applicability of related methods remains to be verified.
Therefore, an on-line detection device for the moisture content of straw bales in a square baler based on the capacitance method was developed in this study. The device integrates the capacitance sensor, pressure sensor, and temperature sensor and improves the detection sensitivity of the capacitance sensor by optimizing the structure of the capacitance plate. The detection models for moisture content of straw bales based on the multiple linear regression (MLR) algorithm and the backpropagation neural network (BPNN) algorithm were constructed, respectively. The prediction effects of the models were compared and analyzed to determine the optimal model for detecting the moisture content of the straw bales, which was integrated into the software system for moisture content monitoring. Finally, a performance test of the on-line detection device for the moisture content of the straw bales was carried out to verify the accuracy and stability of the device. By improving the detection method, optimizing the structure of the capacitor plate, and the method of data processing, the on-line detection accuracy for the moisture content of the straw bales was improved. This approach provides a new method and technical support for the rapid and accurate on-line detection of the moisture content of straw bales.

2. Optimization of Capacitor Plates

2.1. Analysis of Detection Principle

The capacitance method is based on the mathematical relationship between the capacitance of a capacitance sensor and the moisture content. It realizes indirect measurement of the moisture content of materials [12]. As the content changes, the material’s relative dielectric constant ε changes. Because ε reflects the capacitance of the capacitor, the moisture content of bales can be indirectly gauged by measuring the capacitance value. In this study, the planar structure of the capacitance sensor plate was determined according to the actual structure of the baler chamber and the characteristics of the bale. When the edge effect is omitted, the equation of a planar plate capacitor is as follows:
{ K = L π 2 ln ( 1 + 2 b a ) C = K × ε , ,
where K is the detection sensitivity of the plates; L is the length of the plate in mm; b is the width of the plate in mm; a is the spacing of the plates in mm; ε is the relative dielectric constant of the material to be measured; and C’ is the capacitance value in pF.
The detection sensitivity of a capacitance sensor is determined by its K value, which is related to the length, width, and spacing of the plates [13]. Therefore, when designing the structure of the plates of a capacitance sensor, different plate size parameters must be considered in accordance with the size of the baler chamber. Additionally, the structure size with the best detection sensitivity of capacitor plate must be sought.
Several factors affect the detection signal of a capacitance sensor during capacitance detection. The change in the bale capacitance caused by temperature variations can be compensated for by the temperature sensor. In addition, the change in bale compactness has a significant impact on the capacitance-detection accuracy [11,14]. The pressure exerted by the bale on the capacitor plate was monitored by a pressure sensor because the bale compactness information could not be obtained in real time from the test. Additionally, the pressure was considered as another factor affecting the capacitance detection result [15,16].

2.2. Structural Design of Capacitor Plates

A divergent electric-field phenomenon occurs at the edge of the capacitor plates during detection. This is called the edge effect [10,17]. The existence of this effect reduces the sensitivity of the capacitor plates. Therefore, reasonable optimization of the capacitor plate’s structure will eliminate the influence of the edge effect on the detection sensitivity.

2.2.1. Establishment of Three-Dimensional Simulation Model of Capacitor Plates

Ideally, the plate thickness is nearly zero and can be omitted. Hence, the primary factors affecting the edge effect of a planar plate capacitor are the plate length, width, and spacing. In this study, the three-dimensional electrostatic fields of the capacitor plates were simulated using Ansys Maxwell 2021, with the three factors affecting the edge effect. A single factor analysis using the control variable method was also conducted to explore the relationship between the size of the capacitor plate and the edge effect. In the simulation, Cu foil was selected as the electrode material. The simulation model was divided with a dense grid division mesh. The bale was simulated as a uniformly distributed entity. The electrostatic field was selected as the physical field. A voltage of 3.3 V was applied to the upper plate and the lower plate was grounded. The capacitance values at both ends of each plate were computed using capacitance calculations in the Ansys solver. The simulation model of capacitor plates in an electrostatic field is illustrated in Figure 1.

2.2.2. Simulation Analysis of Edge Effect

In the capacitor plate simulation analysis, the plate length L, width b, and spacing a were varied using the control variable method. Thus, the simulated capacitor value C was obtained. The theoretical value of capacitance C’ can be calculated using the equation of a flat-plate capacitor. The ratio of the simulated capacitance C to the theoretical capacitance C’ can reflect the degree of the edge effect of the capacitor plate. When the ratio is closer to 1, the edge effect is the weakest and the capacitor plate is the most sensitive, compared to when the ratio is far from 1. Considering that the capacitor plates were too thin and could be easily damaged during the test, and that an excessively thick plate will obstruct the bale’s motion, the thicknesses of all the plates in the test were set to 1 mm. During the simulation test, the size parameters of the capacitor plates participating in the test were determined according to the actual size of the compression chamber of the square baler. The test results are shown in Table 1. According to the test results, the relationships between L, b, and a and the edge effect C/C’ are illustrated in Figure 2.
As illustrated in Figure 2, for a constant width and spacing, the edge effect is negatively correlated with the plate length; for a constant length and spacing, the edge effect is negatively correlated with the width; and for a constant length and width, it is positively correlated with the plate spacing.

2.2.3. Optimization of Structural Parameters of Capacitor Plates

The Box–Behnken design based on response surface optimization, along with the simulation results, was used to design the test. The length L, width b, and spacing a were selected as the test factors and C/C’ as the test index. The iterations of the test factors are listed in Table 2.
The test factors were validated using an analysis of the variance of different models. The results are summarized in Table 3. The table reveals that the p values of the linear and quadratic equation models were markedly less than 0.05, i.e., the results of the models were significant. The p value of the two-factor equation was 0.1081, which is less than 0.05, indicating that it was not significant. Considering the calibration R2 and prediction R2 of each model, the quadratic equation with a calibration determination coefficient of 0.9952 was ultimately determined as the regression model. The model explained 99.52% of the changes in the response values. The degree of fit with the test was extremely high and the test error was minimal.
The variance analysis of the response surface quadratic model and its regression coefficients are shown in Table 4. It can be seen from the table that the significance test of the model is F = 372.23, p < 0.0001, indicating that the established quadratic regression model is highly significant, and the sum of squares of the net error is 0, indicating that the model has high fitting accuracy with the test. According to the p value of the interaction terms of different factors, the order of the influence of each factor on the model is: plate length > plate width > plate spacing. Regression fitting was performed on the items in the model, and the ternary quadratic regression model between the capacitance ratio and the three factors was obtained after eliminating the interaction terms that have no significant effect on the equation as shown below:
Y = 1.3035 − 0.003262 L − 0.002964 b + 0.020524 a + 7.6649 × 10−6 Lb − 1.13 × 10−4 ba + 7.42389 × 10−6 L2 + 1.1 × 10−5 b2,
where Y is the ratio of simulated capacitance to theoretical capacitance; L is the plate length in mm; b is plate width in mm; and a is the plate spacing in mm.
The influence of L, b, and a on C/C’, as obtained by analyzing and processing the test data using Design-Expert, is illustrated in Figure 3; the phenomenon in the figure shows that the changes in various parameters of capacitor plate structure will have a significant influence on the edge effect.
From the previous analysis, it can be seen that the change in the ratio (C/C’) between the simulated capacitance value and the theoretical capacitance value will affect the edge effect of the capacitor plate. When the ratio is equal to 1, it indicates that the edge effect has a minimal influence on the detection sensitivity of the capacitor plate. Therefore, the goal of C/C’ is set as 1 in the Design-Expert criteria. According to the actual structure size of the compression chamber of the square baler, the plate length L is set within the range of 50–150 mm, the plate width b is set within the range of 40–100 mm, and the plate spacing a is set within the range of 5–15 mm. The optimal size of the capacitor plate calculated using Design-Expert is shown in Figure 4. The results were as follows: L = 148.6 mm, b = 47.7 mm, a = 5.1 mm, and C/C’ = 0.999. Thus, the simulated capacitance value was close to the theoretical one, and the edge effect had the weakest influence on the sensitivity of the capacitor plates with these optimal dimensions.
In the above, it is determined that the capacitor plate in this study adopts a planar structure. The main factors affecting the edge effect of the capacitor plate were studied, and the relationship between the plate structure parameters and the edge effect was determined by establishing a three-dimensional simulation model of the capacitor plate. Through variance analysis and response surface analysis, the structural parameters of the capacitor plate with the highest detection sensitivity were obtained, which ensured the detection accuracy of the moisture content detection device.

3. Materials and Methods

3.1. Hardware Design of Moisture Content Detection Device

The hardware part of the on-line detection device for moisture content of straw bales is mainly composed of an information acquisition unit and a data-processing unit, which can realize multi-channel sensor information acquisition, analog-to-digital (A/D) conversion, filtering etc. Its hardware composition is illustrated in Figure 5.
The information acquisition unit mainly includes three sensors: a FDC2214 capacitance sensor, which adopts the I2C communication protocol, operating at a power supply voltage of 3.3 V and detection upper limit of 250 nF; four DYMH-103 pressure sensors manufactured by Bengbu Dayang Sensing System Engineering Co. Ltd., Bengbu, China, having a sensitivity of 1.5 mV, a detection upper limit of 1000 N, and the total voltage signal being output to the main control unit for A/D conversion through a junction box; and a DS18B20 digital temperature sensor, which adopts the single-bus protocol, with a detection accuracy of 0.5 °C under an ambient temperature of −10–85 °C.
A STM32F103 single-chip microcomputer was selected as the data processing unit. It realizes 1-channel A/D signals and 2-channel I/O acquisition. The single-chip microcomputer collects all types of sensor signals, and filters and transmits data (after preliminary processing) to the moisture content monitoring system of the upper computer.

3.2. Software Design of Moisture Content Detection Device

The software design of the bale moisture content detection device consists of the data acquisition and processing program of the lower computer and the moisture content monitoring system program of the upper computer. In the program of the lower computer, the signal acquisition frequency was set to 1 Hz, and the median value average filtering method was used to filter all types of data to improve their stability and accuracy. Finally, all types of data were transmitted to the moisture content monitoring system of the upper computer.
This monitoring system was developed on MATLAB2020b (MathWork, Natick, MA, USA). Its functions are as follows: (1) Construction of the moisture content detection model. The training data of the model were input into the system and the relevant parameters were set in order to realize the function of building the detection model. The performance of the model was preliminarily assessed using the R2 (coefficient of determination) and Root Mean Square Error (RMSE). (2) Data processing function. The data-processing function includes receiving three channels of sensor data collected by the lower computer, analyzing and computing them using the moisture content detection model, and finally calculating the moisture content value. (3) Data real-time display function. The bale capacitance, pressure, temperature, and moisture content information are displayed in real time. (4) Data storage and erasure. Test data are stored or erased after the test. This is convenient for the subsequent data analysis and processing of the tester. The main interface of the moisture content monitoring software is illustrated in Figure 6.

3.3. Materials and Methods

3.3.1. Test Materials

Rice straw was taken as the experimental object. In order to ensure that the straw could be placed evenly in the small-sized experimental box, the long straw was cut into the shape of broken branches having a length of 40 mm and randomly divided into 33 samples, each weighing 200 g. The samples were placed in sealed bags and stored at room temperature (15 °C).

3.3.2. Test Equipment

The equipment used in the test is illustrated in Figure 7. It mainly includes a self-made capacitance-acquisition device, upper computer data-acquisition software, a WDW-01S electronic universal tension and pressure testing machine and support control software (Changzhou Sanfengx’ Instrument Technology Co. Ltd., Changzhou, China), an Omron E5CC-8 temperature control box, and a silicone-rubber heating plate (Jiangyin Jinyu Electric Appliance Co. Ltd., Jiangyin, China). In addition, samples were dried in a DHG-9240A electric blast drying oven (Shanghai Yiheng Scientific Instrument Co., Ltd., Shanghai, China) and their quality was measured by an MTB2000D electronic balance (Shenzhen Mobil Electronics Co. Ltd., Shenzhen, China).
In the test equipment, the self-made capacitance-acquisition device was composed of a single-chip microcomputer, a capacitance sensor, capacitor plates, and a test box. The test box was used for arranging the capacitor plates and holding the test samples. Its internal dimensions were 180 mm × 150 mm × 70 mm. Two capacitor plates were symmetrically arranged 5 mm apart at the bottom of the test box for detecting samples’ capacitance data. The samples to be tested were placed in the test box, and the surface was closed with a metal pressure plate (170 mm × 140 mm × 5 mm) to ensure uniform density of the samples in the test box. The silicone-rubber heating plate was designed to wrap the outer wall of the test box. The temperature control box was used to preset the test environment temperature to modulate the test environment temperature. The lifting table of the testing machine, pressure sensor, and strut were connected using bolts. The lifting table was controlled by software in the upper computer to change the sample compactness, thus indirectly realizing the accurate control of samples using the plate pressure.

3.4. Test Methods

The initial moisture content of the rice straw samples measured using the drying method was 6.53%. Thirty-three samples with moisture content in the range of 10.89–28.06% were obtained by adding deionized water of different qualities. To ensure uniform humidity within a sample, the configured samples were stored in self-sealing bags at room temperature (15 °C) for 1–2 d, during which the samples were taken out 2–3 times and fully stirred. Each sample was cut into four sub-samples, and each sub-sample was tested at 15, 20, 25, and 30 °C sequentially. As the compactness of samples could be changed by adjusting the pressure, we varied the downforce of the testing machine 11 times, i.e., at 100, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, and 2000 N. Finally, capacitance data of the straw samples with different moisture contents at different temperatures and pressures were collected.
Before the test, the indoor temperature was controlled at 15 °C, the self-made capacitance-acquisition device was started and preheated, and the initial capacitance value was cleared to zero. During the test, approximately 40 g of samples was removed from the bag and placed in the test box, and the remaining samples were kept in the sealed bag. The test environment temperature was set using the temperature control box. The test was started when the temperature reached the required environmental temperature. The upper computer software accurately controlled the pressure of the testing machine on the samples. It also collected capacitance data under the above 11 pressures. Considering the errors during capacitance data acquisition, the collected capacitance data were derived after the test, and the average value of the data was calculated as the capacitance data of the sample at a certain temperature and pressure. After the test, the actual moisture contents of the samples were measured using the electronic balance and electric blast drying oven. The moisture content of each sample was the average of the actual moisture content of the four samples. The equation of moisture content is as follows:
W = M     M 1 M   ×   100 %
where W is the actual moisture content of the samples in %; M is the fresh quality of the samples before drying in g; and M1 is the dry mass of the samples after drying.
One aspect of the above research content mainly includes the hardware and software design of the detection device for moisture content of straw bales. The type and design scheme of capacitance sensor, pressure sensor, and temperature sensor were determined in the hardware design part. The main functions of the moisture content monitoring system were determined in the software design part. Based on this, the design and manufacture of the moisture content detection device were preliminarily completed. After the selected moisture content detection model was determined, as presented in the next section, the software design part of this section was supplemented. Another aspect of the above research content is the material preparation and method description for the model construction test of moisture content detection in the next section.

4. Results and Discussion

The linear and nonlinear modeling methods were used to construct a better moisture content detection model. Subsequently, the two models were compared and analyzed in terms of their prediction performance. MLR was used for linear modeling and BPNN was used for nonlinear modeling [18,19,20,21,22]. The R2, RMSE, and relative predictive deviation (RPD) were used to evaluate the model performance.

4.1. Establishment of the MLR Model

We used SPSS 26 (Statistical Product and Service Solutions, IBM, Chicago, IL, USA) software to analyze data obtained from the test. Equation (4) is the MLR model of the relationship between the sample moisture content and the capacitance, pressure, and temperature.
W = 0.176 − 6.725 × 10−7 C2 + 1.251 × 10−7 P2 − 4.917 × 10−7 CP + 6.271 × 10−5 CT + 1.759 × 10−10 C3 − 3.417 × 10−11 P3 + 1.308 × 10−10 CP2 + 8.269 × 10−11 C2P − 6.388 × 10−7 PT2,
where W is the actual moisture content of the samples in %; C is the capacitance in pF; P is pressure in N; and T is the temperature in °C.
The results of the variance analysis and significance of the MLR model of Equation (4) are summarized in Table 5, Table 6 and Table 7. The R2 of the moisture content detection model was 0.898. This proves that the model can perform accurate linear fitting. The overall significance level of the model was less than 0.0001 and the significance levels of the nine factors were all less than 0.0001. This indicates that each factor had a significant impact on the model. The model better expressed the relationship between the sample moisture content and its capacitance, pressure, and temperature.

4.2. Establishment of the BPNN Model

Capacitance, pressure, and temperature data were taken as the input signals for the neural network, while the actual moisture content of the sample was taken as the output signal. Next, the BPNN model was established. The model adopted a three-layer neural network structure with a single hidden layer. Data of different dimensions were normalized using the max-min method. The optimal number of hidden layer nodes was determined as 5. The Sigmoid function was adopted for the transfer function and the number of training iterations was set to 1000. For the same function, the learning rate was set to 0.01 and the minimum error of the training target to 0.00001. The structure of the BPNN model is illustrated in Figure 8.
The results of the moisture content detection model based on the BPNN algorithm are listed in Table 8. The R2 of the calibration and prediction sets of the model were 0.9895 and 0.9865, respectively. This indicates that the model had a robust fit with no over-fitting. The RMSE of the two sets were 0.004846 and 0.005584, respectively, which indicates that the deviation between the predicted and actual values was minimal and the model had a high prediction accuracy. The RPD of the two sets were 6.92 and 6.11, respectively. These values highlight the stable prediction performance of the model.

4.3. Model Performance Verification and Comparative Analysis

To explore the prediction effect of the best model on the moisture content of different samples, 60 straw samples with moisture contents between 10.89 and 28.06% were arbitrarily prepared. Each sample was tested at different temperatures (15, 20, 25, and 30 °C) and pressures (100–2000 N). The two moisture content detection models were then verified. The verification results are listed in Table 9.
As observed in Table 9, the R2, RMSE, and RPD of the BPNN model were 0.986, 0.008998, and 5.99, respectively, and those of the MLR model were 0.910, 0.025931, and 2.41, respectively. Compared with the MLR model, the BPNN had a more significant fit, smaller prediction error, and more stable prediction ability. The comparison results between the predicted and actual moisture contents of the two models are illustrated in Figure 9. In Figure 9, the moisture content measured using the BPNN model and the actual moisture content were more uniformly distributed near the regression line than the moisture content measured using the MLR model. Hence, the moisture content measured using the BPNN was closer to the actual moisture content. Therefore, the BPNN algorithm was used to construct the moisture content detection model of bales in this study.
In the above section, the capacitance data of straw samples with different moisture content at different temperatures and pressures were collected. The moisture content detection models were constructed using the MLR algorithm and the BPNN algorithm, respectively. According to the modeling results, it was finally determined to build a moisture content detection model based on the BPNN algorithm. The model was integrated into the software design of the water content detection device to complete the final design of the detection device.

5. Performance Test of Straw Bale Moisture Content On-line Detecting Device

5.1. Design of Experiment Bench for Square Baler

An independently developed square baler experimental bench was used to simulate the normal working conditions of a square baler. A 3 kW single-phase motor was used as the power source to test the accuracy and stability of the on-line detection device under the bench conditions. The experimental bench mainly included a power system, a power transmission mechanism, a sensor system, and an experimental bench fuselage. During the test, the motor transmitted power to the piston push rod through the transmission mechanism. The wood board was used to simulate the grass sheets transferred to the baling chamber through the feeding mechanism during the actual operation of the square baler. Under the condition of continuously increasing the number of wood boards, the grass bales entered the detection area of the baling chamber to complete the on-line moisture content detection. Figure 10 presents the photographs of the square baler test bench.

5.2. Calibration Test of Moisture Content Detection Model

During the bench test of the device, the moisture content detection model yielded a few systematic errors under the influences of the sensor installation and test environment. To eliminate the effects of these errors on the detection accuracy, we performed a calibration test of the model.
In the model calibration test, 30 samples with moisture content between 13.7 and 27.91% were selected. Additionally, the device collected several pieces of physical information on the bales. The analytical calculations were conducted based on the proposed model. The test results are illustrated in Figure 11.
As observed in Figure 11, the relative error distribution of the sample moisture content was 2.24–14.72%, when the model was not modified. All the errors were positive, indicating that the model contained systematic errors. The measured and predicted moisture contents of the sample were linearly fitted. The R2 of the fitting curve was 0.9986 and the calibration coefficient K of the model was 1.0811. The predicted results of the sample moisture content after calibration with the calibration coefficient are listed in Table 10. The relative errors of the predicted values were between −5.69 and 7.81%, which coincides with the expected results of the model calibration test.

5.3. Performance Verification Test of Moisture Content Detection Device

After the model was calibrated, the performance of the device was dynamically verified on the test bench. In the experiment, 20 samples with moisture contents between 13.1 and 28.04% were monitored in the pressure and temperature ranges of 109–671 N and 15.8–19.6 °C, respectively. To better reflect the relationship between the predicted value and the actual value of sample moisture content, and show the distribution of sample error, the error range of relative error and absolute error was judged by positive and negative symbols when processing test data. The test results are illustrated in Figure 12. The R2 of the fitting curve between the predicted and actual values was 0.949. This indicates that the actual and predicted moisture contents were linearly correlated. The relative error range of the predicted moisture content was −6.51–8.66%, and the absolute error range was −1.63–1.72%, which indicates that the device had acceptable accuracy and stability.

6. Conclusions

  • The aim of this study was to solve the problems of low detection accuracy and poor stability of current devices for the on-line detection for moisture content of bales, due to the weak anti-interference ability of the bridge circuit and operational amplification circuit and the influence on capacitance of the bulk density and temperature of the bales. The designed device integrates a capacitor sensor, pressure sensor, and temperature sensor. The optimum structure size of the capacitor plate was determined by a simulation test of the capacitor plate structure of the capacitor sensor. A moisture content monitoring system based on the MATLAB language was established, and the moisture content detection model was constructed based on a BPNN algorithm. Finally, a test bench for a square baling machine was designed, and the performance verification test of the on-line detection device for moisture content of bales of square baler was carried out.
  • The simulation results of the capacitor plate show that when the length, width, and spacing of the plates are 148.6, 47.7, and 5.1 mm, respectively, the detection sensitivity of the capacitor plate is the highest. The experimental results show that the R2, RMSE, and RPD of the BPNN model are 0.986, 0.008998, and 5.99, respectively. Compared with the MLR model, BPNN model has stronger data fitting ability, lower prediction error, and a more stable prediction effect. The results of the bench test show that the determination coefficient R2 of the fitting curve between the predicted value of moisture content and the actual value is 0.949, the relative error range of the predicted value of moisture content is −6.51–8.66%, and the absolute error range is −1.63–1.72% for the samples with moisture content between 13.1 and 28.04%. The on-line detection device for moisture content of bales has good accuracy and stability.
  • To summarize, the on-line detection device for moisture content of bales of square balers has a simple structure, easy installation, and high detection upper limit. It can effectively overcome the influence of straw bulk density and temperature on detection accuracy. Compared with the current detection device for moisture content, it yields a noticeable improvement in accuracy and stability and meets the actual needs of field operation of square balers.

Author Contributions

Conceptualization, H.L. and Z.M.; methodology, H.L. and A.Z.; software, X.A.; validation, Y.C., H.L. and A.Z.; formal analysis, W.F.; investigation, G.W.; resources, Z.M. and A.Z.; data curation, H.L.; writing—original draft preparation, H.L., Z.M. and A.Z.; writing—review and editing, H.L., Z.M. and A.Z.; visualization, H.L.; supervision, C.J.; project administration, Y.Y.; funding acquisition, A.Z. and X.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Jiangsu Agriculture Science and Technology Innovation Fund (JASTIF), grant number: CX(20)1007, and the Innovation Capacity Building Project of Beijing Academy of Agriculture and Forestry Sciences, grant number: KJCX20200416, KJCX20210433.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

All data are presented in this article in the form of figures or tables.

Acknowledgments

We would like to thank Intelligent Equipment Research Center, Beijing Academy of Agriculture and Forestry Sciences.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Huang, L.; Ma, M.; Ji, X.; Choi, S.; Si, C. Recent Developments and Applications of Hemicellulose From Wheat Straw: A Review. Frontiers in Bioengineering and Biotechnology. Front. Bioeng. Biotechnol. 2021, 9, 440. [Google Scholar] [CrossRef] [PubMed]
  2. Li, J.; Jiao, X.; Jin, S.; Pan, Y. Effects of aerated irrigation and straw returning on paddy nitrogen and phosphorus losses. Trans. Chin. Soc. Agric. Eng. 2021, 37, 42–51. [Google Scholar] [CrossRef]
  3. Pascuzzi, S.; Guerrieri, A.S.; Vicino, F.; Santoro, F. Assessment of required torque and power bybig square baler during the wrapping and baling process. In Proceedings of the 20th International Scientific Conference Engineering for Rural Development (ERD 2021), Jelgava, Latvia, 26–28 May 2021; pp. 298–302. [Google Scholar]
  4. Zhang, A.; Meng, Z.; Chen, L.; Wu, G.; Cong, Y.; An, X. Design and Experiment of Dynamic Weighing System for Small Square Baler. Trans.Chin. Soc. Agric. Mach. 2020, 51, 170–175, 185. [Google Scholar] [CrossRef]
  5. Hamilton, K.J. Baler with NIR Sensor in Plunger Face. U.S. Patent 20200375114A1, 3 December 2020. [Google Scholar]
  6. Kraus, T.J. Baler with Dry Matter Content Detection System. U.S. Patent 20190098836A1, 4 April 2019. [Google Scholar]
  7. Pemrick, P. Device and Method for Measuring Hay Bale Moisture. U.S. Patent 6377058B1, 23 April 2002. [Google Scholar]
  8. Falbo, J. System and Method for Determining Moisture Content in a Bale of Hay. U.S. Patent 20110068809A1, 24 March 2011. [Google Scholar]
  9. Roberts, J.S.; Johnson, R.P. Device and Method for Measuring the Moisture of Hay in the Pre-Compression Chamber of a Rectangular Baler. U.S. Patent 20130319263A1, 5 December 2013. [Google Scholar]
  10. Wan, L.; Tang, H.; Ma, G.; Che, G.; Zou, D.; Sun, W. Optimization Design and Experiment on Finned Double Plates Rice Moisture Content Measuring Device. Trans. Chin. Soc. Agric. Mach. 2021, 52, 320–328. [Google Scholar]
  11. Niu, Z.; Liu, F.; Liu, M.; Ren, Z.; Li, P. Design of dielectric pellet feed moisture detector based on parallel plate capacitance sensor. Trans. Chin. Soc. Agric. Eng. 2019, 35, 36–43. [Google Scholar]
  12. Xi, Q.; Zhang, Z.; Xu, Y.; Zuo, Y.; Song, H.; Han, X.; Yang, W. Rapid moisture determination of oat grains with capacitance method and PLS modeling. J. Shanxi Agric. Univ. 2018, 38, 52–57. [Google Scholar] [CrossRef]
  13. Li, Y. Development of Plate Capacitive Roof Seepage Detector. Master’s Thesis, Zhengzhou University, Zhengzhou, China, 2005. [Google Scholar]
  14. Kumar, G.A.A.U.; Jindal, S.K.; Sreekanth, P.K. Capacitance Response of Concave Well Substrate MEMS Double Touch Mode Capacitive Pressure Sensor: Robust Design, Theoretical Modeling, Numerical Simulation and Performance Comparison. Silicon 2022, 1–9. [Google Scholar] [CrossRef]
  15. Abraham, S.; Heckenthaler, T.; Morgenstern, Y.; Kaufman, Y. Effect of temperature on the structure, electrical resistivity, and charge capacitance of supported lipid bilayers. Langmuir 2019, 35, 8709–8715. [Google Scholar] [CrossRef] [PubMed]
  16. Dong, Y.; Han, R.; Wang, D.; Wang, R.; Guo, C. An Analytical Model Including Interface Traps and Temperature Effects in Negative Capacitance Double Gate Field Effect Transistor. Silicon 2021, 13, 3101–3111. [Google Scholar] [CrossRef]
  17. Chen, J.; Wang, Y.; Lian, Y.; Wang, S.; Liu, X. Development of on-line monitoring device of grain moisture content in combine harvester with high frequency capacitance. Trans. Chin. Soc. Agric. Eng. 2018, 34, 36–45. [Google Scholar]
  18. Bouasria, A.; Ibno Namr, K.; Rahimi, A.; Ettachfini, E.M.; Rerhou, B. Evaluation of Landsat 8 image pansharpening in estimating soil organic matter using multiple linear regression and artificial neural networks. Geo-Spat. Inf. Sci. 2022, 1–12. [Google Scholar] [CrossRef]
  19. Bu, J.; Tian, Y.; Zong, Y. Analysis on the influencing factors of multiple indicators in the United States based on multiple linear regression model. In Proceedings of the 2021 Asia-Pacific Conference on Image Processing, Electronics and Computers (IPEC 2021), Dalian, China, 14–16 April 2021. [Google Scholar]
  20. Ohana-Levi, N.; Ben-Gal, A.; Munitz, S.; Netzer, Y. Grapevine crop evapotranspiration and crop coefficient forecasting using linear and non-linear multiple regression models. Agric. Water Manag. 2022, 262, 107317. [Google Scholar] [CrossRef]
  21. Ruan, B. Prediction of Stock Market by BP Neural Network Model. In Proceedings of the 2020 International Conference on Mechanical Automation and Computer Engineering (MACE 2020), Xi’an, China, 28–30 October 2020. [Google Scholar]
  22. Yu, W.; Guan, G.; Li, J.; Wang, Q.; Xie, X.; Zhang, Y.; Huang, Y.; Yu, X.; Cui, C. Claim Amount Forecasting and Pricing of Automobile Insurance Based on the BP Neural Network. Complexity 2021, 2021, 6616121. [Google Scholar] [CrossRef]
Figure 1. Simulation of capacitor plates in an electrostatic field.
Figure 1. Simulation of capacitor plates in an electrostatic field.
Agriculture 12 01183 g001
Figure 2. Relationship between various factors and the edge effect: (a) plate length vs. edge effect; (b) plate width vs. edge effect; (c) plate spacing vs. edge effect.
Figure 2. Relationship between various factors and the edge effect: (a) plate length vs. edge effect; (b) plate width vs. edge effect; (c) plate spacing vs. edge effect.
Agriculture 12 01183 g002
Figure 3. Response surface of interaction of various factors: (a) when the plate width is 70 mm, influence of plate length and spacing on the capacitance ratio; (b) when the plate spacing is 10 mm, influence of plate length and width on the capacitance ratio; (c) when the plate length is 100 mm, influence of plate width and spacing on the capacitance ratio.
Figure 3. Response surface of interaction of various factors: (a) when the plate width is 70 mm, influence of plate length and spacing on the capacitance ratio; (b) when the plate spacing is 10 mm, influence of plate length and width on the capacitance ratio; (c) when the plate length is 100 mm, influence of plate width and spacing on the capacitance ratio.
Agriculture 12 01183 g003
Figure 4. Optimization results of structural parameters of capacitor plate.
Figure 4. Optimization results of structural parameters of capacitor plate.
Agriculture 12 01183 g004
Figure 5. Structural block diagram of on-line detection device for moisture content of bales.
Figure 5. Structural block diagram of on-line detection device for moisture content of bales.
Agriculture 12 01183 g005
Figure 6. Moisture content monitoring software user interface.
Figure 6. Moisture content monitoring software user interface.
Agriculture 12 01183 g006
Figure 7. Testing equipment: (1) data-acquisition software for upper computer; (2) capacitance-acquisition device; (3) silicone-rubber heating plate; (4) test box; (5) pillar; (6) pressure sensor; (7) lifting platform of testing machine; (8) temperature controller; (9) electronic universal tension and pressure testing machine; (10) pressure control software for upper computer.
Figure 7. Testing equipment: (1) data-acquisition software for upper computer; (2) capacitance-acquisition device; (3) silicone-rubber heating plate; (4) test box; (5) pillar; (6) pressure sensor; (7) lifting platform of testing machine; (8) temperature controller; (9) electronic universal tension and pressure testing machine; (10) pressure control software for upper computer.
Agriculture 12 01183 g007
Figure 8. Structure of the BP neural network model.
Figure 8. Structure of the BP neural network model.
Agriculture 12 01183 g008
Figure 9. Comparison of prediction results between the two models: (a) predicted value vs. actual value of moisture content in the MLR model; (b) predicted value vs. actual value of the moisture content measured by the BPNN model.
Figure 9. Comparison of prediction results between the two models: (a) predicted value vs. actual value of moisture content in the MLR model; (b) predicted value vs. actual value of the moisture content measured by the BPNN model.
Agriculture 12 01183 g009
Figure 10. Square baler experimental bench: (1) reducer; (2) crank wheel; (3) motor; (4) monitoring software; (5) moisture content device; (6) rearview of the press-baling chamber; (7) backplane of capacitor plates; (8) hot-rolled steel groove; (9) limit wheel and support frame; (10) pressure sensor; (11) piston putter; (12) connecting rod.
Figure 10. Square baler experimental bench: (1) reducer; (2) crank wheel; (3) motor; (4) monitoring software; (5) moisture content device; (6) rearview of the press-baling chamber; (7) backplane of capacitor plates; (8) hot-rolled steel groove; (9) limit wheel and support frame; (10) pressure sensor; (11) piston putter; (12) connecting rod.
Agriculture 12 01183 g010
Figure 11. Actual vs. predicted moisture contents of the samples.
Figure 11. Actual vs. predicted moisture contents of the samples.
Agriculture 12 01183 g011
Figure 12. Curve fitting of the samples’ actual and predicted moisture contents and prediction error levels of the moisture content: (a) curve fitting of actual and predicted moisture contents of samples; (b) prediction error level of the moisture content.
Figure 12. Curve fitting of the samples’ actual and predicted moisture contents and prediction error levels of the moisture content: (a) curve fitting of actual and predicted moisture contents of samples; (b) prediction error level of the moisture content.
Agriculture 12 01183 g012
Table 1. Simulation results of capacitor plates with different sizes.
Table 1. Simulation results of capacitor plates with different sizes.
Serial NumberSize of Capacitor Plate (mm)Capacitance (pF)C/C’
Length LWidth bSpacing aSimulated Value CTheoretical Value C’
115090526.227.4 0.95
2150901022.522.4 1.01
3150901520.519.5 1.05
4150902019.217.5 1.10
5150902518.116.0 1.13
65090108.37.5 1.11
7100901015.714.9 1.05
815090102322.4 1.03
9200901029.929.8 1.00
10250901035.637.3 0.95
11150301016.614.8 1.12
12150601020.419.5 1.05
13150901022.522.4 1.01
141501201023.724.5 0.97
151501501024.326.1 0.93
Table 2. Levels of the test factors.
Table 2. Levels of the test factors.
LevelL (mm)b (mm)a (mm)
150405
21006010
31508015
Table 3. Analysis of the variance of considered models.
Table 3. Analysis of the variance of considered models.
Source of Variationp-ValueCalibration R2Prediction R2
Linear model<0.00010.94560.9145
Two-factor equation0.10810.96050.9020
Quadratic equation0.00040.99520.9666
Cubic equation 1.0000.9145
Note: In statistics, the p value is the probability of obtaining results at least as extreme as the observed results of a statistical hypothesis test, assuming that the null hypothesis is correct, where p < 0.01 is extremely significant, p < 0.05 is significant, p > 0.10 is insignificant. R2 is used to measure how well the predicted value fits the actual value.
Table 4. ANOVA of response surface quadratic model.
Table 4. ANOVA of response surface quadratic model.
Source of VariationSum of SquaresdfTF Valuep-Value
Model0.089990.0100372.23<0.0001
L0.030810.03081148.16<0.0001
b0.023610.0236879.77<0.0001
a0.031710.03171180.84<0.0001
L × b0.000510.000519.710.0030
L× a0.000110.00012.470.1630
b × a0.001210.001243.170.0003
L20.001510.001555.490.0001
b20.000410.000415.760.0054
a20.000110.00013.30.1120
Residual0.000270.0000
Lack of Fit0.000230.0001
Pure Error0.000040.0000
Cor Total0.090016
Table 5. Summary of MLR model results.
Table 5. Summary of MLR model results.
RR2Adjusted R2Std. Error of EstimateDurbin Watson
0.9470.8980.8940.01547810.715
Table 6. Variance analysis of the model.
Table 6. Variance analysis of the model.
SourceSum of SquaresDegree of FreedomMean SquareFSignificance
Regression0.55090.061255.102<0.0001
Residual0.0632620.000
Total0.613271
Table 7. Significance analysis of the model.
Table 7. Significance analysis of the model.
Source of VariationUnstandardized BetaTSignificanceVariance Inflation Factor
Constant0.17646.178<0.0001
C2−6.725 × 10−7−11.510<0.0001468.006
P21.251 × 10−76.098<0.0001817.390
CP−4.917 × 10−7−6.753<0.00011231.378
CT6.271 × 10−523.607<0.0001126.217
C31.759 × 10−1010.403<0.000189.766
P3−3.417 × 10−11−5.003<0.0001349.823
CP21.308 × 10−104.015<0.0001783.966
C2P8.269 × 10−112.1430.033608.402
PT2−6.388 × 10−7−8.391<0.0001127.276
Note: C = capacitance; P = pressure; T = environment temperature.
Table 8. Results of moisture content detection model based on BPNN algorithm.
Table 8. Results of moisture content detection model based on BPNN algorithm.
Calibration SetsTest Sets
R2CRMSECRPDCR2PRMSEPRPDP
0.98950.0048466.920.98650.0055846.11
Table 9. Comparison of performance evaluation indices of two moisture content detection models.
Table 9. Comparison of performance evaluation indices of two moisture content detection models.
Modeling MethodsEvaluation Index for Verifying the Performance of the Model
R2RMSERPD
MLR model0.9100.0259312.41
BPNN model0.9860.0089985.99
Table 10. Results of the model calibration test.
Table 10. Results of the model calibration test.
MCP
(%)
MCA
(%)
RECB
(%)
RECA
(%)
MCP
(%)
MCA
(%)
RECB
(%)
RECA
(%)
MCP
(%)
MCA
(%)
RECB
(%)
RECA
(%)
13.714.666.55−1.0320.4221.314.16−3.6121.0623.9111.934.79
15.3317.4512.145.0219.7321.327.46−0.0521.7623.919.011.63
16.8018.117.25−0.2719.421.369.181.8122.424.147.21−0.32
17.2218.356.17−1.4419.8721.467.41−0.102224.178.981.60
17.118.738.701.3019.9921.496.98−0.5623.8525.014.64−3.10
17.7718.956.22−1.3918.3521.5014.677.7523.7125.296.25−1.36
16.8319.4613.516.5019.1221.8912.675.592525.993.81−3.99
17.9621.0614.727.8021.1122.395.72−1.9324.526.678.140.69
18.421.1112.845.7722.0423.656.80−0.7627.0627.682.24−5.69
19.2621.209.171.8023.1923.872.84−5.0427.9128.863.29−4.55
Note: MCP = Predicted moisture content; MCA = Actual moisture content; RECB = Relative error of model before calibration; RECA = Relative error of model after calibration.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Liu, H.; Meng, Z.; Zhang, A.; Cong, Y.; An, X.; Fu, W.; Wu, G.; Yin, Y.; Jin, C. On-Line Detection Method and Device for Moisture Content Measurement of Bales in a Square Baler. Agriculture 2022, 12, 1183. https://doi.org/10.3390/agriculture12081183

AMA Style

Liu H, Meng Z, Zhang A, Cong Y, An X, Fu W, Wu G, Yin Y, Jin C. On-Line Detection Method and Device for Moisture Content Measurement of Bales in a Square Baler. Agriculture. 2022; 12(8):1183. https://doi.org/10.3390/agriculture12081183

Chicago/Turabian Style

Liu, Huaiyu, Zhijun Meng, Anqi Zhang, Yue Cong, Xiaofei An, Weiqiang Fu, Guangwei Wu, Yanxin Yin, and Chengqian Jin. 2022. "On-Line Detection Method and Device for Moisture Content Measurement of Bales in a Square Baler" Agriculture 12, no. 8: 1183. https://doi.org/10.3390/agriculture12081183

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop