Punching trajectory optimization method for warp-knitted vamp based on improved ant colony optimization algorithm and Radau pseudospectral method

Aiming at the problems of complex trajectory, low efficiency and high operational difficulty of the robot in multi-point punching of warp-knitted vamp, a method of optimizing punching trajectory based on improved ant colony optimization algorithm and Radau pseudospectral method is proposed. After obtaining the position coordinates of punching points, an improved ant colony optimization algorithm is used to calculate the punching sequence of the shortest path through all punching points, and then Radau pseudospectral method is used to solve the optimal trajectory of the laser punching robot. Improved ant colony optimization algorithm combines a distributed calculation method and the positive feedback mechanism. Radau pseudospectral method can transform the optimal control problems into nonlinear programming problems, and the combination of the two can quickly and reliably obtain the optimal solution. To verify the method, under the condition of selecting the same number and location of punching points, the experiments of Radau pseudospectral method to solve the trajectory planning of laser punching robot is carried out. The experimental results show that improved ant colony optimization algorithm can calculate the path of the vamp punching point in a shorter time and with high accuracy. Radau pseudospectral method can obtain smooth trajectories satisfying various constraints, which can meet the requirements of accuracy and efficiency in practical production.

insufficient punching accuracy, low yield, and low processing efficiency. The traditional manual punching method has quite obvious disadvantages, such as low punching efficiency, poor punching accuracy, large processing limitations, huge personnel costs, and can only process simple warp-knitted vamps. Although the use of molds for punching can improve punching accuracy and efficiency to a certain extent, different molds need to be used for different shoe types, and there are disadvantages such as long mold production cycles and high costs. With technological innovation and increased demand, traditional methods are far from being able to meet today's manufacturing intensity and requirements. Therefore, it is necessary to design more intelligent methods to improve performance to meet various needs. The punching robot can well solve the disadvantages of the previous punching problems, can effectively reduce the labor cost, and improve the efficiency and accuracy of punching. Therefore, the research on the punching trajectory planning of warp-knitted vamp is of great significance.
In the context of "Industry 4.0," the high-end shoe manufacturing industry is also facing an intelligent transformation, of which warp-knitted vamp punching motion planning is a key component, that is, the laser punching robot calculates the optimal or approximate optimal trajectory from an initial position to the final position according to the objective function in the set condition model. 1 The trajectory planning of the laser punching robot is mainly divided into two parts: the punching sequence planning and the optimal control of the punching robot. In the multipoint sequence planning, the mainstream calculation methods are exhaustive method, 2 greedy algorithm, 3 genetic algorithm, 4 and Improved ant colony optimization algorithm. 5 Greedy algorithm is a classic heuristic algorithm, 6 but the "greedy" feature of the algorithm makes the planning choose the shortest edge in the early stage and be forced to choose the longer edge in the late stage, resulting in that the final solution is not the global optimum 7 ; Improved ant colony optimization algorithm is an oddsbased algorithm to find the optimal path in multi-objective points, 8 it can solve the combinatorial problem effectively. 9 The algorithm contains a similar density function to represent the number of pheromones, and finally determine whether it is the optimal solution, so that the search for the optimal location is a positive feedback process, 10,11 which is beneficial to improve efficiency.
The pseudospectral method can convert the optimal control problem into a general nonlinear programming problem, [12][13][14] commonly known as Gauss pseudospectral method, 15 Legendre pseudospectral method, 16 and Radau pseudospectral method. 17 Generally, pseudospectral method is divided into h method and p method. 18 The process is segmented by h method, and the accuracy is improved by increasing the number of segments. 19 The p method is solved by increasing the polynomial number. 20 These two methods can amplify errors and affect the accuracy of results in practical applications. 21 The researchers proposed hp-adaptive Radau pseudospectral method and applied it to solve optimal control problems, 22,23 which combines the advantages of h method and p method and substantially improves efficiency of calculation and accuracy of solutions.
In this paper, Improved ant colony optimization algorithm and Radau pseudospectral method are proposed to optimize the multi-point punching trajectory of warp-knitted vamp. The characteristics, accuracy, and calculation process of Improved ant colony optimization algorithm and Radau pseudospectral method are analyzed. Finally, Matlab software is used for simulation to obtain the optimal trajectory of punching robot.

Punching motion model
The laser punching robot works in planar motion, mainly in X-direction and Y-direction of the control torque to produce a punching trajectory that meets the constraints, and the laser punching is carried out when moving through the target punching point. The kinematic equation is as follows: where x and y are the abscissa and ordinate of the laser punching robot moving on the plane respectively; v x and v y represent the velocities of punching robots in Xand Y-direction respectively; u x and u y are control torque in Xand Y-direction respectively. Since the punching robot in this problem must pass through the fixed punching point, for the optimal trajectory with end constraints in multiple intervals, this paper selects the state variable X = [x y v x v y ] T and the control variable U = [u x u y ] T to obtain the state equation constraint:

Optimal punching trajectory problem
In the process of punching, considering the shortest punching time and the least robot consumption, the number of warp-knitted vamp punching points is assumed to be n, and the objective function is defined as follows: where In the formula, t 0 is the initial time of phase p and t f is the termination time of this phase. Boundary conditions can be obtained from the state vector t 0 , t f at different phases as follows: x t y t x y p where (x 0 ,y 0 ) (p) is the coordinates of the pth punching point; (x(t 0 ), y(t 0 )) (p) , (x(t f ), y(t f )) (p) is the position boundary value of the initial moment and termination on the interval (t f ) are the velocity boundary values at the initial moment of phase 1 and the termination of the final phase respectively.
For the connection points between different phases, do the following constraints: Through the above dynamic equations, objective functions, and constraint conditions, the optimal control problem of Bolza performance index is formed, and the optimal trajectory of punching robot is solved.

Basic principles
Classical ant colony algorithm is a heuristic improved algorithm, 24 which is an optimization algorithm generated by simulating the ant colony path planning behavior when ants collectively search for food in nature. The path between the ant colony and the food is usually a straight line as the ants search for food around the nest, thus showing that the colony has a strong ability to find the best.
Ants leave pheromones along their path of movement. The higher the information concentration is, the shorter the path is. Ants will choose the path based on the concentration of pheromones. The higher the concentration is, the greater the tendency of selection is. This positive feedback mechanism results in ants eventually choosing the shortest path to realize path planning. 25,26 Assuming that the number of ants in the colony is m, and d ij (i, j = 1, 2,. . ., n) represents the distance between punching point i and j. Each punching point is accessed only once in an iteration, and the visited pouching points are stored by establishing a "tabu list" to avoid repeated access.
The probability Q of the ant k (k = 1, 2,. . ., m) moving from punching point i to punching point j in the operation of the algorithm can be calculated by equation (7): where τ ij (t) is the pheromone concentration between the punching point i and j; η ij (t) is the expected heuristic from the punching point i to the punching point j, and its value is 1/d ij ; A k is a collection of punching points that ants can choose next; α is the information heuristic factor, indicating the degree of pheromone concentration affecting the transfer probability Q during calculation; β is the expected heuristic factor, indicating the extent to which the transition probability P is affected by the distance between the punching point i and j. Ants release pheromones as they move, but they also volatilize over time, so pheromone concentrations need to be updated after calculating the length of each ant's path, recording the shortest length and path sequence. Firstly, the remaining pheromone concentration after volatilization was calculated, and then the pheromone concentration released during this journey was calculated as shown in equation (8): where ρ is the evaporation factor of pheromone.
In this formula, ∆τ ij k is the increment of pheromone concentration left by the kth ant at the end of this iteration in the path it has passed through, which can be calculated according to equation (10): where Q is a constant; l k is the path through which the ant k travels in this cycle and L k is the length of the path. In this paper, the Ant cycle model is selected, which updates the pheromone concentration in the travel uniformly after all ants visit all the punching points. 27 The Ant cycle model outperforms the other two models: the Ant density model and Ant quantity model which update the pheromone concentration after moving one time between two punching points. 28 Strategies for adaptively changing the value of ρ When the problem scale is large, due to the existence of pheromone volatilization coefficient ρ, the number of pheromones of some solutions that have not been searched will be reduced to close to 0. Although it can be improved by reducing ρ value, it will also reduce the convergence speed. Therefore, an improved strategy can be adopted to adaptively change the ρ value. 29,30 ρ λ λ ( ) ( ) n sigmoid n e n = = + − 1 1 (11) In this paper, the saturation activation function sigmoid is used to control the pheromone volatilization coefficient ρ, where ρ(n) is the pheromone volatilization coefficient after n cycles, and 0 < ρ(n) < 1; λ is the limiting coefficient, and λ < 0; n is the number of cycles; According to the above formula, ρ(n) decreases with the increase of the number of iterations. When the pheromone volatilization coefficient ρ can adaptively adjust its own value, the convergence speed of the algorithm will be significantly improved to avoid the algorithm falling into local optimization.

Strategies for adaptively changing the value of τ
The Improved ant colony optimization algorithm uses the positive feedback principle to strengthen the performance of the solution, but it is prone to stagnation. Therefore, the number of pheromones on the path needs to be dynamically adjusted. An adaptive Improved ant colony optimization algorithm aims to narrow the gap between the number of pheromones on the optimal and worst paths, and conduct global search on the solution space to improve the global search ability. 31 The pheromone update formula is: Where, f(x) = log(1 + e cn ),n is the number of convergence; c is a constant; Therefore, the more times of convergence; The greater the value of f(x). The number of pheromones is updated adaptively, and the number of pheromones on each path is dynamically adjusted at the same time, so that the ants are neither too concentrated on a path nor too scattered, so as to avoid the situation of premature and local convergence and improve the global search ability.

Program calculation process
In the punching process of warp-knitted vamp, the program flow chart of Improved ant colony optimization algorithm is shown in Figure 1, which is described as follows: (1) Initialize the program and set parameters, including the number of ants, punching point position matrix, information heuristic factor, expected heuristic factor, pheromone volatilization factor, the number of iterations, etc. (2) Iterate to find the best path and randomly generate the starting punching point of each ant. According to the probability formula, the next point of the roulette method is calculated, and the visited punching points are added to the tabu list. (3) Calculate the shortest path and average path during this iteration, update the pheromone concentration, and empty the tabu list. (4) Repeat the above process until the initial set number of iterations is reached, and the optimal solution and calculation time are obtained.

Multi-interval Radau pseudospectral method
In the laser punching work, since the robot's trajectory needs to pass through known vamp punching points for laser punching, it is a multi-interval optimization problem, and the starting and ending positions of each interval are fixed. In this paper, the multi-interval Radau pseudospectral method is used to solve the optimal control problem of the punching robot. The discrete points are matched based on Legendre-Gauss-Radau (LGR) points. 32 Since there are n punching points on warp-knitted vamp, the robot punching trajectory is divided into n intervals for calculation. Each interval is S p = [t p−1 , t p ] (p = 1, 2,. . ., n), and any time on each interval is transformed into the interval τ ∈ [−1, 1] by equation (11).
On each interval S p , N p LGR nodes, and boundary points τ p N p ( ) + = 1 1 are set to discrete the continuous optimal control problem. Each node on the interval is obtained by finding the roots of P N−1 (τ) + P N (τ) = 0 using Legendre polynomials. Using the generated N p + 1 node and selecting the Lagrange polynomial for approximation, the N p -order approximate expression for the state variable on the interval S p is where For the control variables, N p LGR points are selected for approximation, and the expression is The optimal control problem of the laser punching robot can be discretized into a nonlinear programming problem through the above process, and the discrete objective function is where ω i (p) is the weight of the LGR. The discrete state equation and continuity condition are as follows: where D ij (p) is the Radau pseudospectral differential matrix of p-interval, which is calculated by equation (18)

Punching path planning results and analysis
In this paper, the coordinates of punching points are extracted from warp-knitted vamp shown in Figure 2 respectively, and Matlab software is used. Firstly, exhaustive method, greedy algorithm, particle swarm optimization and improved ant colony optimization algorithm are selected. The path planning experiments are carried out under the same conditions and the same environment. Multiple groups of experiments are repeated, and the average value of the results is compared. Then, the optimal punching sequence obtained from the vamp is selected to solve the optimal trajectory of the punching robot. The experimental environment is macOS Mojave 10.14.3 operating system, 2.2GHz Intel Core i7 processor, 8G RAM and MATLAB_R2018a programming environment. The path of manual punching is shown in Figure 3. It can be seen from Figure 3 that when the worker punch holes, the choice of holes is disorderly and there are many worthless paths in the path. After the optimization of the three algorithms mentioned in this paper, the punching efficiency of the punching robot will be greatly improved.
The path optimization results of improved ant colony optimization algorithm are shown in Figure 4. The blue point in the figure is the punching point.
For punching points on five warp-knitted vamp; the optimal solution of punching sequence is obtained after using exhaustive method for its punching planning; after using improved ant colony optimization algorithm for its planning, the results of the punching sequence are the same as the optimal solution obtained by exhaustive method; after using greedy algorithm for its planning, although the operation time is the shortest, the path results obtained are not consistent with the optimal solution obtained by exhaustive method. Table 1 shows the result and operation time of the three algorithms, and Figure 5 shows the comparison result of artificially selected path and algorithm optimization path.
In the calculation process of the above three algorithms: exhaustive method obtains all punching sequences through full permutation, and the path length of each sequence is compared to select the optimal value; the starting point of improved ant colony optimization algorithm is randomly selected, and the shortest optimal value of the path is selected from the punching sequence formed by different starting points. Therefore, these two algorithms do not need to consider the selection of punching starting points.
In greedy algorithm, the starting point should be given artificially, and the result can be obtained by greedy search afterward, so the selection of the starting point has a certain influence. Figure 7 is the optimization results of five different punching starting points of sample 3.
The shortest path obtained in Figure 7(a) is 1196.0452 mm; the shortest path obtained in Figure 7(b) is 1229.9577 mm; the shortest path obtained in Figure 7(c) is 1140.1293 mm; and the shortest path obtained in Figure  7(d) is 1119.4134 mm. Thus, the selection of the starting point of punching has a great influence on the optimization results of greedy algorithm, which will make greedy algorithm appear local optimal solution and affect the efficiency of punching work.
In the path planning of warp-knitted vamp punching, the results obtained by improved ant colony optimization algorithm are basically consistent with the optimal solutions listed by exhaustive method, and the results obtained by greedy algorithm are too large; on the basis of the optimal punching sequence of sample 3 obtained by improved ant colony optimization algorithm, the optimal control problem of the punching robot is transformed into a general nonlinear programming problem by using the multiinterval Radau pseudospectral method, and the optimal trajectory of the robot in the working process is obtained. The GPOPS-II software is used to solve the problem described in this paper, and the simulation results are shown in Figures 8 to 11.    Figure 8 shows the working trajectory of the punching robot obtained by solving. It can be seen that the punching robot works according to the optimal punching path shown in Figure 2(c), and passes through the punching position specified in the vamp in strict accordance with the constraints. The trajectory does not pause when punching at each punching point, and passes through the required punching coordinate points one by one by a smooth curve trajectory. The existing punching robot needs to remain stationary at each punching point, and the frequent start and stop increase loss and working time of the robot. Figure 9 shows the velocity curve of the punching robot during its motion, which shows that the velocity change is relatively small and consistent, which satisfies the constraint that the starting and ending speed is zero. Figures 10 and 11 show the acceleration curves of the robot in Xand Y-direction. From the figures, it can be seen that the change rate of acceleration is relatively stable in the same stage, which is easy to realize the control of the robot, ensure the stable acceleration and deceleration of the robot in the motion, and reduce the vibration of the body during the working process.
In summary, the calculation process of improved ant colony optimization algorithm saves a lot of time compared with exhaustive method in solving the punching sequence of punching robots. Therefore, improved ant colony optimization algorithm obtains the optimal solution with good accuracy, high efficiency and strong global searching capability. In solving the trajectory of the robot, the curve trajectory obtained by the multi-interval Radau pseudospectral method improves the consistency of the punching robot movement, and enhances the punching efficiency and the robot life.

Conclusion
In this paper, aiming at the problems of low punching accuracy and poor efficiency of warp-knitted vamp, we propose an algorithm optimization method, including improved ant colony optimization algorithm to solve the punching sequence and Radau pseudospectral method to solve the optimal control problem. The advantages and disadvantages of different algorithms applied to solve punching paths are compared, and the optimal trajectory planning of the robot is carried out for the optimal path, and the specific conclusions are as follows: (1) In the calculation process of punching sequence, the solution of greedy algorithm is based on the selection of local optimal solution, which has limitations in the multi-point punching path planning of the vamp and is easy to obtain non-optimal The parameter settings of the Improved ant colony optimization algorithm are: the number of ants is set to 100, the pheromone importance factor is set to 1, the heuristic function importance factor is set to 1, and the maximum number of iterations is set to 100; the particle swarm algorithm parameters are set to: The number of particles is set to 81, the evolution algebra is set to 800, and the weight is set to 0.9. Greedy algorithm and exhaustive algorithm simply calculate the distance between points, and there is no optimized parameter setting. The convergence curves of the Improved ant colony optimization algorithm and the Particle swarm optimization algorithm are shown in Figure 6. Among them, the ordinate based on the improved ant optimization algorithm is marked by distance, and the ordinate of particle swarm optimization algorithm is marked by the global optimal fitness value (adaptability).   solutions. The calculation efficiency and accuracy of improved ant colony optimization algorithm are greatly improved compared with greedy algorithm.
The optimal solution obtained by improved ant colony optimization algorithm and exhaustive method is basically the same, and greedy algorithm obtains the result for local optimal solution. (2) The optimal control problem of the punching robot is transformed into a nonlinear programming problem by using the multi-interval Radau pseudospectral method. With the shortest time and the least consumption as the objective function, the obtained trajectory curve satisfies all constraints and increases the continuity of the work, reducing the consumption of frequent start during the movement.
Overall, improved ant colony optimization algorithm and multi-interval Radau pseudospectral method are suitable for multi-point punching on warp-knitted vamp, which can significantly improve the overall efficiency. With further research, it is expected to further improve the accuracy of path planning by combining other optimization algorithms with improved ant colony optimization algorithm and analyzing the optimized objective function.