Next Article in Journal
Effects of Biological Additives on the Fermentation Quality and Microbial Community of High-Moisture Oat Silage
Previous Article in Journal
Small Target Ewe Behavior Recognition Based on ELFN-YOLO
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Study on Trajectory Optimization for a Flexible Parallel Robot in Tomato Packaging

1
College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China
2
Intelligent Equipment Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
3
Information Technology Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
4
Key Laboratory of Cold Chain Logistics Technology for Agro-Product, Ministry of Agriculture and Rural Affairs, Beijing 100097, China
*
Author to whom correspondence should be addressed.
Agriculture 2024, 14(12), 2274; https://doi.org/10.3390/agriculture14122274 (registering DOI)
Submission received: 16 October 2024 / Revised: 29 November 2024 / Accepted: 9 December 2024 / Published: 11 December 2024
(This article belongs to the Section Agricultural Technology)

Abstract

:
Currently, flexible robots, exemplified by parallel robots, play a crucial role in the automated packaging of agricultural products due to their rapid, accurate, and stable characteristics. This research systematically explores trajectory planning strategies for parallel robots in the high-speed tomato-grabbing process. Kinematic analysis of the parallel robot was conducted using geometric methods, deriving the coordinates of each joint at various postures, resulting in a kinematic forward solution model and corresponding equations, which were verified with data. To address the drawbacks of the point-to-point “portal” trajectory in tomato grabbing, a 3-5-5-3 polynomial interpolation method in joint space was proposed to optimize the path, enhancing trajectory smoothness. To improve the efficiency of the tomato packaging process, a hybrid algorithm combining particle swarm optimization (PSO) and genetic algorithms (GA) was developed to optimize the operation time of the parallel robot. Compared to traditional PSO, the proposed algorithm exhibits better global convergence and is less likely to fall into local optima, thereby ensuring a smoother and more efficient path in the robot-grabbing tomato process and providing technical support for automated tomato packaging.

1. Introduction

Tomatoes are one of the most widely cultivated vegetables in China, with an annual production nearing 70 million tons, accounting for 33% of the global output. They are highly valued for their nutritional and economic benefits (Castro et al., 2021; Cámara et al., 2019; Kumar et al., 2022) [1,2,3]. As a fresh-consumable produce, tomatoes have a short harvesting cycle, are difficult to store, and are prone to decay. Consequently, tomatoes must be promptly packaged after harvest for distribution across the country. This necessitates the short-term employment of a substantial workforce for packaging (Clement et al., 2012) [4]. The industry faces significant challenges such as labor shortages, high packaging costs, low efficiency, and difficulties maintaining packaging quality. To alleviate these issues, research into automated packaging technologies and equipment is essential.
Fresh tomatoes are delicate and easily damaged, making flexible robotic packaging a critical area of development. In this regard, international research and applications began somewhat earlier, with notable examples including the UBIROS fruit and vegetable grabbing robot, the Motor Cortex fruit sorting and packaging robot, and the Soft Robotics flexible packaging robot in the United States (Xie et al., 2024; Wei et al., 2020; Wang et al., 2022) [5,6,7]. These fruit and vegetable packaging methods share a common feature: the use of serial robots. A serial robot is an open kinematic chain robot consisting of a series of links connected by rotating or moving joints, driven by actuators that control the motion of each joint to manipulate the links and the end-effector, enabling the grabbing and boxing of fruits and vegetables (Zhao et al., 2023) [8]. Although these packaging systems are still experimental, the slow movement speed, complex motions, and large working space of serial robots are not suitable for the rapid handling and packaging of tomatoes.
Compared to serial robots, parallel robots are structured in a closed loop, offering higher rigidity and accumulating fewer errors within the loop, resulting in more precise positioning (Lilge et al., 2024) [9]. Delta robots have played an important role in the picking, packaging, and transportation of agricultural products. Sundaram et al. (2019) [10] used parallel robots to transplant potted vegetable seedlings. Yang et al. (2021) [11] used parallel robots to realize the automatic picking of high-quality tea leaves. Hu et al. (2019) [12] developed a mushroom-picking robot and optimized the picking efficiency of the parallel robot through an algorithm. Zhao et al. (2022) [13] optimized the motion control of the parallel robot in the seedling transplanting process. Zhang et al. (2022) [14] proposed a comprehensive evaluation method to solve the problem of inconsistent priority definition of stacked fruit clusters grasped by parallel robots, which further improved the accuracy of parallel robot sorting. In the field of tomato flexible grasping, parallel robots also play an important role. However, the movement trajectory of the end-effector in parallel robots significantly impacts the operation time, energy consumption, and stability of the robot during actual tomato packaging processes. Therefore, trajectory planning for the end-effector of parallel robots is of utmost importance. Zhang et al. (2023) [15] combined the principle of angular velocity superposition and the vector chain method to propose an improved kinematic model and derived the inverse kinematics model of the parallel manipulator on the basis of the improved kinematic model. Zhou et al. (2024) [16] simplified the inverse dynamics model of the parallel robot based on the Lagrangian method and compared and analyzed different dynamic models in detail. Wang et al. (2024) [17] proposed a new method to solve the forward kinematics of parallel robots based on transfer matrices and verified the effectiveness of the method through experiments. Chen et al. (2024) [18] proposed a neural network algorithm to realize the tracking control of the trajectory of a robotic arm. Jia et al. (2024) [19] put forward a method to plan the robot arm’s trajectory using the trajectory learning and generalization characteristics of dynamic motion primitives. Song et al. (2024) [20] proposed a trajectory planning technique for a spatial robotic arm based on twin delayed DDPG (deep deterministic policy gradient) in deep reinforcement learning. In addition, some researchers used non-uniform rational basis spline (NURBS) curves (Jahanpour et al., 2016; Wang et al., 2022) [21,22], Pythagorean-hodograph curves (Xu et al., 2019) [23], Lamé curve (Zhang et al., 2019; Myong et al., 2023) [24,25], and Bezier curves (Chen et al., 2017; Alfatih et al., 2021) [26,27], instead of “gate” paths for trajectory optimization. Intelligent optimization algorithms are also widely used in time optimization. Common ones include particle swarm optimization (Nguyen et al., 2023; Jin et al., 2024) [28,29], genetic algorithm (Jiang et al., 2024; Yu et al., 2023) [30,31], and simulated annealing algorithm (Zeng et al., 2023) [32].
The research methods previously discussed have advanced the trajectory optimization of parallel robots. However, studies on polynomial interpolation within the joint space are limited. To achieve a smoother operational trajectory for the tomato-grabbing robot, it is essential to explore the robot’s motion trajectory. In this study, three key nodes were inserted between the tomato-grabbing and placement points, and a 3-5-5-3 polynomial interpolation method was employed to optimize the trajectory of the tomato-grabbing robot within the joint space. Additionally, to enhance the speed of the parallel robot and reduce its operational cycle, this study proposed a hybrid algorithm combining particle swarm optimization (PSO) and genetic algorithms (GA) to optimize the operation time of the parallel robot, thereby increasing the robot’s stability and efficiency during the tomato-grabbing process. This study employs a novel approach combining polynomial interpolation with an improved particle swarm optimization algorithm, specifically aimed at optimizing the tomato-grasping problem in the tomato packaging industry. We anticipate that this method will provide more reliable strategic recommendations for the tomato-grasping field and hold significant practical importance for advancing the development of tomato packaging.

2. Tomato-Grabbing Robot Kinematic Model

In this research, the tomato-grabbing robot consists of an upper stationary platform and a lower moving platform linked by three identical support chains forming a parallel structure. Each support chain’s active arm is connected to the stationary platform through a revolute joint, and the three passive arms are connected to both the active arm and the moving platform via ball joints, forming a parallelogram mechanism. This configuration provides the system with three degrees of freedom, which facilitates high-speed and stable grabbing of tomatoes during the packaging process, as illustrated in Figure 1.

2.1. Establishment of Kinematic Equations

To facilitate the study of the motion characteristics of the tomato-grabbing robot, the equipment can be simplified, as depicted in Figure 1. Both the active and static platforms, connected by three links each at an angle of 120°, are reduced to two equilateral triangles of different sizes. The active and passive arms are simplified into line segments. The origin of the coordinate system, denoted as O, is placed at the center of the circumscribing circle of the static platform. The X-axis is parallel to the plane A1A2A3, and the Z-axis is perpendicular to the plane, oriented vertically upward-this establishes the static platform coordinate system, O–XYZ. Similarly, the moving platform coordinate system, O’–XYZ, is established using the same method. The position vector from the origin of the static platform to the origin of the moving platform is denoted by O O = x y z T . The radii of the circumscribing circles for the static (R) and moving (r) platforms are denoted as O A i and O C i , respectively; αi represents the angle between the static platform and the X-axis, while βi represents the angle between the active arm and the static platform.
The position of point Ai in the static platform coordinate system can be expressed as
A i o = R cos α i R sin α i 0 i = 1 , 2 , 3
Similarly, the position of point Ci in the moving platform coordinate system is
C i o = r cos α i r sin α i 0 i = 1 , 2 , 3
Using geometric methods, the position of point Bi in the static platform coordinate system can be calculated as
B i o = R + L 1 sin β i cos α i R + L 1 sin β i sin α i L 1 cos β i i = 1 , 2 , 3
Vector operations allow us to derive the vector from the static platform’s origin to vertex Ci of the moving platform:
O C = O O + O C
Using vector addition and subtraction, we can obtain the position of Ci in the static platform coordinate system O–XYZ as
C i o = r cos α i r sin α i 0 + x y z = r cos α i + x r sin α i + y z   ( i = 1 , 2 , 3 )
The value of αi is given by
α i = 4 i 3 6 π   i = 1 , 2 , 3
Assuming the length of the parallel robot’s active arm is L1, the coordinates of the passive arm in the static platform coordinate system can be calculated as
B i C i ¯ = O B i ¯ O C i ¯ = R + L 1 sin β i r cos α i x R + L 1 sin β i r sin α i y L 1 cos β i z   i = 1 , 2 , 3
Assuming the length of the parallel robot’s passive arm is L2, given B i C i = L 2 , the kinematic equation of the parallel robot becomes
R + L 1 sin β i r cos α i x 2 + R + L 1 sin β i r sin α i y 2 + L 1 cos β i z 2 = L 2 2

2.2. Kinematic Forward Analysis

The tomato-grabbing robot operates its platform through the coordinated action of three independent, driven arms. The forward kinematic analysis entails determining the precise position and orientation of the end-effector within Cartesian space, based on known angles of each driving joint. Due to the complexity of the tomato-grabbing robot’s structure, this analysis requires a combination of geometric, algebraic, and numerical methods.
By substituting the angle αi for the active arm into Equation (8), the following system of equations is obtained:
3 2 R + L 1 sin β 1 r x 2 + 1 2 R + L 1 sin β 1 r y 2 + L 1 cos β 1 + z 2 = L 2 2 3 2 R + L 1 sin β 2 r + x 2 + 1 2 R + L 1 sin β 2 r y 2 + L 1 cos β 2 + z 2 = L 2 2 x 2 + R + L 1 sin β 3 r + y 2 + L 1 cos β 3 + z 2 = L 2 2
  n 1 = 1 2 R + L 1 sin β 1 r ,   n 2 = 1 2 R + L 1 sin β 1 r ,   n 3 = R + L 1 sin β 3 r Defining m 1 = 3 2 R + L 1 sin β 1 r ,   m 2 = 3 2 R + L 1 sin β 2 r ,   p i = L 1 cos β i
and substituting mi, ni, and pi into Equation (9) results in
m 1 x 2 + n 1 y 2 + p 1 + z 2 = L 2 2 m 2 x 2 + n 2 y 2 + p 2 + z 2 = L 2 2 m 3 2 + n 3 + y 2 + p 3 + z 2 = L 2 2
Solving the system of Equation (10) through elimination yields
m 1 x + n 13 y = p 13 z + q 1
m 2 x + n 23 y = p 23 z + q 2
where
n 13 = n 1 + n 3 n 23 = n 2 + n 3 p 13 = p 1 p 3 p 23 = p 1 p 3 q 1 = 1 2 m 1 2 + n 1 2 + p 1 2 n 3 2 p 3 2 q 2 = 1 2 m 2 2 + n 2 2 + p 2 2 n 3 2 p 3 2
Combining Equations (11)–(13) leads to
x = E 1 z + F 1 y = E 2 z + F 2
where
E 1 = n 13 p 23 n 23 p 13 m 2 n 13 m 1 n 23 F 1 = n 13 q 2 n 23 q 1 m 2 n 13 m 1 n 23 E 2 = m 2 p 13 m 1 p 23 m 2 n 13 m 1 n 23 F 2 = m 2 q 1 m 1 q 2 m 2 n 13 m 1 n 23
Substituting Equation (14) back into the system (10) results in an equation for z, succinctly expressed as a z 2 + b z + c = 0 :
a = E 1 2 + E 2 2 + 1 b = 2 E 1 F 1 + 2 E 2 F 2 + 2 E 2 n 3 + 2 p 3 c = F 1 2 + n 3 + F 2 2 + p 3 2 L 2 2
Using a root-finding formula, a solution for z can be determined as z = b ± b 2 4 a c 2 a . The specific value of z can be chosen based on the operational environment of the tomato-grabbing robot.
Due to the substantial computational demands of solving the forward kinematics for the tomato-grabbing robot, MATLAB R2020b software can be employed. By inputting the three angles of the parallel robot’s active arms, β1, β2, β3, the position data (x, y, z) for the center of the moving platform can be calculated. Table 1 shows six sets of active arm data, from which MATLAB can derive six sets of Cartesian coordinates for the robot.

3. Tomato-Grabbing Robot Path Optimization

The trajectory planning of robots is generally optimized in Cartesian space and joint space. Trajectory planning in Cartesian space involves direct planning within the workspace, offering intuitive operation but at the cost of high computational complexity. Additionally, planning in Cartesian space can sometimes lead to singularities in robot posture, causing the robot to encounter singular points. Trajectory planning in joint space refers to path planning carried out within the robot’s joint space. Its advantages include simpler calculations, ease of control implementation, and the ability to interpolate between joint angles to achieve a smooth transition from the starting to the target position. Common methods of joint space planning include linear interpolation, polynomial interpolation, and spline interpolation.

3.1. Cartesian Space Path Description

In the tomato-grabbing and packaging processes, the tomato-grabbing robot primarily performs point-to-point grabbing and boxing tasks. The packaging operation mainly consists of tomato object grabbing, moving, and boxing, typically employing a “portal” type path. Each grabbing cycle of the tomato-grabbing robot begins at the tomato-grabbing point (h1) and ends at the tomato-boxing placement point (h4), as illustrated in Figure 2. During this process, the robot’s moving platform executes a sequence of actions: tomato grabbing → ascending → translating → descending → tomato placing. To smooth the “portal” type path and reduce the instability in grabbing and placing packaging caused by mechanical vibrations, which could damage the tomatoes, the tomato-grabbing path is optimized using joint space polynomial interpolation.

3.2. Joint Space Polynomial Interpolation

For the “portal”-type path of the tomato-grabbing robot, there are initially only four key points: the tomato-grabbing point; the placement point; and two intermediate nodes. These constraints ensured neither optimal running height nor optimal operation time, and considering the delicate nature of tomatoes, a smoother motion process is necessary. To address this, our study introduced an additional key node, dividing the entire trajectory into four segments and setting specific operational heights for the parallel robot according to actual packaging requirements. When there are many path data points, the direct use of a higher polynomial may cause the interpolation polynomial to produce large fluctuations between the data points (called the Runge phenomenon), so we use the method of piecewise interpolation to divide the data points into four smaller intervals and perform three polynomial interpolations in the first and fourth intervals and five polynomial interpolations in the second and third intervals to avoid this problem. Within the Cartesian coordinate system, the tomato-grabbing point is set at h0 (−400 mm, −300 mm, 600 mm) and the placement point at h4 (300 mm, 300 mm, 600 mm), with intermediate interpolation points at h1 (−400 mm, −300 mm, 800 mm), h2 (−50 mm, 0 mm, 850 mm), and h3 (300 mm, 300 mm, 800 mm). Using MATLAB, the inverse kinematics equations for the parallel robot were solved to obtain the corresponding joint angles: βj0 (117.89°, 46.56°, 18.29°); βj1 (130.30°, 81.70°, 63.84°); βj2 (82.65°, 76.65°, 78.72°); βj3 (49.10°, 91.38°, 121.12°); βj4 (−7.09°, 55.96°, 91.89°). Cubic polynomial interpolation is a polynomial interpolation method that makes the robot position, velocity, and acceleration continuous and of the lowest order, but the cubic polynomial interpolation cannot ensure the continuity of the degree of urgency, so a higher order polynomial is selected for interpolation because the polynomial of the seventh order and higher order requires a lot of computational time. Consequently, this study proposes using a 3-5-5-3 polynomial to interpolate these four path segments in joint space.
h i 1 t = a i 13 t 1 3 + a i 12 t 1 2 + a i 11 t 1 + a i 10 h i 2 t = a i 25 t 2 5 + a i 24 t 2 4 + a i 23 t 2 3 + a i 22 t 2 2 + a i 21 t 2 + a i 20 h i 3 t = a i 35 t 3 5 + a i 34 t 3 4 + a i 33 t 3 3 + a i 32 t 3 2 + a i 31 t 3 + a i 30 h i 4 t = a i 43 t 4 3 + a i 42 t 4 2 + a i 41 t 4 + a i 40
The coefficients αi1j, αi2j, αi3j, αi4j in Equation (17) represent the coefficients for the polynomial interpolation of the ith joint for each of the four trajectory segments, where hi1(t), hi2(t), and hi3(t) are the three key points in the path optimization process; hi0(t) is the tomato-grabbing point, and hi4(t) is the tomato placement point. By setting the initial and final velocities and accelerations to zero and ensuring the continuity of velocities and accelerations at the intermediate points, the constraint equations in Equation (18) are derived.
h i 1 ( 0 ) = β i 0 h i 1 ( 0 ) = 0 h i 1 ( 0 ) = 0 h i 2 ( 0 ) = h i 1 ( t 1 ) = β i 1 h i 2 ( 0 ) = h i 1 ( t 1 ) h i 2 ( 0 ) = h i 1 ( t 1 ) h i 3 ( 0 ) = h i 2 ( t 2 ) = β i 2 h i 3 ( 0 ) = h i 2 ( t 2 ) h i 3 ( 0 ) = h i 2 ( t 2 ) h i 4 ( 0 ) = h i 3 ( t 3 ) = β i 3 h i 4 ( 0 ) = h i 3 ( t 3 ) h i 4 ( 0 ) = h i 2 ( t 3 ) h i 4 ( t 4 ) = β i 4 h i 4 ( t 4 ) = 0 h i 4 ( t 4 ) = 0
Based on the constraints specified in Equation (18), Equation (17) can be expressed through matrices, as shown in Equations (19)–(22).
A = t 1 3 t 1 2 t 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 3 t 1 2 2 t 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 6 t 1 2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t 2 5 t 2 4 t 2 3 t 2 2 t 2 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 5 t 2 4 4 t 2 3 3 t 2 2 2 t 2 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 20 t 2 3 12 t 2 2 6 t 2 2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 60 t 2 2 24 t 2 6 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t 3 5 t 3 4 t 3 3 t 3 2 t 3 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 5 t 3 4 4 t 3 3 3 t 3 2 2 t 3 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 20 t 3 3 12 t 3 2 6 t 3 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 60 t 3 2 24 t 3 6 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t 4 3 t 4 2 t 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 t 4 2 2 t 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 t 4 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
a = a i 13 a i 12 a i 11 a i 10 a i 25 a i 24 a i 23 a i 22 a i 21 a i 20 a i 35 a i 34 a i 33 a i 32 a i 31 a i 30 a i 43 a i 42 a i 41 a i 40 T
b = A a
b = 0 0 0 0 0 0 0 0 0 0 0 β i 4 0 0 β i 0 0 0 β i 3 β i 2 β i 1
The time allocated for each of the four segments of the path is set as t1 = 0.5 s, t2 = 0.5 s, t3 = 0.5 s, and t4 = 0.5 s, totaling 2 s. In MATLAB, a 3-5-5-3 polynomial interpolation path was constructed, resulting in the generation of curves for angular displacement, angular velocity, and angular acceleration during the motion of the parallel robot, as illustrated in Figure 3, Figure 4 and Figure 5, respectively. Analysis of these figures indicates that the joint space polynomial interpolation trajectory planning method ensures continuity and smooth transitions in the angles, velocities, and accelerations of the joints throughout the motion process. This guarantees smooth movement of the robot during tomato grabbing, thereby reducing potential damage to the tomatoes due to the robot’s motion.

4. Optimizing Trajectories Using Enhanced Intelligent Optimization Algorithms

PSO is a swarm intelligence-based optimization algorithm that simulates collaboration and information sharing among individuals in a flock of birds to solve optimization problems (Cheng et al., 2023) [33]. Each particle represents a potential solution within the search space, continuously adjusting its position and velocity to find the optimal solution. PSO particles have memory capabilities that retain the optimal information of both the individual and the population. They exhibit strong local search capabilities and fast convergence rates but are prone to premature local convergence. In contrast, GA possesses robust global search capabilities; their crossover operations encompass the concept of information exchange, and mutation operations increase the diversity of the population, preventing premature convergence during iterations.
In the context of tomato packaging, efficiency is a critical factor. To plan time-optimized trajectories for tomato-grabbing robots, this study integrates the advantages of GA and PSO to propose an improved PSO for tomato packaging, enabling the traditional PSO to avoid local optima and achieve rapid convergence.
Optimizing the joint space trajectory through a 3-5-5-3 polynomial interpolation requires adjusting the initial parameters of the particle swarm to minimize the operation time for trajectory optimization. In the case of a 3-5-5-3 polynomial interpolation of the joint space trajectory, t1, t2, t3, and t4 represent the operating times of the parallel robot across four segments, with m(t) as the trajectory motion concerning time parameters. Given that the initial positions and velocities of particles are randomly generated, it may cause the coefficient matrix A in Equation (19) to be rank-deficient, leading to potentially infinite coefficients in the polynomial and exceeding the maximum velocity limit during iterations, rendering the times t1, t2, t3, and t4 invalid. In such cases, the fitness value of this particle is set to infinity and excluded from consideration.
m t = min t 1 + t 2 + t 3 + t 4
max v i v max max a i a max
The local and global optima of the time particle parameters are calculated and compared using Equation (25):
V i d k + 1 = ω V i d k + c 1 r 1 P i d X i d + c 2 r 2 P g d X i d X i d k + 1 = X i d k + α V i d k + 1
Here, i denotes the number of particles; d represents the spatial dimensions; ω is the inertia weight, which balances local and global search—higher ω values enhance global search capabilities, while lower values strengthen local search; n is the number of iterations; r1 and r2 are random numbers between 0 and 1 maintaining population diversity; c1 and c2 are learning factors; α acts as a constraint factor controlling the particle’s speed.
When optimizing the time-minimized trajectories of a parallel robot using an enhanced PSO algorithm applied to a 3-5-5-3 segmented polynomial trajectory, it is essential to individually optimize the motion trajectory of each joint. The maximum value from the same segment of polynomial interpolation across all joints is selected to ensure that each joint can achieve its target angle. Subsequently, the times for the four segments of polynomial interpolation are incorporated into the polynomial equations to solve for the coefficients of the 3–5–3 polynomial, yielding the time-optimized operational trajectory of the robotic arm.
The specific optimization process for minimizing the trajectory time for the j joints of the parallel robot is outlined as follows:
Step 1: Set the population size of the particle swarm to N = 50, define the maximum number of iterations as 100, set the dimension D = 3, establish the range of particle velocities, learning factors, mutation operators, and inertia weights, and initialize the initial positions and velocities of the population;
Step 2: Input the times t1, t2, t3, and t4 for the four segments of polynomial interpolation into Equations (19)–(22) to compute the coefficients for the 3-5-5-3 segmented polynomial;
Step 3: Substitute the polynomial coefficients obtained in Step 2 into Equation (17) to determine the joint angles and derive their velocities and accelerations by differentiating with respect to time. Verify whether these values meet the requirements specified in Equation (24);
Step 4: Calculate the fitness value for each particle and filter the results from Step 3. Ensure that the instantaneous velocities of particles at all moments within the four trajectory segments comply with Equation (24); if a particle’s velocity exceeds the maximum velocity limit (Vmax) at any moment, assign an infinite fitness value to that particle. During the search for optimal particles, sort by fitness value and exclude the half with excessively high values, allowing for the remainder to proceed to the next generation;
Step 5: Select one of the two superior particles from the next generation with a higher fitness value as the sire, and similarly select a dam. Perform crossover to produce two new individuals, repeat the operation until the number of new individuals matches the number in the current generation, and then mutate the newly selected individuals. These particles then move into the next generation;
Step 6: Compare the current fitness value of each particle with the fitness value from its historical best position (oldbest). If the current fitness value is lower, set the current position of the particle as the optimal position (nowbest); otherwise, it remains unchanged. Compare the fitness values of the best positions currently held by all particles in the group, and if the current fitness value is lower than that of the group’s historical best (oldbest), set the current group’s best position as the new optimal (nowbest); otherwise, it remains unchanged;
Step 7: Calculate and rank each particle’s fitness value, updating the individual and global optima;
Step 8: Determine whether the termination conditions have been met. If the number of iterations reaches the maximum, end the computational process and output the optimal solution; otherwise, return to Step 2.

5. Simulation of a Tomato-Grabbing Robot

The simulation experiments produced the time curves for the angle, angular velocity, and angular acceleration of joint 1 of the tomato-grabbing robot under optimal time planning, along with the corresponding optimal fitness curve for the particle swarm, as shown in Figure 6. Similar results were obtained for joint 2 and joint 3 of the robot, with their respective curves and particle swarm fitness curves displayed in Figure 7 and Figure 8. The continuous and smooth nature of the angle, angular velocity, and angular acceleration curves for all three joints, as optimized by the enhanced PSO, indicates a reduction in damage to tomatoes during the grabbing process. Furthermore, the improved PSO algorithm demonstrates rapid convergence and the ability to find global optima, thereby enhancing the operational efficiency of the tomato-grabbing robot.
In this study, the initial size of the particle swarm was set to 50, with a maximum particle velocity limited to three units and the number of iterations set to 100. The pre-optimized motion time for the four segments was set at 0.25 s, 0.25 s, 0.25 s, and 0.25 s, totaling 1 s for the parallel robot’s motion. The enhanced PSO was applied to process the optimal time trajectory. Given the continual positional changes in the particles during the optimization process, the resulting optimal time trajectories for the robot’s joint angles and angular velocities were not unique. Therefore, multiple iterations of trajectory optimization were conducted, and the mean time was used as the optimization metric. Table 2 displays five sets of data for optimal time trajectory planning.
From Table 2, it is evident that the average optimized motion time for the parallel robot is approximately 0.69 s, representing a 31% reduction from the pre-optimized time (calculated as (4 × 0.25 − 0.69) × 100%) and an 11.54% improvement over the traditional PSO (calculated as (0.78 − 0.69)/0.78 × 100%). These results underscore the effectiveness of the hybrid algorithm proposed in this study for optimizing trajectory time in robotic tomato packing.

6. Experimental Validations

In order to further verify the effectiveness and feasibility of the proposed algorithm, tomato packaging experiments were carried out based on the developed parallel robot system, as shown in Figure 9. Figure 10 is a 3D model of the developed system. The verification experiment is a 100-time tomato-boxing test. As shown in Figure 10, each experiment represents the parallel robot grabbing four tomatoes from positions A, B, C, and D and then boxing them. The conveyor speed is set to 0.2 m/s. Figure 11 shows the time of the 100 boxing tests based on the improved particle swarm optimization and the traditional particle swarm optimization, respectively.
As can be seen from Figure 11, the improved algorithm has a shorter time than the original particle swarm optimization in the process of tomato grabbing using a parallel robot system. The average time of the improved algorithm was 2.74 s for the 100-time tomato-boxing test. The time is reduced by 11.3% compared to the traditional particle swarm algorithm. The error analysis of the captured experimental data shows that the variance and mean square deviation of the sample data are 0.0081 and 0.09, respectively, which shows that the algorithm has obvious reliability in trajectory optimization. With the shortest running time and smaller motion impact of the parallel robot as the optimization goal, the 3-5-5-3 polynomial interpolation method was optimized by the improved particle swarm optimization algorithm so that the running time of the parallel robot was shorter, and the trajectory was smoother.

7. Conclusions

Tomato grabbing by flexible robots is a critical component of automated tomato packaging. This paper, taking the parallel robot as an example, proposes, for the first time, a trajectory planning method using 3-5-5-3 polynomial interpolation in joint space. Based on the velocity constraints of the robot’s movement, the particle swarm optimization (PSO) algorithm is improved by incorporating the advantages of the genetic algorithm. The improved PSO algorithm is then used to perform time-optimal planning for the trajectory after polynomial interpolation. This study utilized a 3-5-5-3 polynomial interpolation to optimize the trajectory of the parallel robot, ensuring continuous control over joint angles, speeds, and accelerations suitable for automated tomato packaging applications. Time optimization of the polynomial interpolation path was conducted through simulation experiments, which, under constraint-satisfying conditions, yielded an average optimized operational time of approximately 0.69 s for the parallel robot—31% less than the pre-optimized 1 s and an 11.54% improvement over traditional PSO. These findings affirm the efficacy of the improved PSO method. Based on the developed parallel robot system, the proposed algorithm was validated. One hundred tomato-boxing test experiments showed that the improved algorithm can effectively improve packaging efficiency. The method proposed in this study can be extended to grasping and packaging other easily damaged agricultural products by flexible robots.

Author Contributions

All authors who have made substantial contributions to the work are reported in the manuscript. T.G. (first author), methodology and original manuscript writing; J.L. (corresponding author), funding, supervision, revision, and editing; Y.Z., revision and editing; L.C., revision and editing; Q.L., Editing. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Science and Technology Innovation Ability Construction Project of Beijing Academy of Agriculture and Forestry Science (Project No. KJCX20240503), the Reform and Development Project of Beijing Academy of Agricultural and Forestry Sciences-Design and Control Implementation of Flexible Parallel Robot for Spherical Fruit and Vegetable Packaging, the Construction of the Research and Innovation Platform of Beijing Academy of Agriculture and Forestry Science (PT2024-32), and the Outstanding Scientist Cultivation Project of Beijing Academy of Agriculture and Forestry Sciences (JKZX202405).

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Castro, T.A.; Leite, B.S.; Assunção, L.S.; de Jesus Freitas, T.; Colauto, N.B.; Linde, G.A.; Otero, D.M.; Bruna Aparecida, S.M.; Camila Duarte, F.R. Red Tomato Products as an Alternative to Reduce Synthetic Dyes in the Food Industry: A Review. Molecules 2021, 26, 7125. [Google Scholar] [CrossRef] [PubMed]
  2. Cámara, M.; Fernández-Ruiz, V.; Sánchez-Mata, M.; Domínguez Díaz, L.; Kardinaal, A.; van Lieshout, M. Evidence of antiplatelet aggregation effects from the consumption of tomato products, according to EFSA health claim requirements. Crit. Rev. Food Sci. Nutr. 2020, 60, 1515–1522. [Google Scholar] [CrossRef] [PubMed]
  3. Kumar, M.; Chandran, D.; Tomar, M.; Bhuyan, D.J.; Grasso, S.; Amanda Gomes Almeida, S.; Bruno Augusto, M.C.; Radha Dhumal, S.; Singh, S.; Senapathy, M.; et al. Valorization Potential of Tomato (Solanum lycopersicum L.) Seed: Nutraceutical Quality, Food Properties, Safety Aspects, and Application as a Health-Promoting Ingredient in Foods. Horticulturae 2022, 8, 265. [Google Scholar] [CrossRef]
  4. Clement, J.; Novas, N.; Gazquez, J.A.; Manzano-Agugliaro, F. High speed intelligent classifier of tomatoes by colour, size and weight. Span. J. Agric. Res. 2012, 10, 314–325. [Google Scholar] [CrossRef]
  5. Xie, B.; Jin, M.; Duan, J.; Li, Z.; Wang, W.; Qu, M.; Zhou, Y. Design of Adaptive Grippers for Fruit-Picking Robots Considering Contact Behavior. Agriculture 2024, 14, 1082. [Google Scholar] [CrossRef]
  6. Wang, Z.; Xun, Y.; Wang, Y.; Yang, Q. Review of smart robots for fruit and vegetable picking in agriculture. Int. J. Agric. Biol. Eng. 2022, 15, 33–54. [Google Scholar]
  7. Wei, D.; Gao, T.; Mo, X.; Xi, R.; Zhou, C. Flexible bio-tensegrity manipulator with multi-degree of freedom and variable structure. Chin. J. Mech. Eng.=Ji Xie Gong Cheng Xue Bao 2020, 33, 1–11. [Google Scholar] [CrossRef]
  8. Zhao, Y.; Wan, X.; Duo, H. Review of rigid fruit and vegetable picking robots. Int. J. Agric. Biol. Eng. 2023, 16, 1–11. [Google Scholar] [CrossRef]
  9. Lilge, S.; Nuelle, K.; Childs, J.A.; Wen, K.; Rucker, D.C.; Burgner-Kahrs, J. Parallel-Continuum Robots: A Survey. IEEE Trans. Robot. 2024, 40, 3252–3270. [Google Scholar] [CrossRef]
  10. Sundaram, R.; Raheman, H.; Paradkar, V. Design and development of a 5R 2DOF parallel robot arm for handling paper pot seedlings in a vegetable transplanter. Comput. Electron. Agric. 2019, 166, 105014. [Google Scholar]
  11. Yang, H.; Chen, L.; Ma, Z.; Chen, M.; Zhong, Y.; Deng, F.; Li, M. Computer vision-based high-quality tea automatic plucking robot using Delta parallel manipulator. Comput. Electron. Agric. 2021, 181, 105946. [Google Scholar] [CrossRef]
  12. Hu, X.; Pan, Z.; Lv, S. Picking Path Optimization of Agaricus bisporus Picking Robot. Math. Probl. Eng. 2019, 2019, 8973153. [Google Scholar] [CrossRef]
  13. Zhao, X.; Cheng, D.; Dong, W.; Ma, X.; Xiong, Y.; Tong, J. Research on the End Effector and Optimal Motion Control Strategy for a Plug Seedling Transplanting Parallel Robot. Agriculture 2022, 12, 1661. [Google Scholar] [CrossRef]
  14. Zhang, Q.; Zhao, Z.; Gao, G. Fuzzy Comprehensive Evaluation for Grasping Prioritization of Stacked Fruit Clusters Based on Relative Hierarchy Factor Set. Agronomy 2022, 12, 663. [Google Scholar] [CrossRef]
  15. Zhang, X.; Wang, H.; Rong, Y. Improved inverse kinematics and dynamics model research of general parallel mechanisms. J. Mech. Sci. Technol. 2023, 37, 943–954. [Google Scholar] [CrossRef]
  16. Zhou, Z.; Gosselin, C. Simplified inverse dynamic models of parallel robots based on a Lagrangian approach. Meccanica 2024, 59, 657–680. [Google Scholar] [CrossRef]
  17. Wang, J.; Jing, Z.; Guo, J.; Qin, T.; Li, H.; Li, X.; Li, Z.; Meng, F.; Qi, B. A New Theoretical Method for Solving Forward Kinematics of the Parallel Mechanisms Based on Transfer Matrix. Int. J. Aerosp. Eng. 2024, 2024, 2582680. [Google Scholar] [CrossRef]
  18. Chen, X.; Zhao, H.; Zhen, S.; Liu, X.; Zhang, J. Fixed-time adaptive neural network-based trajectory tracking control for workspace manipulators. Actuators 2024, 13, 252. [Google Scholar] [CrossRef]
  19. Jia, X.; Zhao, B.; Liu, J.; Zhang, S. A trajectory planning method for robotic arms based on improved dynamic motion primitives. Ind. Robot. 2024; ahead-of-print. [Google Scholar]
  20. Song, Y.; Li, Q.; Liu, Y.; Wang, L. A Trajectory Planning Method for Capture Operation of Space Robotic Arm Based on Deep Reinforcement Learning. ASME. J. Comput. Inf. Sci. Eng. 2024, 24, 091003. [Google Scholar] [CrossRef]
  21. Jahanpour, J.; Motallebi, M.; Porghoveh, M. A Novel Trajectory Planning Scheme for Parallel Machining Robots Enhanced with NURBS Curves. J. Intell. Robot. Syst. 2016, 82, 257–275. [Google Scholar] [CrossRef]
  22. Wang, D.; Zhang, C.; Xi, X. A Novel Interpolation Method for Cutting Trajectories in Spatial Coherent Cutting Machine. J. Phys. Conf. Ser. 2022, 2395, 012033. [Google Scholar] [CrossRef]
  23. Xu, L.; Su, T. Quintic pythagorean-hodograph curves based trajectory planning for delta robot with a prescribed geometrical constraint. Appl. Sci. 2019, 9, 4491. [Google Scholar] [CrossRef]
  24. Zhang, X.; Ming, Z. Trajectory Planning and Optimization for a Par4 Parallel Robot Based on Energy Consumption. Appl. Sci. 2019, 9, 2770. [Google Scholar] [CrossRef]
  25. Myong, S.C.; Jang, K.S.; Kim, Y.H.; Kim, K.H.; Yang, W. An Approach for Elliptical Trajectory Planning with Vertical Straight Line Segments of Pick-and-Place Robot Operation with Height Clearance. Math. Probl. Eng. 2023, 2023, 7419178. [Google Scholar]
  26. Chen, W.; Liu, J.; Tang, Y.; Huan, J.; Liu, H. Trajectory Optimization of Spray Painting Robot for Complex Curved Surface Based on Exponential Mean Bézier Method. Math. Probl. Eng. 2017, 2017, 10. [Google Scholar] [CrossRef]
  27. Alfatih, M.F.; Riyadi, M.A.; Setiawan, I. Speed control system in mobile robot based on bezier curve trajectory. IOP Conf. Ser. Mater. Sci. Eng. 2021, 1108, 012015. [Google Scholar] [CrossRef]
  28. Nguyen, D.H.; Mai, V.L.; Pham, D.P. A Co-Optimization Algorithm Utilizing Particle Swarm Optimization for Linguistic Time Series. Mathematics 2023, 11, 1597. [Google Scholar] [CrossRef]
  29. Jin, M.; Li, J.; Chen, T. Method for the Trajectory Tracking Control of Unmanned Ground Vehicles Based on Chaotic Particle Swarm Optimization and Model Predictive Control. Symmetry 2024, 16, 708. [Google Scholar] [CrossRef]
  30. Jiang, Y.; Wang, L. Application of Genetic Algorithm in Optimizing Path Selection in Tourism Route Planning. J. Electr. Syst. 2024, 20, 462–468. [Google Scholar]
  31. Yu, Y.; Han, J.; Gu, H.; Yang, Y. Dynamic Optimization of Construction Time-Cost for Deep and Large Foundation Pit Based on BIM Technology and Genetic Algorithm. Appl. Sci. 2023, 13, 10716. [Google Scholar] [CrossRef]
  32. Zeng, X.; Wang, Y. Multi-objective Logistics Distribution Path Optimization Based on Annealing Evolution Algorithm. J. Phys. Conf. Ser. 2023, 2555, 012014. [Google Scholar] [CrossRef]
  33. Cheng, Y.; Fa-you, A.; Wu, Y.F.; Yan, S.-Q.; Zhu, C.-B.; Zhang, H. Impact of Parameter Tuning with Genetic Algorithm, Particle Swarm Optimization, and Bat Algorithm on Accuracy of the SVM Model in Landslide Susceptibility Evaluation. Math. Probl. Eng. 2023, 2023, 1393142. [Google Scholar]
Figure 1. Schematic diagram and actual figure of the parallel robot. (a) Schematic diagram of the parallel robot structure; (b) Actual parallel robot.
Figure 1. Schematic diagram and actual figure of the parallel robot. (a) Schematic diagram of the parallel robot structure; (b) Actual parallel robot.
Agriculture 14 02274 g001
Figure 2. Traditional “portal” type trajectory.
Figure 2. Traditional “portal” type trajectory.
Agriculture 14 02274 g002
Figure 3. A 3-5-5-3 polynomial interpolation joint angle curve.
Figure 3. A 3-5-5-3 polynomial interpolation joint angle curve.
Agriculture 14 02274 g003
Figure 4. A 3-5-5-3 polynomial interpolation joint angular velocity curve.
Figure 4. A 3-5-5-3 polynomial interpolation joint angular velocity curve.
Agriculture 14 02274 g004
Figure 5. A 3-5-5-3 polynomial interpolation joint angular acceleration curve.
Figure 5. A 3-5-5-3 polynomial interpolation joint angular acceleration curve.
Agriculture 14 02274 g005
Figure 6. Optimal time planning related curves for joint 1. (a) Angle curve post-optimization of joint 1. (b) Angular velocity curve post-optimization of joint 1. (c) Angular acceleration curve post-optimization of joint 1. (d) Fitness during the optimization of joint 1.
Figure 6. Optimal time planning related curves for joint 1. (a) Angle curve post-optimization of joint 1. (b) Angular velocity curve post-optimization of joint 1. (c) Angular acceleration curve post-optimization of joint 1. (d) Fitness during the optimization of joint 1.
Agriculture 14 02274 g006
Figure 7. Optimal time planning related curves for joint 2. (a) Angle curve post-optimization of joint 2. (b) Angular velocity curve post-optimization of joint 2. (c) Angular acceleration curve post-optimization of joint 2. (d) Fitness during the optimization of joint 2.
Figure 7. Optimal time planning related curves for joint 2. (a) Angle curve post-optimization of joint 2. (b) Angular velocity curve post-optimization of joint 2. (c) Angular acceleration curve post-optimization of joint 2. (d) Fitness during the optimization of joint 2.
Agriculture 14 02274 g007aAgriculture 14 02274 g007b
Figure 8. Optimal time planning related curves for joint 3. (a) Angle curve post-optimization of joint 3. (b) Angular velocity curve post-optimization of joint 3. (c) Angular acceleration curve post-optimization of joint 3. (d) Fitness during the optimization of joint 3.
Figure 8. Optimal time planning related curves for joint 3. (a) Angle curve post-optimization of joint 3. (b) Angular velocity curve post-optimization of joint 3. (c) Angular acceleration curve post-optimization of joint 3. (d) Fitness during the optimization of joint 3.
Agriculture 14 02274 g008
Figure 9. Robot experiment platform.
Figure 9. Robot experiment platform.
Agriculture 14 02274 g009
Figure 10. A 3D modeling drawing of a packaging robot.
Figure 10. A 3D modeling drawing of a packaging robot.
Agriculture 14 02274 g010
Figure 11. A 100-time tomato-boxing test results.
Figure 11. A 100-time tomato-boxing test results.
Agriculture 14 02274 g011
Table 1. Kinematic forward solution position calculations.
Table 1. Kinematic forward solution position calculations.
Initial Angle (In Degrees)Cartesian Coordinates (In mm)
β1β2β3(x, y, z)
51520(−112.41, −103.44, −928.83)
152525(−215.17, −124.23, −895.11)
403560(46.74, −202.18, −821.16)
604070(165.56, −176.15, −758.52)
708060(−69.67, 125.88, −720.84)
1009080(62.53, 108.46, −628.48)
Table 2. Trajectory optimization time.
Table 2. Trajectory optimization time.
IterationImproved PSO Time (s)PSO Time (s)
10.650.78
20.710.80
30.690.76
40.730.84
50.660.72
Average0.690.78
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Guo, T.; Li, J.; Zhang, Y.; Cai, L.; Li, Q. Study on Trajectory Optimization for a Flexible Parallel Robot in Tomato Packaging. Agriculture 2024, 14, 2274. https://doi.org/10.3390/agriculture14122274

AMA Style

Guo T, Li J, Zhang Y, Cai L, Li Q. Study on Trajectory Optimization for a Flexible Parallel Robot in Tomato Packaging. Agriculture. 2024; 14(12):2274. https://doi.org/10.3390/agriculture14122274

Chicago/Turabian Style

Guo, Tianci, Jiangbo Li, Yizhi Zhang, Letian Cai, and Qicheng Li. 2024. "Study on Trajectory Optimization for a Flexible Parallel Robot in Tomato Packaging" Agriculture 14, no. 12: 2274. https://doi.org/10.3390/agriculture14122274

APA Style

Guo, T., Li, J., Zhang, Y., Cai, L., & Li, Q. (2024). Study on Trajectory Optimization for a Flexible Parallel Robot in Tomato Packaging. Agriculture, 14(12), 2274. https://doi.org/10.3390/agriculture14122274

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop