# Hybrid Mutation Fruit Fly Optimization Algorithm for Solving the Inverse Kinematics of a Redundant Robot Manipulator

Authors: Jianping Shi; Yuting Mao; Peishen Li; Guoping Liu; Peng Liu; Xianyong Yang; Dahai Wang
Journal: Mathematical Problems in Engineering
 (2020)

---

## 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 is10−14 mm, while the pose errors obtained by FOA, LGMS-FOA, AE-LGMS-FOA, IFOA, and SFOA are 102 mm, 10−1 mm, 10−2 mm, 102 mm, and 102 mm, respectively. The experimental results show that HMFOA can be used to solve the inverse kinematics problem of redundant manipulators effectively.


---

## Body

## 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. Section2 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.Figure 1
7-DOF YuMi 14000 ABB industrial robot.Figure 2
YuMi robot arm links and joints (robotics product specification IRB 14000, 2015).
(a)
(b)Figure 3
The structure diagram of the left arm of the YuMi robot.Table 1
DH parameters for the left arm (i is the axis).
i
d
i (mm)
θ
i (degree)
a
i (mm)
α
i (degree)
l
i (degree)
u
i (degree)
1
166
0
−30
−90
−168.5
168.5
2
0
0
30
90
−143.5
43.5
3
251.5
0
40.5
−90
−123.5
80
4
0
−90
40.5
−90
−290
290
5
265
180
27
−90
−88
138
6
0
0
−27
90
−229
229
7
36
0
0
0
−168.5
168.5In Table1, the parameters θi, αi, di, ai, li, and ui (i = 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 Tii−1 of link iis formed by DH parameters in (1)Tii−1=cθi−cαisθisαisθiaicθisθicαicθi−sαicθiaisθi0sαicαidi0001,where sθi and cθi denote sinθi and cosθi, respectively, while sαi and cαi denote sinαi and cosαi, respectively.Thus, the forward kinematic can be calculated as(2)T70=T10⋅T21⋅T32⋅T43⋅T54⋅T65⋅T76=nxoxaxpxnyoyaypynzozazpz0001,where T70 is the pose matrix of the end-effector relative to the base coordinate system. nx, ny, nz, ox, oy, oz, ax, ay, and az represent the rotational elements of the pose matrix, while px, py, and pz are the elements of position vector.According to equations (1) and (2), the pose equations are as follows.(3)nx=cθ7sθ6cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4+cθ6cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2−sθ5cθ3sθ1+cθ1cθ2sθ3−sθ7sθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2+cθ5cθ3sθ1+cθ1cθ2sθ3,(4)ny=sθ7sθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2+cθ5cθ1cθ3−cθ2sθ1sθ3−cθ7sθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4+cθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3,(5)nz=sθ7sθ5cθ2cθ4−cθ3sθ2sθ4+cθ5sθ2sθ3−cθ7cθ6cθ5cθ2cθ4−cθ3sθ2sθ4−sθ2sθ3sθ5−sθ6cθ2sθ4+cθ3cθ4sθ2,(6)ox=−cθ7sθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2+cθ5cθ3sθ1+cθ1cθ2sθ3−sθ7sθ6cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4+cθ6cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2−sθ5cθ3sθ1+cθ1cθ2sθ3,(7)oy=cθ7sθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2+cθ5cθ1cθ3−cθ2sθ1sθ3+sθ7sθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4+cθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3,(8)oz=cθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4−sθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3,(9)ax=sθ6cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2−sθ5cθ3sθ1+cθ1cθ2sθ3−cθ6cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4,(10)ay=cθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4−sθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3,(11)az=−sθ6cθ5cθ2cθ4−cθ3sθ2sθ4−sθ2sθ3sθ5−cθ6cθ2sθ4+cθ3cθ4sθ2,(12)px=a1cθ1−d7cθ6cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4−sθ6cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2−sθ5cθ3sθ1+cθ1cθ2sθ3−d5cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4−a4sθ4sθ1sθ3−cθ1cθ2cθ3−a5sθ5cθ3sθ1+cθ1cθ2sθ3+a2cθ1cθ2+d3cθ1sθ2−a3sθ1sθ3+a5cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2+a6sθ6cθ4sθ1sθ3−cθ1cθ2cθ3+cθ1sθ2sθ4+a6cθ6cθ5sθ4sθ1sθ3−cθ1cθ2cθ3−cθ1cθ4sθ2−sθ5cθ3sθ1+cθ1cθ2sθ3+a3cθ1cθ2cθ3+a4cθ1cθ4sθ2,(13)py=d7cθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4−sθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3+a1sθ1+d5cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4−a6cθ6cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−sθ5cθ1cθ3−cθ2sθ1sθ3+a4sθ4cθ1sθ3+cθ2cθ3sθ1+a5sθ5cθ1cθ3−cθ2sθ1sθ3+a2cθ2sθ1+a3cθ1sθ3+d3sθ1sθ2−a5cθ5sθ4cθ1sθ3+cθ2cθ3sθ1+cθ4sθ1sθ2−a6sθ6cθ4cθ1sθ3+cθ2cθ3sθ1−sθ1sθ2sθ4+a3cθ2cθ3sθ1+ac4θ4sθ1sθ2,(14)pz=d1−d5cθ2sθ4+cθ3cθ4sθ2−d7sθ6cθ5cθ2cθ4−cθ3sθ2sθ4−sθ2sθ3sθ5+cθ6cθ2sθ4+cθ3cθ4sθ2+d3cθ2−a2sθ2−a5cθ5cθ2cθ4−cθ3sθ2sθ4+a6sθ6cθ2sθ4+cθ3cθ4sθ2+a4cθ2cθ4−a3cθ3sθ2−a6cθ6cθ5cθ2cθ4−cθ3sθ2sθ4−sθ2sθ3sθ5−a4cθ3sθ2sθ4+a5sθ2sθ3sθ5.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 valueSi 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 ith fly in D-dimensional search space is presented as Xi=xi1,xi2,...,xiD, and the smell concentration judgment value of the ith fly can be directly obtained according to Si=Xi. 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).(15)Xi=Xi′,rand1<1−ω,Xi″,rand1≥1−ω,(16)Xi′=Pbg+ω×Pbr1−Pbr2,rand2<0.5,Pbg×rand3+ω×Pbr1−Pbr2,rand2≥0.5,(17)Xi″=Pbi+ω×Pbr1−Pbr2,rand4<0.5,L+rand5×U−L,rand4≥0.5,(18)ω=1+cosπ×t−1/tmax2,where Pbg denotes the best previous position of all fruit flies in the swarm, Pbr1 denotes the best previous position of the r1th fruit fly, Pbr2 denotes the best previous position of the r2th fruit fly, r1 and r2 are random and mutually different integers generated in the range 1,m (m presents the population size), and they also are different from the fly’s index i and g; that is, r1≠r2≠i≠g. U and L are the upper and lower boundary vectors of the search space, respectively. rand1, rand2, rand3, rand4, and rand6 are random variables uniformly distributed on the interval [0, 1]. ω is a perturbation scaling factor that controls the search radius. t is the current iteration of the algorithm and tmax 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 ith 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 ω×Pbr1−Pbr2 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 Pbg, Pbg×rand3, and Pbi are further updated in real-time using equations (19) and (20) (in this paper, the optimization problem refers to the minimum optimization problem).(19)Pbg=Xi,fitnessXi≤fitnessPbg,Pbg,fitnessXi>fitnessPbg,(20)Pbi=Xi,fitnessXi≤fitnessPbi,Pbi,fitnessXi>fitnessPbi,where fitness⋅ 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.(21)xij=uj−minxij−uj,uj−lj∗rand6,xij>uj,lj+minlj−xij,uj−lj∗rand6,xij<lj,where rand6 is a random variable uniformly distributed on the interval [0, 1] and lj and uj are the lower and upper bounds for xij, respectively.


### 3.4. Implementation of HMFOA

The implementation process of HMFOA is shown in Figure4. 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. Assigni=1, t=1.Step 2: the olfactory search of theith 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 ith 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 ith 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,i=m, the next step is executed. Otherwise, set i=i+1 and return to step 2.Step 6: if the iterative number reaches the maximum, that is,t=tmax, the algorithm ends and the optimization results are output. Otherwise, set t=t+1, i=1 and return to step 2.Figure 4
The process of HMFOA.


## 3.1. A Hybrid Mutation Mechanism for Osphresis Search

In the original FOA, the smell concentration judgment valueSi 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 ith fly in D-dimensional search space is presented as Xi=xi1,xi2,...,xiD, and the smell concentration judgment value of the ith fly can be directly obtained according to Si=Xi. 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).(15)Xi=Xi′,rand1<1−ω,Xi″,rand1≥1−ω,(16)Xi′=Pbg+ω×Pbr1−Pbr2,rand2<0.5,Pbg×rand3+ω×Pbr1−Pbr2,rand2≥0.5,(17)Xi″=Pbi+ω×Pbr1−Pbr2,rand4<0.5,L+rand5×U−L,rand4≥0.5,(18)ω=1+cosπ×t−1/tmax2,where Pbg denotes the best previous position of all fruit flies in the swarm, Pbr1 denotes the best previous position of the r1th fruit fly, Pbr2 denotes the best previous position of the r2th fruit fly, r1 and r2 are random and mutually different integers generated in the range 1,m (m presents the population size), and they also are different from the fly’s index i and g; that is, r1≠r2≠i≠g. U and L are the upper and lower boundary vectors of the search space, respectively. rand1, rand2, rand3, rand4, and rand6 are random variables uniformly distributed on the interval [0, 1]. ω is a perturbation scaling factor that controls the search radius. t is the current iteration of the algorithm and tmax 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 ith 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 ω×Pbr1−Pbr2 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 Pbg, Pbg×rand3, and Pbi are further updated in real-time using equations (19) and (20) (in this paper, the optimization problem refers to the minimum optimization problem).(19)Pbg=Xi,fitnessXi≤fitnessPbg,Pbg,fitnessXi>fitnessPbg,(20)Pbi=Xi,fitnessXi≤fitnessPbi,Pbi,fitnessXi>fitnessPbi,where fitness⋅ 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.(21)xij=uj−minxij−uj,uj−lj∗rand6,xij>uj,lj+minlj−xij,uj−lj∗rand6,xij<lj,where rand6 is a random variable uniformly distributed on the interval [0, 1] and lj and uj are the lower and upper bounds for xij, respectively.


## 3.4. Implementation of HMFOA

The implementation process of HMFOA is shown in Figure4. 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. Assigni=1, t=1.Step 2: the olfactory search of theith 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 ith 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 ith 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,i=m, the next step is executed. Otherwise, set i=i+1 and return to step 2.Step 6: if the iterative number reaches the maximum, that is,t=tmax, the algorithm ends and the optimization results are output. Otherwise, set t=t+1, i=1 and return to step 2.Figure 4
The process of HMFOA.


## 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ω0=1, α=0.95, n=0.005. The parameters of AE-LGMS-FOA are p=0.005, ω0=1, n=10, and 80% of the best population is used to generate XAv. 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 Table1, 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 Table2 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.Table 2
Benchmark functions.
Test function
Search space
Optimal value
f
1
x
=
∑
i
=
1
D
x
i
2
−
100,100
D
0
f
2
x
=
∑
i
=
1
D
−
1
100
x
i
+
1
−
x
i
2
2
+
1
−
x
i
2
−
30,30
D
0
f
3
x
=
∑
i
=
1
D
∑
k
=
1
i
x
k
2
−
100,100
D
0
f
4
x
=
∑
i
=
1
D
x
i
+
∏
i
=
1
D
x
i
−
10,10
D
0
f
5
x
=
∑
i
=
1
D
x
i
2
/
4000
−
∏
i
=
1
D
cos
x
i
/
i
+
1
−
600,600
D
0
f
6
x
=
∑
i
=
1
D
x
i
2
−
10
cos
2
π
x
i
+
10
−
5.12,5.12
D
0
f
7
x
=
−
20
exp
−
0.2
1
/
D
∑
i
=
1
D
x
i
2
−
exp
1
/
D
∑
i
=
1
D
cos
2
π
x
i
+
20
+
e
−
100,100
D
0
f
8
x
=
f
x
1
,
x
2
+
f
x
2
,
x
3
+
⋯
+
f
x
D
,
x
1
,
f
x
,
y
=
0.5
+
sin
2
x
2
+
y
2
−
0.5
/
1
+
0.001
x
2
+
y
2
2
−
100,100
D
0To 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 Table3 for all functions with dimensions equal to 30. The average convergence curve of each algorithm is shown in Figure 5.Table 3
Comparison results of benchmark functions.
FOA
LGMS-FOA
AELGMS-FOA
IFOA
SFOA
HMFOA
f
1
Best
1.411770e − 4
3.466251e − 40
1.911653e − 19
1.356467e − 4
3.625604e − 5
0
Mean
4.623815e − 4
5.019091e − 40
3.351138e − 18
1.387048e − 4
3.721975e − 5
0
Worst
4.794164e − 4
7.370712e − 40
1.821983e − 17
1.411770e − 4
3.830758e − 5
0
Std.
1.432076e − 6
9.099148e − 41
3.523805e − 18
1.432076e − 6
4.633699e − 7
0
f
2
Best
27.244893
26.430489
26.945519
27.752978
28.688393
0
Mean
28.693051
28.056813
27.956949
28.228172
28.722672
0
Worst
32.020138
29.377247
28.994375
28.596902
28.774159
0
Std.
0.892672
0.640186
0.497804
0.232890
0.024310
0
f
3
Best
0.133342
0.029958
3.335927e − 4
0.039419
1.503231e − 5
0
Mean
0.138847
0.923459
0.006701
0.040155
2.124765e − 5
0
Worst
0.143332
4.750825
0.036739
0.040996
3.583190e − 5
0
Std.
0.001782
1.030883
0.007965
3.230054e − 4
4.625523e − 6
0
f
4
Best
0.118299
2.814927e − 13
7.590946e − 9
0.063400
0.035800
0
Mean
0.119498
0.010992
4.956341e − 6
0.064237
0.035856
0
Worst
0.121374
0.103356
2.242247e − 4
0.064880
0.035957
0
Std.
6.145446e − 4
0.021724
3.133953e − 5
2.749579e − 4
3.254229e − 5
0
f
5
Best
2.409987e − 5
0
1.920686e − 14
6.970412e − 6
1.028335e − 6
0
Mean
2.481638e − 5
0.005076
0.003841
7.121020e − 6
1.226157e − 6
0
Worst
2.562478e − 5
0.019697
0.024573
7.284919e − 6
1.517875e − 6
0
Std.
3.167733e − 7
0.005384
0.006266
7.113268e − 8
9.531260e − 8
0
f
6
Best
0.092326
0
0
0.026792
0.008531
0
Mean
11.785692
5.968559e − 15
6.430412e − 15
0.027441
0.008581
0
Worst
79.015636
1.598721e − 14
1.598721e − 14
0.028106
0.008613
0
Std.
16.989014
3.440084e − 15
4.603335e − 15
2.965811e − 4
1.659589e − 5
0
f
7
Best
0.016704
1.509903e − 14
1.443619e − 10
0.008752
0.004740
8.881784e − 16
Mean
0.016867
2.376765e − 14
4.627204e − 10
0.008835
0.004774
8.881784e − 16
Worst
0.017080
3.996803e − 14
1.311684e − 09
0.008934
0.004807
8.881784e − 16
Std.
9.602465e − 5
6.518431e − 15
2.675685e − 10
4.148766e − 5
1.263296e − 5
0
f
8
Best
9.296021e − 4
0
0
2.719695e − 4
7.178698e − 5
0
Mean
0.067527
1.554312e − 17
1.831868e − 16
2.772358e − 4
7.458798e − 5
0
Worst
1.109406
2.220446e − 16
8.881784e − 16
2.829657e − 4
7.696815e − 5
0
Std.
0.163524
5.329071e − 17
2.332129e − 16
2.697164e − 6
9.418096e − 7
0Figure 5
Average convergence curves for the selected functions. (a)f1. (b) f2. (c) f3. (d) f4. (e) f5. (f) f6. (g) f7. (h) f8.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)As can be seen from Table3, 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 theith fly contains the set of the joint variables of the 7-DOF redundant manipulator, that is, Xi=xi1,xi2,...,xi7=θi1,θi2,...,θi7, where θi1,θi2,...,θi7 denote 7 joint angles, respectively. For a desired pose matrix T70∗=nx∗ox∗ax∗px∗ny∗oy∗ay∗py∗nz∗oz∗az∗pz∗0001 of the end-effector, the position vector Xi of the ith fly is substituted into the forward kinematics equations (3)–(14) to obtain the actual pose matrix T70=nxoxaxpxnyoyaypynzozazpz0001. If T70∗=T70 holds, then Xi is the solution of the corresponding inverse kinematics. Therefore, the optimization objective of the algorithm should be to make the matrix T70 infinitely close to the matrix T70∗ 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.(22)f′=nx∗−nx+ny∗−ny+nz∗−nz+ox∗−ox+oy∗−oy+oz∗−oz+ax∗−ax+ay∗−ay+az∗−az,(23)f″=px∗−px+py∗−py+pz∗−pz.Thus, the fitness function of the inverse kinematics problem can be defined as follows.(24)f=minf′+λf″,where min⋅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 10−2. In this research, the desired pose matrix of the end-effector is set as follows.(25)T70∗=−0.4294219697−0.36342568920.826751800916.05405185880.84509708310.16109336360.509764502866.8595013541−0.31844574430.91758961230.2379529604243.14912004190001.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 Table4. 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.Table 4
Performance statistics of different algorithms.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
Best
2.3664845407
8.6689214717e − 3
8.0997417917e − 4
5.8509445796
5.1327857288
4.8294701571e − 16
Worst
5.8858025146
1.5095793139
1.3589677774
6.1056362998
8.3300837795
9.1473267081e − 2
Mean
5.7220157213
4.5801009616e − 1
3.1026807967e − 1
5.9634463791
7.0334301557
2.1510704486e − 3
Std
4.8093695407e − 1
4.2380970796e − 1
3.0905484214e − 1
5.3295364512e − 2
6.6812284973e − 1
1.2857130856e − 2
SR (%)
0
0
0
0
0
94Figure 6
Average convergence curves for a redundant robot manipulator.Table 5
An inverse kinematics solution corresponding to the best fitness of each algorithm.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
θ
1/rad
0.0976126056
−1.0839133510
−2.6595857928
0.0879773602
0.2928215864
−2.7714570693
θ
2/rad
−1.0722179601
−2.4772682366
−1.3854268665
0.1076406335
−0.3252784200
−1.2864166263
θ
3/rad
0.1066073486
−0.4238387176
−0.8803102621
0.0778478430
0.2793738833
−1.1659304990
θ
4/rad
5.0187740095
−4.5222500892
−4.8530768097
0.0983433196
0.5282601969
1.4498210529
θ
5/rad
0.0666429414
1.3790609675
0.0041955026
0.3085488511
0.3596046188
0.3811435232
θ
6/rad
0.0906599000
1.3828761741
3.3703822119
0.0943219901
−0.2018160421
3.4299412880
θ
7/rad
0.9180238304
0.3766713486
−1.0054925913
0.0726914072
0.5789474603
−0.3168192999Figure 7
Poses of the end-effector corresponding to different algorithms. (a) FOA. (b) LGMS-FOA. (c) AE-LGMS-FOA. (d) IFOA. (e) SFOA. (f) HMFOA.
(a)
(b)
(c)
(d)
(e)
(f)Table 6
The pose errors of different algorithms.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
n
x
∗
−
n
x
−7.3284224305e − 1
5.5511151231e − 17
−5.5511151231e − 17
−9.0361801676e − 2
−6.9918463297e − 2
0
n
y
∗
−
n
y
−7.1127054555e − 2
−1.1102230246e − 16
0
5.1834675479e − 1
1.9132713058e − 1
0
n
z
∗
−
n
z
−5.8011245465e − 1
−5.5511151231e − 17
−1.1102230246e − 16
5.6375175368e − 1
3.4739363429e − 1
0
o
x
∗
−
o
x
3.5307444229e − 1
−5.5511151231e − 17
−5.5511151231e − 17
−2.9259749224e − 1
−6.5206087533e − 2
−5.5511151231e − 17
o
y
∗
−
o
y
−0.2393223149e − 1
−2.7755575616e − 17
−8.3266726847e − 17
−7.6512409616e − 1
−4.3453605161e − 1
−1.1102230246e − 16
o
z
∗
−
o
z
1.4888118509
0
1.1102230246e − 16
5.4731325106e − 1
1.7174065382e − 1
0
a
x
∗
−
a
x
1.4548948573
2.2204460493e − 16
1.1102230246e − 16
−1.1134284726e − 1
−5.7455356949e − 2
1.1102230246e − 16
a
y
∗
−
a
y
5.2392832745e − 1
−1.1102230246e − 16
−2.2204460493e − 16
3.2173407939e − 1
4.3062832710e − 2
0
a
z
∗
−
a
z
−5.4001598940e − 1
0
−2.7755575616e − 17
5.2885327132e − 1
2.5711680884e − 1
2.7755575616e − 17
p
x
∗
−
p
x
4.6935429781e + 2
5.3290705182e − 14
−8.0995335681e − 2
−3.5061043328e + 2
−1.9242055348e + 2
−3.5527136788e − 15
p
y
∗
−
p
y
1.0069936321e + 2
−8.6290277692e − 1
−2.0822353690e − 6
6.4331576044
−8.5433896652e + 1
−1.4210854715e − 14
p
z
∗
−
p
z
−2.9740412354e + 2
3.9893702441e − 3
0
−1.3976150052e + 2
−1.6629175959e + 2
0The SR, i.e., the percentage of trials where algorithms converge with a specified accuracy (in this study it is assigned a value of10−9), is defined by(26)SR=n′n×100%,where n is the total number of trials and n′is the number of successful trials.According to Table4, 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 Table6, the position errors corresponding to the optimal inverse solutions of FOA, IFOA, and SFOA are 102 mm, 102mm, and 102mm, 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 10−1mm and 10−2mm, 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.


## 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ω0=1, α=0.95, n=0.005. The parameters of AE-LGMS-FOA are p=0.005, ω0=1, n=10, and 80% of the best population is used to generate XAv. 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 Table1, 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 Table2 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.Table 2
Benchmark functions.
Test function
Search space
Optimal value
f
1
x
=
∑
i
=
1
D
x
i
2
−
100,100
D
0
f
2
x
=
∑
i
=
1
D
−
1
100
x
i
+
1
−
x
i
2
2
+
1
−
x
i
2
−
30,30
D
0
f
3
x
=
∑
i
=
1
D
∑
k
=
1
i
x
k
2
−
100,100
D
0
f
4
x
=
∑
i
=
1
D
x
i
+
∏
i
=
1
D
x
i
−
10,10
D
0
f
5
x
=
∑
i
=
1
D
x
i
2
/
4000
−
∏
i
=
1
D
cos
x
i
/
i
+
1
−
600,600
D
0
f
6
x
=
∑
i
=
1
D
x
i
2
−
10
cos
2
π
x
i
+
10
−
5.12,5.12
D
0
f
7
x
=
−
20
exp
−
0.2
1
/
D
∑
i
=
1
D
x
i
2
−
exp
1
/
D
∑
i
=
1
D
cos
2
π
x
i
+
20
+
e
−
100,100
D
0
f
8
x
=
f
x
1
,
x
2
+
f
x
2
,
x
3
+
⋯
+
f
x
D
,
x
1
,
f
x
,
y
=
0.5
+
sin
2
x
2
+
y
2
−
0.5
/
1
+
0.001
x
2
+
y
2
2
−
100,100
D
0To 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 Table3 for all functions with dimensions equal to 30. The average convergence curve of each algorithm is shown in Figure 5.Table 3
Comparison results of benchmark functions.
FOA
LGMS-FOA
AELGMS-FOA
IFOA
SFOA
HMFOA
f
1
Best
1.411770e − 4
3.466251e − 40
1.911653e − 19
1.356467e − 4
3.625604e − 5
0
Mean
4.623815e − 4
5.019091e − 40
3.351138e − 18
1.387048e − 4
3.721975e − 5
0
Worst
4.794164e − 4
7.370712e − 40
1.821983e − 17
1.411770e − 4
3.830758e − 5
0
Std.
1.432076e − 6
9.099148e − 41
3.523805e − 18
1.432076e − 6
4.633699e − 7
0
f
2
Best
27.244893
26.430489
26.945519
27.752978
28.688393
0
Mean
28.693051
28.056813
27.956949
28.228172
28.722672
0
Worst
32.020138
29.377247
28.994375
28.596902
28.774159
0
Std.
0.892672
0.640186
0.497804
0.232890
0.024310
0
f
3
Best
0.133342
0.029958
3.335927e − 4
0.039419
1.503231e − 5
0
Mean
0.138847
0.923459
0.006701
0.040155
2.124765e − 5
0
Worst
0.143332
4.750825
0.036739
0.040996
3.583190e − 5
0
Std.
0.001782
1.030883
0.007965
3.230054e − 4
4.625523e − 6
0
f
4
Best
0.118299
2.814927e − 13
7.590946e − 9
0.063400
0.035800
0
Mean
0.119498
0.010992
4.956341e − 6
0.064237
0.035856
0
Worst
0.121374
0.103356
2.242247e − 4
0.064880
0.035957
0
Std.
6.145446e − 4
0.021724
3.133953e − 5
2.749579e − 4
3.254229e − 5
0
f
5
Best
2.409987e − 5
0
1.920686e − 14
6.970412e − 6
1.028335e − 6
0
Mean
2.481638e − 5
0.005076
0.003841
7.121020e − 6
1.226157e − 6
0
Worst
2.562478e − 5
0.019697
0.024573
7.284919e − 6
1.517875e − 6
0
Std.
3.167733e − 7
0.005384
0.006266
7.113268e − 8
9.531260e − 8
0
f
6
Best
0.092326
0
0
0.026792
0.008531
0
Mean
11.785692
5.968559e − 15
6.430412e − 15
0.027441
0.008581
0
Worst
79.015636
1.598721e − 14
1.598721e − 14
0.028106
0.008613
0
Std.
16.989014
3.440084e − 15
4.603335e − 15
2.965811e − 4
1.659589e − 5
0
f
7
Best
0.016704
1.509903e − 14
1.443619e − 10
0.008752
0.004740
8.881784e − 16
Mean
0.016867
2.376765e − 14
4.627204e − 10
0.008835
0.004774
8.881784e − 16
Worst
0.017080
3.996803e − 14
1.311684e − 09
0.008934
0.004807
8.881784e − 16
Std.
9.602465e − 5
6.518431e − 15
2.675685e − 10
4.148766e − 5
1.263296e − 5
0
f
8
Best
9.296021e − 4
0
0
2.719695e − 4
7.178698e − 5
0
Mean
0.067527
1.554312e − 17
1.831868e − 16
2.772358e − 4
7.458798e − 5
0
Worst
1.109406
2.220446e − 16
8.881784e − 16
2.829657e − 4
7.696815e − 5
0
Std.
0.163524
5.329071e − 17
2.332129e − 16
2.697164e − 6
9.418096e − 7
0Figure 5
Average convergence curves for the selected functions. (a)f1. (b) f2. (c) f3. (d) f4. (e) f5. (f) f6. (g) f7. (h) f8.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)As can be seen from Table3, 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 theith fly contains the set of the joint variables of the 7-DOF redundant manipulator, that is, Xi=xi1,xi2,...,xi7=θi1,θi2,...,θi7, where θi1,θi2,...,θi7 denote 7 joint angles, respectively. For a desired pose matrix T70∗=nx∗ox∗ax∗px∗ny∗oy∗ay∗py∗nz∗oz∗az∗pz∗0001 of the end-effector, the position vector Xi of the ith fly is substituted into the forward kinematics equations (3)–(14) to obtain the actual pose matrix T70=nxoxaxpxnyoyaypynzozazpz0001. If T70∗=T70 holds, then Xi is the solution of the corresponding inverse kinematics. Therefore, the optimization objective of the algorithm should be to make the matrix T70 infinitely close to the matrix T70∗ 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.(22)f′=nx∗−nx+ny∗−ny+nz∗−nz+ox∗−ox+oy∗−oy+oz∗−oz+ax∗−ax+ay∗−ay+az∗−az,(23)f″=px∗−px+py∗−py+pz∗−pz.Thus, the fitness function of the inverse kinematics problem can be defined as follows.(24)f=minf′+λf″,where min⋅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 10−2. In this research, the desired pose matrix of the end-effector is set as follows.(25)T70∗=−0.4294219697−0.36342568920.826751800916.05405185880.84509708310.16109336360.509764502866.8595013541−0.31844574430.91758961230.2379529604243.14912004190001.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 Table4. 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.Table 4
Performance statistics of different algorithms.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
Best
2.3664845407
8.6689214717e − 3
8.0997417917e − 4
5.8509445796
5.1327857288
4.8294701571e − 16
Worst
5.8858025146
1.5095793139
1.3589677774
6.1056362998
8.3300837795
9.1473267081e − 2
Mean
5.7220157213
4.5801009616e − 1
3.1026807967e − 1
5.9634463791
7.0334301557
2.1510704486e − 3
Std
4.8093695407e − 1
4.2380970796e − 1
3.0905484214e − 1
5.3295364512e − 2
6.6812284973e − 1
1.2857130856e − 2
SR (%)
0
0
0
0
0
94Figure 6
Average convergence curves for a redundant robot manipulator.Table 5
An inverse kinematics solution corresponding to the best fitness of each algorithm.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
θ
1/rad
0.0976126056
−1.0839133510
−2.6595857928
0.0879773602
0.2928215864
−2.7714570693
θ
2/rad
−1.0722179601
−2.4772682366
−1.3854268665
0.1076406335
−0.3252784200
−1.2864166263
θ
3/rad
0.1066073486
−0.4238387176
−0.8803102621
0.0778478430
0.2793738833
−1.1659304990
θ
4/rad
5.0187740095
−4.5222500892
−4.8530768097
0.0983433196
0.5282601969
1.4498210529
θ
5/rad
0.0666429414
1.3790609675
0.0041955026
0.3085488511
0.3596046188
0.3811435232
θ
6/rad
0.0906599000
1.3828761741
3.3703822119
0.0943219901
−0.2018160421
3.4299412880
θ
7/rad
0.9180238304
0.3766713486
−1.0054925913
0.0726914072
0.5789474603
−0.3168192999Figure 7
Poses of the end-effector corresponding to different algorithms. (a) FOA. (b) LGMS-FOA. (c) AE-LGMS-FOA. (d) IFOA. (e) SFOA. (f) HMFOA.
(a)
(b)
(c)
(d)
(e)
(f)Table 6
The pose errors of different algorithms.
FOA
LGMS-FOA
AE-LGMS-FOA
IFOA
SFOA
HMFOA
n
x
∗
−
n
x
−7.3284224305e − 1
5.5511151231e − 17
−5.5511151231e − 17
−9.0361801676e − 2
−6.9918463297e − 2
0
n
y
∗
−
n
y
−7.1127054555e − 2
−1.1102230246e − 16
0
5.1834675479e − 1
1.9132713058e − 1
0
n
z
∗
−
n
z
−5.8011245465e − 1
−5.5511151231e − 17
−1.1102230246e − 16
5.6375175368e − 1
3.4739363429e − 1
0
o
x
∗
−
o
x
3.5307444229e − 1
−5.5511151231e − 17
−5.5511151231e − 17
−2.9259749224e − 1
−6.5206087533e − 2
−5.5511151231e − 17
o
y
∗
−
o
y
−0.2393223149e − 1
−2.7755575616e − 17
−8.3266726847e − 17
−7.6512409616e − 1
−4.3453605161e − 1
−1.1102230246e − 16
o
z
∗
−
o
z
1.4888118509
0
1.1102230246e − 16
5.4731325106e − 1
1.7174065382e − 1
0
a
x
∗
−
a
x
1.4548948573
2.2204460493e − 16
1.1102230246e − 16
−1.1134284726e − 1
−5.7455356949e − 2
1.1102230246e − 16
a
y
∗
−
a
y
5.2392832745e − 1
−1.1102230246e − 16
−2.2204460493e − 16
3.2173407939e − 1
4.3062832710e − 2
0
a
z
∗
−
a
z
−5.4001598940e − 1
0
−2.7755575616e − 17
5.2885327132e − 1
2.5711680884e − 1
2.7755575616e − 17
p
x
∗
−
p
x
4.6935429781e + 2
5.3290705182e − 14
−8.0995335681e − 2
−3.5061043328e + 2
−1.9242055348e + 2
−3.5527136788e − 15
p
y
∗
−
p
y
1.0069936321e + 2
−8.6290277692e − 1
−2.0822353690e − 6
6.4331576044
−8.5433896652e + 1
−1.4210854715e − 14
p
z
∗
−
p
z
−2.9740412354e + 2
3.9893702441e − 3
0
−1.3976150052e + 2
−1.6629175959e + 2
0The SR, i.e., the percentage of trials where algorithms converge with a specified accuracy (in this study it is assigned a value of10−9), is defined by(26)SR=n′n×100%,where n is the total number of trials and n′is the number of successful trials.According to Table4, 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 Table6, the position errors corresponding to the optimal inverse solutions of FOA, IFOA, and SFOA are 102 mm, 102mm, and 102mm, 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 10−1mm and 10−2mm, 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.



---

*Source: 6315675-2020-05-07.xml*