Combining closed-form and numerical solutions for the inverse kinematics of six-degrees-of-freedom collaborative handling robot

In the process of solving the inverse kinematics of six-degrees-of-freedom collaborative robots, the numerical solution has problems such as low accuracy and singular configurations. Moreover, due to the high coupling of its position and attitude, the direct closed-form solution fails. To address these problems, an inverse kinematics algorithm that combines closed-form and numerical solutions was proposed. The Jacobian matrix was established based on the forward kinematics equation of the six-degrees-of-freedom collaborative robot. Its inverse matrix was obtained by a singular value decomposition of the matrix using the Manocha elimination method to avoid the singularities of the Jacobian matrix. The optimal inverse kinematics solution was obtained using the Newton–Raphson iterative method. A computer simulation implemented in MATLAB and Visual C++ was used to evaluate the accuracy and speed of the proposed algorithm. The results of the trajectory planning experiments demonstrate that the algorithm satisfies the requirements for real-time smooth motion. This study of inverse kinematics lays the theoretical foundation for solutions to the inverse problem and real-time control of collaborative robots.


Introduction
Because it is impossible to realize full automation in flexible production, man-machine collaboration is a feasible way to improve the productivity of semiautomated systems. 1 Collaborative robots, which have the characteristics of high flexibility, simple programming and rapid configuration, have a wide range of potential applications in the service industry, such as health care, education and retail. 2 In practical applications, the position and direction of the end effector are usually given or predetermined.Therefore, inverse kinematics plays a crucial role in solving the realtime control process and trajectory planning problems of robotic manipulators. 3Furthermore, due to the inherent nature of the Non-deterministic Polynomial (NP) problem and complex nonlinear equations, computing the inverse kinematics solution of a multi-degree of freedom (DOF) serial robotic manipulator requires more computational resources and time compared to the forward kinematics. 4here are two main methods for solving inverse kinematics: closed-form solutions and numerical solutions. 5o improve flexibility, most collaborative robots adopt a design configuration that uses three parallel axes.There is no universal closed-form solution method for the inverse kinematics equation of this type of robot; therefore, many numerical solutions have been adopted. 6However, numerical solutions have problems, such as low accuracy and complex solution processes.Because of the variable structure of the robot itself, the algorithm has different time and space requirements, and there are few algorithms that can satisfy these requirements. 7n recent years, many researchers have made significant efforts to solve the inverse kinematics problem of sixdegrees-of-freedom (6-DOF) robotic arm.Primrose was the first to demonstrate that the inverse solution of a 6 R robot with a general configuration has at most 16 sets of real roots. 8Lee and Liang constructed 14 basic equations of inverse kinematics, used low-dimensional ideas to simplify the multivariate nonlinear equations into one-dimensional 16-degree equations, and finally obtained 16 exact solutions of inverse kinematics.The inversion process is very complicated. 9,10Xu et al. proposed an analytic algorithm for the kinematics inverse algorithm for the palletizing robotics.This algorithm has practicality to a certain extent, but it always has a problem that the attitude corresponds to multiple analytical results, and the unique solution cannot be determined. 11Wang et al. used a damped least-squares method to solve the inverse solution of a seven revolutejoint (7 R) 6-DOF robot by comparing the 7 R 6-DOF robot with the equivalent 6 R robot, but an approximate solution was not considered. 12,13Chu et al. proposed a Robotics kinematics inverse algorithm based on the reconfigurable method.Simultaneously, the simulation robotic arm was designed based on the algorithm.The practice shows that the robotic arm under the algorithm is very flexible, but the design process is too complicated.The number of iterations of the solution result is too many, so the actual algorithm is not efficient. 14Hang and Savkin have proposed using competitive neural networks to solve the inverse kinematics problem of robotics using mechanical arm grabbing, but they are limited to specific robotics, and they are not implemented in the actual algorithm verification. 15Amici and Cappellini obtained an inverse solution through the numerical inversion of a Jacobian matrix combined with a soft computing method, but its accuracy was low. 16Yuan-Yuan and Wei proposed a simulated annealing algorithm and genetic algorithm that could calculate the inverse solution of a robot.This approach can achieve a certain accuracy but requires a large amount of calculation. 17Zhi-jian and Jian-hua proposed a fast selection algorithm for analytical solutions based on the mathematical characteristics and motion continuity of the problem but did not consider singular problems. 18ost of the above robot kinematics inverse solutions have convergence problems, and the iterative process is too complicated, which affects the efficiency and quality of the entire algorithm. 19,20At the same time, in the actual application of collaborative robots, because of factors such as special configurations or limitations of the approach, the traditional inverse solution is low in accuracy and prone to problems such as singular configurations.To solve these problems, an algorithm combining a closed-form solution with a numerical solution was proposed, and the inverse kinematics equation of a 6-DOF collaborative robot was constructed.To further reduce the computational complexity of joint quantization, this study introduces the Newton-Raphson iteration method to obtain optimal inverse kinematic solutions.To evaluate this approach, simulations and trajectory planning experiments were conducted, demonstrating its significant advantages compared to traditional inverse kinematics algorithms.The combined algorithm has faster solution and stability under higher precision and is not limited by the configuration of the manipulator; therefore, it can effectively solve the problem of inverse kinematics solution of the 6-DOF collaborative robot.

Forward kinematics analysis
A collaborative 6-DOF lightweight handling robot with a 3 kg load was designed.The structure of the robot was designed to be modular.Depending on the joints, the robot was divided into six modules, and the kinematic pair of each module was a rotary axis.The joints are divided into two categories, joints 1, 2, and 3, which are used for large motions and to determine the location of the claw, and smaller joints 4, 5, and 6 with mounting holes reserved at the end, which are utilized to determine the posture of the claw.A three-dimensional model of 6-DOF collaborative robot is shown in Figure 1.
The inverse kinematics solution of the robot is based on the forward kinematics solution, and the position and orientation of the end are obtained by the forward solution, which is used as the input to calculate the inverse solution. 21According to the structural parameters and dimensions of the 6-DOF lightweight collaborative robot, the Denavit-Hartenberg (D-H) parameter method 22 was used to establish the six-axis space coordinate system of the robot.The D-H model of the robot is shown in Figure 2, and its parameters are listed in Table 1.
The transformation matrix A i between two adjacent connecting rods is obtained according to the translation and rotation theory of the space coordinate system In equation ( 1), cq i ¼ cosq i , sq i ¼ sinq i , ca i ¼ cosa i , and sa i ¼ sina i .The 6-DOF lightweight collaborative robot is connected to a flange at the base to fix the gripper.Hence, the homogeneous pose transformation matrix of the end gripper relative to the base coordinate system is expressed as follows (2) Based on the differential transformation method and the differential mapping relation between the Cartesian space and joint space, the Jacobian matrix T J is obtained as follows A singular configuration can be identified based on whether the determinant of the Jacobian matrix is zero.The determinant of the Jacobian matrix is  Equation ( 4) reveals that a singular configuration of the robot has no relationship with joints 1 and 6.Given the configuration of the robot, it is clear that joints 1 and 6 do not cause a singular configuration during a practical grasping task.Because of the chain coupling structure of the robot, the determinant of the Jacobian matrix is very complicated.The singular configurations that occur when j T J j ¼ 0 are as follows

Inverse kinematics modelling
The inverse kinematics problem of a robot involves solving the angle of each joint of the robot when the position and orientation of the end-effector are given.Its solution enables the robot to realize kinematic simulation and trajectory planning. 23Because the inverse solution of the collaborative robot is difficult to obtain, the inverse kinematics model is analyzed using a combination of a closed-form solution and numerical solution.The Manocha elimination method was used to determine the forward kinematics, and the key matrix of the inverse kinematics was obtained using singular value decomposition (SVD) and the Newton-Raphson iteration method.The key matrix is converted into a numerical matrix with the link parameters.
First, according to the homogeneous transformation matrix, 0 T 6 is transformed to obtain Qði; jÞ In equation ( 5), Q(i, j) and R(i, j) represent the elements in row i and column j of matrices Q and R, respectively, where i and j ¼ 1, 2, . . ., 4.
The elements Q(i, j) and R(i, j) are regarded as functions of the joint variable q i , namely, ¼ ðq 1 ; q 2 ; q 6 Þ ðq 1 ; q 2 ; q 6 Þ ðq 1 ; q 2 ; q 6 Þ ðq 1 ; q ðq 1 ; q 2 ; q 6 Þ ðq 1 ; q 2 ; q 6 Þ 0 0 In equation ( 6), the elements in the third and fourth columns on both sides are independent with q 6 , and the corresponding elements in the third column of matrices Q and R are equal.Both sides were obtained by multiplying by the orthogonal symmetric matrix and adding ð a 2 0 In equation ( 7), h ¼ and FSC(Á) indicates that the function is a combination of the sines and cosines of their respective variables.The corresponding elements in column 4 are equal and can be obtained in the same manner In equation ( 8), ñ ¼ Vector P is used to represent matrix in equation (7), and vector L is used to represent matrix in equation (8).
Fourteen linear independent equations are obtained from P, L, PÁP, PÁL, PÂL, and (PÁP)LÀ(2PÁL)P, namely, The above 14 equations are simplified as follows In equation ( 10), L 1 6Â2 and L 1 8Â6 are matrices with dimensions of 6 Â 2 and 8 Â 6, respectively, R 1 6Â9 and R 1 8Â9 are matrices with dimensions of 6 Â 9 and 8 Â 9, respectively, and their elements are functions containing unknown variables s 3 and c 3 .The coefficients of these variables are used to express the link parameters during the solution.
Using the Manocha elimination method, we have x i ¼ tanðq i =2Þ, i ¼ 1, . . ., 6, from the half angle formula Substituting this into equation (10), s 3 and c 3 of R 1

6Â9
and R 1 8Â9 are replaced by x 3 , and we then eliminate q 1 and q 2 using Gaussian elimination to obtain six equations containing only q 3 , q 4 , and q 5 .In addition, the parameter pairs s 4 , c 4 and s 5 , c 5 are replaced by x 4 and x 5 , respectively, and 12 sets of equations are obtained, which are written in matrix form as follows In equation ( 12)

Inverse kinematics solution based on closed solution and numerical solution
The inverse kinematics equation expressed in matrix form is used for the symbolic operation, and the specific steps are as follows: Step 1. Matrix equations were constructed by the vectors P and L, and 14 groups of linear equations were obtained using simple matrix operations.
Step 2. The above equations were simplified by shifting the terms to L 1 6Â2 , L 1 8Â6 , R 1 6Â9 , and R 1 8Â9 .According to the half angle formula, s 3 and c 3 are replaced by x 3 .
Step 3. The coefficient matrices were obtained by splitting the matrices such that each element was a constant expression.
Step 4. When the parameters of each connecting rod of the robot are not zero, the matrix expression of PA 1 *PC 2 of the 6 R robot with general configuration can be obtained.For a robot with a special configuration, when solving the inverse kinematics equation, it only needs to perform a symbolic operation to Chen et al.
calculate the constant expressions of the PA 1 *PC 2 matrices.
Step 5. Assign the given link parameters and terminal pose to each expression of PA 1 *PC 2 to obtain a numerical matrix.Step 6.After a series of matrix simplifications such as Gaussian elimination method, the key matrices S A , S B , and S C of this configuration are finally obtained.
The solution process is illustrated in Figure 3. Considering that several link parameters of the cooperative robot are zero, many elements of the symbol matrix are zero.Using the known link parameters to eliminate the unknown parameters, the sign matrices for L 1 6Â2 and L 1 8Â6 are obtained.
Parameters x 3 , x 4 , and x 5 can be solved after the key matrices are obtained using the closed-form and numerical methods.To avoid the effect of the cumulative error of floating-point calculations on the accuracy of the solution, the matrix decomposition method is adopted to ensure the accuracy of the solution.When P A is a nonsingular matrix, the square matrix constructed using the key matrix is as follows In equation ( 15), I and 0 represent the 12 Â12 identity and zero matrices, respectively.
The eigenvalue of M is the solution of x 3 , and the corresponding eigenvector V is expressed as follows Parameters x 3 , x 4 , and x 5 are solved using eigenvector V, and q 3 , q 4 , and q 5 are subsequently solved.Next, q 1 and q 2 are solved using the matrix eigenvalue decomposition method.Finally, the joint angle q 6 was obtained.
There is a sizable number of matrix operations during the calculation, and to meet the required accuracy, an eigenvector V with a larger absolute value is selected to solve q 4 and q 5 to reduce the influence of cumulative errors in the floating-point calculations.When jx 3 j 1, we select the first 12 rows of eigenvector V; otherwise, the last 12 rows of eigenvector V are selected, which increases the accuracy of the solution.Considering the uncertainty in the maximum absolute value of vector n in equation ( 12), the calculation results for q 4 and q 5 are as follows By choosing a larger eigenvector, the overall calculation process is guaranteed to be stable, and the cumulative errors in the calculation process can also be reduced.

Inverse kinematics verification
The effectiveness of the algorithm was verified on a computer configured with AMD Ryzen 7 5800 H with Radeon Graphics 3.20 GHz, 16.0 GB RAM and Windows 10 Professional operating system based on the parameters of each link of the robot and the pose matrix of the end point shown in equation (19).The abovementioned algorithms were implemented using Visual Studio 2019.Because there is no mathematical function library for matrix operations in Cþþ, the MATLAB Cþþmathematical function library is called and the static link libraries are set in Visual Cþþ.Thus, relevant functions can be called to calculate the matrix, thereby improving the efficiency of development.
Combining the Newton-Raphson iterative algorithm, eight sets of inverse solutions for the robot were obtained, as shown in Table 2 In previous studies, some scholars used pose errors to establish fitness functions J PP to solve inverse kinematics solutions. 24,25In the robot inverse kinematics solution based on the improved fitness function combination method, Guang et al. proposed a fitness function J DR of an intelligent algorithm, combined with the analytical method to solve the inverse kinematics solution of the collaborative robot.The combined method and the original method were used to solve the problem, respectively, and the solution time is shown in Table 3. 26 According to the data in Table 2, the inverse kinematics solution of the robot obtained using the elimination method is accurate to eight decimal places, which satisfies the positioning accuracy requirements of the robot.
The average solution time based on the improved fitness function combination method is 4 ms, and the average solution time of the original method is 32 ms.The hybrid programming approach of MATLAB and Visual Cþþ was used in this study, with an average computation time of 1.548 ms.The combination method exhibited a solution speed approximately 2.5 times faster than the method previously proposed in literature.When the inverse kinematics algorithm meets the accuracy requirements, the solution time is less than 4 ms, which meets the requirements for real-time inverse kinematics solution of the control system of the collaborative robot to realize grasping and sorting materials.

Experimental analysis of trajectory planning
The algorithm was employed in our 6 R-robot prototype to further verify the correctness and feasibility of the algorithm in the control of the robot moving along a predetermined trajectory.The experimental platform was set up as shown in Figure 4 and includes the robot body, control cabinet, laser tracker, target ball, and PC.
The arc track of the grasping workpiece was considered as an example.First, the trajectory curve of the task space was planned and discretized, the number of space interpolation points was set to 100, and three points in any space were selected, as listed in Table 4. Second, the robot was instructed to execute arc interpolation planning using the inverse kinematics algorithm.The trajectory curve of the robot's gripper was determined using a laser tracker to record the sample points every 300 ms, and the obtained coordinate points were sent to MATLAB.The actual and theoretical trajectories are compared in Figure 5.
The actual trajectory had certain errors with respect to the theoretical trajectory.These errors were affected by the robot's manufacturing accuracy, motion control accuracy, and how well the PID parameters are matched.Nevertheless, the maximum error is 2.459 mm, which meets the requirements of the robot's trajectory planning in grasping-task scenarios.

Conclusion
In this study, an inverse kinematics algorithm that combines a closed-form solution and a numerical solution was proposed.The SVD based on the Manocha elimination method was used to solve the inverse matrix to avoid singularities in the Jacobian matrix.The Newton-Raphson iterative method was used to obtain the optimal solution of the inverse kinematics, which improved the accuracy of the solution.
The trajectory planning experiments showed that the resultant trajectory was smooth and the motion was stable during grasping tasks, which verifies that inverse kinematics modelling is reasonable and feasible.The algorithm has high solving accuracy, which can satisfy the requirements for smooth robot motion.
This study provides a theoretical basis for inverse kinematics solutions of series-coupled structure robots based on a combination of closed-form and numerical methods.

C
are key matrices for solving the inverse kinematics of the robot.In the case that there are three axes parallel to each other, we adopt SVD and the Newton-Raphson iterative algorithm to obtain the inverse matrix of the key matrix P A .

Figure 5 .
Figure 5.Comparison of the actual and theoretical trajectories.

Table 2 .
Solution for the inverse kinematics of the eight groups.

Table 3 .
Inverse kinematics solution time for three methods.
Figure 4. Experimental platform for trajectory planning.

Table 4 .
Arbitrary space coordinates of three points.