Design of and Experiment with Seedling Selection System for Automatic Transplanter for Vegetable Plug Seedlings

In the process of vegetable plug seedling cultivation, packaging, and transportation, there may be missing, unhealthy or injured seedlings in the tray, which results in a missed planting or a low seedling survival rate after automatic transplanting. In this study, a seedling selection system with the function of seedlings identification, week seedlings elimination, and missing seedlings supplement was developed for an automatic transplanter. A plug seedling identification system based on a machine vision was used to detect vegetable plug seedlings based on the area characteristics of plug seedlings, stem leaves and plug bodies. The identification results were transmitted to a programmable logic controller (PLC), which controlled a nozzle to eliminate the unqualified seedlings from the conveyor belt lattice. When the empty conveyor belt lattice reaches the seedling throwing funnel, the rear conveyor belt lattice with the plug seedling is accelerated to ensure the continuity of seedlings supply. The adaptive fuzzy PID control algorithm was used to control the stepper motor of the conveyor belt to realize accurate seedling conveying and a seedling supplement. Using 30 days pepper plug seedlings as experimental seedlings, a comparative field experiment was carried out to evaluate the performance of the seedling selection system. The results showed that when the seedling selection system was turned on and the seedling extracting frequencies were 60, 80, and 100 plants/min, the success rates of plug seedling identification were 98.84%, 98.38%, and 96.99%, and the robust seedling rates were 98.05%, 97.78%, and 95.83%. The robust seedling rates were increased by 15.64%, 16.07%, and 13.89%, respectively, in contrast to turning off the seedling selection system.


Introduction
Vegetables are rich in nutrients, such as vitamins, minerals, and dietary fiber, which are essential for the human body. They are important food sources and economic crops all around the world [1,2]. Plug seedling cultivation and transplantation are important procedures for vegetable production. The quality of transplanting directly affects the vegetable yield, quality, and economic benefits. The application of an automatic transplanter can not only improve the transplanting efficiency and quality, but also reduce labor intensity and cost [3][4][5]. According to the mechanical industry standard experimental method in the People's Republic of China Transplanter of dry land plant (JB/T 10291-2013), the transplanting qualified rate of the transplanter required is ≥90%, which means up to 10% of the land could be wasted, and there is also waste of fertilizers, pesticides, and water. During the transplanting process, the growth status of plug seedlings is detected in real time, and the unqualified seedlings (dead, weak, diseased, and injured seedlings) are eliminated, and only robust seedlings are planted, which can improve land utilization, reduce waste of resources, and meet the requirements of precision, automatic, and intelligent agriculture [6,7]. The research on seedling selection systems has important significance for automatic transplanting and further development of the vegetable industry [8,9].
During the seedling cultivation process in the greenhouse, there are unqualified seedlings in the seedling tray due to the seed quality, sowing precision, and environmental impact. Seedling selection in the seedling cultivation stage improves the quality of automatic transplanting [10]. Ryu [11] designed a robotic transplanter with a vision system for bedding plants. The vision system could identify empty cells and reduce transplanting time with the identification success rate of empty cells higher than 95%. Tong [12,13] presented a machine vision system to detect the state of seedlings in the plug tray by measuring the leaf area and to guide the manipulator to transplant the robust seedlings by locating empty and unhealthy seedling holes. The identification accuracy of seedling quality was higher than 95%. For the images of a plug tray, a skewness correction algorithm, based on the Canny operator and Hough transform, was proposed to improve the evaluation accuracy in 2018. Wang [14] presented a recognition and classifying system for diseased and shortage seedlings based on machine vision to realize automatic seedling selection in the process of transplanting. However, when the leaves of plug seedlings are covered by each other, it will make it difficult for the machine vision system to identify the state of seedlings from the top view of the tray. Yang [15,16] proposed a monocular vision-based information acquisition method of plug seedling transplanting fitness. When a plug seedling was grasped and rotated by a manipulator, multiple seedling images were taken by a camera. The fitness information of the perpendicularity and height of the seedlings was evaluated to filter out plug seedlings; however, the detection time of plug seedlings is longer, so the transplanting efficiency is low.
There are some studies on plug seedling identification in the automatic transplanting process field. Wu [8] and Xin [17] designed a detection and recognition device for plug seedlings using a photosensor, which could detect the lack of seedlings and controls the seedling picking device to skip the empty seedling holes. The seedling leakage rate of the transplanter was reduced by 12%. Shi [18] developed an automatic transplanter with a seedling selection function for corn paper plug seedlings. The seedling transporting and selecting transmission mechanism automatically eliminated paper pots with shortage seedlings or weak seedlings and accelerated seedling supplying to guarantee the uniformity of seedlings. Wei [19] designed an image acquisition and processing system of automatic transplanter for plug seedlings. A proximity sensor triggered the camera to capture the seedling image when the seedlings fell into the seedling guide tube, and only robust seedlings were planted. However, the system did not compensate for missing seedlings. There is little research on the system of eliminating inferior seedlings and compensating for missing seedlings based on machine vision in the field automatic transplanter.
The goal of this study is to develop a seedling selection system with multiple functions of seedling identification, weak seedling elimination and missing seedling supplement for an automatic transplanter of vegetable plug seedlings [20] to improve the quality of transplanting. The plug seedling states are identified by the comprehensive information of the stems, leaves, and plug bodies of the plug seedlings. The seedling conveyor device controlled by fuzzy PID is used to convey and replenish seedlings. The system performance was evaluated through a comparative field experiment. The automatic transplanter for vegetable plug seedlings is mainly composed of a rack, seedling extraction device, seedling conveyor device, empty tray recovery device, seedling division device, 2-row planting devices, pneumatic system, power distribution system, PLC control system, and seedling selection system, as shown in Figure 1A. The transplanting objects are vegetable plug seedlings in 72 (6 × 12) holes tray ( Figure 1B). The seedling extraction device takes plug seedlings to the seedling conveyor device row by row, the seedling conveyor device puts plug seedlings into the seedling division device one by one through the seedling throwing funnel, and the seedling division device puts the plug seedlings into the left and right planting device for double row planting. The empty tray recovery device recovers the empty trays in real time. The seedling selection system is used to identify plug seedlings, eliminate weak seedlings, and compensate for missing seedlings in real time. The seedling selection system consists of an industrial camera (China, Daheng image, model: MER-131-75GC, CCD), two strip light sources (China, Lemons, OPT-L133037-W), a light box, a nozzle, a seedling conveyor belt (width: 220 mm), an industrial personal computer (IPC) equipped with plug seedling identification software, and PLC (Germany, Siemens, S7-200, 224xp), as shown in Figure 2. The light box is installed on the left side of the seedling conveyor device, and the strip light sources and camera are installed inside the light box. The angle of the light sources and the spatial position of the camera are adjustable. The seedling conveyor device is composed of a stepper motor, a seedling conveyor belt with multiple partition plate (height: 35 mm, thickness: 3 mm), driving roller, driven roller, and tension bearing pedestals. The adjacent two partition plates of the conveyor belt form a seedling lattice. The nozzle is set at the left of the light box and aligned with the seedling lattice.

Materials and Methods
transplanting objects are vegetable plug seedlings in 72 (6 × 12) holes tray (F seedling extraction device takes plug seedlings to the seedling conveyor d row, the seedling conveyor device puts plug seedlings into the seedling d one by one through the seedling throwing funnel, and the seedling divisio the plug seedlings into the left and right planting device for double row empty tray recovery device recovers the empty trays in real time. The seed system is used to identify plug seedlings, eliminate weak seedlings, and co missing seedlings in real time. The seedling selection system consists of an in era (China, Daheng image, model: MER-131-75GC, CCD), two strip light so Lemons, OPT-L133037-W), a light box, a nozzle, a seedling conveyor belt (w an industrial personal computer (IPC) equipped with plug seedling iden ware, and PLC (Germany, Siemens, S7-200, 224xp), as shown in Figure 2. T installed on the left side of the seedling conveyor device, and the strip ligh camera are installed inside the light box. The angle of the light sources a position of the camera are adjustable. The seedling conveyor device is comp per motor, a seedling conveyor belt with multiple partition plate (height: ness: 3 mm), driving roller, driven roller, and tension bearing pedestals. Th partition plates of the conveyor belt form a seedling lattice. The nozzle is se the light box and aligned with the seedling lattice.

Working Principle of the Seedling Selection System
The seedling extraction device puts the whole row of plug seedlings into the seedling lattices of the conveyor belt, as seen in Figure 2 (position a). The seedling lattices drive the plug seedlings into the light box (position b) in an orderly manner. The PLC control system triggers the camera to capture plug seedling images every three seedlings. The plug seedling identification software processes and detects the plug seedlings' image, and sends the detection result to the PLC. Only the robust seedlings are sent to the seedling throwing funnel by the conveyor belt, and fall into the seedling division device. The unqualified seedlings detected by the plug seedling identification software are blown out from the seedling lattices (position c) by the high-pressure nozzle. When the empty lattices reach the seedling throwing funnel (position e), the conveyor belt accelerates, and the robust seedling in the rear seedling lattice (position d) is thrown into the seedling division device through the seedling throwing funnel to complete the seedling supplement. The working process of seedlings extracting and seedlings supplement of the transplanter is shown in Figure 3. The image processing algorithm should be simple and stable, so that the plug seedling identification software can run on an IPC, which is important for field operations.

Working Principle of the Seedling Selection System
The seedling extraction device puts the whole row of plug seedlings into the seedling lattices of the conveyor belt, as seen in Figure 2 (position a). The seedling lattices drive the plug seedlings into the light box (position b) in an orderly manner. The PLC control system triggers the camera to capture plug seedling images every three seedlings. The plug seedling identification software processes and detects the plug seedlings' image, and sends the detection result to the PLC. Only the robust seedlings are sent to the seedling throwing funnel by the conveyor belt, and fall into the seedling division device. The unqualified seedlings detected by the plug seedling identification software are blown out from the seedling lattices (position c) by the high-pressure nozzle. When the empty lattices reach the seedling throwing funnel (position e), the conveyor belt accelerates, and the robust seedling in the rear seedling lattice (position d) is thrown into the seedling division device through the seedling throwing funnel to complete the seedling supplement. The working process of seedlings extracting and seedlings supplement of the transplanter is shown in Figure 3. The image processing algorithm should be simple and stable, so that the plug seedling identification software can run on an IPC, which is important for field operations.

Working Principle of the Seedling Selection System
The seedling extraction device puts the whole row of plug seedlings into the s lattices of the conveyor belt, as seen in Figure 2 (position a). The seedling lattices d plug seedlings into the light box (position b) in an orderly manner. The PLC con tem triggers the camera to capture plug seedling images every three seedlings. T seedling identification software processes and detects the plug seedlings' ima sends the detection result to the PLC. Only the robust seedlings are sent to the s throwing funnel by the conveyor belt, and fall into the seedling division device. qualified seedlings detected by the plug seedling identification software are blo from the seedling lattices (position c) by the high-pressure nozzle. When the empty reach the seedling throwing funnel (position e), the conveyor belt accelerates, and bust seedling in the rear seedling lattice (position d) is thrown into the seedling device through the seedling throwing funnel to complete the seedling suppleme working process of seedlings extracting and seedlings supplement of the transp shown in Figure 3. The image processing algorithm should be simple and stable the plug seedling identification software can run on an IPC, which is important operations.   Plug seedling identification software is developed based on the following software: program development software laboratory virtual instrumentation engineering workbench (LabVIEW), vision acquisition module software (VAS), Halcon machine vision software. The LabVIEW can be used to build various measurement or control systems using its tools [21]. The Halcon provides an interactive programming environment (HDevelop) to write image processing algorithms and programs. In this paper, the human-machine interface and the main control program are built in the LabVIEW, and the image acquisition module is programmed with the usage of NI-IMAQ driver of VAS. The Halcon image processing library is used to develop plug seedling identification software to realize the characteristic extraction of plug seedlings, plug bodies and stem leaves. The camera communicates with the IPC through GigE Vision, and the PLC triggers the camera to collect images by means of an external trigger. The system of the plug seedling identification is shown in Figure 4.

Plug Seedling Identification Software
Plug seedling identification software is developed based on the following s program development software laboratory virtual instrumentation engineerin bench (LabVIEW), vision acquisition module software (VAS), Halcon machine vis ware. The LabVIEW can be used to build various measurement or control system its tools [21]. The Halcon provides an interactive programming environment (HD to write image processing algorithms and programs. In this paper, the humaninterface and the main control program are built in the LabVIEW, and the image tion module is programmed with the usage of NI-IMAQ driver of VAS. The Halco processing library is used to develop plug seedling identification software to re characteristic extraction of plug seedlings, plug bodies and stem leaves. The cam municates with the IPC through GigE Vision, and the PLC triggers the camera t images by means of an external trigger. The system of the plug seedling identifi shown in Figure 4.

Characteristic Extraction and Classifying of Plug seedlings
The purpose of plug seedlings image processing is to classify plug seedling ing to the area characteristics of the plug seedlings, stem leaves and plug bodies age processing includes image acquisition, image cropping, threshold segmentati phological processing, and characteristic extraction. Due to the different characte different vegetable seedling varieties (cabbage, pepper, cauliflower, etc.) and ages of plug seedlings, the image processing parameters are different. Only the i pepper plug seedlings with the seedling age of 30 days have been used as an exa analysis.

Image Acquisition and Segmentation
In order to improve identification efficiency, the PLC control system triggers era to capture images for every three seedlings. Image segmentation methods m clude threshold segmentation [22,23], edge detection segmentation [24], and c algorithm segmentation [25]. Considering the reflection of the seedling conveyor mutual interference of the seedling leaves, the broken matrix in the seedling lat the diverse shapes of the seedlings, a combination of threshold segmentation a and morphology algorithm for image segmentation have been developed. The threshold between foreground and background was obtained using the Otsu t segmentation algorithm according to the grayscale histogram [26,27], and morph algorithms such as dilation, hole filling and erosion were used to improve the im mentation effect.

Characteristic Extraction and Classifying of Plug Seedlings
The purpose of plug seedlings image processing is to classify plug seedlings according to the area characteristics of the plug seedlings, stem leaves and plug bodies. The image processing includes image acquisition, image cropping, threshold segmentation, morphological processing, and characteristic extraction. Due to the different characteristics of different vegetable seedling varieties (cabbage, pepper, cauliflower, etc.) and different ages of plug seedlings, the image processing parameters are different. Only the images of pepper plug seedlings with the seedling age of 30 days have been used as an example for analysis.

Image Acquisition and Segmentation
In order to improve identification efficiency, the PLC control system triggers the camera to capture images for every three seedlings. Image segmentation methods mainly include threshold segmentation [22,23], edge detection segmentation [24], and clustering algorithm segmentation [25]. Considering the reflection of the seedling conveyor belt, the mutual interference of the seedling leaves, the broken matrix in the seedling lattice, and the diverse shapes of the seedlings, a combination of threshold segmentation algorithm and morphology algorithm for image segmentation have been developed. The optimal threshold between foreground and background was obtained using the Otsu threshold segmentation algorithm according to the grayscale histogram [26,27], and morphological algorithms such as dilation, hole filling and erosion were used to improve the image segmentation effect.

Characteristic Extraction of Plug Seedlings
The plug seedling identification software crops the whole seedling image into three single plug seedling images (Width: 220) according to the whole seedling image size (Width×Height: 1280 × 1024) and the position of the plug seedlings in the image ( Figure 5A). By comparing and analyzing the histogram of different color spaces of the seedling image, the S-channel image in the HSV space was chosen to separate the plug seedling area from the background by threshold segmentation of the histogram bimodal characteristics. The specific process of plug seedling extraction is as follows: convert the RGB images of a single plug seedling into R, G, and B single-channel images ( Figure 5B), and then convert the R, G, and B single-channel images into the HSV color space ( Figure 5C), perform Otsu threshold segmentation on the saturation S channel image to obtain plug seedlings region ( Figure 5D), dilate the plug seedling area to form a connected region ( Figure 5E), fill the hole in the connected region ( Figure 5F), display all connected regions ( Figure 5G), and select the largest connected region as the plug seedlings region ( Figure 5H). The area of the plug seedling region S seedling was calculated by the Halcon image processing function "Region Features ()". nomy 2021, 11, x FOR PEER REVIEW image, the S-channel image in the HSV space was chosen to separate area from the background by threshold segmentation of the histogram b istics. The specific process of plug seedling extraction is as follows: co ages of a single plug seedling into R, G, and B single-channel images (Fi convert the R, G, and B single-channel images into the HSV color spac form Otsu threshold segmentation on the saturation S channel image to lings region ( Figure 5D), dilate the plug seedling area to form a connec 5E), fill the hole in the connected region ( Figure 5F), display all connect 5G), and select the largest connected region as the plug seedlings regio area of the plug seedling region Sseedling was calculated by the Halcon function "Region Features ()".

Characteristic Extraction of Plug Bodies
By comparing the images in each color space, the gray-scale ch plug in the H-channel image ( Figure 6A) are more obvious. The H-c masked to eliminate the background region that is close to the gray val basic region of the plug ( Figure 6B) is obtained by the gray-histogram b istics. All connected regions are labeled ( Figure 6C) and the maximum is selected as the plug region ( Figure 6D). The area characteristic of th was calculated after the processing of morphological dilation (Figure 6

Characteristic Extraction of Plug Bodies
By comparing the images in each color space, the gray-scale characteristics of the plug in the H-channel image ( Figure 6A) are more obvious. The H-channel image was masked to eliminate the background region that is close to the gray value of the plug. The basic region of the plug ( Figure 6B) is obtained by the gray-histogram bimodal characteristics. All connected regions are labeled ( Figure 6C) and the maximum connected region is selected as the plug region ( Figure 6D). The area characteristic of the plug region S plug was calculated after the processing of morphological dilation ( Figure 6E) and hole filling algorithms ( Figure 6F).

Characteristic Extraction of Stems and Leaves
The excess green algorithm (L = 2G-R-B) is often used to segment the gr the image from the background [27,28]. Considering that there are many inte tors of the seedling conveyor belt, the improved graying algorithm for the segmentation is adjusted to (L' = (G-R) * 10) according to the actual situation The binary image is obtained by threshold segmentation (Figure 7B), and a regions are labeled ( Figure 7C). After eliminating holes and noises by dilatio ( Figure 7D), the area of the stem leaves region Sleaves was calculated by the Hal "Region Features ()" (Figure 7E).

Classification of plug seedlings
An array of three components was set to represent the growth informa plug seedlings, respectively. The value of each array component was obtaine (1) according to the plug seedling value of Sseedling, Splug and Sleaves(pixels). Th standard of strong seedlings is based on NY/T 2119-2012 the general rules plug seedling cultivation and vegetable transplantation. The values of each a nent were determined by the following equation.

Characteristic Extraction of Stems and Leaves
The excess green algorithm (L = 2G-R-B) is often used to segment the green region of the image from the background [27,28]. Considering that there are many interference factors of the seedling conveyor belt, the improved graying algorithm for the stem leaves segmentation is adjusted to (L' = (G-R) * 10) according to the actual situation ( Figure 7A). The binary image is obtained by threshold segmentation (Figure 7B), and all connected regions are labeled ( Figure 7C). After eliminating holes and noises by dilation processing (Figure 7D), the area of the stem leaves region S leaves was calculated by the Halcon function "Region Features ()" (Figure 7E).

Characteristic Extraction of Stems and Leaves
The excess green algorithm (L = 2G-R-B) is often used to segment the gre the image from the background [27,28]. Considering that there are many inte tors of the seedling conveyor belt, the improved graying algorithm for the segmentation is adjusted to (L' = (G-R) * 10) according to the actual situation The binary image is obtained by threshold segmentation (Figure 7B), and a regions are labeled ( Figure 7C). After eliminating holes and noises by dilatio ( Figure 7D), the area of the stem leaves region Sleaves was calculated by the Hal "Region Features ()" (Figure 7E).

Classification of plug seedlings
An array of three components was set to represent the growth informa plug seedlings, respectively. The value of each array component was obtained (1) according to the plug seedling value of Sseedling, Splug and Sleaves(pixels). Th standard of strong seedlings is based on NY/T 2119-2012 the general rules plug seedling cultivation and vegetable transplantation. The values of each a nent were determined by the following equation.

Classification of Plug Seedlings
An array of three components was set to represent the growth information of three plug seedlings, respectively. The value of each array component was obtained by formula (1) according to the plug seedling value of S seedling , S plug and S leaves (pixels). The classifying standard of strong seedlings is based on NY/T 2119-2012 the general rules of vegetable plug seedling cultivation and vegetable transplantation. The values of each array component were determined by the following equation.
where (0) means the seedling is classified as a robust seedling ( Figure 8A); (1) means the seedling is classified as dead, weak, or injured seedlings ( Figure 8B); (2) means the seedling is classified that the plug body is injured or loose ( Figure 8C); and (3) means the seedling is classified as no seedling ( Figure 8D). When the PLC receives the array component value of

Adaptive Fuzzy PID Control Algorithms for Seedling Conveyor Device
The seedling conveyor belt conveys plug seedlings orderly and replenish missing for a long time and with high frequency. When the missing seedlin ished, the conveying speed is accelerated. When the seedling conveyor be seedling lattices just correspond to the seedling extracting device and the no fore, the seedling conveyor stepper motor requires a high repeated positioni sion and stability. Fuzzy PID control technology can be used to control the st and to accelerate mechanical system response speed [29]. In this study, the ada PID control algorithm was used to achieve precise positioning control of seed ance and seedling replenishment.

Precision Analysis of Seedling Conveyor Device
The seedling conveyor belt is driven by a stepping motor (86BYG250H, brid, 12 N·m, 1.8°) through a synchronous belt to drive the seedling conve ( Figure 2). The seedling conveyor belt moves forward for a seedling displacem by the stepping motor cycle once, and it moves two seedling displacements the stepping motor acceleration when performing seedling replenishment. T (Xinling, CHB38S-E-5000) sends corresponding speed pulses to the PLC to fo feedback control.
Calculation of conveyor belt displacement L

= 2
Calculation of the pulses number N sent by the PLC = 2 where d is the diameter of the conveyor belt on the roller, 94 mm; i is the t reduction ratio, 2; θ is the step angle of the stepper motor, 1.8°; n is the subdi ber; and ψ is the motor rotation angle.

Adaptive Fuzzy PID Control Algorithms for Seedling Conveyor Device
The seedling conveyor belt conveys plug seedlings orderly and replenishes seedlings missing for a long time and with high frequency. When the missing seedling is replenished, the conveying speed is accelerated. When the seedling conveyor belt stops, the seedling lattices just correspond to the seedling extracting device and the nozzle. Therefore, the seedling conveyor stepper motor requires a high repeated positioning for precision and stability. Fuzzy PID control technology can be used to control the stepper motor and to accelerate mechanical system response speed [29]. In this study, the adaptive fuzzy-PID control algorithm was used to achieve precise positioning control of seedling conveyance and seedling replenishment.

Precision Analysis of Seedling Conveyor Device
The seedling conveyor belt is driven by a stepping motor (86BYG250H, 2 phase hybrid, 12 N·m, 1.8 • ) through a synchronous belt to drive the seedling conveyor belt roll ( Figure 2). The seedling conveyor belt moves forward for a seedling displacement (43 mm) by the stepping motor cycle once, and it moves two seedling displacements (86 mm) by the stepping motor acceleration when performing seedling replenishment. The encoder (Xinling, CHB38S-E-5000) sends corresponding speed pulses to the PLC to form a motor feedback control.
Calculation of conveyor belt displacement L Calculation of the pulses number N sent by the PLC where d is the diameter of the conveyor belt on the roller, 94 mm; i is the transmission reduction ratio, 2; θ is the step angle of the stepper motor, 1.8 • ; n is the subdivision number; and ψ is the motor rotation angle.
Calculation of total error value of the stepper motor: Putting ∆N and θ into Equation (4) gives ∆θ = 0.09, and putting ∆θ as ψ into Equation (2) to get the conveyor belt displacement error s 1 = 0.037 mm. In order to ensure the accuracy of pot seedling conveying, the maximum positioning error allowed by the conveyor belt is s 2 = ±1 mm. Based on the relation of |s 1 | < |s 2 |, the displacement error of the conveyor belt caused by the rotation error of the stepper motor is theoretically smaller than the setting error. However, in the field experiment, the mechanical characteristic was unstable and the non-linear errors may have been caused by transmission due to the complex and changeable environmental factors. Moreover, the signal to the solenoid valves or from the sensors may cause data loss or distortion because of electromagnetic interference. Continuous high-frequency intermittent rotation of the conveyor belt causes error accumulation. It is necessary to optimize the positioning algorithm of the stepper motor to improve the positioning precision and stability.

The Composition of Adaptive Fuzzy PID Control Algorithm
Conventional PID control is a classic control theory as a linear controller, which is widely used in industrial process control. The conventional PID algorithm is: where the control quantity u(k) is composed of the linear addition of the proportional term K p e(k), integral term K i k ∑ j=0 e(j), and differential term K d ∆e(k). Kp, Ki, and Kd are proportional, integral, and differential coefficients, respectively. The selection of PID parameters directly affects the stability and responsiveness of the system. When the control object has the characteristics of time-varying uncertainty, strong interference, and nonlinearity, the conventional PID control with fixed control parameters cannot achieve good control results. According to the actual error detection situation, the fuzzy PID controller selects the parameter correction values ∆Kp, ∆Ki, ∆Kd in the fuzzy controller rule base for PID control to achieve the adaptive and high-precision control effect. The adaptive fuzzy PID feedback control block diagram of the seedling conveyor device is shown in Figure 9. and changeable environmental factors. Moreover, the signal to the solenoid valves or from the sensors may cause data loss or distortion because of electromagnetic interference. Continuous high-frequency intermittent rotation of the conveyor belt causes error accumulation. It is necessary to optimize the positioning algorithm of the stepper motor to improve the positioning precision and stability.

The Composition of Adaptive Fuzzy PID Control Algorithm
Conventional PID control is a classic control theory as a linear controller, which is widely used in industrial process control. The conventional PID algorithm is: where the control quantity u(k) is composed of the linear addition of the proportional term , integral term ∑ , and differential term . Kp, Ki, and Kd are proportional, integral, and differential coefficients, respectively. The selection of PID parameters directly affects the stability and responsiveness of the system.
When the control object has the characteristics of time-varying uncertainty, strong interference, and nonlinearity, the conventional PID control with fixed control parameters cannot achieve good control results. According to the actual error detection situation, the fuzzy PID controller selects the parameter correction values ΔKp, ΔKi, ΔKd in the fuzzy controller rule base for PID control to achieve the adaptive and high-precision control effect. The adaptive fuzzy PID feedback control block diagram of the seedling conveyor device is shown in Figure 9.

Implementation of Adaptive Fuzzy PID Control Algorithm
In the feedback control process of the stepper motor, the encoder detects the rotation angle of the driven roller. The position deviation e(k) and deviation change rate ∆e(k) were used as the inputs of the fuzzy controller. Based on the fuzzy inference, ∆K p , ∆K i , ∆K d were deblurred as the outputs of the fuzzy controller. The basic domains of e(k), ∆e(k), ∆K p , The fuzzy control rules were determined by repeated experiments and expert experience. Based on the input values of the fuzzy controller (e(k), ∆e(k)) and fuzzy control rules, the parameter correction values of the PID controller (∆K p , ∆K i , ∆K d ) were determined. The fuzzy PID parameter correction rules are shown in Table 1. The PID control parameters revised by the fuzzy controller are as follows: where K p , K i , K d are PID basic parameters, ∆K p , ∆K i , ∆K d are online correction parameters.

Experiment Conditions
In the field transplanting experiment, the automatic transplanter was driven by a tractor (Luzhong, model: 604), and the frequency of taking seedlings was controlled by the throttles and the gear of the tractor. The plug seedlings used for the experiment were pepper seedlings, which were cultivated in the 72-hole tray. The age of the pepper seedlings used in the experiment was 30 days, and the water content of the plug was 50-70%, the seedling diameter was 2-3 mm, the seedling height was 120-140 mm, the seedling spread was 60-80 mm, and the robust seedling rate was 100%. The experiment prototype is shown in Figure 10A, and the experiment plug seedling is shown in Figure 10B.

Experiment Method and Index
Thirty-six tray seedlings were divided into two groups, and the seedling transplanting experiments were conducted turning on/off the seedling selection system with the fixed seedling extraction frequencies of 60, 80, and 100 seedlings/min. The experiment was repeated three times for each frequency, and two trays were extracted (144 seedlings) continuously each time. In order to test the identification effect of plug seedlings, the plug seedlings were manually treated before the comparative experiment. Each tray was randomly set with 9 non-adjacent unqualified seedlings, including three plug injured seedlings, three stem leaves injured seedlings, and three missing seedlings.
In the experiment, the success rate of plug seedling identification and the robust seedling rate were used as the experiment evaluation indexes. The success rate of plug seedling identification refers to the ratio of the number of correctly identified plants on the conveyor belt to the total number of plug seedlings in a single test; the robust seedling rate refers to the ratio of the number of robust seedling plants to the total number seedlings in the seedling division device. the throttles and the gear of the tractor. The plug seedlings used for the expe pepper seedlings, which were cultivated in the 72-hole tray. The age of the p lings used in the experiment was 30 days, and the water content of the plug the seedling diameter was 2-3 mm, the seedling height was 120-140 mm, spread was 60-80 mm, and the robust seedling rate was 100%. The experime is shown in Figure 10A, and the experiment plug seedling is shown in Figure   (  Calculation of the success rates of plug seedling identification Calculation of the robust seedling rates where Q is the number of correctly classified plug seedlings by the system and plants. P is the number of seedlings and holes in the trays in a single test, 144 plants (2 trays). W is the number of cups of seedling division device with robust seedlings, and plants. V is the number of total seedling cups of the seedling division device passing through the bottom of the seedling throwing funnel.

Results and Analysis
The comparative experiment result of seedlings extraction is shown in Table 2. The seedling selection system and the automatic vegetable transplanter operated at high speed and coordinated to complete the seedling transplanting operation. When the seedling extracting frequencies are 60, 80, and 100 plants/min without the seedling selection system, the average robust seedling rates are 82.4%, 81.71%, and 81.94%, respectively.
When the seedling selection system is turned on with the seedling frequencies of 60, 80, 100 plants/min, the average success rates of plug seedling identification are 98.84%, 98.38%, and 96.99%, and the average robust seedling rates are 98.05%, 97.78%, and 95.83%, respectively. The experiment statistical results of seedlings extracting comparative experiment is shown in Figure 11. The success identification rate of plug seedlings does not change significantly, but the robust seedling rate has a downward trend with the increase of the seedling extracting frequency.

Discussion
When the seedling selection function is turned on, the main factors that a robust seedling rate are identification errors and failure to replenish seedlings. T two cases of plug seedling identification errors: (1) there is no seedling in the s lattice, but some scattered substrates are left in the seedling lattice, and the leave adjacent seedling lattices extend into the seedling lattice due to mutual entangle friction, which leads to the misjudgment of the plug seedling ( Figure 12A); and robust seedlings in the lattice are inclined, parts of the stem leaves are located in t cent lattice, which are mistaken for dead, weak, or injured seedlings ( Figure 12B). be improved from the following aspects: (1) properly increase the height of the c belt lattice, so that the stem leaves of plug seedlings are confined to the seedling l much as possible; (2) increasing the gap between the mechanical device and the pl lings on the conveyor belt to prevent the stem leaves of plug seedlings from inte

Discussion
When the seedling selection function is turned on, the main factors that affect the robust seedling rate are identification errors and failure to replenish seedlings. There are two cases of plug seedling identification errors: (1) there is no seedling in the seedling lattice, but some scattered substrates are left in the seedling lattice, and the leaves in the adjacent seedling lattices extend into the seedling lattice due to mutual entanglement or friction, which leads to the misjudgment of the plug seedling ( Figure 12A); and (2) the robust seedlings in the lattice are inclined, parts of the stem leaves are located in the adjacent lattice, which are mistaken for dead, weak, or injured seedlings ( Figure 12B). This can be improved from the following aspects: (1) properly increase the height of the conveyor belt lattice, so that the stem leaves of plug seedlings are confined to the seedling lattice as much as possible; (2) increasing the gap between the mechanical device and the plug seedlings on the conveyor belt to prevent the stem leaves of plug seedlings from interference and moving to the other lattice; and (3) controlling the age of seedlings to prevent them from disturbing the adjacent seedlings due to the excessive leaves spreading. Due to the torque limitation of the seedling conveyor motor and the inertia of the seedling convey device, when the speed of the division device cup is increased, the frequency of conveying seedlings is increased as well; the seedling conveyor belt cannot respond fast enough to replenish seedlings. The seedlings in conveyor belt lattices do not fall into the division device cups through the seedling funnel, which leads to the failure of the seedling replacement. Therefore, the frequency of extracting seedlings is limited to a reasonable range (≤100 plants/min) to improve the success rate of seedling replenishment.

Conclusion
 The seedling selection system of automatic transplanter for ve was developed to realize the identification of plug seedlings, qualified seedlings and the replenishment of seedlings. It is co stalled with plug seedling identification software, an industrial sources, a light box, a PLC control system, a nozzle, and seed With the cooperation of the PLC control system and the plug software, all parts of the automatic transplanter coordinate and the seedling extraction, plug seedling identification, unqualified and seedling replenishment.  The plug seedling identification software was built by LabVIE The characteristics extraction algorithms for plug seedling, s body were designed using image processing, such as image cr dilation, merging, and filling. The plug seedlings on the convey and the result was sent from IPC to PLC to conduct real-time s seedling replenishment.  The adaptive fuzzy PID controller was designed to control the s

•
The seedling selection system of automatic transplanter for vegetable plug seedlings was developed to realize the identification of plug seedlings, the elimination of unqualified seedlings and the replenishment of seedlings. It is composed of an IPC installed with plug seedling identification software, an industrial camera, two strip light sources, a light box, a PLC control system, a nozzle, and seedling conveyor device.
With the cooperation of the PLC control system and the plug seedling identification software, all parts of the automatic transplanter coordinate and cooperate to complete the seedling extraction, plug seedling identification, unqualified seedling elimination, and seedling replenishment.

•
The plug seedling identification software was built by LabVIEW, VAS, and Halcon. The characteristics extraction algorithms for plug seedling, stem leaves, and plug body were designed using image processing, such as image cropping, segmentation, dilation, merging, and filling. The plug seedlings on the conveyor belt were identified and the result was sent from IPC to PLC to conduct real-time seedling elimination or seedling replenishment.

•
The adaptive fuzzy PID controller was designed to control the seedling conveyor belt. The controller revised the PID control parameters in real time based on the conveyor belt position deviation value e(k) and deviation value change rate ∆e(k) to realize fast and accurate seedling conveyance and seedling replenishment. • Taking the seedling identification success rate and the robust seedling rate as the test indicators, the comparative field experiment of seedling transplanting was conducted on the seedling extracting frequencies of 60, 80, and 100 plants/min. The experimental results indicate that when the seedling selection system was turned on, the success rates of plug seedling identification were 98.84%, 98.38%, and 96.99%, respectively, and the robust seedling rates were 98.05%, 97.78%, and 95.83%, respectively. The robust seedling rates were increased by 15.64%, 16.07%, and 13.89%, in contrast to turning off the seedling selection system. In addition, the data of the comparative field experiment show that the growth rates of robust seedlings will decline with increasing seedling extracting frequencies, but the overall growth rates of robust seedlings reach more than 13%. This study provides a reference for the further improvement of transplanting quality of the automatic transplanter for vegetable plug seedlings.
With the application of information technology, sensor technology, control technology and other advanced technology to the fully automatic transplanter, the quality and speed of the automatic transplantation of vegetable plug seedlings will be further improved, which will be conducive to promoting the development of the vegetable industry.