Research on the inverse kinematics of manipulator using an improved self-adaptive mutation differential evolution algorithm

To assess the inverse kinematics (IK) of multiple degree-of-freedom (DOF) serial manipulators, this article proposes a method for solving the IK of manipulators using an improved self-adaptive mutation differential evolution (DE) algorithm. First, based on the self-adaptive DE algorithm, a new adaptive mutation operator and adaptive scaling factor are proposed to change the control parameters and differential strategy of the DE algorithm. Then, an error-related weight coefficient of the objective function is proposed to balance the weight of the position error and orientation error in the objective function. Finally, the proposed method is verified by the benchmark function, the 6-DOF and 7-DOF serial manipulator model. Experimental results show that the improvement of the algorithm and improved objective function can significantly improve the accuracy of the IK. For the specified points and random points in the feasible region, the proportion of accuracy meeting the specified requirements is increased by 22.5% and 28.7%, respectively.


Introduction
The inverse kinematics (IK) of a manipulator is an important part of its design and control, which has guiding significance for motion analysis and trajectory planning. Traditional solution methods can be divided into two categories: analytic and numerical methods. When the manipulator does not meet Pieper criterion, 1 the analytic solution cannot be obtained. For PUMA-type manipulators, when the last three axes do not exactly intersect at a common point and the shoulder joint axes are not exactly orthogonal, there is an error in the analytic solution. In this case, the numerical method can be used to find the IK. Even in cases where an analytic solution does exist, numerical methods are often used to improve the accuracy of these solutions. 2,3 Because of the limitations of traditional solutions, other algorithms, such as the Newton-Raphson method, neural network method, genetic algorithm (GA), and swarm intelligence algorithm, have been proposed to solve the IK of the manipulator. Yin et al. 4 proposed to use an improved Davidon-Fletcher-Powell for IK of the manipulator. Köker,5 Al-Mashhadany, 6 and Khaleel 7 have proposed several methods of using neural networks to solve the IK of the manipulator. Tabandeh et al. 8 proposed the adaptive niche GA to generate multiple solutions for manipulator IK. Ren et al. 9 and Rui et al. 10 proposed to use an improved particle swarm optimization algorithm to solve the IK of the manipulator. Zhang et al. 11 used the chaotic and parallelized artificial bee colony algorithm to solve the manipulator IK problem. Xie et al. 12 used an improved DE algorithm to find the IK of a manipulator. Pena et al. 13 proposed using bioinspired multiobjective optimization techniques to solve the industrial robot IK problem. The Newton-Raphson method has the advantage of a simple calculation process, high efficiency, and high precision, but its optimization result is too dependent on the choice of initial value. The neural network method has the advantages of high efficiency and high precision, but a large amount of sample data is needed during training, and the generalization performance of the network cannot be guaranteed. The traditional swarm intelligence algorithm has no special requirements for the configuration of the manipulator, but the selection of parameters has a greater impact on the performance of the algorithm. Among them, the classic DE algorithm [14][15][16][17] has the advantage of simple structure, few control parameters, and strong robustness. However, the improper selection of control parameters and mutation strategies leads to slower convergence and local optimization.
Aiming at the local optimization in the process of solving the IK, this article proposes an improved adaptive mutation differential evolution (ISAMDE) algorithm. An adaptive mutation operator (AMO) and adaptive scaling factor (AF) are used to adaptively adjust the mutation strategy of the algorithm and the degree of individual scaling according to the current iteration number and error value, and balance the exploration ability and exploitation ability of the algorithm. To further improve the accuracy of the IK of the manipulator, this article optimizes the objective function of the numerical solution and proposes an adaptive orientation error weight coefficient to normalize the corresponding posture error.

Classic differential evolution algorithm
The DE algorithm is a heuristic parallel search algorithm 18 based on population differences proposed by Storn and Price, including initialization, mutation, crossover, and selection. The flowchart of the DE algorithm is shown in Figure 1.
The standard DE algorithm mainly includes the following five steps: Initialization. Assume that D is the individual dimension, NP is the population size, t is the evolutionary generation, and x(t) is the population of the t generation. The initial individual is where x U ij and x L ij are the upper and lower bounds of the j'th variable of the i'th individual, and r 1 is a uniformly distributed random number between 0 and 1.
Mutation. Two commonly used mutation strategies are DE/ rand/1/bin and DE/best/1/bin. The mutation equations are shown in equations (2) and (3) where F is the scaling factor, p 1 ; p 2 ; p 3 ; p 4 are the serial number of different individuals randomly selected from the population, and x bj ðtÞ is the best individual of the current group.
Boundary operation. The methods crossing the boundary initialization include reinitialization, reflection, projection, wrapping, and resampling. Arabas et al. 19 verified that the boundary constraint processing method has an important effect on the optimization performance of differential evolution.  where j rand is an integer randomly selected in [1, D], and C is the crossover probability.

Crossover
Selection. The selection criteria can be described as where f is the fitness value of the individual.

Improved self-adaptive mutation differential evolution algorithm
The core challenge of the DE algorithm is balancing the exploration and exploitation capabilities of the algorithm.
In the literature, the authors 20-23 studied the parameter setting method and optimization method of the algorithm, and proved that the setting of control parameters plays a vital role in the optimization performance, convergence speed, and stability of the algorithm. In the literature, Qin and Suganthan 24 and Qin et al. 25 studied the optimization method of mutation strategy and proved that mutation strategy is the key to the exploration and development capabilities of equilibrium algorithms. For example, the DE/rand/ 1/bin strategy emphasizes the exploration ability of the algorithm, and the DE/best/1/bin strategy emphasizes the development ability of the algorithm. In this article, the control parameters and mutation strategy are improved, and the timing of the algorithm enters the DE/best/1/bin mutation strategy and the degree of scaling of the mutated individual to achieve rapid global optimization of the algorithm. The flowchart of the ISAMDE is shown in Figure 2.
Adaptive mutation operator for adaptive adjustment mutation strategy. To improve the global optimization capability of the algorithm, an AMO is used in the ISAMDE algorithm to independently adjust the mutation strategy of the algorithm. After improvement, the algorithm's mutation strategy and the AMO are defined as follows Among them, AMO ¼ 1 À ðt=T Þ N , where AMO is related to a current number of iterations t, a maximum number of iterations T, and a power exponent N. Figure 3 shows the relationship between N and the trend of the AMO function value. Figure 3 shows that the smaller the power exponent N is, the earlier the algorithm enters the DE/best/ 1/bin evolution mode, the stronger the exploitation capability, and the faster the convergence speed. The exponent N determines the selection principle of the mutation strategy of the DE algorithm. When N is greater than 1, the algorithm emphasizes exploration, and when N is less than 1, the algorithm emphasizes exploitation.
When the random number is less than the AMO, the DE/ rand/1/bin mutation strategy is adopted. In the early stage of evolution, the AMO is relatively large, so the DE/rand/1/ bin evolution mode is preferred, giving full play to the exploration ability of the algorithm. In the later stage of evolution, the algorithm enters the DE/best/1/bin evolution mode and is adjusted to be guided by the optimal individual, and the exploitation ability of the algorithm is given full play.
Adaptive scaling factor for adaptively adjusting the degree of differential mutation scaling. In the DE algorithm, the scaling factor F determines the degree of scaling of the mutated individual. Increasing F can increase the diversity of the population, but it will weaken the exploitation ability of the  algorithm. Reducing F can improve the exploitation ability of the algorithm, but it will increase the risk of the algorithm falling into premature convergence. To achieve fast global optimization, this article proposes an error-related AF. At the beginning of the iteration, the scaling factor is 1, and the exploration ability is strong. When the error value under the current iteration number of the algorithm is less than the set value E 0 , the AF in equation (7) is adopted to improve the exploration ability of the algorithm AF ¼ where the AF is related to the error value under the current iteration number (eðtÞ), and the value of E 0 can be adjusted according to the specific engineering problems. In this article, E 0 is 500. Figure 4 shows the relationship between the AF and eðtÞ.

Kinematics and improvement of objective function
The intelligent algorithm to solve the IK of the manipulator refers to transform the kinematics equation into the corresponding objective function and find the function extreme value.
The posture of the end effector relative to the first coordinate system is 0 where the R matrix is a 3 Â 3 matrix and the P matrix is a 3 Â 1 matrix. It can be seen in Figure 5 that the position error E P is related to the joint angles and the link parameters of the manipulator, and its value range is (À1500, 1500), while orientation error E O is only the trigonometric function transformation of the joint angles, and its value range is (À1, 1). The position error weight coefficient ! P and the orientation error weight coefficient ! o are introduced into the objective function to balance the weight of the two types of errors in the objective function so that the two types of errors are on the same order of magnitude.
The objective function of the IK can be written as where R t and P t represent the orientation matrix and position matrix of the target point, respectively, R c and P c represent the orientation matrix and position matrix of the current population location, respectively. E P is calculated by the Euclidean distance between P t and P c , E P ¼ jP t À P c j j j . E O is calculated by the Euclidean distance between R t and R c , E O ¼ jR t À R c j j j . The orientation angles a; b; g and the orientation matrix R have one-to-one correspondence. 14 Tabandeh et al. 8 use the weight coefficients =p in the objective function, where k is the coefficient related to the rod length, l is the sum of the length of the connecting rod, and P d is the distance from the target position of the manipulator to the origin of the base coordinate.
In this article, E P is introduced as one of the influencing factors in ! o , and ! o is adaptively adjusted according to the error value under the number of iterations of the current generation to ensure that the two types of errors are always at the same magnitude. In the simulation analysis of the 6 degree-of-freedom (DOF) manipulator, k is 20. The position error weight ! P ¼ 1 and the expression of ! o are shown in equation (8) respectively. Tables 1 and 2 are their DH parameter tables, respectively.

Experiments and results
To evaluate the performance of ISAMDE, three DE algorithms (DE, SAMDE, and ISAMDE) are used to solve the minimum of six standard benchmark functions.
To test the effectiveness of the ISAMDE algorithm for the IK of the manipulator, simulation experiments were carried out on the IK of the 6-DOF and 7-DOF manipulators on the three DE algorithms. First, seek the IK for a fixed point in the workspace to verify the feasibility of the algorithm. Then, the IK is obtained for random target points in the workspace to verify the robustness of the algorithm.

Benchmark function tests
D and P refer to search space dimension and population size, respectively, N means the power exponent of the AMO, F 0 is the original scaling factor, N max is the maximum number of iterations, and symmetric mapping is used after the mutated individual crosses the boundary.
The benchmark functions and their simulation results are shown in Table 3 and Table 4. Figure 8 shows the convergence curves of the three algorithms on the benchmark functions. The optimal value of the algorithm is presented in bold in Table 4. In the solution of f 1 , the SAMDE algorithm performs best with an average accuracy of 10 À78 , while the average accuracy of ISAMDE is slightly lower, which is 10 À74 . In the solution of f 2 , ISAMDE and SAMDE have the same solution accuracy. In the solution of f 3 , f 4 , and f 6 , the ISAMDE algorithm has the highest solution accuracy. In the solution of f 5 , the calculation results of ISAMDE and SAMDE are in an order of magnitude, and SAMDE is better. ISAMDE algorithm has better convergence speed on f 2 -f 4 , ISAMDE has better convergence speed on f 1 and f 5 , and DE algorithm has better convergence speed on f 6 .

Inverse kinematics simulation of manipulators
Aiming at the IK of the manipulator, the 6-DOF and 7-DOF manipulators are used as experimental objects, and three DE algorithms are used for simulation experiments to verify the effectiveness of the algorithm improvement and objective function improvement.
The initial parameters of the algorithm are set as follows: F 0 ¼ 0.5, C ¼ 0.9, N ¼ 0.9, P ¼ 70, N max ¼ 600, and random initialization is used after the mutated individual crosses the boundary.
Termination condition of algorithm iteration: meet the given accuracy (position:10 À2 mm and orientation: 5 Â 10 À4 rad) or reach the maximum number of iterations. The    results were achieved on MATLAB R2018a on a 2.8 GHz intel i5 processor.

6-DOF underwater manipulator.
The joint vector corresponding to the target point of the 6-DOF underwater manipulator is [p/6, Àp/3, p/6, p/18, Àp/3, Àp/2]. In the algorithm, the solution of each population represents a set of joint angles of the manipulator, corresponding to a set of posture at the end of the manipulator. Aiming at the fixed target point, using three DE algorithms, the simulation results of the IK of the manipulator are shown in Figure 9 and Table 5.
In the table, DE_O, SAMDE_O, and ISAMDE_O represent the optimal results of the three algorithms under the original objective function. DE_I, SAMDE_I, and ISAM-DE_I represent the optimal results of the three algorithms under the improved function. Best_P, Worst_P, Best_O, and Best_O represent the optimal value of the position error, the worst value of the position error, the optimal value of the orientation error, and the worst value of the orientation error, respectively. SR is the ratio of the posture error to the specified accuracy in 1000 independent runs.
The abscissa in the figure is the number of repeated positioning of the algorithm, and the ordinate is the number of algorithm iterations, position error (mm), orientation error (rad), and algorithm running time (s).
As shown in Figure 9 and Table 5, aiming at the fixed target point, for the 6-DOF underwater manipulator, before and after improving the objective function, the SR of the three DE algorithms for IK of the manipulator is 77.5%, 84.9%, 98.7% and 100%, 100%, 100%, respectively.
Aiming at the fixed target point, using Newton-Raphson method, where F obj ¼ E P þ E O , the units of E P and E O are meter and radians, the IK simulation results are shown in Table 6. N max is 1000. MM: multimodal, UM: unimodal; ISAMDE: improved self-adaptive mutation differential evolution; DE: differential evolution; SAMDE: self-adaptive mutation differential evolution. The optimal value of the algorithm are shown in bold in the table.
In the table, N_L refers to Newton-Raphson. Table 6 shows that the SR of Newton-Raphson method is 88%.
For 50 random target points in the workspace, using three DE algorithms, the simulation results of the IK are shown in Figure 10 and Table 7.
As shown in Figure 10 and Table 7, before and after improving the objective function, the SR of the three DE algorithms for IK of the manipulator is 73.6%, 71.3%, 78.9% and 91.6%, 90.2%, 92.3%, respectively.
For 50 random target points in the workspace, the simulation result of Newton-Raphson method to solve the IK is provided in Table 8. Table 8 shows that the SR of Newton-Raphson method is 76%.
For the fixed target point, using three DE algorithms, the IK simulation results are shown in Figure 11 and Table 9.
As shown in Figure 11 and Table 9, aiming at the fixed target point, for the Cyton Gamma 300 manipulator, before  Table 5. Statistical results of fixed target points of the 6-DOF underwater manipulator (50 independent runs).
As shown in Figure 12 and     DOF: degree-of-freedom; ISAMDE: improved self-adaptive mutation differential evolution; DE: differential evolution; SAMDE: self-adaptive mutation differential evolution.

Discussion
The simulation results of benchmark functions in Table 4 and Figure 8 show that ISAMDE performs well in most benchmark functions both in terms of computational accuracy and convergence speed. The experimental results show that under the guidance of the optimal individual x best , ISAMDE algorithm quickly approaches the optimal solution, which better balances the exploration and exploitation ability of the algorithm.
In the ISAMDE algorithm, the introduction of AMO enables the algorithm to switch timely between the two evolutionary modes of DE/rand/1/bin and DE/best/1/bin. The introduction of the current generation error value eðtÞ in AF realizes the adaptive adjustment of the search step length of the algorithm. The above parameters all achieve a good balance between algorithm exploration ability and exploitation ability. The simulation results of the IK of the 6-DOF manipulator show that among the three DE algorithms, the ISAMDE algorithm has the best performance on the IK problem.
For random points in the workspace, the SR of the ISAMDE algorithm can reach 92.3% instead of 100%, which may be related to factors such as the randomness of the swarm intelligence algorithm, improper selection of the initial point, the location of the random point too close to the boundary, and the large search space. To improve the accuracy of the algorithm, follow-up research can be carried out around how to reasonably select the location of the initial point of the algorithm and the optimization of the boundary points. To improve the accuracy of the algorithm, follow-up research can be carried out around how to reasonably select the location of the initial point of the algorithm and the optimization of the boundary points.  ISAMDE: improved self-adaptive mutation differential evolution; DE: differential evolution; SAMDE: self-adaptive mutation differential evolution.  ISAMDE: improved self-adaptive mutation differential evolution; DE: differential evolution; SAMDE: self-adaptive mutation differential evolution.
The 7-DOF manipulator is a redundant manipulator. In practical applications, for different optimization goals, different constraints need to be added to find the IK of the manipulator. The ISAMDE algorithm is inferior to the 6-DOF in the inverse solution of the 7-DOF algorithm, which is related to the increase in the extreme value peaks of the objective function caused by the increase of the algorithm dimension D. The ISAMDE algorithm does not perform well in the solution of multimodal functions. Follow-up research can continue to optimize the algorithm for multimodal functions.
This article proposes an error-related objective function and introduces the position error E P to realize the adaptive adjustment of the orientation error weight coefficient ! o , which ensures that the position error and orientation error are always at the same magnitude. Both the 6-DOF and 7-DOF manipulator IK experimental results show that after using the improved objective function, the performance of the three DE algorithms has been greatly improved, so the improvement effect of the objective function is significant.

Conclusions
In this article, an IK method of a serial manipulator based on an ISAMDE algorithm is proposed. To better balance the exploration and exploitation ability of the mutation DE algorithm, the AMO and the error-related AF are proposed, which can enable a quick approach to the optimal solution when solving the IK of the manipulator, improve the convergence speed, avoid premature convergence, and enhance global optimization ability. The experimental results show that the proposed IK method is suitable for 6-DOF and 7-DOF serial manipulators and has the advantage of high precision and high efficiency. This provides a new research concept for the general IK method of serial manipulators.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Strategic Priority Research Program of the Chinese Academy of Sciences under grant no. XDA22040303, the key projects supported by "the 13th five year plan" of Hefei Institute of Physical Sciences, Chinese Academy of Sciences, under grant no. KP-2019-14, and Anhui Natural Science Foundation of China under grant no. 1808085QF214.