Simulation Design of a Tomato Picking Manipulator

: Simulation is an important way to verify the feasibility of design parameters and schemes for robots. Through simulation, this paper analyzes the effectiveness of the design parameters selected for a tomato picking manipulator, and verifies the rationality of the manipulator in motion planning for tomato picking. Firstly, the basic parameters and workspace of the manipulator were determined based on the environment of a tomato greenhouse; the workspace of the lightweight manipulator was proved as suitable for the picking operation through MATLAB simulation. Next, the maximum theoretical torque of each joint of the manipulator was solved through analysis, the joint motors were selected reasonably, and SolidWorks simulation was performed to demonstrate the rationality of the material selected for the manipulator and the strength design of the joint connectors. After that, the trajectory control requirements of the manipulator in picking operation were determined in view of the operation environment, and the feasibility of trajectory planning was confirmed with MATLAB. Finally, a motion control system was designed for the manipulator, according to the end trajectory control requirements, followed by the manufacturing of a prototype. The prototype experiment shows that the proposed lightweight tomato picking manipulator boasts good kinematics performance, and basically meets the requirements of tomato picking operation: the manipulator takes an average of 21 s to pick a tomato, and achieves a success rate of 78.67%.


INTRODUCTION
Automated picking improves work efficiency and reduces labor intensity, marking an important trend in agricultural automation [1][2][3]. With an annual output of over 60 million tons of tomatoes [4], China needs a large number of automated tomato picking devices [5]. At present, some scholars have carried out some researches on the simulation design of picking manipulator. Xu Lijia et al. [6] from Sichuan Agricultural University carried out simulation analysis on the working space and trajectory planning of citrus picking manipulator, which provided theoretical support for the subsequent research on citrus picking manipulator. However, most of the current picking robots use industrial manipulators, or simply modified ones [7]. For example, Kondo et al. [8] designed a tomato picking robot with a Mitsubishi RH-6SH5520 industrial manipulator; despite its fast picking speed, their robot has a low success rate (about 50%), a high cost, a heavy mass, and a large size. Chiu et al. [9] from National Ilan University developed a tomato picking robot, which integrates a Mitsubishi 5 -degrees of freedom (DOF) articulated manipulator with a scissor-type lifting mobile chassis; but the manipulator is too large, and the robot is as heavy as 219 kg. Zhao et al. [10] from Shanghai Jiaotong University created a double-arm tomato harvesting robot, which is complex to control with two 3DOF prismaticrevolute-revolute (PRR) manipulators. Chen et al. [11] from the University of Tokyo proposed a human-based double-arm tomato picking robot, in which each arm has 7DOFs; the robot cannot complete the picking operation without being instructed by the operator. To sum up, tomato picking robots designed based on industrial manipulators are generally large, heavy, costly, and complicated in control. Nevertheless, if simple and lightweight picking manipulators are designed following the idea of industrial manipulators, the operation accuracy and stability might be reduced, making the picking operation inefficient [12][13]. Therefore, the development of lightweight picking manipulators through simulation design is very meaningful for automated picking.
Aiming at the problems of large inertia and high cost of the traditional picking manipulator, this paper adopts lightweight materials and completes the lightweight design of the tomato picking manipulator through simulation. Through MATLAB simulation, this paper verifies the rationality of the selected workspace of our lightweight manipulator for tomato picking, and the selected lengths for the arm rods, and proves the feasibility of the end trajectory planning. Then, SolidWorks was adopted to prove the reasonability of the material and shape design for arm rods. The main contents include the system construction of the lightweight tomato picking manipulator, the kinematic analysis and the simulation verification of the workspace, the joint force analysis and the stress-strain simulation analysis, as well as the motion trajectory planning and simulation of the end of the manipulator. Based on the simulation results, a prototype was made, and subject to experiment, aiming to verify the simulation results.

WORKSPACE SIMULATION ANALYSIS 2.1 Theoretical Analysis
Fig . 1 shows the planting environment of a tomato greenhouse in Shaanxi, China. In the greenhouse, the root system of tomatoes is 36 cm deep, plant spacing is 26 -82 cm, plant height is 45 -145 cm, and plant thickness is 36 cm; the ridges are 36 cm tall, 36 cm wide, and 80 cm apart from each other; the fruits are harvested at the height of 16 -142 cm. Based on these parameters, a work plan was prepared for the tomato picking robot (Fig. 2): the robot chassis travels along the ridge road, and stops at the picking position; the platform height is adjusted according to the growth condition of the tomatoes; the spatial coordinates of the target fruit are obtained through machine vision; then, the manipulator is driven to pick the fruit.
Based on the contents of Fig. 1 and Fig. 2, a 6DOF manipulator (Fig. 3) was selected for tomato picking [14]. The Denavit-Hartenberg (D-H) method was chosen to build up the coordinate system for the manipulator. The fixed base of the manipulator was defined as rod 0; the first rotatable rod was defined as rod 1; the other rods were numbered similarly in turn. The manipulator consists of six revolving joints.
Among them, the waist joint, shoulder joint, and elbow joint help to position the end of the manipulator, and the wrist pitch joint, wrist yaw joint, and wrist roll joint help to determine the pose of that end. The manipulator adopts the 2 -1 -3 configuration, and the 6 revolving joints were arranged in the form of R ⊥ R ∥R∥ R ⊥ R ⊥ R. In order to facilitate the kinematics analysis of the manipulator and determine the terminal attitude in practical operation, to facilitate the kinematic analysis and determine the pose of that end in the actual operation, orthogonal non-spherical structures were selected for the three wrist joints of the manipulator. In actual situations, the workspace of the manipulator mainly depends on the parameters of the upper and lower arms. Therefore, the structural parameters of the picking manipulator need to be designed according to the geometric size and motion range of the waist, upper arm, and lower arm. Let d 1 be the base height of the manipulator; a 2 be the length of the upper arm; a 3 be the length of the lower arm; θ 1 (α 1 , α 2 ) be the range of the revolution angle at the waist; θ 2 (β 1 , β 2 ) be the range of the revolution angle at the upper arm; θ 3 (γ 1 , γ 2 ) be the range of the revolution angle of the lower arm. Fig. 4 shows the workspace determined by the main rod, where the rectangle A refers to the workspace of the manipulator. The value of A is determined through the following steps: (1) The upper arm is fixed at the left limit position, and the lower arm rotates from the upper limit position to the lower limit position, forming an arc S 1 ; (2) The upper arm is fixed at the right limit position, and the lower arm rotates from the upper limit position to the lower limit position, forming an arc S 2 ; (3) The lower arm is fixed at the lower limit position, and the upper arm rotates from the left limit position to the right limit position, forming an arc S 3 ; (4) The lower arm is fixed at the upper limit position, and the upper arm rotates from the left limit position to the right limit position, forming an arc S 4 ; (5) The lower arm is set in a position parallel to the upper arm, and the upper arm rotates from the left limit position to the right limit position, forming an arc S 5 ; (6) The area enclosed by the inscribed rectangle A in Fig. 4 is determined as the actual maximum workspace, according to the growth features of tomato plants and the growth interval of mature tomatoes. Assuming that each joint of the picking manipulator rotates to 180°, the maximum theoretical workspace of the picking robot could be determined as a round crown area ( 145cm 126cm A efficient picking trajectory, the actual working area of the robot is illustrated as the orange cuboid in Fig. 5. Then, a Cartesian coordinate system was established, with the center O of the manipulator base as the origin, the advancing direction of the robot as the Y axis, the vertical upward direction as the Z axis, and the direction perpendicular to the ridge as the X axis (as per the righthand rule). To pick tomatoes, the robot needs to walk along the centerline of the ridge. The workspace of the manipulator must cover half of the plant profile in the X direction. Limited by ridge spacing and plant thickness, it can be seen that the cuboid workspace was set as 18 cm long in the X direction, that is, from the origin to the effective workspace, the distance is between 22 cm and 40 cm. half the ridge distance (40 cm) in the Y direction, and 40 cm in the Z direction. Thus, the workspace size of the picking manipulator was designed as b × w × h = 18 cm × 40 cm × 40 cm.      on the XOY plane, that is, θ 1 ≥ 84,55°. Considering the working environment, the relevant parameters were selected as: the height of the base column d 1 = 96 mm, the revolution angle at the waist θ 1 (−80°, 80°), the revolution angle at the upper arm θ 2 (50°, 130°), the revolution angle of the lower arm θ 3 (−50°, 130°), the distance from the center point of the lower arm rod to that of the wrist yaw joint d 4 = 78 mm, and the distance from the center point of the wrist pitch joint to that of the wrist roll joint d 6 = 202 mm. From the theory on manipulator structure [15], the manipulator has the best operability and obstacleavoidance ability, when the upper arm is equal to the lower arm in length, i.e., a 2 = a 3 . Therefore, when a 2 = a 3 = 244 mm, the revolution angle of the wrist pitch joint θ 4 (−80°, 80°), and the revolution angle of the wrist yaw joint θ 5 (−80°, 80°), the end effector can be adjusted in a large range to better envelop the fruit; when the revolution angle of the wrist roll joint θ 6 (−80°, 80°), the pose of the manipulator can be adjusted flexibility, and the tomato fruit can be separated from the stem by rotation action.
From the above theoretical analysis, the D-H parameters of the manipulator were obtained as in Tab. 1.

Simulation Verification
The positive kinematics equation of the manipulator can be established as: According to the tomato growth features and the picking plan, the robot chassis moves back and forth, and the support moves up and down, such that the workspace of the manipulator covers the tomato growth space. Based on the selected parameters of the manipulator, the Monte-Carlo method [16][17] was adopted to analyze the workspace of the manipulator as per the kinematic parameters. In essence, the workspace analysis aims to solve the coordinates of the end of the manipulator by the positive kinematics equation, after sufficient revolution angles were chosen from different joints. The resulting point set is the workspace. Relative to the base coordinate system 0, the end point of the manipulator can be expressed as:

Figure 7 Workspace simulation results
Within the revolution angle range of each joint, 10000 values were randomly generated. Next, MATLAB simulation was carried out to simulate all the possible end positions. The obtained random values were substituted into Eq. (2), and 10000 working points were obtained by solving the positive kinematics equation. Fig. 7 presents the workspace of the manipulator plotted from the 10,000 working points. From the YOZ, XOZ, and XOY views, it was learned that the workspace of the manipulator could cover all the points in the growth space, when 22 cm < x < 40 cm, −20 cm < y < 20 cm, and 0 cm < z < 40 cm. In this case, the picking requirements can be satisfied through the collaboration between the manipulator and the lifting mobile chassis. Hence, the proposed workspace and rod lengths of the manipulator are reasonable.

FORCE ANALYSIS OF MANIPULATOR 3.1 Theoretical Analysis
From the above configuration of the manipulator, this paper constructed the force model of the manipulator during the picking operation (Fig. 8). Then, a coordinate system was established with the base of the manipulator as the zero point, the direction of the upper arm as the X axis, the direction of the shoulder joint as the Y axis, and the vertical upward direction as the Z axis. When the manipulator is in a horizontal position, the torque of each joint reaches the maximum, and the end mass stands at about 350 g. Each mature tomato weighs is between 100 g and 500 g. Taking the maximum mass of each tomato as 500 g, then: Under the acceleration of gravity g = 9.8 m/s 2 , the moments of the waist joint, shoulder joint, elbow joint, and the three wrist joints can be obtained as:  Motor and reducer are core components of the joints in the manipulator. Together, the two components guarantee the stable operation of the manipulator. Common motors include alternative current (AC) motors, stepper motors, and direct current (DC) motors. Among them, the AC motors are not suitable for mobile robots; the stepper motors cannot feedback current information, albeit their high control accuracy. Hence, the 24 V DC brushless motor (42BL50S03-230TR9, Time Chaoqun Technology Co., Ltd., Beijing, China) was chosen for all the six joints, with the 4 pole pairs, a rated speed of 3000 r/min, and a mass of 420 g. The power, rated current, and torque of each joint motor are given in Tab. 2. The above analysis shows that the joints are small and subject to a large moment. Thus, the harmonic reducer (CSF-17-100-2UH, HarmonicDrive Systems Inc., Tokyo, Japan) was selected for our manipulator. The parameters of the reducer are provided in Tab. 3.

Simulation Verification of Joint Stress
Through the above analysis, the three-dimensional (3D) model of the lightweight robotic tomato picker was designed on SolidWorks (Fig. 9). Carbon fiber was initially taken as the material for the rods of the manipulator. The polylactide (PLA) material was selected for the joint connectors, including the L -shaped connector, discshaped connector, and cylindrical connector. The tensile strength of PLA material is 61.5 Mpa. The waist joint of the manipulator is mainly composed of the waist joint motor, an L -shaped connector, and a base. The lower arm consists of a disc-shaped connector, an L -shaped connector, a wrist roll joint, a lower arm carbon fiber tube, and a cylindrical connector. The upper arm is assembly by the same principle as the lower arm. The wrist of the manipulator encompasses a wrist pitch joint, an L -shaped joint connector, a wrist yaw joint, a wrist roll joint, and an end clamp. The wrist pitch joint and the L -shaped joint connector are fixedly connected by screws; the end clamp is directly connected to the flange of the output end of the harmonic reducer; the wrist pitch joint and the wrist yaw joint are connected perpendicularly to each other; the wrist yaw joint and the wrist roll joint are connected perpendicularly to each other; the three wrist joints adopt the orthogonal non-spherical structures.
All the six joints of the manipulator have an L -shaped connector; the fixed surface lies at the position linked with the disc-shaped connector, and the force-bearing surface lies at the position linked with the cylindrical connector. The disc-shaped connector and the cylindrical connector connect the rods and the joints. For the disc-shaped connector, the fixed surface lies at the position linked with the L -shaped connector, and the force-bearing surface lies at the position linked with the flange of the reducer. For the cylindrical connector, the fixed surface lies at the position linked with the carbon fiber tube, and the force-bearing surface lies at the position linked with the L -shaped connector.  The three-dimensional model of the L -shaped connector is established in SolidWorks, and the stress and strain of the L -shaped connector is simulated by the Simulation finite element plug-in. The connector material is PLA, and a fixed position is added where the part is connected to the disc-shaped connector. The solid mesh was divided based on curvature, and the Jacobian number was chosen as 4. If the torque applied to the L -shaped connector is 22 Nm, the stress and strain of the L -shaped connector could be obtained by the Simulation finiteelement plug-in. As shown in Fig. 10, the maximum stress and maximum strain of the L -shaped connector were 43.02 MPa, and 0.01813, respectively. The stress and strain of the L -shaped connector were below the tensile strength of the PLA material.
Under the torques of 12 Nm and 22 Nm, the stress and strain of the disc-shaped connector and the cylindrical connector could be obtained by the Simulation finiteelement plug-in. As shown in Fig. 11, the maximum stress and maximum strain of the disc-shaped connector were 36.71 MPa and 0.01448, respectively; the maximum stress and maximum strain of the cylindrical connector were 33.45 MPa and 0.0002071, respectively. The stress and strain of both connectors were below the tensile strength of the PLA material.

SIMULATION ANALYSIS OF WORKING TRAJECTORY 4.1 Theoretical Analysis
The tomato picking robot proposed by Kondon et al. needs 15 s to recognize and pick each tomato. This speed was adopted as the reference speed. Each picking operation of the manipulator consists of three actions: the motion from the initial position to the target tomato, that from the target tomato to the collection box, and that from the collection box back to the initial position. Since each action takes 5 s on average, and the maximum range of joint motion is 180°, the maximum angular speed of joint motion could be obtained as ω max = 0.105 rad/s. In addition, during the picking operation, the speed and acceleration curves of each joint of the manipulator must be continuous and smooth. No sudden change in speed and acceleration is allowed to reduce the impact on the manipulator and improve the motion stability. Therefore, the trajectory of the manipulator planned under the maximum angular speed ω max of joint motion must eliminate any sudden change in speed and acceleration.

Simulation Verification of Working Trajectory
The trajectory of the joint space of our manipulator was planned through fifth-order polynomial interpolation [18][19]. The first step is to constrain the joint angle, joint speed and joint acceleration of the start and end positions. Let θ(t) be the joint angle at a moment; t 0 and t f be the start and end moments, respectively; t 0 and t f be the start angle and end angle of the joint, respectively. Then, the constraints can be designed as: According to the above analysis, the joint space trajectory of the manipulator was planned through the fifthorder polynomial interpolation, based on the robot toolbox in MATLAB. As shown in Fig. 12a, when the end of the manipulator moves from the start point A to the end point B in the workspace, the position curve, speed curve and acceleration curve of each joint can be described as in Fig.  12b, Fig. 12c, and Fig. 12d, respectively.
The 3D model designed on SolidWorks was imported into MATLAB to simulate the manipulator trajectory under the Cartesian coordinate system. Specifically, a rigid body tree was set up with the help of the Simscape module of the Simulink plug-in. Under the Cartesian coordinate system, a trajectory was planned for the manipulator, and used to control the motion of the end of the manipulator from the start point to the end point, along a straight line (Fig. 13a). The end position and pose variations are shown in Fig. 13b and Fig. 13c, respectively. As shown in Fig. 13, under the joint space trajectory planning, even when the joint speed ω > ω max , the trajectory planned could eliminate sudden changes in acceleration. Under the Cartesian space, the trajectory planned could directly express the position and pose of the end of the manipulator; but the manipulator was not controllable, due to the presence of singularities in the planned trajectory; the computing load was very high [20]. By contrast, the joint space trajectory planning by the fifthorder polynomial interpolation ensures the stable operation of the manipulator, and the high flexibility of end trajectory; the planned trajectory better suits the complexity of the picking environment, and adapts well to the previously stated requirements on trajectory control of robotic picking manipulator. Therefore, it is reasonable to plan the trajectory of the manipulator through by the fifthorder polynomial interpolation.

Platform Design
In order to verify the correctness of the simulation results and confirm that the manipulator can complete the picking operation a prototype of the proposed tomato picking manipulator was developed, and applied to pick real fruits in the lab. The experimental platform is shown in Fig. 14. Before the experiment, an end effector and a visual positioning system were installed at the end of the manipulator, and five mature tomatoes were hung in the workspace. Then, the manipulator was used to pick each tomato for 30 times. The number of successful pickings and mean picking time of each tomato were recorded to analyze the success rate and speed of tomato picking.

Figure 14 Experimental platform
The control system of the manipulator has 6 groups of motion units, a motion controller (Battleship V3, Xingyi Electronic Technology Co., Ltd., Guangzhou, Guangdong, China) and an industrial computer. The motion unit is composed of joint motors, Hall sensor groups, and motor drivers (AQMD3608BLS, Aikong Electronic Technology Co., Ltd., Chengdu, Sichuan, China).
The working process of the control system is shown in Fig. 15. After obtaining the 3D coordinates of a tomato, the industrial computer performs trajectory planning based on the Move it toolbox under the Robot Operating System (ROS) [21] to realize the real-time calculation of the interpolation points of the manipulator, and outputs the points to the motion controller. Then, the motion controller outputs control information to the motor driver of each joint to control joint revolution, thereby changing the end pose of the manipulator. Figure 15 Working process of the control system

Results and Analysis
Tab. 4 records the results of the picking experiment. It can be seen that the proposed manipulator consumed 21 s to pick a tomato, and achieved a success rate of 78.67%. Thus, the manipulator meets the requirements on the speed and success rate of tomato picking. The mean picking time and mean success rate need to be further improved by optimizing the control algorithm, enhancing the stability of visual servo positions, and streamlining the design of the end effector.

CONCLUSIONS
Most tomato picking manipulators are large, heavy, costly, and highly complex. To solve these defects, this paper designs a lightweight manipulator for tomato picking under the greenhouse environment through simulations. Firstly, the design parameters of the manipulator were determined according to the working environment, and the design parameters were proved reasonable through workspace simulation on MATLAB. Next, based on the results of force analysis, the authors selected the most suitable motor for the joints, and verified the rationality of joint structure through stress and strain analysis, using the Simulation plug-in of SolidWorks. After that, the requirements on trajectory control were clarified for the picking environment and workspace, if the trajectory is planned under the maximum joint speed. Then, the trajectory planning was simulated on MATLAB, and the fifth-order polynomial interpolation was adopted for joint space trajectory planning. Finally, a prototype was constructed to physically verify the simulation results. It was confirmed that the proposed lightweight tomato picking manipulator is feasible, which takes an average of 21 s to pick a tomato and achieves a mean success rate of 78.67%. To adapt to the actual picking operation, many aspects of the manipulator need to be improved, to overcome the limits of time and experimental equipment. In future, the authors will try to design a flexible end effector for efficient, nondestructive tomato picking, and increase the success rate by improving the real-time obstacle avoidance under complex unknown environment.