Design of a Sweet Potato Transplanter Based on a Robot Arm

: Traditional sweet potato transplanters have the problem of seedling leakage and can only accomplish one transplantation method at a time, which does not meet the requirements of complex planting terrain that requires multiple transplantation methods. Therefore, this paper proposes a design for a crawler-type sweet potato transplanting machine, which can accomplish a variety of transplanting trajectories and conduct automatic replanting. The machine has a transplanting piece and a replanting piece. The transplanting piece completes the transplanting action through a transplanting robot arm, and the replanting piece detects the transplanting status by deep learning. The mathematical model of the transplanting robot arm is built, and the transplanting trajectory is inferred from the inverse kinematics model of the transplanting robot. In the replanting piece, a target detection network is used to detect the transplanting status. The DBIFPN structure and the CBAM_Dense attention mechanism are proposed to improve the accuracy of the target detection of sweet potato seedlings. The experiment showed that the transplanting robot arm can transplant sweet potatoes in horizontal and vertical methods, and the highest transplanting qualiﬁcation rate is 96.8%. Compared with the use of the transplanting piece alone, the leakage rate of the transplanting– replanting mechanism decreased by 5.2%. These results provide a theoretical basis and technical support for the research and development of sweet potato transplanters.


Introduction
The sweet potato is an important food for countries all over the world. It provides raw starch for industrial uses, and it is a high-quality, anti-cancer, and energy-providing health food [1][2][3][4][5]. With the reduction in the number of agricultural workers, transplanting machinery will inevitably become the main development direction of agricultural mechanization [6][7][8].
It is difficult to separate sweet potato seedlings from each other for planting, due to their interweaving branches and the significant differences in morphology [9][10][11][12]. Therefore, semi-automatic transplanting machinery has been adopted worldwide [13][14][15]. For example, the semi-automatic chain clip-type sweet potato seedling transplanter produced by the American Marcinick Company can complete more than ten plantings at one time, but it damages the soil structure and is mainly used for direct insertion operations [16]. Hu et al. [17] developed the 2ZGF-2 duplex sweet potato transplanter, which can accomplish the oblique transplanting of sweet potatoes and transplant two rows of sweet potatoes at one time. In recent years, a connecting rod-type sweet potato transplanting machine has been favored by scholars. The Japanese company Dongfeng Well Seki has produced a self-propelled sweet potato transplanting machine, using four connecting rod mechanisms to achieve the sweet potato transplanting. The sweet potato transplanting height can be adjusted by adjusting the installation position of the connecting rod, and the main operation method is oblique planting. Zhu et al. [18] designed a clip type sweet potato naked seedling transplanting machine. The reference track of the sweet potato transplanting was defined, and the dimensions of each connecting rod were obtained through mathematical modeling and virtual prototype analysis to accomplish oblique transplanting. Shao et al. [19] and Shen et al. [20] designed a sweet potato ship-type transplanting mechanism through simulation analysis. However, no prototype was manufactured for field tests. It can be seen that at the present stage, a sweet potato transplanting machine can only achieve direct planting or oblique planting, and a sweet potato transplanting machine can only achieve one type of transplanting method. The different planting terrains typical of sweet potato fields require different transplanting methods, and different transplanting methods have a significant impact on the survival rate and yield of sweet potatoes. The shortage of sweet potato mechanized transplanting methods will restrict the yield and production efficiency of sweet potatoes. Designing a transplanter that can realize a variety of transplanting methods is a good solution to solve this type of problem. A mechanical arm is compact in structure and can execute complex moving trajectories. Therefore, many scholars have researched the use of mechanical arms for use in transplanting machinery. Han, L. et al. [21] developed a PLC-controlled multi-tasking robot transplanting cell for greenhouse seedlings. Yang, Q.L. et al. [22] designed a reciprocating transplanting mechanism that uses linear motors and cylinders, as well as an end-effector that can efficiently pick and plant seedlings at a given position. However, there is no corresponding special transplanting robot arm for crops like sweet potato seedlings, which have significant requirements for transplanting trajectories.
Replenishing seedlings has always been a challenge for transplanting machinery, and the difficulty lies in how to detect missing seedlings. Due to the rapid development of machine vision in recent years, seedling replanting mechanisms based on visual inspection have gradually emerged. He et al. [23] used machine vision to detect the health of cavity seedlings and control the end-effector to grasp the potted seedlings for replenishment operations based on a greedy genetic algorithm. Japanese scholars such as Mganilwa [24] applied machine vision technology to the dynamic detection of seedling quality in large potted seedling trays with an accuracy of over 99.93%, as well as a replanting strategy with an accuracy of 99%. Leakage of sweet potato seedlings is a common problem during transplanting, and currently, there is no effective way to replant the sweet potato seedlings.
To solve the shortage of sweet potato mechanized transplanting methods and the problem of leaked seedlings, this paper designed a crawler sweet potato transplanting machine based on a robot arm and machine vision. Because a robot arm is used for transplanting, the transplanting piece described in this paper can accomplish a variety of transplanting methods. At the same time, the deep learning-based object detection network can accurately detect the transplanting status of the sweet potato seedlings and perform replanting operations when missing seedlings are detected.

Overall Structure and Working Principle
The transplanting machine designed in this paper is shown in Figure 1. It is composed of four parts: a transplanting part, a replanting part, a tracked chassis, and a control box. As shown in Figure 1a, the transplanting part comprises a transplanting conveyor belt, a transplanting conveyor belt drive motor, and a transplanting robot arm. As shown in Figure 1b, the replanting part comprises a replanting drive motor, a replanting conveyor belt, a camera, and a replanting robot arm. The control box comprises two STM32 controllers and motor drives. The working process of the transplanting part proceeds in several stages. The transplanter runs in a field ditch, and the seedlings are manually separated on the working table and placed into grooves on the transplanting conveyor belt, which transports the seedlings to the designated location. Then, the transplanting robot arm picks up the seedlings and transplants them. The camera detects the transplanting conditions in real time. When a leakage seedling is detected, the controller will send a command to the replanting part, which will generate seedling replenishment actions. The controller coordinates the relationship between each movement, which simplifies the link and cooperation between the various mechanisms in the transplanter. The main structural parameters and working parameters of the machine are shown in Table 1.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 3/16 troller will send a command to the replanting part, which will generate seedling replenishment actions. The controller coordinates the relationship between each movement, which simplifies the link and cooperation between the various mechanisms in the transplanter. The main structural parameters and working parameters of the machine are shown in Table 1.

Mathematical Model of Transplanting Robot Arm
As shown in Figure 2a, in the proposed design, the sliding table driving motor drives the seedling claws to move up and down along the sliding platform module. Meanwhile, the rotating motor drives the seedling claws to rotate on the transplanting plane. As shown in Figure 2b, proximity switches are installed on the side of the moving platform and the sliding platform module. The proximity switches indicate the initial position of the seedling claw rotation angle and the movement of the moving platform. The signal returned by the controller through the proximity switch can be used to adjust the initial rotation angle of the seedling claw for each transplant. In this way, deviations will not be accumulated in process of transplanting sweet potatoes. The seedling claw motor adjusts the push rod through the eccentric wheel to achieve the opening and closing of the seedling claw. A proximity switch is installed above the eccentric wheel. When the eccentric wheel rotates, the controller will receive the seedling claw status signal returned by the proximity switch to prevent the seedling claws from damaging the potato seedlings. Figure 2c is the assembled transplanting robotic arm.

Mathematical Model of Transplanting Robot Arm
As shown in Figure 2a, in the proposed design, the sliding table driving motor drives the seedling claws to move up and down along the sliding platform module. Meanwhile, the rotating motor drives the seedling claws to rotate on the transplanting plane. As shown in Figure 2b, proximity switches are installed on the side of the moving platform and the sliding platform module. The proximity switches indicate the initial position of the seedling claw rotation angle and the movement of the moving platform. The signal returned by the controller through the proximity switch can be used to adjust the initial rotation angle of the seedling claw for each transplant. In this way, deviations will not be accumulated in process of transplanting sweet potatoes. The seedling claw motor adjusts the push rod through the eccentric wheel to achieve the opening and closing of the seedling claw. A proximity switch is installed above the eccentric wheel. When the eccentric wheel rotates, the controller will receive the seedling claw status signal returned by the proximity switch to prevent the seedling claws from damaging the potato seedlings. Figure 2c is the assembled transplanting robotic arm. The transplanting robot arm can be simplified to the linkage mechanism shown in Figure 3.

Inverse Kinematics Model of Transplanting Robot Arm
Different from the general robot arm trajectory tracking control, the sweet potato transplanting trajectory refers to the specific transplanting trajectory (sweet potato vertical transplanting method, oblique transplanting method, horizontal transplanting method) that meets the agronomic requirements of transplanting; this process does not require real-time trajectory planning. Sweet potato transplanting agronomy does not strictly stipulate the planting angle and planting depth required during transplanting. Overfocusing on the transplanting trajectory accuracy will not improve the success rate of the transplanting. Therefore, in this paper, the rotation speed, the torque of the motor at the joint of the robot arm, and the transplanting trajectory coordinates at the end of the seedling claw are not detected in real time. Instead, the open loop is used to control the sweet potato transplanting arm. Only the proximity switch is used to mark the initial position of the manipulator to prevent the phenomenon of deviation accumulation in the process of transplanting. In the case of a known transplanting reference trajectory, the The transplanting robot arm can be simplified to the linkage mechanism shown in Figure 3.
where x 1 (t), y 1 (t) is the coordinate of joint 1 at time t; ϕ(t) is the angle of joint 2 at time t, and l is the length of link 2. The transplanting robot arm can be simplified to the linkage mechanism shown in Figure 3.

Inverse Kinematics Model of Transplanting Robot Arm
Different from the general robot arm trajectory tracking control, the sweet potato transplanting trajectory refers to the specific transplanting trajectory (sweet potato vertical transplanting method, oblique transplanting method, horizontal transplanting method) that meets the agronomic requirements of transplanting; this process does not require real-time trajectory planning. Sweet potato transplanting agronomy does not strictly stipulate the planting angle and planting depth required during transplanting. Overfocusing on the transplanting trajectory accuracy will not improve the success rate of the transplanting. Therefore, in this paper, the rotation speed, the torque of the motor at the joint of the robot arm, and the transplanting trajectory coordinates at the end of the seedling claw are not detected in real time. Instead, the open loop is used to control the sweet potato transplanting arm. Only the proximity switch is used to mark the initial position of the manipulator to prevent the phenomenon of deviation accumulation in the process of transplanting. In the case of a known transplanting reference trajectory, the

Inverse Kinematics Model of Transplanting Robot Arm
Different from the general robot arm trajectory tracking control, the sweet potato transplanting trajectory refers to the specific transplanting trajectory (sweet potato vertical transplanting method, oblique transplanting method, horizontal transplanting method) that meets the agronomic requirements of transplanting; this process does not require realtime trajectory planning. Sweet potato transplanting agronomy does not strictly stipulate the planting angle and planting depth required during transplanting. Overfocusing on the transplanting trajectory accuracy will not improve the success rate of the transplanting. Therefore, in this paper, the rotation speed, the torque of the motor at the joint of the robot arm, and the transplanting trajectory coordinates at the end of the seedling claw are not detected in real time. Instead, the open loop is used to control the sweet potato transplanting arm. Only the proximity switch is used to mark the initial position of the manipulator to prevent the phenomenon of deviation accumulation in the process of transplanting. In the case of a known transplanting reference trajectory, the motion velocity of joint 1 v 1 and the rotation angular velocity of joint 2 ω 2 are solved by the inverse kinematics calculation of the transplanting robot arm.
The transfer matrix between the global coordinates and the seedling claw coordinates can be deduced from Figure 3: where ϕ 0 is the initial rotation angle of link 2, and (x 0 , y 0 ) is the initial coordinate of joint 2.
The general form of the transfer matrix is as follows: where x(t) is the x-coordinate of the transplanting reference track, and y(t) is the ycoordinate of the transplanting reference track. Set Equation (2) equal to Equation (3): The velocity v 1 (t) of joint 1 and the angular velocity ω 2 (t) of joint 2 are deduced:

EfficientDet D Object Detection Network
The task of the object detection network is to detect the transplanting effect of the transplanting robot arm. As shown in Figure 4, the camera will detect the status of the seedling picking claw, and when the missing seedling is detected, the controller will give replanting instructions to the robot arm. Considering the simple target detection features and real-time requirements, the target detection network selected in this paper is EfficientDet, because the network can balance the speed and accuracy by simply scaling the model. The BIFPN is its feature detection network. Assuming that the feature at the top level has the best abstract feature, and the feature at the bottom level has the best detail feature, this paper adds the link between the adjacent nodes at the top and bottom levels. In this way, the DBiFPN is obtained. The structure is shown in Figure 5a. To further improve the detection accuracy, an attention mechanism module CBAM_Dense is added to the main feature extraction network, which improves the spatial attention based on the CBAM and replaces the original global maximum pooling layer and the global average pooling layer with the dense layer to increase the correlation among features. The structure is shown in Figure 5b. Appl. Sci. 2021, 11, x FOR PEER REVIEW 6/16

Influence of Operation Speed on Transplanting Track
The operation speed of the transplanter directly affects transplanting efficiency, and it has a significant influence on the transplanting trajectory; thus, the operation speed is an important parameter. To ensure the same transplanting track and transplanting distance of sweet potato seedlings at different operation speeds, the following equations are performed: where T0 is the time to complete a sweet potato seedling transplantation; L is the transplanting distance; and ω is the transplanting frequency.
When the operation speed is v2, and the transplanting frequency of the transplanting robot arm is ω2, it can be deduced that: v/w = v2/w2 In other words, to keep the sweet potato transplanting track and the transplanting distance unchanged, it is necessary only to ensure a fixed speed ratio between the operation speed and the transplanting frequency of the transplanting robot arm.

Work Procedure
To create the transplanting action, the transplanting conveyor belt, tracked chassis, and transplanting robot arm need to work together. The worker presses the transplanting start button in the control box, the seedling picking claw and slide table quickly return to their origin positions, and the crawler chassis moves forward at the set speed. The worker divides the plants and places them on the conveyor belt. The conveyor belt rotates and transfers the plants. When the proximity switch on the belt is triggered, this indicates that the seedlings have been transported to the designated location. When the chassis moving distance reaches 30 cm, the seedling picking claw clips the seedlings, adjusts the entry posture, and the sliding table moves down. Then, the seedling picking

Influence of Operation Speed on Transplanting Track
The operation speed of the transplanter directly affects transplanting efficiency, and it has a significant influence on the transplanting trajectory; thus, the operation speed is an important parameter. To ensure the same transplanting track and transplanting distance of sweet potato seedlings at different operation speeds, the following equations are performed: where T0 is the time to complete a sweet potato seedling transplantation; L is the transplanting distance; and ω is the transplanting frequency.
When the operation speed is v2, and the transplanting frequency of the transplanting robot arm is ω2, it can be deduced that: v/w = v2/w2 In other words, to keep the sweet potato transplanting track and the transplanting distance unchanged, it is necessary only to ensure a fixed speed ratio between the operation speed and the transplanting frequency of the transplanting robot arm.

Work Procedure
To create the transplanting action, the transplanting conveyor belt, tracked chassis, and transplanting robot arm need to work together. The worker presses the transplanting start button in the control box, the seedling picking claw and slide table quickly return to their origin positions, and the crawler chassis moves forward at the set speed. The worker divides the plants and places them on the conveyor belt. The conveyor belt rotates and transfers the plants. When the proximity switch on the belt is triggered, this indicates that the seedlings have been transported to the designated location. When the chassis moving distance reaches 30 cm, the seedling picking claw clips the seedlings, adjusts the entry posture, and the sliding table moves down. Then, the seedling picking

Influence of Operation Speed on Transplanting Track
The operation speed of the transplanter directly affects transplanting efficiency, and it has a significant influence on the transplanting trajectory; thus, the operation speed is an important parameter. To ensure the same transplanting track and transplanting distance of sweet potato seedlings at different operation speeds, the following equations are performed: where T 0 is the time to complete a sweet potato seedling transplantation; L is the transplanting distance; and ω is the transplanting frequency.
When the operation speed is v 2 , and the transplanting frequency of the transplanting robot arm is ω 2 , it can be deduced that: v/w = v 2 /w 2 In other words, to keep the sweet potato transplanting track and the transplanting distance unchanged, it is necessary only to ensure a fixed speed ratio between the operation speed and the transplanting frequency of the transplanting robot arm.

Work Procedure
To create the transplanting action, the transplanting conveyor belt, tracked chassis, and transplanting robot arm need to work together. The worker presses the transplanting start button in the control box, the seedling picking claw and slide table quickly return to their origin positions, and the crawler chassis moves forward at the set speed. The worker divides the plants and places them on the conveyor belt. The conveyor belt rotates and transfers the plants. When the proximity switch on the belt is triggered, this indicates that the seedlings have been transported to the designated location. When the chassis moving distance reaches 30 cm, the seedling picking claw clips the seedlings, adjusts the entry posture, and the sliding table moves down. Then, the seedling picking claw and the sliding table are linked to complete the transplanting trajectory. Finally, the seedling picking claw and the sliding table start the original return instructions, preparing for the next transplantation. At the same time, the camera monitors the transplanting situation.
When leakage occurs, the controller will issue replanting instructions to the replanting piece. The workflow is shown in Figures 6 and 7.

Control System Design
Two STM32 chips with the same configuration was used as the controller for the transplanting part and the replanting part. The motor speed obtained by the simulation was converted into code instructions that were burned into the STM32 controller, and the controller controlled the rotation of each stepping motor. A laptop computer ran the target detection algorithm and was connected with the controller through serial communication. The control system diagram is shown in Figure 8.  Figure 6. Work procedure.

Control System Design
Two STM32 chips with the same configuration was used as the controller for the transplanting part and the replanting part. The motor speed obtained by the simulation was converted into code instructions that were burned into the STM32 controller, and the controller controlled the rotation of each stepping motor. A laptop computer ran the target detection algorithm and was connected with the controller through serial communication. The control system diagram is shown in Figure 8.  Figure 7. Work procedure flow chart.

Control System Design
Two STM32 chips with the same configuration was used as the controller for the transplanting part and the replanting part. The motor speed obtained by the simulation was converted into code instructions that were burned into the STM32 controller, and the controller controlled the rotation of each stepping motor. A laptop computer ran the target detection algorithm and was connected with the controller through serial communication. The control system diagram is shown in Figure 8. Appl. Sci. 2021, 11, x FOR PEER REVIEW 8/16 Figure 8. Control system diagram.

Transplanting Trajectory Simulation
The reference transplanting trajectory is set according to agronomic requirements. Figure 9a shows the trajectory of the horizontal transplantation of sweet potato seedlings in ridges. In order to apply it to the particle swarm optimization algorithm, the trajectory is transformed into the mathematical description, as shown in Figure 9b.
where T is the simulation interval of the reference trajectory.
T has a significant impact on the transplanting completion time. The simulation interval is set as T = 0.05 s, 0.01 s, 0.002 s, and the comparative simulation test is conducted. The set parameters for the simulation are: l = 400 mm; v0 = 0.2 m/s. The simulation results are shown in Figure 10.

Transplanting Trajectory Simulation
The reference transplanting trajectory is set according to agronomic requirements. Figure 9a shows the trajectory of the horizontal transplantation of sweet potato seedlings in ridges. In order to apply it to the particle swarm optimization algorithm, the trajectory is transformed into the mathematical description, as shown in Figure 9b.

Transplanting Trajectory Simulation
The reference transplanting trajectory is set according to agronomic requirements. Figure 9a shows the trajectory of the horizontal transplantation of sweet potato seedlings in ridges. In order to apply it to the particle swarm optimization algorithm, the trajectory is transformed into the mathematical description, as shown in Figure 9b.
where T is the simulation interval of the reference trajectory.
T has a significant impact on the transplanting completion time. The simulation interval is set as T = 0.05 s, 0.01 s, 0.002 s, and the comparative simulation test is conducted. The set parameters for the simulation are: l = 400 mm; v0 = 0.2 m/s. The simulation results are shown in Figure 10.  Mathematical description of reference track for horizontal transplanting of sweet potatoes: where T is the simulation interval of the reference trajectory.
T has a significant impact on the transplanting completion time. The simulation interval is set as T = 0.05 s, 0.01 s, 0.002 s, and the comparative simulation test is conducted. The set parameters for the simulation are: l = 400 mm; v 0 = 0.2 m/s. The simulation results are shown in Figure 10. As the simulation interval decreases, it can be seen from Figure 10a,b that the optimized speed of the rotating motor and the speed of the sliding table motor decrease in size and also have a smoother change trend, which is conducive to the regulation of the stepping motor speed in the actual environment. However, the transplanting track completion time will gradually increase. When T is 0.05 s, the track completion time is 0.4 s, but the speed of the sliding table motor varies greatly; it also readily causes vibration when the machine is operating, and it can be seen from Figure 10c,d that the trajectory deviation is large. When T is 0.002 s, the track completion time is 0.7 s, and the transplanting efficiency of sweet potatoes is affected when the machine advances too fast. Considered comprehensively, T = 0.01 s is the optimal simulation interval. Figure 11a is the chain-clip sweet potato transplanting machine, and its transplanting principle is shown in Figure 11b. Its main transplanting method is vertical transplanting, as shown in Figure 11c. "Zero speed" seeding is realized accomplished under the action of the potato seedling holder speed and the operation speed of the machine. However, different parts of the seedlings have different speeds; thus, it is difficult to keep potato plants upright in the actual transplanting process. Figure 12a is the connecting rod-type sweet potato transplanting machine, and its transplanting principle is shown in Figure 12b. Its transplanting method is horizontal transplanting, as shown in Figure 12c. Four-bar linkage mechanism is applied in sweet potato transplanting. Because of its simple structure and smooth operation, this mechanism has been widely used in recent years. It can be seen that the traditional sweet potato transplanting machine (Figure 11a, Figure 12a) realizes the transplanting of potato seedlings through the rotation of the active parts and a complex mechanical structure, and only one transplanting method can be conducted. However, the transplanter described in this paper, as shown in Figure 13a,b, can achieve different transplanting tracks (as shown in Figure 13c) by adjusting the adjustment of the motor speed. Thus, the transplanter can meet the requirements of different planting terrains for different sweet potato transplanting tracks and improve the effects of sweet potato transplanting. As the simulation interval decreases, it can be seen from Figure 10a,b that the optimized speed of the rotating motor and the speed of the sliding table motor decrease in size and also have a smoother change trend, which is conducive to the regulation of the stepping motor speed in the actual environment. However, the transplanting track completion time will gradually increase. When T is 0.05 s, the track completion time is 0.4 s, but the speed of the sliding table motor varies greatly; it also readily causes vibration when the machine is operating, and it can be seen from Figure 10c,d that the trajectory deviation is large. When T is 0.002 s, the track completion time is 0.7 s, and the transplanting efficiency of sweet potatoes is affected when the machine advances too fast. Considered comprehensively, T = 0.01 s is the optimal simulation interval. Figure 11a is the chain-clip sweet potato transplanting machine, and its transplanting principle is shown in Figure 11b. Its main transplanting method is vertical transplanting, as shown in Figure 11c. "Zero speed" seeding is realized accomplished under the action of the potato seedling holder speed and the operation speed of the machine. However, different parts of the seedlings have different speeds; thus, it is difficult to keep potato plants upright in the actual transplanting process. Figure 12a is the connecting rod-type sweet potato transplanting machine, and its transplanting principle is shown in Figure 12b. Its transplanting method is horizontal transplanting, as shown in Figure 12c. Four-bar linkage mechanism is applied in sweet potato transplanting. Because of its simple structure and smooth operation, this mechanism has been widely used in recent years. It can be seen that the traditional sweet potato transplanting machine (Figures 11a and 12a) realizes the transplanting of potato seedlings through the rotation of the active parts and a complex mechanical structure, and only one transplanting method can be conducted. However, the transplanter described in this paper, as shown in Figure 13a

Trajectory Test
To verify the correctness of the trajectory optimization algorithm, the transplanting trajectory of the robot arm was tested. During the experiment, a camera was placed on the side of the prototype to record the movement of the seedling picking claw during the transplanting process. Then, the trajectory was traced and drawn by video processing. It can be seen from Figure 14 that the trajectory meets the agronomic requirements of the sweet potato horizontal planting method. To further observe the deviation between the actual transplanting trajectory and the reference trajectory, encoders are installed on the sliding table driving motor and the seedling picking claw driving motor. By observing the actual speed and the reference speed of the motor, the transplanting trajectory can be accurately analyzed. It can be seen

Trajectory Test
To verify the correctness of the trajectory optimization algorithm, the transplanting trajectory of the robot arm was tested. During the experiment, a camera was placed on the side of the prototype to record the movement of the seedling picking claw during the transplanting process. Then, the trajectory was traced and drawn by video processing. It can be seen from Figure 14 that the trajectory meets the agronomic requirements of the sweet potato horizontal planting method. To further observe the deviation between the actual transplanting trajectory and the reference trajectory, encoders are installed on the sliding table driving motor and the seedling picking claw driving motor. By observing the actual speed and the reference speed of the motor, the transplanting trajectory can be accurately analyzed. It can be seen

Trajectory Test
To verify the correctness of the trajectory optimization algorithm, the transplanting trajectory of the robot arm was tested. During the experiment, a camera was placed on the side of the prototype to record the movement of the seedling picking claw during the transplanting process. Then, the trajectory was traced and drawn by video processing. It can be seen from Figure 14 that the trajectory meets the agronomic requirements of the sweet potato horizontal planting method. To further observe the deviation between the actual transplanting trajectory and the reference trajectory, encoders are installed on the sliding table driving motor and the seedling picking claw driving motor. By observing the actual speed and the reference speed of the motor, the transplanting trajectory can be accurately analyzed. It can be seen

Trajectory Test
To verify the correctness of the trajectory optimization algorithm, the transplanting trajectory of the robot arm was tested. During the experiment, a camera was placed on the side of the prototype to record the movement of the seedling picking claw during the transplanting process. Then, the trajectory was traced and drawn by video processing. It can be seen from Figure 14 that the trajectory meets the agronomic requirements of the sweet potato horizontal planting method.

Trajectory Test
To verify the correctness of the trajectory optimization algorithm, the transplanting trajectory of the robot arm was tested. During the experiment, a camera was placed on the side of the prototype to record the movement of the seedling picking claw during the transplanting process. Then, the trajectory was traced and drawn by video processing. It can be seen from Figure 14 that the trajectory meets the agronomic requirements of the sweet potato horizontal planting method. To further observe the deviation between the actual transplanting trajectory and the reference trajectory, encoders are installed on the sliding table driving motor and the seedling picking claw driving motor. By observing the actual speed and the reference speed of the motor, the transplanting trajectory can be accurately analyzed. It can be seen  To further observe the deviation between the actual transplanting trajectory and the reference trajectory, encoders are installed on the sliding table driving motor and the seedling picking claw driving motor. By observing the actual speed and the reference speed of the motor, the transplanting trajectory can be accurately analyzed. It can be seen from Figure 15 that the reference speed of each motor is basically the same as the actual speed, but the speeds do not completely overlap. The main reason for this is that the actual speed curve of the stepper motor cannot match the reference motor speed, due to factors such as inertia and motor characteristics; also, there is a gap between the connecting rods during processing.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 11/16 from Figure 15 that the reference speed of each motor is basically the same as the actual speed, but the speeds do not completely overlap. The main reason for this is that the actual speed curve of the stepper motor cannot match the reference motor speed, due to factors such as inertia and motor characteristics; also, there is a gap between the connecting rods during processing.

Target Detection Test for Replanting Seedlings
This section verifies the effectiveness of the target detection optimization algorithm described in this article and then applies the algorithm to sweet potato seedling detection. The computer model used in this experiment was a Dell G3 3590, and the graphics card was GTX1660TI. The Radam optimizer is used, and its learning rate is 0.0001. The loss function is binary cross entropy, the batch size is 32, the momentum is 0.9, and the dropout inactivation rate is 0.5. Standard data augmentation is applied to increase the amount of effective available training data.
To verify the effectiveness of the DBiFPN CBAM_Dense structure proposed in this paper, comparative experiments were conducted. The performance of the object detection was evaluated in the Voc datasets. In EfficientDet, the network was divided into four target detection algorithms (B0, B1, B2, B3) according to DBiFPN cycle times (3,4,5,6). With the increase in cycle iterations, the accuracy of target detection increases, and the real-time performance decreases. The EfficientDetB0-B3, EfficientDet + DBiFPNB0-B3, EfficientDet + CBAM_DenseB0-B3 and EfficientDet_DB0-B3(+DBiFPN + CBAM_Dense) target detection algorithms were compared. The test results are shown in Table 2. It can be seen from Table 2 that the target detection network described in this paper can effectively improve the accuracy of target detection. Compared with EfficientDet, the +DBiFPNB0-B3 network MPA increased by up to 0.19%, the +CBAM_Dense network MPA increased by up to 0.07%, and the EfficientDet_D network MPA increased by up to 0.23%. It can be seen that the DBiFPN CBAM_Dense structure proposed in this paper can improve the accuracy of target detection.
The target detection network described in this paper was applied to potato seedling detection. One thousand pictures taken by the camera were collected as samples during the transplanting, and the images of the seedling samples were labeled and trained. The test results are shown in Table 3, and the identification effects are shown in Figure 16.

Target Detection Test for Replanting Seedlings
This section verifies the effectiveness of the target detection optimization algorithm described in this article and then applies the algorithm to sweet potato seedling detection. The computer model used in this experiment was a Dell G3 3590, and the graphics card was GTX1660TI. The Radam optimizer is used, and its learning rate is 0.0001. The loss function is binary cross entropy, the batch size is 32, the momentum is 0.9, and the dropout inactivation rate is 0.5. Standard data augmentation is applied to increase the amount of effective available training data.
To verify the effectiveness of the DBiFPN CBAM_Dense structure proposed in this paper, comparative experiments were conducted. The performance of the object detection was evaluated in the Voc datasets. In EfficientDet, the network was divided into four target detection algorithms (B0, B1, B2, B3) according to DBiFPN cycle times (3,4,5,6). With the increase in cycle iterations, the accuracy of target detection increases, and the real-time performance decreases. The EfficientDetB0-B3, EfficientDet + DBiFPNB0-B3, EfficientDet + CBAM_DenseB0-B3 and EfficientDet_DB0-B3(+DBiFPN + CBAM_Dense) target detection algorithms were compared. The test results are shown in Table 2. It can be seen from Table 2 that the target detection network described in this paper can effectively improve the accuracy of target detection. Compared with EfficientDet, the +DBiFPNB0-B3 network MPA increased by up to 0.19%, the +CBAM_Dense network MPA increased by up to 0.07%, and the EfficientDet_D network MPA increased by up to 0.23%. It can be seen that the DBiFPN CBAM_Dense structure proposed in this paper can improve the accuracy of target detection.
The target detection network described in this paper was applied to potato seedling detection. One thousand pictures taken by the camera were collected as samples during the transplanting, and the images of the seedling samples were labeled and trained. The test results are shown in Table 3, and the identification effects are shown in Figure 16.   It can be seen from Table 3 that the target detection algorithm described in this paper can accurately and efficiently detect the status of potato seedling transplantation. In the actual transplanting process, it was found that the EfficientDet_D-B2, Effi-cientDet_D-B3 program takes up considerable space and computing resources, and the upper computer becomes hot when running. In addition, the speed of potato seedling transplanting is limited to the speed of the human beings working with the seedlings; thus, a high detection speed will not improve the transplanting effect. Considering the requirements of accuracy and real-time functionality, this paper uses EfficientDet_D-B1 for target detection. The target detection network MPA was 97.66%, and the Fps was 29.2; these results meet the actual requirements of sweet potato transplanting operations.

Field Experiment
Different varieties of potato seedlings have different material properties, such as seedling diameter and tensile stress, which will affect the transplanting effect. When the machine works at different speeds, the transplanting effects will have different influences. To verify the applicability of the transplanter for different types of sweet potato seedlings and operation speeds, a validation experiment was carried out.

Experiment Conditions
The experiment site was the experimental field of Shandong Agricultural University, and the soil viscosity was moderate. The seedlings were planted in rows in the greenhouse, and the seedlings were collected by the high shearing method. The average length of the seedlings was 267 mm, and the average distance of the nodules was 32 mm. The method of ridge planting without film mulching was adopted, the planting distance was 900 mm, and the planting distance was about 300 mm.

Experimental Scheme
A transplanting experiment was conducted with XiGuaRed, YanShu25, and purple potato seedlings to verify the transplanting effect of the transplanter at 0.15, 0.2, and 0.25 m/s. Taking horizontal transplanting and vertical transplanting as examples, the qualification rate and the leakage rate were recorded.
We first determined the evaluation index of sweet potato transplanting according to the requirements of agronomy. As Figure 17 shows, the evaluation index of the horizontal transplanting method is planting depth d, for which the reasonable range is 50-70 mm, and the seedling angle is θ, for which the reasonable range is 43°-47°. The evaluation index of the vertical transplanting method is planting depth d, for which the rea- It can be seen from Table 3 that the target detection algorithm described in this paper can accurately and efficiently detect the status of potato seedling transplantation. In the actual transplanting process, it was found that the EfficientDet_D-B2, EfficientDet_D-B3 program takes up considerable space and computing resources, and the upper computer becomes hot when running. In addition, the speed of potato seedling transplanting is limited to the speed of the human beings working with the seedlings; thus, a high detection speed will not improve the transplanting effect. Considering the requirements of accuracy and real-time functionality, this paper uses EfficientDet_D-B1 for target detection. The target detection network MPA was 97.66%, and the Fps was 29.2; these results meet the actual requirements of sweet potato transplanting operations.

Field Experiment
Different varieties of potato seedlings have different material properties, such as seedling diameter and tensile stress, which will affect the transplanting effect. When the machine works at different speeds, the transplanting effects will have different influences. To verify the applicability of the transplanter for different types of sweet potato seedlings and operation speeds, a validation experiment was carried out.

Experiment Conditions
The experiment site was the experimental field of Shandong Agricultural University, and the soil viscosity was moderate. The seedlings were planted in rows in the greenhouse, and the seedlings were collected by the high shearing method. The average length of the seedlings was 267 mm, and the average distance of the nodules was 32 mm. The method of ridge planting without film mulching was adopted, the planting distance was 900 mm, and the planting distance was about 300 mm.

Experimental Scheme
A transplanting experiment was conducted with XiGuaRed, YanShu25, and purple potato seedlings to verify the transplanting effect of the transplanter at 0.15, 0.2, and 0.25 m/s. Taking horizontal transplanting and vertical transplanting as examples, the qualification rate and the leakage rate were recorded.
We first determined the evaluation index of sweet potato transplanting according to the requirements of agronomy. As Figure 17 shows, the evaluation index of the horizontal transplanting method is planting depth d, for which the reasonable range is 50-70 mm, and the seedling angle is θ, for which the reasonable range is 43 • -47 • . The evaluation index of the vertical transplanting method is planting depth d, for which the reasonable range is 100-120 mm, and the seedling angle is θ, for which the reasonable range is −3 • -3 • . When sweet potato transplantation meets the above requirements, it is qualified.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 13/16 sonable range is 100-120 mm, and the seedling angle is θ, for which the reasonable range is −3°-3°. When sweet potato transplantation meets the above requirements, it is qualified. Three experimental trials were conducted, and each trial included the transplantation of 200 plants three times. The qualification rate and leakage rate of the transplanting piece and replanting piece were tested. The experiments are shown in Figure 18, and the results are shown in Tables 4-6.   Three experimental trials were conducted, and each trial included the transplantation of 200 plants three times. The qualification rate and leakage rate of the transplanting piece and replanting piece were tested. The experiments are shown in Figure 18, and the results are shown in Tables 4-6.

Experimental Results
Appl. Sci. 2021, 11, x FOR PEER REVIEW 13/16 sonable range is 100-120 mm, and the seedling angle is θ, for which the reasonable range is −3°-3°. When sweet potato transplantation meets the above requirements, it is qualified. Three experimental trials were conducted, and each trial included the transplantation of 200 plants three times. The qualification rate and leakage rate of the transplanting piece and replanting piece were tested. The experiments are shown in Figure 18, and the results are shown in Tables 4-6.

Experimental Results
The experiment proved that the transplanter could accomplish both the horizontal and vertical transplanting methods. It can be seen from Tables 4-6 that the transplanting effect had little correlation with the variety of potato seedlings, indicating that the transplanting device has good applicability. It can also be seen from the tables that the higher the operation speed, the worse the transplanting effect. At 0.15 m/s, the highest qualified rate of transplanting was 96.8%, and at 0.25 m/s, the lowest qualified rate of transplanting was 86.4% (i.e., the qualified rate decreased 10.4%). The speed ratio between the operation speed and the transplanting piece determined the transplanted trajectory. The STM32 controller monitored the operation speed through the encoder and controlled the rotational speed of the transplanting part. However, the controller had a lag. With the increase in the operation speed, the fluctuation range of the speed ratio will increase and then change the transplanting trajectory, such that the qualified rate of the sweet potato transplanting index decreases.

Replanting Experiment
To verify the rationality of the designed replanting part, a replanting experiment was carried out.

Experimental Conditions
"YanShu25" was used for the potato seedlings in the experiment. The operation speed was 0.2 m/s. The leakage rates of the transplanting part, replanting part, and transplanting-replanting mechanism in the horizontal and vertical transplanting processes were recorded.

Experimental Results
It can be seen from Table 7 that when using the transplanting part alone, the leakage rate of horizontal planting was 6.1%, and that of vertical planting was 5.9%. When using the transplanting-replanting mechanism, the leakage rate of the horizontal method was 1.2%, and that of the vertical method was 0.7%. The leakage rate decreased by 4.9% and 5.2%, respectively, indicating the necessity of using the seedling replacement part. The leakage rate of the transplanting part was higher than that of the replanting part. This is because the seedling picking claw of the replanting part is located directly above the seedlings. When the length of the artificial seedlings is short, the structure is sufficient for grasping the seedlings. In addition, during the experiment, it was found that the soil viscosity affects the transplanting effect, and the significant difference in the bending morphology of the sweet potato roots was the main factor that caused missed seedlings.

Limitations
(1) In the actual working process, it was found that the ridge height affected the sweet potato transplanting track, and the artificial ridge height in particular was not consistent, which directly affected the transplanting effect. It is difficult to adjust the height of the transplanting arm on site, and it cannot adapt to all planting terrains. Moreover, the transplanter described in this paper has no feeler mechanism, which negatively affects the quality of ridge cultivation.
(2) In the replanting part, the target detection algorithm relies heavily on the quantity and quality of the training images. When the transplanting environment changes greatly, the detection results will be affected. In order to ensure the accuracy of target detection, a large number of images of the transplanting operations must be collected as samples for training.
(3) The transplanter describe in this paper can accomplish a variety of sweet potato transplanting methods, but the operation mode of a single ridge limits the transplanting efficiency. The multi-row compound transplanter, which can complete rotary tillage, ridge raising, planting, and suppression operations at one time, can greatly improve the efficiency of sweet potato transplantation and save labor costs. This was the main research direction of the team in the later stages of the research reported in this paper.

Suggestions for Future Research
When selecting the motor for the transplanting arm, the research group ignored the influence of soil resistance, resulting in the motor torque being less than the actual required torque. As a result, the motor vibrated during the transplanting process, and sweet potato seedlings could not be inserted into the ridge correctly, which created difficulties with respect to the debugging of the prototype in the later stages of the research.
The selection of the sweet potato seedling conveyor belt is key in the process of purchasing and assembling the parts of the transplanting arm. Because sweet potato transplanting takes a long time and is a high frequency operation process, the vibration of the transplanter causes the longitudinal and lateral sliding of the conveyor belt along the drive shaft. After repeated transplantations, cumulative deviation will occur, which will affect the transplanting effect. In this paper, a POM plastic mesh belt is used as a potato seedling conveyor belt for researchers as a reference.
When picking seedlings with claws, excessive holding force can damage the roots of the potato seedlings, and too little holding force will not remove the potato seedlings from the conveyor belt. In order to obtain the appropriate holding force, it is necessary to conduct a mechanical properties test of the sweet potato seedlings to obtain the maximum holding force that may be used without damaging the seedlings. In addition, the specific influence of the holding force on the survival rate of the potato seedlings still needs to be demonstrated by relevant experiments.

Conclusions
(1) The sweet potato transplanter designed in this paper can transplant sweet potato seedings both horizontally and vertically, and it can also automatically replant the seedlings when there is seedling leakage. (2) The inverse kinematics model of the transplanting robot arm was used to optimize the transplanting trajectory, and the influence of the simulation interval on the transplanting trajectory was discussed. The seedling replanting part was designed, and the status of potato seedling transplantation was detected by deep learning. The DBIFPN structure and CBAM_Dense attention mechanism were proposed to improve the accuracy of the target detection. (3) The field experiment proved that the machine can accomplish the horizontal and vertical transplanting of sweet potato seedlings, and the transplanting qualification rate can reach 96.8%. In order to verify the appropriateness of the replanting part, a replanting experiment was designed, and the leakage rate of the transplantingreplanting mechanism decreased by a maximum of 5.2%.