Robot Time-Optimal Trajectory Planning Based on Improved Cuckoo Search Algorithm

,


I. INTRODUCTION
Trajectory planning is the basis of robot motion control. Existing trajectory planning algorithms are developing towards intelligence as our technological environment grows continually sophisticated. A high-performance trajectory planning algorithm makes the robot run more smoothly, work more efficiently, and function over a longer service life. Trajectory planning algorithms are a hot topic in the robotics field.
Cubic polynomial interpolation trajectory planning is widely used due to its simplicity in calculation but may produce mechanical vibrations which increase joint abrasion and degrade control accuracy. Improving the interpolation order of the polynomial and deploying piecewise interpolation methods smooth the trajectory. Xu et al. [1] proposed the 3-5-3 spline function method for smoothed robot trajectory planning; this was a valuable contribution to the literature, The associate editor coordinating the review of this manuscript and approving it for publication was Luigi Biagiotti . but the scholars did not consider interpolation time. This time variable represents the robot's ability to complete a specified motion as quickly as possible under multiple constraints. Trajectory planning based on polynomial interpolation is difficult to optimize under traditional methodology due to its high order and lack of convex hull. Using intelligent algorithms to achieve time optimal trajectory planning is a worthwhile research objective to this effect. Commonly used intelligent algorithms include the genetic algorithm [2], [3], particle swarm optimization [4], and convex optimization algorithm [5]. These methods require many iterations and complicated parameter adjustments; they show room for improvement compared to the cuckoo search algorithm [6] in terms of performance.
Nima and Farnaz [7] applied a cuckoo search algorithm in the cloud computing context to solve task scheduling problems. Prases and Dayal [8] used a cuckoo search algorithm for optimal path planning and obstacle avoidance in a mobile robot. Medjahed et al. [9] applied acuckoo search algorithm to improve traditional hyperspectral image VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ classification techniques. Nie et al. [10] established a multiskill human resource scheduling model, where a cuckoo search algorithm was used to allocate labor force time and resources. He et al. [11] used a cuckoo search algorithm to optimize a semi-supervised SVM for oil layer identification, which improved recognition rates and shortened recognition time by comparison to other methods. Yang et al. [12] applied a cuckoo search algorithm in a Kriging model to optimize fixture positioning layouts. The cuckoo search algorithm step size control factor is a fixed constant, which causes the algorithm to converge slowly and fall into local optimal solution prematurely. Wang et al. [13] adopted an improved cuckoo search algorithm to solve the flow-shop scheduling problem, where a Nawaz-escort-ham (NEH) method was used to population initialization and a generalized opposition learning method was used to accelerate the convergence rate; this approach is effective but yields a highly complex algorithm. Ma et al. [14], Yang and Deb [15] proposed a dynamic adaptive cuckoo search algorithm which uses an adaptive step control to increase the cooperation among subgroups, improve the convergence speed, and increase the optimization accuracy.
There have been many other valuable contributions to the literature. Xia et al. [16] proposed a piecewise continuous function to limit the speed and acceleration in a robot trajectory planning process and did succeed in truncating the running time compared to traditional methods. However, the calculation was overly complex and computationally burdensome. He et al. [17] adopted an immune algorithm to simultaneously optimize the time and energy of a robot, but optimizing multiple goals at the same time is timeconsuming. Chen et al. [18] used a harmony search algorithm to optimize a five-degree b-spline curve, and obtained a smooth and time-optimal trajectory, but the trajectory was not sufficiently smooth compared to the piecewise polynomial interpolation function. Verscheure et al. [19] adopted a convex optimization method to transform the time-optimal path tracking problem into a convex optimal control problem, which is effective but also costly in terms of the complexity of the solution process. Wang et al. [20] proposes a new algorithm named trajectory-planning beetle swarm optimization (TPBSO) algorithm for solving trajectory planning of robots. Kim et al. [21] presented a method for online trajectory planning that is computationally efficient, time-optimal, and maintains path following integrity.
This paper proposes a time-optimal 3-5-3 polynomial interpolation trajectory planning algorithm based on the cuckoo search algorithm under a velocity constraint. The UR robot was taken as the research object and the polynomial interpolation function was determined based on robot kinematics analysis. The improved cuckoo search algorithm adjusts the size of the control factor as iterations progress rather than using a fixed control factor. The improved cuckoo search algorithm can optimize interpolation time under the speed constraint and determine the quickest trajectory of the robot accordingly. Thus, the time uncertainty problem can be solved under a series of constraints (e.g., position, velocity, and acceleration). The proposed algorithm was validated in a series of simulations and by comparison against other stateof-the-art algorithms, as discussed in detail below.

II. ROBOT KINEMATICS ANALYSIS
Kinematics analysis is the basis of trajectory planning. When the robot is working, it is necessary to obtain the displacement of each joint based on the position and posture of tool at the end of the robot so as to achieve the specified position. The connecting rod coordinate system of the UR robot tested in this study was established according to the rules of the connecting rod coordinate system [22], as shown in Figure 1, with the D-H parameters shown in Table 1.   VOLUME 8, 2020 The transformation matrix between ith and i − 1th links of robot i−1 i T is: According to the given D-H parameters, the transformation matrix 0 1 T of the first link can be obtained as follows: 3 4 T , 4 5 T , 5 6 T can be obtained similarly to T . The transformation matrix of each link can then be multiplied in turn to obtain the transformation matrix between the end of the robot. The base coordinates 0 6 T can be obtained by multiplying the transformation matrix of each link in turn.
The mechanism of UR robot satisfies the Pieper criterion [23]:Three consecutive revolute joint axes intersect at a common point or three consecutive revolute joint axes are parallel. So its inverse kinematics solution has a numerical solution. The forward kinematics solution can be used to obtain the inverse kinematics solution analytically.
The solutions of joint angles θ 1 θ 5 and θ 6 can be obtained as follows.
Equation (3) can be rewritten as follows: Because the elements of the third row and fourth column on the left and right sides of Equation (4) are equal to each other, the following formula holds: where: The elements of the third row and third column on the left and right sides of Equation (4) are also equal to each other, so where s 1 = sin θ 1 , c 1 = cos θ 1 . Further, the elements of the third row and first column on the left and right sides of Equation (4) are equal to each other, so The solutions of joint angles θ 2 θ 3 θ 4 can be obtained as follows. Equation (3) can be rewritten as: The following relationships can be obtained because the right and left sides are equal (corresponding to elements in Formula (5)): The analytic expressions of the inverse kinematic solutions are then given.

III. POLYNOMIAL INTERPOLATION FUNCTION CONSTRUCTION
The commonly used cubic polynomial interpolation trajectory planning algorithm may produce mechanical vibrations, a simulation of cubic polynomial interpolation trajectory planning for robot was carried out as is shown in the Figure2. It can be found that the position curve and velocity curves are continuous, but the acceleration curve has obvious mutation. This phenomenon will cause mechanical vibration and friction, this is bad for robots, so 3-5-3 polynomial interpolation method is adopted in this paper.
To complete the specified motion of the robot in joint space, the joint angles can be solved via inverse kinematics VOLUME 8, 2020 solution as per the starting point, dropping point, and end point positions corresponding to the polynomial interpolation function. This makes the robot end pass through the required path point to satisfy the given trajectory. The 3-5-3 polynomial interpolation method is adopted in this study is as follows: where a imn represents the nth unknown coefficient of the interpolation trajectory of the ith joint in the mth (m = 1, 2, 3) polynomial trajectory segment; h im (t) Represents the mth trajectory segment of the ith joint and t is the time variable.
In the trajectory planning process, it is necessary to satisfy constraints regarding the position, velocity, and acceleration of the starting point θ i1 , lifting starting point θ i2 , descending point θ i3 , and end point θ i4 . Constraint conditions include the following.
1) The positions of the four interpolation points are known; 2) The velocity and acceleration of the starting point are 0; 3) The velocity and acceleration of the end point are 0; 4) The velocity and acceleration of the starting point and descending point are continuous.
The unknown coefficient can be deduced according to Equations (7)-(9) under these constraints. Equation (7) is the matrix of the interpolation time t i1 , t i2 , t i3 of the ith joint, Equation (8) is the position matrix of the joint angle, and Equation (9) is the coefficient matrix.
where A, B, C, D, E, F, G, H are: and a 1 = a i13 a i12 a i11 a i10 a 2 = a i25 a i24 a i23 a i22 a i21 a i20 a 3 = a i33 a i32 a i31 a i30 .

IV. TIME-OPTIMAL PROBLEM BASED ON IMPROVED CUCKOO SEARCH ALGORITHM A. TRADITIONAL CUCKOO SEARCH ALGORITHM
The Cuckoo Search (CS) is a natural meta-heuristic algorithm proposed by Yang and Deb in 2009 inspired by the avian breeding process [24]. The algorithm solves complex problems quickly and effectively by combining the Levy flight random search method. For a straightforward description of the standard CS, the following three idealized rules are introduced: 1)In a randomly selected nest, a cuckoo produces only one egg at a time; 2)The best nests with good eggs are preserved for the next generation; 3)The number of available nests is constant, and the probability of cuckoo eggs being found by the host is P a . In this case, the host can destroy the egg or abandon the old nest and build a new one.
On the basis of these three ideal states, the specific steps of cuckoo search algorithm are as follows.
1) The population size, discovery probability, and the termination conditions are initialized.
2) The objective function value of the initial population is evaluated to find the current global optimal nest.
3) Low-quality nests are weeded out according to the probability that their eggs will be found. 4) Low-quality (high detection probability) nests are replaced with new nests created by Levy's flight: where x t i represents the location of the ith nest in the tth generation, α represents the step size control factor, and L (λ) represents Levy-flight random search paths.
5) The best nest will be found again in the updated nest data.
6) If the termination condition is satisfied, the best nest is the optimal solution found so far. Otherwise, return to Step 3.

B. IMPROVED CUCKOO SEARCH ALGORITHM
Although CS algorithm has been applied and studied in many fields, it still has some defects. The Levy's flight randomness is large, so the standard CS algorithm lacks an effective mechanism to enhance the search depth and the algorithm's convergence accuracy is relatively low. The step size control factor of the CS algorithm is defined in Equation (10) as an artificial constant; if it is too large, the search value of the algorithm will yield a poor solution in the later stages of operation while slowing down its convergence rate. If it is too small, the algorithm may fall into the local optimal solution too early, i.e., perform poorly overall. In this study, the CS algorithm was improved by targeting the step size control factor a: the original (fixed) one was replaced by an adaptive one.
The value range of α decreases in each evolutionary generation. In the early stages of the algorithm, large step size control factors can be used to quickly find the region of highquality solutions in the global range. The step size control factor is then gradually reduced as the iterations progress while conducting a detailed search of the local high-quality solution region, which enhances the convergence speed and performance of the algorithm.
The proposed expression of step size control factor α is: The value of α min was set as 0.01 [25] in this paper, In order to find the appropriate value of α max , the parameter α max was set to 0.4, 0.5, 0.75 and 1 respectively, other parameters unchanged, the first joint optimization time was taken as the objective function. The first joint optimization time of different α max is shown in table 2, when the test run 15 times.
We can find when α max = 0.5, variance value and the running time are minimal and the average value is acceptable, so we choose α max = 0.5 as the most appropriate value of parameter α max . where T is the ratio between the current number of iterations and the total number of iterations, α min is the lower limit of step size control factor, t max is the maximum number of iterations, and t i is the number of current iterations.
In order to find the appropriate time segment of T, Rastrigin Function was chanced as the testing function, generations is 300, and run 30 times. the testing results of different sections are shown in Table 3. It can be seen that the solution accuracy is the highest when 0.35-065 is the segmentation boundary, and the difference in running time is not big, so 0.35-0.65 is chosen as the dividing line.
In the initial phase of the algorithm when T < 0.35, the global search should be performed with large strides. The algorithm may reach its best update state in the middle phase, when 0.35 ≤ T ≤ 0.65. At this time, it should further search in the region where the high-quality solution is located and strengthen the local refined search while α has the same value. At the later stage, when T > 0.65, a smaller step length should be used to search for the optimal value.
If the unknown coefficient a imn is selected as the objective function to be optimized, the optimized dimension of the improved CS algorithm is 14. This makes finding the optimal value very difficult. Taking the three interpolation times t i1 , t i2 , and t i3 of the ith joint as the objective function greatly reduces the search dimensions and makes the computation simpler. The objective function to be optimized serves to minimize the running time of each joint under the constraint of velocity: where v i is the real-time velocity of polynomial trajectory segment and v i max is the restricted velocity of joints.
The algorithm flow is shown as follows: 1) The population size, discovery probability, and the termination conditions are initialized.
2) The objective function value F i = f (X i ) of the initial population is evaluated. VOLUME 8, 2020 3) Levy flight random walk mechanism is used to generate new nest locations X j ,based on Equations (10)- (11). 4) Evaluate the fitness value F j = f X j of the new nest location.
If f X j < f (X i ) Replace the original location nest with a new nest location, Otherwise, keep it in the same place. 5) If the termination condition is satisfied, the best nest is the optimal solution found so far. Otherwise, return to Step 3.

C. TIME-OPTIMAL TRAJECTORY PLANNING BASED ON IMPROVED CS
The step-wise process of the time-optimal trajectory planning process for the robot's ith joint based on the improved CS algorithm is as follows.
1) Initialize the population by determining the number N of host nests and the probability p a of a cuckoo egg being found. The location of the nest is randomly generated in the time-interpolated search space.
2) Solve the unknown polynomial coefficient by plugging the N groups of time variables t i1 , t i2 , and t i3 into Equations (7)- (9).
3) Validate the constraint by plugging the polynomial coefficient (Step 2) and the corresponding time variable into the derivative of Equation (6) to obtain the real-time joint velocity. Judge whether the velocity conforms to the constraint of Equation (13). 4) Calculate the fitness value. Screen the results of Step 3. If the velocity value is greater than the constraint value, the nest will be considered low-quality and eliminated according to its probability of discovery. If the velocity value is less than the constraint value, Equation (12) is taken as the objective function and the improved CS algorithm is used for iterative operation over the shortest possible interpolation time.
5) Produce a new nest based on the improved CS algorithm iteration.
6) Judge the final conditions. If the termination condition is satisfied, the algorithm operation ends; otherwise, return to Step 2.

V. SIMULATION VERIFICATION AND RESULTS ANALYSIS A. TIME-OPTIMAL TRAJECTORY PLANNING RESULTS
Take the polishing work of denim fabric polishing robot as an example, the speed limit of the denim polishing robot in the grinding process, the safety and efficiency of robot operation should be considered. The speed limit depends on the speed of polishing tools when polishing the fabric manually and convert this velocity to joint space velocity. then we set the speed limit to 35 • /s The position and posture information of the robot end is shown in Table 4; the first three values in the path point are position information and the last three are posture information. According to this information, interpolation points in Cartesian space can be converted into joint space angle interpolation points via inverse solution. The corresponding angles of each joint at each path point are shown in Table 5. Each interpolation time is artificially given with uncertainty for the traditional 3-5-3 polynomial interpolation, which affects the operation efficiency. The position, velocity, and acceleration curves of each joint motion with interpolation time of 5 s are shown in Figure 2.  The improved CS algorithm was used to solve the optimal time of the 3-5-3 interpolation polynomial method with the velocity constraint. The solving of Joint 1 optimal time is 86928 VOLUME 8, 2020   reported here as an example. The initial population of the bird nest was set to 15 in this case, the probability of cuckoo eggs being found was 0.25, the search optimization was carried out in the 3D solution space, the initial particle position was any random number within 0.1 to 5, the value range of the step size control factor was 0.01-0.5, and the number of iterations was 100.
The proposed improved CS algorithm was compared against the CS algorithm, particle swarm optimization (PSO), and genetic algorithm (GA) to obtain the optimal particle evolution diagram shown in Figure 6. The GA optimization capability is poor compared with other three algorithms and it has a longer minimum running time. The PSO converges   quickly, but its solution accuracy is poor compared with the ICS or CS. The CS converges after about 90 iterations, while the ICS converges after about 30 iterations; in effect, the improved CS algorithm proposed here has better solution accuracy and faster convergence speed than the other algorithms we tested. Figure 7 shows a comparison of the running time of the four algorithms. The running environment in this case was Windows 764-bit, processor: Intel (R) core (TM) i5-3210M, CPU frequency: 2.50GHz Memory:4GB, Software: MATLAB2016b.
The four algorithms were run 15 times independently. The average running time of GA was 1.8791 s, that of the PSO was 2.8531 s, the CS was 1.5265s, and the ICS was 1.4957 s, as is shown in Table 6.
The improved CS algorithm, in other words, very quickly solved the problem of the optimal 3-5-3 interpolation polynomial time under the velocity constraint.
Then the improved CS algorithm was also used to obtain the optimal time of each segment of other joints. The results are shown in Table 7. VOLUME 8, 2020 Since the joint motion of the robot has time synchronization, Max (t i1 ) = 3.8190 s, Max (t i2 ) = 2.9135 s, and Max (t i3 ) = 3.3355 s were selected as the maximum interpolation time of each segment. Compared with the unoptimized 3-5-3 interpolation polynomial, the interpolation time was reduced by 4.932 s.    unoptimized position curve is not much different from that of the optimized curve. The optimized joint speed has increased but not exceeded the limit speed compared to the nonoptimized speed curve, and tends toward the limited speed. This suggests that the proposed method is correct, but further, that it improves the robot's work efficiency while ensuring safety. Figure 11 shows the trajectory curve of the robot end with the optimal 3-5-3 polynomial interpolation optimized by the improved CS algorithm. The motion trajectory of the robot end passes through the given interpolation point smoothly, which further validates the proposed algorithm.

B. ROBUSTNESS TEST RESULTS OF THE ICS
The improved cuckoo search algorithm presented in this paper can be used on different velocity and acceleration conditions by setting different limitations on velocity. as below: Taking the motion of the first joint as an example, the solving ability of the algorithm under different speed constraints is verified. The Table8 shows the optimization time and total time of each section obtained by using the improved cuckoo algorithm under different speed constraints. figure12 shows the change curves of position, speed and acceleration under different speed constraints. According to the figure, the algorithm can be used under different speed constraints. In order to test the anti-interference ability of the ICS, taking the first joint as an example, add perturbations to the interpolation points, as shown in the following Table. The total optimization time of the first joint is 7.4005s by using the improved cuckoo optimization while consider the disturbance, as is shown in Figure13., the optimal time of  each segment t1 = 2.8537s, t2 = 1.4775s, and t3 = 3.0692s as is shown in Figure14. the comparison result is shown in Table 10.    We can find there was only a slight change in the two situations. Then, combined the 3-5-3 polynomial interpolation the curves of position, velocity and acceleration can be obtained as shown in figure 15.16 and 17. We can find that the speed curve does not exceed the speed limit. In addition, it is found that the algorithm has better anti-interference ability by testing other joints.

VI. CONCLUSION
This paper presents an improved CS algorithm where the step size control factor serves as a variable constant and changes with the number of iterations. This improves the convergence speed of the original cuckoo search algorithm and prevents falling into the local optimal solution prematurely, which is the case when the step size control factor is fixed.
The interpolation time of each segment is uncertain in the traditional 3-5-3 polynomial interpolation, which adversely affects the working efficiency, mechanical wear, and production safety of the robot in which it is applied. In this study, we developed a time-optimal trajectory planning method based on an improved CS algorithm in joint space with velocity as the constraint condition. Compared with CS, PSO, and GA techniques, the proposed algorithm performs better robot time optimal trajectory planning according to MATLAB simulations based on the UR robot as an example. After optimization via the proposed algorithm, each joint of the robot runs smoothly, and each joint satisfies the speed constraint. Its speed and acceleration are continuous and smooth at the interpolation time point, while the running time is greatly shortened, and operating efficiency is improved compared to other algorithms. And the improved CS algorithm has good anti-interference ability and the adaptability. These results indicate that the proposed algorithm has high practical value.

VII. FUTURE WORK
We will use the trajectory planning method proposed in this paper to test the performance of this method and lay a foundation for the actual product development in the next physical experiment of denim fabric polishing robot.
QING TAO received the B.S. degree in automation from the Liren College, Yanshan University, Hebei, China, in 2017. He is currently pursuing the M.S. degree in control engineering with Xi'an Polytechnic University, China.
His research interests include robot dynamics, trajectory planning, and control system design.
YUTING CAO received the B.S. degree in automation from the Changzhou Institute of Technology, Changzhou, China, in 2017. She is currently pursuing the M.S. degree in control engineering with Xi'an Polytechnic University, China.
Her research interests include robot dynamics, trajectory planning, and control system design.
XIAOHUA WANG was born in Baiquan, Heilongjiang, China, in 1972. She received the B.S. and M.S. degrees from Xi'an Polytechnic University, Xi'an, China, in 1997 and 1997, respectively, and the Ph.D. degree in mechanical engineering from the Xi'an University of Science and Technology, Xi'an, in 2010.
Since 1997, she has been a Teacher with Xi'an Polytechnic University. Since 2006, she has been a Professor with the College of Electrics and Information, Xi'an Polytechnic University. She is the author of four books and more than 40 articles. Her research interests include supervisory control of discrete event systems, system dynamics, and innovation linear and nonlinear systems.
XU ZHANG is currently pursuing the bachelor's degree with Xi'an Polytechnic University, China.
His research interests include robot dynamics, trajectory planning, and control system design. VOLUME 8, 2020