Intelligent sowing depth regulation system based on Flex sensor and Mamdani fuzzy model for a no-till planter

Sowing depth has an important impact on the performance of no-tillage planters, it is one of the key factors to ensure rapid germination. However, the consistency of sowing depth is easily affected by the complex environment of no-tillage operation. In order to improve the performance of no-tillage planters and improve the control precision of sowing depth, an intelligent depth regulation system was designed. Three Flex sensors installed on the inner surface of the gauge wheel at 120° intervals were used to monitor the downward force exerted by the seeding row unit against ground. The peak value of the output voltage of the sensor increased linearly with the increase of the downward force. In addition, the pneumatic spring was used as a downforce generator, and its intelligent regulation model was established by the Mamdani fuzzy algorithm, which can realize the control of the downward force exerted by the seeding row unit against ground and ensure the proper seeding depth. The working process was simulated based on MATLAB-Simulink, and the results showed that the Mamdani fuzzy model performed well in changing the pressure against ground. Field results showed that when the operating speed was 6 km/h, 8 km/h and 10 km/h, the error of the system’s control of sowing depth was ±9 mm, ±12 mm, and ±22 mm, respectively, and its sowing performance was significantly higher than that of the unadjusted passive operation.


Introduction 
Conservation tillage is a tillage technique that uses mechanization as its primary means of operation [1][2][3] . It reduces the tillage of the soil by using less or no-tillage and keeps the crop straw and stubble on the surface. It can effectively reduce the evaporation of soil water, increase soil organic matter and improve the soil structure. Therefore, it can reduce wind erosion and water erosion of soil and effectively alleviate the damage of sandstorms [4] . The no-tillage planter is the ideal equipment to realize this farming method. It is different from the traditional planter which does not need to plow the soil at all, and can complete the operations such as ditching, sowing, soil covering and crushing simultaneously [5] . In the actual sowing work, the sowing rate, row spacing and sowing depth are the main indexes to evaluate the seeding quality of no-tillage seeder [6] . Generally, the accurate control of these three indexes can ensure the reasonable distribution of seeds in the seed ditch after sowing [7] , and effectively guarantee the production and crops benefit.
Under the conditions of conservation tillage, poor surface conditions will affect the quality of cultivation, fertilization and sowing, especially control of sowing depth. This is of extra importance since consistent sowing depth is the basic requirement to ensure the seedlings are neat and healthy [8,9] . In order to ensure the consistency of sowing depth, a profiling mechanism was designed for the no-tillage planter [10] . At present, the profiling methods used in no-tillage planters can be divided into active profiling and passive profiling [11] . The passive profiling mechanism is widely used because of its simple structure, low cost and good contour ability. However, there are problems with profiling advance and lagging because this profiling method cannot make timely and accurate responses according to the actual situation of the soil [12] . These problems will lead to inconsistent sowing depth, and even seed exposure, which will affect the final emergence. The problem of low profiling sensitivity of passive profiling mechanisms makes researchers focus on active profiling [13][14][15] .
It is a typical active profiling method to adjust the floating up and down of the seeding row unit by detecting the fluctuation of ground by ultrasonic sensor [16] . The surface condition of no-till sowing is complex, and the spatial difference of soil is large. It is difficult to achieve the desired sowing depth by this method. Therefore, it is very important to adjust the sowing depth of the seeding row unit in real-time according to the spatial difference of soil.
In this research, Flex sensors were used to detect the pressure exerted by the seeding row unit against the ground to describe the spatial difference of soil, and to determine the relationship between sensor deformation and the pressure.
Because it has the characteristics of long service cycle, simple application circuit and easy processing of output signal [17] .
The Mamdani fuzzy algorithm was used to established the intelligent control model, and it has the advantages of simple parameter setting, arbitrary precision approximation of continuous function in compact space and outstanding language information carrying capacity [18,19] . The model takes the deviation between the seeding row unit's pressure on the ground and the target pressure and the rate of change of the deviation as input, and outputs the increment of downward pressure of the seeding row unit. By adjusting the air pressure in the air spring, a controllable downforce can be provided for the seeding unit, so that the opener of the planter can reach the target depth.

Sensor
The Flex sensor is an electromechanical characteristic sensor that can be used to measure the bending strength of an object [20] . The production process is to glue the conductive polymer PEDOT: PSS (poly3, 4-vinyl dioxythiophene: polystyrene sulfonic acid) film onto a flexible substrate (made from polyimide), and lead the positive and negative electrodes through wires. It has the characteristics of a long period of use and a wide application temperature range. Its application circuit is simple and the output signal is easy to process. The Flex sensor is widely used in finger bending detection, robots, medical instruments and musical instruments [21][22][23][24] .
The type of Flex bending sensor used in this study is Flex 2.2. Under the condition of no bending (flat state), the output resistance is 25 kΩ. The output resistance of the sensor increases when bending in the forward direction (conductive polymer PEDOT: PSS is located on the side of bending) and decreases when bending in the reverse direction. To monitor the downward force exerted by the seeding row unit against ground, the Flex sensor was seamlessly installed on the inner surface of the gauge wheel with polyurethane glue, as shown in Figure 1.

Figure 1 Flex sensor installation mode
The output signal of the Flex sensor is a resistance signal, which is not conducive to the acquisition of microcontrollers. The common method used to facilitate signal acquisition is to transform the resistance signal into a voltage signal for processing [25] . This study designed a signal conversion circuit as shown in Figure 2. In Figure 2, the series voltage division method is used to realize signal conversion, and the operational amplifier LM358 is used as the voltage follower to prevent signal loss.
According to the principle of series voltage division, the following can be obtained: where, R 1 is a constant value resistor, Ω; R 2 is a Flex sensor, Ω; V out and V CC are the output voltage signal and reference voltage, respectively, V. It can be seen that V out is not linearly correlated with R 2 , which is unfavorable for control applications. To eliminate this non-linear relationship, set R 1 to a high resistance (3MΩ), so that R 1 >R 2 . Then Equation (1) can be written as Equation (2).

Intelligent regulation method of sowing depth
The seeding row unit of the no-till seeder is mainly composed of parallel four-bar profiling mechanisms, stubble cleaning device, rubber gauge wheel, trench coulter and closing wheel, as shown in Figure 3a. The seeding row unit is mounted to the toolbar by the parallelogram linkage. It can float up and down with the parallelogram linkage to adapt to the fluctuation of the soil surface. The stubble cleaning device consists of a corrugated disc stubble cutter and a pair of V-type claw wheels. It was installed in the front of the no-tillage planter, which can effectively clean the straw and stubble on the seedbeds, and improve the soil temperature of the seedbeds and the pass ability of the planter. The rubber gauge wheels are mounted symmetrically on both sides of the trench coulter slightly behind. In the working process of the no-tillage seeder, the lower part of the trench coulter can enter the soil due to the pressure of the seeding row unit against the ground. Two gauge wheels are pressed on the surface, so there is a fixed height difference between the gauge wheels and the trench coulter, which is the predetermined depth value h. When the downforce of the seeding row unit against the ground is sufficient, the trenching depth of the seeding row unit can reach h, but it will not exceed h, because of the limiting effect of the gauge wheel. When the pressure of the seeding row unit against the ground is insufficient (including no pressure against the ground and suspension of the gauge wheel), the trenching depth of the trench coulter will be less than h. Therefore, the seeding depth can be judged indirectly according to the downforce of the seeding row unit against the ground.
However, the downforce of the seeding row unit against the ground cannot always be enough. This is because the weight of the seeding row unit cannot be too large, otherwise, it will not only affect the profiling ability during operation but also consume a lot of traction power. When the seeding row unit operation, it will have an adverse effect due to the continuous reduction of seed and fertilizer, as well as the uneven and inconsistent firmness of the seeding soil and other spatial differences. As a result, the depth of the trench coulter into the soil cannot reach the appropriate depth, that is, the sowing depth is not qualified. In order to make the sowing depth meet the planting demand, it is necessary to provide an intelligent and adjustable downward force mechanism for seeding the row unit. Therefore, a pneumatic spring was installed on the parallel four-bar profiling mechanism of the seeding row unit to provide downward force. When the seeding row unit works stably, its working parts can be regarded as rigid connection with the unit. The stress of the seeding row unit under the stable working state is shown in Figure 3b. According to the force analysis the equations as follows could be obtained: cos cos cos As the pressure of the pneumatic spring increased, the downward force F provided by the pneumatic spring increased. It can be seen from Equations (6) and (7) that the value of downward force P of seeding row unit against the ground would increase. Therefore, increasing the pressure in the pneumatic spring could increase the downward force P against the ground. The driving source of the pneumatic spring was the pneumatic transmission system. In this study, the pneumatic transmission system was mainly composed of a pneumatic compressor, gas storage tank, filter, electric-gas proportional valve and pneumatic spring. The pneumatic compressor compressed the gas to provide the initial gas energy, the gas storage tank stored the gas energy, the filter absorbed the water vapor, and the electric proportional valve controlled the output downward force of the pneumatic spring. The Flex sensor was glued to the inner surface of the gauge wheel, which could be used to monitor the downforce during the seeding row unit's works. According to the predetermined depth, the corresponding target pressure against the ground could be calibrated. After that, the real-time pressure of the seeding row unit against the ground, the target pressure and the downward force generated by the pneumatic spring were used as the modeling factors to establish an intelligent model of depth adjustment. This model could realize the dynamic real-time correction of the downward pressure of the seeding row unit to ensure that the trench depth was consistent with the predetermined depth. It is difficult to meet the real-time requirements with a single Flex sensor. Therefore, three Flex sensors were installed with the same performance and type on the inner wall of the depth limiting wheel at an interval of 120°. In order to effectively determine the position of the Flex sensor in the rolling process, three hall proximity switches were set on the outside of the depth limiting wheel, and each hall proximity switch was fixed on the front end of the Flex sensor along the forward direction of the implement.

Construction of the Mamdani fuzzy model
Due to the complexity of the mathematical model of the pneumatic spring, the pressure it provided can only be adjusted by controlling the input signal of the electrical proportional valve. In this study, an intelligent algorithm was designed by using fuzzy control technology to calculate the appropriate input signal of the electrical proportional valve. In the process of sowing depth control, the downward force of the pneumatic spring output is needed to match the pressure of the target against the ground continuously. Therefore, a Mamdani type double-input-single output fuzzy controller was designed with the deviation ΔP between the target pressure and the real-time pressure against the ground as well as the change rate d P of ΔP as the inputs and the pneumatic spring downward force F as the output.
To improve the effects of system dynamic response and reduce the complexity of fuzzy thrust, dividing ΔP to seven fuzzy subsets, that was, large positive deviation (PDL), moderate positive deviation (PDM), small positive deviation (PDS), zero deviation (PDZ), small negative deviation (NDS), moderate negative deviation (NDM) and large negative deviation (NDL). Divide d P into three fuzzy subsets, that was, deviation slow (DS), deviation moderate (DM) and deviation fast (DF). Divide the downward force F generated by the pneumatic spring into four fuzzy subsets, namely force zero (FZ), force small (FS), force medium (FM) and force large (FL). The domains of ΔP, d P and F were selected as [−1, 1], [−0.1, 0.1] and [0, 1]. The Gaussian function was used as the membership function of the two input quantities ΔP and d P , and a trigonometric function was used as the membership function of the output quantity F. According to the experience of field sowing depth adjustment, 21 fuzzy control rules have been made as shown in Table 1. According to the fuzzy approximate inference rule, the relationship between the input variables ΔP, d P and the output variable F of the fuzzy controller can be obtained [26] , as shown in Figure 4. In Figure 4, it can be seen that the thrust F of the pneumatic spring increases with the increase of the absolute value of ΔP when ΔP is greater than 0. This shows that the greater the pressure of the seeding row unit against the ground deviates from the target pressure, the greater downward force is given by the pneumatic spring, and with the increase of d P , the downward force of the pneumatic spring also increases. When ΔP is less than 0, the thrust F generated by the pneumatic spring approaches 0. This indicates that there is no need for the pneumatic spring to provide additional downward force when the pressure of the seeding row unit against the ground is greater than the target pressure.

Design of an intelligent regulation system
In order to effectively realize the function of depth adjustment of the no-till planter, an intelligent regulation system was designed based on the Flex sensor and the Mamdani fuzzy model [21] , as shown in Figure 5. The system had two parts: the collector and the regulator. The collector was used to collect the pressure of the seeding row unit against the ground in real-time. The regulator ran a Mamdani fuzzy control algorithm to realize the dynamic adjustment of the pneumatic seeding depth. Since the gauge wheel was rolling, the collector and regulator communicated through a wireless module NRF24L01.
The collector adopted a STM32F103RCT6 chip as its microprocessor. By triggering a Hall sensor and analog switch ADG412, the signal acquisition could be realized when the Flex sensor makes contact with the ground. Considering that the output signal of Flex sensor was weak after signal conversion circuit processing, an amplifying circuit and peak sampling circuit were added in the design (as shown in Figure 5a). The regulator consisted of a STM32F103ZET6 chip, NRF24L01 and an output control circuit (Figure 5b). The regulator received a pressure detection signal from the collector via NRF24L01. The deviation signal could be obtained by the difference between the pressure against ground and the target pressure. The controller STM32F103ZET6 ran the Mamdani fuzzy model program by querying the storage table. According to the deviation signal and its change rate, the output value of the Mamdani fuzzy model could be queried. The output value was processed by the output control circuit and applied to the electro-air proportional valve to realize the pneumatic spring downward force adjustment, so as to ensure that the sowing depth reaches the set depth.

Soil bin test
In order to determine the relationship between the downward force of seeding row unit against the ground and the output voltage of the Flex sensor, an indoor soil bin test was carried out in the soil bin. The soil bin was 30.0 m long and 2.8 m wide, and the soil was chernozem. The main equipment required for the test were as follows: soil bin tester, no-tillage planter seeding row unit, frame, laptop, NI data acquisition card, sowing depth control system, soil compaction meter SC 900, moisture meter MS-350, soil thermometer 11000, ring tool assembly, tape measure, steel rule, etc.
In order to simulate the soil condition in the field, the soil was first rotary tilled and watered, and then the soil was compacted by press roller after it was naturally dried for a period of time. The soil physical properties at 0-100 mm are listed in Table 2. The depth uniformity of no-tillage seeder was mainly affected by the operating speed and the downward force provided by the seeding row unit, so the forward speed v and the downward force P of the seeder were selected as the test factors. The operating speed of the seeder in Northeast China was 6.0-10.0 km/h, the operating speed of the soil bin tester was 1.5-7.0 km/h. In this study, the planting depth was set at 50 mm, the operating speeds was 3 km/h, 5 km/h and 7 km/h. According to the maximum load demand of seeder with seed manure in actual operation (the total weight of seed manure was 95 kg), the target downward forces of seeding row unit against the ground was 2300 N, 2556 N, 2831 N, 3092 N and 3365 N. The maximum pressure of the pneumatic spring was 0.9 MPa, and the range of downward force F provided by the pneumatic spring was 0-2400 N. The pressure of the pneumatic spring matching the target downward force (including the gravity of the seeding row unit) is listed in Table 3. The target pressure value of the pneumatic spring was set as 0.9 MPa. When a step signal was given to the system, the time required for the pneumatic spring to reach the predetermined pressure value was 0.4 s [19] . In other words, the maximum response time of the system was 0.4 s. To reduce the complexity of the experiment, only one Flex sensor was used to monitor the downward force exerted by the seeding row unit against ground.
The test system is shown in Figure 6a. The data generated by the Flex sensor was processed by a signal conversion circuit, then collected by NI data acquisition card and finally displayed and stored in a laptop. The horizontal test of each factor was repeated three times to take the mean value. The operation effect of the machine as shown in Figure 6b The output signals of the Flex sensor at three operating speeds and five downward forces are shown in Figure 7. The test results showed that during the movement of the seeder, the wheels gradually contacted the ground. The contact length between the sensor installed inside the wheel and the ground increased gradually, the output of the sensor decreased first and then increased rapidly. When the contact length between the sensor and the ground (which can be called the length of imprinting area [28] ) reached the maximum, the output voltage of the sensor also reached the maximum. As the sensor gradually left the ground, the output voltage of the sensor began to fall, and the trend of falling was opposite to the rising. When the sensor was completely off the ground, its output voltage was basically unchanged.
In addition, at the same speed, with the increase of the downward force of seeding row unit against the ground, the maximum output voltage of the sensor increased accordingly. This was because the deformation occurred during the contact between the tire and the ground. With the increase of the downward force of the unit against the ground, the maximum deformation caused by the contact between the gauge wheel and the ground increased, the maximum deformation of the sensor increased with the tire deformation, and the maximum output voltage of the sensor increased. With the increase of operating speed, under the same downward force P, the maximum of sensor output voltage decreased. This was because, with the increase of operating speed, the resistance of cleaning disc coulter and trench coulter increased. When the weight of seeding row unit G and the downward force F provided by pneumatic spring remain unchanged, the supporting force N of ground surface to seeding row unit decreased. It meant that the downward force P of seeding row unit against the ground also decreased. So the maximum deformation of the sensor caused by the indirect contact between the sensor and the ground was reduced, and the maximum output value of the sensor was reduced.
The peak signal was used as the detection value in the practical application of intelligent adjustment of the sowing depth. The sensor output peak signals of the seeding row unit at the same speed and different downward force were extracted for linear fitting, and the results are shown in Figure 8. At the three speeds, the fitting degree of the sensor output peak fitting formulas was greater than 0.979. As can be seen from Figure

Simulation test
In order to simulate and test the response effect of the system, the Simulink simulation model needed to be built in MATLAB software according to the previous design scheme, as shown in Figure 9, k P and k dP represent the quantization factors of the pressure against ground deviation and its change rate, respectively, and k f is the scaling factor of spring output. k P and k dP can be determined according to the value range of the pressure of the seeding row unit against the ground, and k f can be determined by the output pressure range of the pneumatic spring. Figure 9 Simulink simulation model In order to reduce the complexity of the simulation and observe the simulation results, the input and output variables were normalized in the simulation process, and k P =1, k dP =0.05, and k f =1. In order to analyze the response of the system to the change of seeding depth, the pressure deviation ΔP was changed according to the sinusoidal curve ΔP=sin(2t), and the simulation test was carried out on the model. The results are shown in Figure 10.
It can be concluded from Figure 10 that the output response curve can change well with the pressure deviation ΔP. When ΔP>0, the output response F changes with the change of h, and the maximum value can be close to 1. When ΔP<0, the output response F approaches 0. In Figure 10, the output response curve fails to reach the extreme values (0 or 1) near the equilibrium point (minimum or maximum value), which is caused by the blind area of fuzzy control. The output response curve of the Mamdani model can meet the demand of depth control. Figure 10 Response curve of the model

Field test
The system was installed on a maize no-till sowing machine with two rows of seeding row units (Figure 11a), the planter was 2BMZ-2 no-till planter produced by Jilin Kangda Agricultural Machinery Co., Ltd. The supporting power was 40 kW and the minimum operating weight was 460 kg. And the target sowing depth was set at 50 mm when the experiment was carried out in the field. In order to facilitate measurement, the soil covering device of one of the seeding row unit was removed before the test (as shown in Field tests were carried out in the experimental field of Jilin University in Changchun City, Jilin Province, China. The experimental field was chernozem, and the previous crop was maize using conservation tillage. The soil moisture content measured at 0-50 mm depth was 16.8%, soil bulk density was 1.1 g/cm 3 , average soil compaction was 4.1 kg/cm 2 , stubble height was 12-18 cm, and there were a small number of plant stumps and leaves in the field.
The test was carried out in blocks. The length of each test block was 50 m, the operating speed of the tractor was set as 6, 8 and 10 km/h respectively. In order to make the seeder work stably, the contact pressure between the gauge wheel and the soil was required to be appropriate. According to the field test, to achieve stable sowing depth at different operating speeds, the downward force of seeding row unit against ground is listed in Table 4. In order to compare the operation effect of active and passive adjustment modes, the surface of the test ground was trimmed before the operation, so that the height difference of the fluctuation of the test ground was all controlled at 0.1 m. Active regulation opened the intelligent regulation system of seeding depth, while passive regulation shut it down. During operation, the tractor passed through the test area at a constant speed after its speed was stabilized.
After the seeder passed, the depth of the trench measured uniformly and randomly was regarded as the seeding depth. When measuring the depth, the loose soil pushed out by the ditch opener was scraped off, and the initial surface of the ground was used as the measuring base. After the seeds in the row were covered with soil germination, they were uprooted, and the root length of the measured plant in the soil was the true sowing depth. Therefore, after the seeds in the row germinated, 25 seedlings were dug out every 2 m and measured the sowing depth of the seeds. Sowing depth results measured at different operating speeds are shown in Figure 12 As can be seen from Figure 12, with the increase of operating speed, the error of controlling sowing depth also increased gradually. At 6, 8 and 10 km/h operating speeds, the control error range of active depth adjustment was within ±9 mm, ±12 mm and ±22 mm, respectively, and that of passive depth adjustment was within ±15 mm, ±23 mm and ±29 mm, respectively. It can be seen that both passive and active regulation can adjust the sowing depth according to the surface fluctuation, but the active operation of the intelligent regulation system of loading and seeding depth is superior to the passive operation in performance. This is because the passive adjustment is completely dependent on the floating copying of the four-link, which is too large in the soil compacted or blocked by straw and stubble, and it is difficult for the disc knife of the planter to reach the set depth due to the insufficient cutting force. To some extent, the regulation system designed in this study can reduce the influence of soil spatial difference and the change of sowing monomer's self-weight on the sowing depth, and improve the copying and cutting ability of the seeder.
The groove sowing depth is not the real sowing depth. On the one hand, it is difficult to ensure that the seeds fall into the groove when the machinery falls. On the other hand, the cover thickness and ballast pressure of the seeder will also affect the sowing depth. It can be seen from the test results that the actual sowing depth deviates from the target sowing depth to a small extent.

Conclusions
Based on the Flex sensor and the Mamdani fuzzy model, a no-till planter sowing intelligent depth regulation system was developed. The peak signal generated by the contact between the Flex sensor and the ground was used to detect the pressure of the seeding row unit against the ground. The peak value of the output voltage of the sensor increased linearly with the increase of the downward force. The fuzzy model of Mamdani was built on the application of sowing depth regulation to realize the intelligent dynamic regulation of sowing depth. The simulation results showed that the model can follow the change of pressure against the ground and meet the demand of regulation of sowing depth. The results of the field experiment showed that the seeding control errors of the system were ±9 mm, ±12 mm and ±22 mm at the operating speeds of 6, 8 and 10 km/h, respectively, which was significantly better than the passive operation without adjustment.