Abstract
The inverse kinematics of redundant manipulators is one of the most important and complicated problems in robotics. Simultaneously, it is also the basis for motion control, trajectory planning, and dynamics analysis of redundant manipulators. Taking the minimum pose error of the end-effector as the optimization objective, a fitness function was constructed. Thus, the inverse kinematics problem of the redundant manipulator can be transformed into an equivalent optimization problem, and it can be solved using a swarm intelligence optimization algorithm. Therefore, an improved fruit fly optimization algorithm, namely, the hybrid mutation fruit fly optimization algorithm (HMFOA), was presented in this work for solving the inverse kinematics of a redundant robot manipulator. An olfactory search based on multiple mutation strategies and a visual search based on the dynamic real-time updates were adopted in HMFOA. The former has a good balance between exploration and exploitation, which can effectively solve the premature convergence problem of the fruit fly optimization algorithm (FOA). The latter makes full use of the successful search experience of each fruit fly and can improve the convergence speed of the algorithm. The feasibility and effectiveness of HMFOA were verified by using 8 benchmark functions. Finally, the HMFOA was tested on a 7-degree-of-freedom (7-DOF) manipulator. Then the results were compared with other algorithms such as FOA, LGMS-FOA, AE-LGMS-FOA, IFOA, and SFOA. The pose error of end-effector corresponding to the optimal inverse solution of HMFOA is mm, while the pose errors obtained by FOA, LGMS-FOA, AE-LGMS-FOA, IFOA, and SFOA are mm, mm, mm, mm, and mm, respectively. The experimental results show that HMFOA can be used to solve the inverse kinematics problem of redundant manipulators effectively.
1. Introduction
Forward kinematics and inverse kinematics are two basic problems in robot kinematics. The forward kinematics which determines the pose of the end-effector relative to the reference coordinate system according to the joint variables of the robot is relatively easy, and its solution is analytical, deterministic, and unique, while the inverse kinematics, to obtain the joint variables from the pose of the end-effector, is a complex system of nonlinear equations with the strong coupling of variables. As a result, it is a much more difficult problem than the forward kinematics. The inverse kinematics problem plays an important role in robotics, which is the premise and foundation of robot motion control, trajectory planning, and dynamic analysis [1].
Generally, the conventional methods for solving the inverse kinematics problem of robots are closed-form methods and numerical methods [2]. The closed-form methods, which consist of algebraic [3] and geometric [4], have the advantages of fast solution speed, high accuracy, and accessibility in obtaining all possible inverse solutions. However, the closed-form methods highly depend on the configuration of the robot. If a robot does not meet the Pieper criterion [5], the closed-form methods cannot be applied to solve the inverse kinematics problem. Therefore, only a very small class of kinematically simple robots is suitable for the closed-form methods to obtain complete analytical solutions. The numerical methods are the main methods to resolve the inverse kinematics of complex articulated manipulators. Unfortunately, the numerical methods may have the singularity of Jacobian matrix and may also cause considerable computational load. In addition, the redundant manipulator has an infinite number of inverse kinematics solutions to reach the same end-effector pose, which makes it more difficult to solve inverse kinematics problems by using the conventional methods. Therefore, more and more researchers have focused on solving the inverse kinematics problem using artificial intelligent optimization algorithms.
So far, various optimization algorithms such as genetic algorithm (GA) [6, 7], particle swarm optimization algorithm (PSO) [8–12], differential evolution algorithm (DE) [2, 13, 14], artificial bee colony algorithm (ABC) [15], and biogeography-based optimization [16] have been proposed to calculate the inverse kinematics solutions of robots; thus the shortcomings of the conventional methods are effectively overcome. In this study, a fitness function was constructed to minimize the pose error of end-effector. Then, the inverse kinematics problem was transformed into an optimization problem using the forward kinematics and the fitness function, and a novel hybrid mutation fruit fly optimization algorithm (HMFOA) was developed to solve the problem more effectively.
The rest of this paper is organized as follows. Section 2 presents a brief introduction to the forward and inverse kinematics of a 7-DOF redundant robot manipulator. The HMFOA is described in Section 3. Experimental design and comparisons are illustrated in Section 4. Finally, the results of the study are summarized in Section 5.
2. Kinematic Analysis of a 7-DOF Robot Manipulator
In this study, the 7-DOF YuMi 14000 ABB industrial robot [17] was used as an example to discuss the inverse kinematics problem. The schematic of the 7-DOF robot is shown in Figure 1, and its links and joints are given in Figure 2. The structure diagram of the left arm of the robot is presented in Figure 3. The Denavit–Hartenberg (DH) parameters as well as lower and upper joint limits for the left arm of the robot are listed in Table 1. In the work, the left arm of the robot was only used as the object to be investigated.


(a)

(b)

In Table 1, the parameters , , , , , and ( = 1, 2, 3, …, 7) represent the joint angle, link twist angle, link offset, link length, lower joint limit, and upper joint limit, respectively. The homogeneous transformation matrix of link is formed by DH parameters in where and denote and , respectively, while and denote and , respectively.
Thus, the forward kinematic can be calculated aswhere is the pose matrix of the end-effector relative to the base coordinate system. , , , , , , , , and represent the rotational elements of the pose matrix, while , , and are the elements of position vector.
According to equations (1) and (2), the pose equations are as follows.
It can be seen that the pose equations of the redundant manipulator are the functions of joint variables. Given the joint variables, the pose of the end-effector relative to the reference coordinate system can be calculated through the pose equations, and the result is unique; that is, the forward kinematics is a one-to-one relationship. However, given the pose of the end-effector, the corresponding joint variables will not be unique; that is, the inverse kinematics is a one-to-many relationship, and there are infinite inverse kinematics solutions for the 7-DOF robot manipulator.
3. Improved FOA
Inspired by the foraging behaviour of fruit flies, Pan [18] proposed a novel meta-heuristic algorithm, namely, the fruit fly optimization algorithm (FOA). Compared with other swarm intelligence-based algorithms, FOA has the merits of simple algorithm framework, few adjustable parameters, easy understanding, and implementation. Therefore, FOA has been used to resolve many science and engineering problems [19–22]. However, FOA also has lots of shortcomings. Particularly, because the smell concentration judgment value cannot be taken a negative value, FOA cannot deal with the optimization problems with negative decision variables. In addition, the optimization performance of FOA is highly dependent on the optimal solution of the current generation. As a result, the ability to maintain population diversity is not strong, making the algorithm easy to fall into local extremum.
To improve the convergence performance of FOA, a novel hybrid mutation mechanism for osphresis searching and a real-time dynamic update mechanism for vision searching are introduced, and a new improved FOA called HMFOA is proposed in this section.
3.1. A Hybrid Mutation Mechanism for Osphresis Search
In the original FOA, the smell concentration judgment value corresponds to the decision vector of the optimization problem, and its value is the reciprocal of distance. As a result, the smell concentration judgment value cannot be assigned a negative value and cannot be uniformly distributed in the search space. In HMFOA, the position of the fly in D-dimensional search space is presented as , and the smell concentration judgment value of the fly can be directly obtained according to . In this way, the above shortcomings can be overcome.
Inspired by the mutation idea of the differential evolution algorithm, the osphresis searching of HMFOA is executed according to equations (15)–(18).where denotes the best previous position of all fruit flies in the swarm, denotes the best previous position of the fruit fly, denotes the best previous position of the fruit fly, and are random and mutually different integers generated in the range ( presents the population size), and they also are different from the fly’s index and ; that is, . and are the upper and lower boundary vectors of the search space, respectively. , , , , and are random variables uniformly distributed on the interval [0, 1]. is a perturbation scaling factor that controls the search radius. is the current iteration of the algorithm and is the maximum iteration number of the algorithm.
According to equation (15), equation (17) is selected as the searching operator with a larger probability in the early stage of algorithm evolution, which ensures that the algorithm has the strong global search ability. As the number of iterations of the algorithm increases gradually, the probability that equation (16) is selected as the searching operator also increases gradually. Therefore, in the later stage of algorithm evolution, the local perturbation search near the global optimal position is enhanced. Thus, the convergence accuracy of the algorithm is steadily improved.
According to equations (16) and (17), it can be seen that the essence of olfactory searching is to randomly select one of the four mutation strategies according to probability as the current olfactory searching operator of the fly. Thus, a hybrid coevolution mechanism can be formed by randomly alternating different mutation strategies, and the diversity of the swarm is well maintained. The difference vector is used to randomly disturb the reference vector, and it is also helpful to improve the diversity of algorithm search. According to equation (18), a nonlinear decreasing perturbation scaling factor is introduced to balance the global exploration and local exploitation of the HMFOA. In the early stage of iteration, the value of factor is relatively large, which ensures that the algorithm can carry out optimal search within a larger search radius and thus has a strong global search capability. As the value of factor decreases, the search radius of fruit fly individual also decreases. Hence, the local search capability of the algorithm is enhanced in the later stage of algorithm evolution, and the candidate solution with better quality can be found in local neighbourhood.
3.2. A Real-Time Dynamic Update Mechanism for Vision Search
In the original FOA, when all fruit flies have completed their olfactory search, they fly toward the current optimal location using their visual senses. This search method, which only learns from the best individual, has the following disadvantages. Firstly, if the position corresponding to the best fruit fly individual is a local extreme value, it will easily lead to premature convergence of the algorithm. Secondly, because the contribution of nonoptimal fruit flies to population search is ignored, this search method places too much emphasis on competition among fruit flies and weakens cooperation among individuals.
In order to accelerate the convergence speed of the algorithm, a dynamic real-time update mechanism is employed in the visual search. In HMFOA, the vision searching refers to the dynamic real-time update of the search center position vector in equations (16) and (17). That is, when the position of the fly is updated, the new position of the fly is evaluated immediately, and then the disturbance center position vectors , , and are further updated in real-time using equations (19) and (20) (in this paper, the optimization problem refers to the minimum optimization problem).where is the fitness function.
In short, HMFOA can make full use of the successful search experience of each fly individual by using a real-time updated vision searching mechanism, which can effectively improve the search efficiency of the swarm.
3.3. Cross-Border Processing
During the evolution of HMFOA, it may occur that the position of the fly is beyond the search space. In order to enhance the diversity of the swarm, the cross-border position component is processed as follows.where is a random variable uniformly distributed on the interval [0, 1] and and are the lower and upper bounds for , respectively.
3.4. Implementation of HMFOA
The implementation process of HMFOA is shown in Figure 4. The detailed steps of implementing the HMFOA are described as follows: Step 1: initialize relate parameters, including population size and the maximum number of iterations. Then, randomly initialize the locations of all fruit flies in the search space. The best position of the fly individual is the current position. The global optimal position is selected as the current optimal position of the swarm. Assign , . Step 2: the olfactory search of the fly is performed according to equations (15)–(18). The cross-border position components are processed according to equation (21) and calculate the fitness of the fly. Step 3: according to equation (19), the best previous position of the swarm is updated in real time, and its objective fitness is recorded. Step 4: according to equation (20), the best previous position of the fly is updated in real time, and its objective fitness is recorded. Step 5: if all flies of the current generation complete the evolution operation, that is, , the next step is executed. Otherwise, set and return to step 2. Step 6: if the iterative number reaches the maximum, that is, , the algorithm ends and the optimization results are output. Otherwise, set , and return to step 2.

4. Simulation Results and Discussion
In this section, 8 typical benchmark functions are used to verify the performance of the HMFOA, and then the algorithm is used to solve the inverse kinematics problem of the 7-DOF YuMi 14000 ABB industrial robot. The optimization results of HMFOA are compared with those of FOA, IFOA [23], LGMS-FOA [24], AE-LGMS-FOA [25], and SFOA [26].
4.1. Parameter Setting
For all the algorithms, the population size is 60, and the maximum number of iterations is 1000. In LGMS-FOA, we set , , . The parameters of AE-LGMS-FOA are , , , and 80% of the best population is used to generate . For FOA, the random initialization fruit fly swarm location zone is [0, 10], and the random direction and distance of iterative fruit fly food searching are [−1, 1]. In IFOA, 50% of the individuals in a swarm fly toward the local optimal solution, and the others fly randomly; the perturbation amplification factor is 0.3.
The DH parameters as well as lower and upper joint limits for the left arm of the robot are listed in Table 1, as mentioned above.
All algorithms are coded in MATLAB R2013a. The computation is conducted on a personal computer (PC) with Intel (R) Core (TM) i7-7700, 3.6 GHz CPU, 16 GB RAM, and Windows 10 Operational System.
4.2. Function Simulation
Eight benchmark functions in Table 2 are used to test the performance of HMFOA. Among them, f1, f2, f3, and f4 are unimodal functions, which are employed to test the convergence speed and accuracy of the algorithm. The latter four functions are multimodal functions, which are made use of testing the global searching ability of the algorithm.
To evaluate the reliability of the results, each function was tested for 50 runs; the fitness results of the best value (Best), the mean value (Mean), the worst value (Worst), and the standard deviation (Std) are reported in Table 3 for all functions with dimensions equal to 30. The average convergence curve of each algorithm is shown in Figure 5.

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)
As can be seen from Table 3, for all benchmark functions, the HMFOA is far superior to other algorithms involved in comparison in terms of the best value, mean value, worst value, and standard deviation. Among the 8 benchmark functions, HMFOA can converge to the theoretical optimal values of 7 functions (except f7). For function f7, HMFOA also achieves satisfactory convergence quality. It can be seen from Figure 5, compared with the other five algorithms, the evolution curve of HMFOA drops faster and reaches a lower level (to facilitate evaluation and observation, the fitness of the objective function in the graph is a logarithm with the base of 10), indicating that HMFOA has the advantages of fast convergence speed and high convergence accuracy. The results in Figure 5 also show that FOA, IFOA, LGMS-FOA, AE-LGMS-FOA, and SFOA are easy to fall into local optimum.
4.3. Inverse Kinematics Solution of Redundant Manipulator
In the inverse kinematics calculation of the manipulator, the position vector of the fly contains the set of the joint variables of the 7-DOF redundant manipulator, that is, , where denote 7 joint angles, respectively. For a desired pose matrix of the end-effector, the position vector of the fly is substituted into the forward kinematics equations (3)–(14) to obtain the actual pose matrix . If holds, then is the solution of the corresponding inverse kinematics. Therefore, the optimization objective of the algorithm should be to make the matrix infinitely close to the matrix by changing the position of the fruit fly.
The orientation error and position error of the end-effector are calculated by equations (22) and (23), respectively.
Thus, the fitness function of the inverse kinematics problem can be defined as follows.where is the minimum function and is the weight factor.
In order to solve the inverse kinematics more effectively, we expand the population size of all the algorithms and set it to 100, and the rest of the parameters are the same as mentioned above. The weight factor is set as . In this research, the desired pose matrix of the end-effector is set as follows.
In order to investigate the reliability of the results, each algorithm runs independently and continuously for 50 times, respectively. The fitness results of the Best, the Worst, the Mean, the Std, and the successful ratio (SR) are reported in Table 4. The average convergence curve of each algorithm is shown in Figure 6. One of the best inverse kinematics solutions obtained by each algorithm is presented in Table 5. According to the inverse kinematics solutions in Table 5, the poses of the end-effector are obtained as shown in Figure 7. The pose errors of different algorithms are listed in Table 6.


(a)

(b)

(c)

(d)

(e)

(f)
The SR, i.e., the percentage of trials where algorithms converge with a specified accuracy (in this study it is assigned a value of ), is defined bywhere is the total number of trials and is the number of successful trials.
According to Table 4, the best value, worst value, mean value, standard deviation, and successful ratio of HMFOA are superior to those of other algorithms involved in comparison. The successful ratio of HMFOA is up to 94%, while the successful ratios of FOA, LGMS-FOA, AE-LGMS-FOA, IFOA, and SFOA are all zero. The best values of LGMS-FOA and AE-LGMS-FOA are 13 and 12 orders of magnitude worse than HMFOA, respectively, while the optimization results of FOA, IFOA, and SFOA are even worse. It can be seen from Figure 6 that the HMFOA has faster convergence speed and higher convergence accuracy than the other five algorithms (to facilitate evaluation and observation, the fitness of the objective function in the graph is a logarithm with the base of 10). From Figure 7, we can directly observe the actual pose of each inverse kinematics solution.
As can be seen from Table 6, the position errors corresponding to the optimal inverse solutions of FOA, IFOA, and SFOA are mm, , and , respectively. Due to the relatively large position errors, the inverse kinematic solutions obtained by FOA, IFOA, and SFOA are unacceptable. The inverse kinematics solutions corresponding to LGMS-FOA and AE-LGMS-FOA have achieved very high orientation accuracy, and the corresponding maximum errors of the position components are orders of magnitude and , respectively. The orientation and position accuracy corresponding to the optimal inverse kinematics solution of HMFOA are rather higher than other methods mentioned above, which indicates that the HMFOA can be used to effectively solve the inverse kinematics problem of redundant manipulator.
In a word, the calculation results of HMFOA are better than those of FOA, LGMS-FOA, AE-LGMS-FOA, IFOA, and SFOA in the inverse kinematics solution of the 7-DOF manipulator.
5. Conclusions
In this study, the inverse kinematics problem of the manipulator is transformed into a minimum optimization problem, and an improved fruit fly optimization algorithm, namely, the hybrid mutation fruit fly optimization algorithm, is proposed for resolving this problem. The olfactory search mechanism based on hybrid coevolution of multiple mutation strategies is employed in the algorithm, which can effectively balance the global and local search of the algorithm. Simultaneously, the premature convergence problem of the algorithm can also be effectively solved. Through the dynamic real-time update of visual search, the successful search experience of each fruit fly individual is fully utilized. Thus, the search efficiency of the swarm can be effectively improved. The simulation results of 8 typical benchmark functions indicate the feasibility and effectiveness of the proposed algorithm. The inverse kinematics of a 7-DOF redundant manipulator is taken as an example for experimental simulation. The comparisons of HMFOA with FOA and other variants of FOA illustrate that HMFOA is extremely suitable for solving kinematic problems of redundant manipulator.
Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This work was supported by the National Natural Science Foundation of China (51566012), the Joint Foundation of Guizhou Province (LH word [2015]7302), and the Special Funding of Guiyang Science and Technology Bureau and Guiyang University (GYU-KYZ (2019∼2020) DT-13).