*2.3. Motor Speed Matching Operation Speed*

To ensure the uniformity and qualified rate of seed spacing, it is very important to establish the dynamic matching relationship between the motor speed and the tractor speed. The rotational speed of the motor is determined by the tractor speed, the number of holes in the seeding plate, the transmission ratio from the reducer to the seeding plate, and the seeding distance. Accordingly, the required rotary speed of the planter unit can be calculated as:

$$R = \frac{1000VI}{36 \text{ X}\_{ref}N} \tag{1}$$

where *R* is the motor speed (r/s), *V* is the tractor speed (km/h), *I* is the transmission ratio from the reducer to the seeding plate, *Xref* is the setting seeding distance (cm), and *N* is the number of holes in the seeding plate. For a well-processed seeding cell, *I* and *N* are fixed values. *Xref* is set based on the agricultural technology. Therefore, the tractor speed is the most critical factor affecting the sowing quality.

#### *2.4. Speed Acquisition and Motor Control*

GPS speed measurement is not affected by the structure of the seeder and surface conditions and can provide a variety of data, including latitude and longitude, heading angle, and elevation. Compared with other velocity measurement methods, such as encoders, it has great advantages. WTGPS-200 is a high-performance vehicle-mounted integrated navigation system for vehicle navigation. When the signal accuracy of the GNSS system is reduced or if the satellite signal is lost, the WTGPS-200 system uses pure inertial navigation technology without the aid of odometer information. It can also independently carry out high-precision positioning, velocity measurement, and attitude measurement for vehicle carriers over a long time. The accuracy of 0.05 m/s can meet the requirements of the GBT6973-2005 single-seed (precision) seeder test method. The controller obtains GPRMC frames conforming to the NMEA0183 protocol by RS232. Figure 6 shows the GPRMC frame format with fifteen fields. Field 0, as the frame head, represents the beginning of a frame, field thirteen is the frame data validation, and the frame ends with CR/LF. Field one to field twelve represent the data fields, in which field seven represents the speed value. Therefore, the seventh field in a frame can be extracted to obtain the speed.

**Figure 6.** GPRMC frame format.

The real-time motor speed was controlled via the pulse width modulation (PWM) signal generated by the STM32 chip's internal timer. The PWM mode could generate a signal whose frequency was determined by the TIMx\_ARR register, and the duty ratio was determined by the TIMx\_CCRx register. The duty ratio could be adjusted to control the motor speed at a certain PWM frequency. Limited to the computing power of the chip used, more complex intelligent control algorithms are not adopted, such as adaptive PID [27], particle swarm optimization algorithm [28], fuzzy PID Control Algorithm [29,30], and ant colony optimization [31]. On the other hand, the experimental results indicated that the motor speed showed a linear relationship with the duty ratio. Therefore, closed-loop control can be carried out by the PID control algorithm [32]. PID control is a closed-loop control method based on deviation, which can eliminate the deviation between the target speed and the actual speed of the motor in the adjustment process. In discrete PID control, the realization of integration is the rectangular addition calculation in the case of infinite subdivision. In the discrete state, the time interval is large enough, and the accuracy of rectangular integration appears to be lower in some cases. To minimize the difference, the rectangular integration was changed into trapezoidal integration to improve the calculation accuracy. Introducing the trapezoidal integral into the incremental PID algorithm modifies the formula as follows:

$$
\Delta v(k) = K\_p(e(k) - e(k-1)) + K\_i \frac{e(k) + e(k-1)}{2} + K\_d(e(k) - 2e(k-1) + e(k-2)) \tag{2}
$$

where Δ*v*(*k*) is the adjustment value, *Kp* is the proportional coefficient, *Ki* is the integral coefficient, *Kd* is the differential coefficient, and *e*(*k* − 1), *e*(*k*), and *e*(*k* − 2) are the last three deviations. Figure 7 shows an analysis of the bench test data. The optimum motor speed control could be achieved when *Kp* was 4.15, *Ki* was 1.2, and *Kd* was 0.

The theoretical motor speed calculated by Formula (1) is the target value; the rotor position sensor measures the speed signal as a feedback value. The theoretical calculation of the target speed does not consider the influence of external factors. However, due to the factors of actual operation, such as zero drift of the speed sensor, error of DC motor speed measurement, and the efficiency of mechanical transmission, the error of the control parameters (*e*(*k*)) is affected. Therefore, setting a threshold variable, t, does not perform the PID algorithm when the deviation is less than the absolute value of the threshold. Experimental results showed that the control precision was best when the absolute value of threshold t was 0.15. On the other hand, if a system always has a uniform direction

deviation, infinite accumulation and saturation can occur, which greatly affects the system performance. To solve the problem of integral saturation, the PID algorithm anti-integral saturation was introduced. The idea is to determine whether the control, *C*(*k* − 1), of the previous moment has exceeded the limit when calculating *e*(*k*). If *C*(*k* − 1) > *Cmax* (*Cmax*: sets the TIMx capture compared to the register maximum value), only negative deviations are accumulated; if *C*(*k* − 1) < *Cmin* (*Cmin*: sets the TIMx capture compared to the register minimum value), only positive deviations are accumulated. This avoids the control quantity from staying in the saturated zone for a long time. The PID control algorithm is shown in Figure 8.

**Figure 7.** Data analysis curve of different PID parameters: (**a**) response curves under different *Kp* conditions and (**b**) response curves under different *Ki* conditions.

**Figure 8.** PID control algorithm.

#### *2.5. Sowing Monitoring*

To realize the real-time monitoring of the quality of maize no-tillage precision seeding operations, a seeding monitoring system based on reflective infrared photoelectric induction was designed. The monitoring probe used an infrared emitting diode and a photodiode as the signal transmitting and receiving ends. During the seeding operation, corn seeds were separated into single seeds from the seed metering device, dropped into the seed guiding tube, and were finally discharged into the soil through the lower seed guiding mouth. Among the working components involved in the seeding process, the structure of the seed guiding tube was the simplest and the closest to the seed dropping point. Therefore, mounting the seed monitoring probe on the seed guiding tube was preferred.

According to GB/T 6973-2005, the ratio of actual adjacent seed spacing, *X* (cm), to theoretical seed spacing, *Xref* (cm), is the benchmark for evaluating the quality of seed metering. In addition to field measurements, the actual seed spacing is generally estimated by multiplying the tractor speed, *V* (km/h), of the seeder by the interval time, *T* (ms), between adjacent seeds. The forward speed, *V* (km/h), of the seeder can be obtained by the pick-up circuit. Therefore, the comparison between the actual seed spacing and the theoretical seed spacing can be converted to a numerical comparison between the actual adjacent seed falling time interval, *T* (ms), and the theoretical time interval, *T*<sup>0</sup> (ms). According to the standard, if *X* > 1.5*Xref* , it is judged as a miss-seeding, and if *X* ≤ 0.5*Xref* , the seeding is judged as a reseed. For the convenience of system calculation, the judgment basis is converted to the relationship between the tractor speed, *V* (km/h), and the theoretical distance, *Xref* (cm). If *VT* > 54*Xref* , the seeding is judged as a missseeding. If *VT* ≤ 18*Xref* is judged as a reseeding and if 18*Xref* < *VT <* 54*Xref* , the seeding is a quality seeding. When a fault (miss-seeding or reseed) occurs, an alarm is triggered. Figure 9 shows three different states of falling seeds in the seed tube. Figure 10 shows the seed condition monitoring process.

**Figure 9.** Judging the state of falling seeds in the seed tube.

#### *2.6. Performance Test of the Seeder Monitoring and Control System*

To verify the performance of the seeder monitoring and control system, laboratory bench tests and field tests were conducted. These tests included photoelectric sensor detection performance tests, abnormal alarm rate reliability tests, motor dynamic speed response tests, and statistical analyses of real-time sowing monitoring parameters.

The related tests were carried out on the JPS-12 seed metering device performance test bench (Bona Technology Co., Ltd., Harbin, China). The test materials were Xinyu No. 9 hybrid maize seeds produced by the Crop Research Institute of Xinjiang Academy of Agricultural Reclamation Sciences. The moisture content was 9.10%, the purity was 98.75%, and the thousand-grain weight was (274.22 ± 2.52) g. We randomly measured 300 seeds, and the shape was horse tooth, and the length, width, and height were 10.04 ± 1.06 mm, 7.45 ± 0.86 mm, and 5.50 ± 1.01 mm, respectively.

The seeding unit motor drive control system and experimental test setup are shown in Figure 11. The metering device was an air suction seed metering device produced by Precision Planting Company in the United States. The diameter of the metering plate was 4.5 mm, and the number of seed holes was 27. The DC motor was an NC3SFN-6035-CVC carbon brush variable-resistance brush DC motor produced by Transmotec, Sweden. The working voltage was 12 V, the current was 5.6 A, the rated speed was 10,700 r/min, and the stall torque was 446.8 mN·m. The motor reducer was a three-stage gear reducer developed

by Devo, Heilongjiang Province, and the deceleration ratio was 82.8125. The power output gear of the DC motor reducer engaged with the external gear of the seeding plate.

**Figure 10.** Seed condition monitoring process.

**Figure 11.** Seeding parameter monitoring on the JPS-12. (**a**) Control cabinet; (**b**) test bench; (**c**) seeding; (**d**) data statistics.

Since no interface can obtain the real-time speed on the JPS-12 test bench, to obtain the real-time operating speed of the seedbed belt as much as possible to simulate the field environment, ten groups of magnetic steel were installed on the inner side of the seedbed drive roller. NPN constant open all-pole Hall sensors were used in pulse signal detection. Figure 12 shows the installation position of the magnetic steel and the Hall sensors. The dynamic speed of the seedbed could be calculated according to Formula (3) after the signal of the speed pulse was collected by the Hall sensor.

$$V\_b = \frac{\pi dn}{mT\_c} \tag{3}$$

where *Vb* is the speed of the seedbed belt (m/s), *d* is the roller diameter (mm), *n* is the number of pulses in the *Tc* cycle, *m* is the number of magnetic steels, and *Tc* is the count cycle (ms).

**Figure 12.** Schematic diagram of seedbed belt speed detection.

The field experiment was conducted in Xiangshui County, Yancheng City, Jiangsu Province, on 17 February 2022, using a dual row with an eighteen-row seeder developed by Devo, Heilongjiang Province (Figure 13). To explore the influence of different operating speeds on seeding performance, the negative pressure of the fan output was adjusted to 4.5 kPa, the grain spacing was set to 20 cm, and the operating speeds were changed to 8 km/h, 10 km/h, and 12 km/h. To explore the effects of different grain spacings on sowing performance, the operating speed was 8 km/h, and the grain spacings were changed to 15 cm, 20 cm, and 25 cm. At the same time, we explored the differences in sowing performance parameters between different planting units. The grain spacing data were obtained by manual measurement.

**Figure 13.** Precision electric seeder and monitoring system test. (**a**) Eighteen-row maize precision electric seeder and monitoring system; (**b**) label seed position; (**c**) seed spacing measurement.

According to GB/T 6973-2005, the qualified index, QI, reseed index, RI, missing index, MI, and coefficient of variation, CV, were calculated as evaluation indices of sowing quality.

ѝѝѝ

$$\text{QI} = \frac{n\_1}{N'} \times 100\% \tag{4}$$

$$\text{RI} = \frac{n\_2}{N'} \times 100\% \tag{5}$$

$$\text{MI} = \frac{\text{\tiny M}}{\text{N}^{\prime}} \times 100\text{\text{\textdegree}} \tag{6}$$

$$X = \frac{\sum (n\_i X\_i)}{n\_2} \tag{7}$$

$$
\sigma = \sqrt{\frac{\sum (n\_i X\_i)^2}{n\_2} - X^2} \tag{8}
$$

$$\text{CV} = \sigma \times 100\% \tag{9}$$

where *N* is the total number of normalized intervals, *n*0, *n*1, and *n*<sup>2</sup> are the missing numbers (*Xi* ∈ (1.5, +∞]), the qualified number (*Xi* ∈ (0.5, 1.5]), and the replay number (*Xi* ∈ [0, 0.5]), respectively, *ni* and *Xi* are the grain spacing number and interval median in the *i*(th) interval, respectively, and *X* and *σ* are the mean and standard deviation of the sample, respectively. At the same time, these indicators were evaluated according to the NY/T 1143-2006 standard provided by the Ministry of Agriculture of China. Table 2 shows the main performance indices of the precision seeder.

**Table 2.** Main performance indices of the precision seeder.

