# Time-Optimal Trajectory Planning for Woodworking Manipulators Using an Improved PSO Algorithm
## 1 Introduction  
Wood processing, as a follow-up industry to forest harvesting and transportation, is a key step in enhancing the synthetic utilization rate of wood in the forestry sector [1, 2]. Compared to other industrial fields, the wood processing industry has a relatively late start-up and slow development, and with the increasing demand for wood products, advanced processing machinery, such as multi-axis CNC, industrial robots, and manipulators, are urgently needed to improve mechanization and automation levels in wood processing [3, 4, 5, 6]. Manipulators are widely used in related industries such as mechanical manufacturing, electronic and electrical, food manufacturing, and aerospace manufacturing [7, 8, 9]. They are designed to replace workers for tasks requiring high repeatability, high execution difficulty, and low safety. With the expansion of its application scope, it will likely bring unprecedented efficiency and quality to other production and manufacturing industries. Therefore, applying manipulators to wood processing improves processing efficiency, safety, product quality, reduces labor costs and create more value. Woodworking manipulators are convenient, which can realize the free movement and rotation of four-head high-speed electric spindles in the workspace to drill and mill wooden structures. However,their unstable operation and long running times pose challenges to the wood processing process, leading to high accident rates and poor efficiency [10; 11]. Appropriate trajectory interpolation algorithms can improve manipulator's operational stability, and the use of intelligent optimization algorithms for time-optimal trajectory planning can improve the manipulator's efficiency. Thus, trajectory planning and time optimization are crucial to improving the security of operation and shortening the running time of woodworking manipulators. These improvements will enhance the machining efficiency and quality of wood processing [12]. Trajectory planning is an important prerequisite step in manipulator's control system, which includes kinematic modeling of the manipulator, forward and inverse kinematic analysis, trajectory interpolation algorithms, trajectory optimization, and simulation. It significantly impacts the energy consumption, service life, and production efficiency of the manipulator, which determines whether the manipulator's terminals can accurately and fast pass through specified path points and obtain a smooth trajectory [13; 14]. According to different methods of describing motion states, there are two typical types of trajectory planning, trajectory planning in joint space and trajectory planning in the Cartesian space. When trajectory planning in joint space, the joint angle is used to represent the position and pose of the manipulator end-effector, which conveniently calculates inverse kinematics and avoids singularity problems compared to the Cartesian space [15; 16]. Joint angels or positions can be obtained through inverse kinematics. In addition, introducing a trajectory planning algorithm is necessary to generate a trajectory between path points. B-spline curves and polynomial function interpolation are commonly used in trajectory planning algorithms [17; 18]. B-splines have excellent smoothing performance [19], but cannot pass through all the path points due to their inherent properties, whether it is approximate fitting or interpolation fitting. When using polynomial functions in trajectory planning, continuity of velocity and acceleration can only be ensured when the polynomials' order is at least five [18]. As the polynomials' order increases, the trajectory becomes more accurate and smoother; however, it may cause Runge's phenomenon [20]. Piecewise polynomial interpolation has proven to be a feasible method for guaranteeing trajectory smoothness while simplifying calculation [21; 22].