1. Introduction
Manipulator robots, known for their unparalleled precision, efficiency, and safety, are revolutionizing industries across the globe. These versatile machines are pivotal in space applications, where they service satellites, remove orbital debris, and construct and maintain orbital assets, ensuring the sustainability of our extraterrestrial endeavors [
1]. In the automotive industry, robotic manipulators excel in welding tasks, utilizing an electric arc and shielding gas to enhance manufacturing processes [
2]. The healthcare sector has also benefited immensely, with robotic arms enabling minimally invasive surgeries that surpass traditional open surgery methods in terms of precision and recovery time [
3]. By performing repetitive and hazardous tasks with consistent accuracy, these robotic systems not only improve operational efficiency but also ensure worker safety. Central to their functionality is the complex challenge of solving the inverse kinematics (IK) of the robotic manipulator, a crucial aspect that underpins their application in these diverse fields.
The inverse kinematics problem entails determining the joint variable configuration that corresponds to a specific position and orientation of the end-effector. This task is generally more complex than solving the forward kinematics problem for several reasons [
4]:
Equations to solve are generally non-linear, making it not always possible to find a closed-form solution.
Multiple solutions may exist.
Infinite solutions may exist.
There might be no admissible solutions.
Conventional numerical methods based on differential kinematics rely on the Jacobian matrix to determine the relationship between joint variables and end-effector positions [
5]. However, these methods encounter significant problems due to singularities in the Jacobian matrix, which can lead to undefined or infinite solutions [
4,
6]. Closed-form methods such as algebraic or geometric methods are commonly used for manipulators with simple geometric structures [
7]. Due to these drawbacks, artificial intelligence methods are increasingly utilized to solve the inverse kinematics problem.
In recent years, although to a limited extent, the solution of inverse kinematics has been explored using Artificial Neural Networks (ANNs). Typically, the input to the network is the desired position and orientation of the end-effector and the output is the vector of generalized coordinates, representing the robot’s joint configurations. However, this method faces challenges in generalizing across different kinematic structures or manipulators, as it requires a unique dataset for each specific manipulator. Due to the complexity of the problem, research has been limited to solving it within the three-dimensional Cartesian plane, with the additional necessity of identifying singularity zones [
8,
9]. Additionally, approaches that account for both position and rotation demand very large datasets and an optimization process for the candidate solution, often utilizing numerical methods such as the Newton–Raphson method [
10].
For these reasons, this paper proposes solving the inverse kinematics problem using metaheuristic algorithms. In the past decade, metaheuristic algorithms have emerged as a viable alternative for addressing various challenges in robotics. These algorithms are particularly useful for solving problems that are difficult to tackle with conventional methods or for which no exact solution method exists [
11]. In the literature we can find examples of the application of metaheuristic algorithms, such as their use for hyperparameter tuning in both machine learning algorithms and deep neural networks [
12], and trajectory tracking optimization [
13], as well as in robotic navigation [
14].
A review of the state of the art in robotic applications, particularly addressing the inverse kinematics of manipulator robots, is presented in
Table 1. This review highlights that differential evolution (DE) and particle swarm optimization (PSO) are the most commonly used metaheuristic algorithms for solving the inverse kinematics problem. Other algorithms, such as Artificial Bee Colony (ABC), bees algorithm (BA), Beta Salp Swarm Algorithm (
-SSA), Wild Geese Migration Optimization (GMO), Gray Wolf Optimization (GWO), and Firefly Algorithm (FA), have also been implemented. Most studies focus on a single manipulator, with only two cases [
15,
16] proposing more generalized methods. Typically, these studies address only the position problem, as incorporating orientation significantly increases the complexity of solving the inverse kinematics. Although joint limits are considered in all optimization processes, hard bounding is commonly applied to manage constraints, or candidate solutions are recalculated when they exceed the search space. This approach is necessary because metaheuristic algorithms are not inherently designed to handle constrained problems.
In this paper, we propose a novel method to solve inverse kinematics using a metaheuristic algorithm combined with a Jacobian step. Unlike traditional approaches, the Jacobian step is applied neither in each iteration nor to a subpopulation; it is used selectively when a deadlock is detected, and only to the global best solution. This strategy reduces the implementation complexity of the algorithm. Our method effectively addresses both position and orientation in inverse kinematics, formulating the problem as a constrained optimization task where joint limits are represented as constraints. Since metaheuristic algorithms are not inherently designed for constrained problems, we employ penalty functions to manage these constraints. Our approach is generalizable to redundant robots with n degrees of freedom. The applicability of the algorithm is demonstrated using a 5 DOF KUKA robotic arm, showcasing its effectiveness and versatility.
A comparative study is conducted using the following metaheuristic algorithms: the differential evolution algorithm “DE” proposed by storn et al. in 1997 [
29], the particle swarm optimization algorithm “PSO” proposed by Kennedy and Heberhart in 1995 [
30], the bees algorithm “BA” proposed by Pham et al. in 2006 [
31], the invasive weed optimization algorithm “IWO” proposed by Mehrabian and Lucas in 2006 [
32] and the imperialist competitive algorithm “ICA” proposed by Atashpaz-Gargari and Lucas in 2007 [
33].
2. Robot Manipulator Kinematics
A robot manipulator consist of a series of links interconnected by joints, forming a kinematic chain. The beginning of the chain is fixed to a base and an end-effector tool is connected to the end of the chain. A joint variable
is defined as
where each joint
with
, where
n represents the total DOFs of the manipulator robot [
4,
34].
A manipulator kinematics model can be described based on the Denavit–Hartenberg convention (DH). Since each joint connects two links, a robot manipulator with
n joints will have
links. In the DH convention, joint
i connects link
to link
i. Each link
i is represented by a homogenous matrix
that transforms the frame attached to the link
into the joint link
i. The homogeneous matrix
is defined as
where the parameters
,
,
, and
represent the joint angle, link length, link offset, and link twist, respectively. The parameter
becomes the joint variable for revolute joints. In contrast, the parameter
becomes the joint variable for prismatic joints. In both cases, the rest of the parameters remain constant.
The forward kinematics computes the end-effector pose
given the joint variable
which is
The end-effector pose
contains the position
and orientation
of the tool in the following form:
The inverse kinematics computes the joint variable
given the end-effector pose
. The iterative Jacobian pseudoinverse algorithm can solve the inverse kinematics as follows:
where
k represents the current iteration,
is a positive scalar factor with
,
is a Jacobian matrix, and
is an error between a desired and current end-effector pose. Moreover, the operation
is the pseudoinverse of
also called the Moore–Penrose inverse. For manipulators of 6 DOF (
),
is rather used. The error
is defined as
where
is the translation error between the desired
and current
end-effector position. This error is defined as
Moreover,
is the orientation error between the desired
and current
orientation, that is,
The forward kinematics always provide a solution for any joint variable . However, inverse kinematics may yield multiple solutions for the same end-effector pose . Additionally, the equations involved to solve the inverse kinematics are non-linear, and for that reason it is not always possible to find a closed-form solution. The iterative Jacobian pseudoinverse method is a commonly used approach for solving inverse kinematics. However, this method is prone to singularities, as it necessitates the inversion of a Jacobian matrix that can become rank deficient. To address these limitations, this work proposes solving the inverse kinematics problem using metaheuristic algorithms.
3. Differential Evolution
Differential evolution (DE) is a population-based algorithm employed for global optimization. In this algorithm, population members are called individuals and they represent potential solutions. These individuals are adjusted during an iterative process (generations) by performing three principal operations: mutation, crossover, and selection.
Initially, each individual is randomly generated, where with N representing the total number of population members, D denoting the dimension of the problem, and G indicating the current generation.
The mutation operation generates a mutant vector
as follows:
where
,
, and
are individuals chosen randomly such that
and
. Moreover,
is called the amplification factor.
A trial vector
is created by the following crossover operation:
where
is the crossover constant, and
and
are random numbers.
In the selection operation, the trial vector
is compared to the current vector
according to the following scheme:
where
f is an objective function. Trial vector
replaces
if
yields a better solution; otherwise,
is retained in the next iteration. A detailed description of DE can be found in [
29].
4. Approach Description
This section presents a comprehensive description of the objective function formulation and introduces the algorithm for solving inverse kinematics using a hybrid differential evolution approach.
4.1. Objective Function Formulation
This work proposes solving the inverse kinematics (IK) problem as a global constrained optimization task. The objective function is formulated to minimize the error between the desired end-effector pose
and the current end-effector pose
, which can be computed using Equations (
2) and (
3).
The objective function
f is defined as
where
represents a Euclidean norm error between the desired and the current position, and
represents the Frobenius norm error between the desired and the current orientation. Additionally,
and
are positive weight factors.
The optimization problem is then defined as follows:
where
and
are the lower and upper joint boundary, respectively. The joint boundary represents the joint limits. They are defined as
The constrained optimization in (
12) is reformulated as an unconstrained optimization problem using quadratic penalty functions. The proposed objective function
is then defined as follows:
where
is a coefficient that scales the contribution of the penalty functions. By setting
larger, constraints are penalized more severely. Moreover, when
and
, the constraint in dimension
j is satisfied.
Finally, the proposed optimization problem is given as
Notice that the proposed objective function (
13) incorporates the weighted error in both position and orientation, along with a penalty scheme. By minimizing the objective function, the joint configurations result in lower position and orientation errors while ensuring feasible joint solutions.
4.2. Inverse Kinematics Using Hybrid Differential Evolution
We propose enhancing the exploitation of differential evolution (DE) with Jacobian-based refinements, tracking the improvements of the best individuals over generations. If the position of the best individual stagnates, a Jacobian pseudoinverse step is performed to generate a candidate solution. This candidate solution replaces the current best individual if it provides a better solution. This operation enhances the local exploitation capabilities of DE with Jacobian-based refinements while preserving the exploration capabilities of DE.
The best individual is considered to be stagnating when there is not improvement after several generations. An counter tracks the number of consecutive unsuccessful modifications at generation G. If reaches a predefined stagnation limit L, a Jacobian-based refinement is performed. This process is called the Jacobian pseudoinverse step.
The Jacobian pseudoinverse step produces a candidate solution based on the conventional numerical method (
4). The candidate solution
is generated as follows:
where
denotes the best individual at generation
G. The candidate solution is then compared against the current best solution according to the following scheme:
which is a selection operation. If candidate solution
produces a better solution than
,
replaces the best individual for the next generation. Otherwise,
is retained.
4.3. Proposed Algorithm
The proposed inverse kinematics algorithm, based on hybrid differential evolution, is outlined in Algorithm 1. Initially, individuals are generated randomly based on the following operation:
where
is a random number.
The algorithm performs the mutation, recombination, and selection operation on each individual in the population. Subsequently, the algorithm identifies the best individual
. It then checks whether the best individual has stagnated, determined by whether the stagnation counter
exceeds the predefined limit
L (i.e.,
). If stagnation is detected, the proposed Jacobian pseudoinverse operation is performed. In this scenario, a candidate solution
is computed using the Jacobian pseudoinverse step. Local refinements are made if
proves to be a better solution than
. Additionally, the stagnation counter
increases when
, indicating an unsuccessful improvement. This process is repeated until the stopping criteria are met. Finally the algorithm returns the individual with the best fitness as the solution.
Algorithm 1 Proposed inverse kinematics based on hybrid differential evolution. |
- 1:
set objective function as in ( 13) - 2:
set and values - 3:
set joint boundary and - 4:
set stagnation counter and stagnation limit L - 5:
for each individual i do - 6:
for each dimension j do - 7:
randomly compute - 8:
- 9:
end - 10:
end - 11:
repeat - 12:
// Mutation, recombination, and selection operations on population: - 13:
for each individual i do - 14:
randomly choose , such that - 15:
- 16:
randomly compute - 17:
for each dimension j do - 18:
randomly compute - 19:
if r or then - 20:
- 21:
otherwise - 22:
- 23:
end - 24:
end - 25:
if then - 26:
- 27:
end - 28:
end - 29:
// Jacobian pseudoinverse operation: - 30:
find best individual g - 31:
if then - 32:
- 33:
if - 34:
- 35:
otherwise - 36:
- 37:
end - 38:
- 39:
end - 40:
if then - 41:
- 42:
otherwise - 43:
- 44:
end - 45:
until the stopping criteria are met - 46:
Return the individual with the best fitness as the solution
|
5. Simulation and Experimental Results
Experiments aim to test the proposed inverse kinematics algorithm under different manipulator structures. Simulations perform a comparison among metaheuristic algorithms. Moreover, real-world experiments validate the applicability of the proposal.
5.1. Simulation Experiments
The objective of these simulations is to compare the performance of various metaheuristic algorithms—BA (BA), differential evolution (DE), particle swarm optimization (PSO), invasive weed optimization (IWO), and the imperialist competitive algorithm (ICA)—in solving the inverse kinematics for both the position and orientation of the Puma 560 robot (6 DOF), Baxter robot (7 DOF), and KUKA iiwa robot (7 DOF). Moreover, simulations are performed using Matlab R2024b.
Each simulation consists of
iterations and a population of
individuals. The following parameters were defined:
,
,
,
, and
; the Denavit–Hartenberg (DH) convention was used to describe the kinematic structure of the manipulators used in the simulations.
Table 2 presents the DH parameters for the Puma-560 manipulator.
Table 3 provides the DH parameters of the Baxter manipulator.
Table 4 lists the DH parameters for the KUKA iiwa manipulator. Moreover, the illustrations in
Figure 1,
Figure 2 and
Figure 3 show the coordinate frames’ assignment for the considered manipulators.
The joint limits for the Puma-560 robot are as follows:
The joint limits for the Baxter robot are as follows:
The joint limits for the KUKA iiwa robot are as follows:
In all cases, the equivalent values in radians are used in the algorithms.
The desired end-effector poses are defined with a set of 100 random positions and orientations generated in a valid workspace for the robotic manipulators, as shown in
Figure 4. All random poses are reachable. Moreover, the proposed approach runs for every randomly desired pose independently. The best fitness value of each run is kept for statistical analysis.
Comparisons aim to analyze the statistical variation in the results of each algorithm. Boxplot graphics are used as a visual aid to identify the algorithm with the lowest variability, characterized by lower dispersion and lower fitness function values. A lower fitness value corresponds to smaller errors in both position and orientation. Moreover, lower fitness values indicate that joint values are feasible, as no penalties are applied. The results are presented using statistical measures such as mean, standard deviation, and the best and worst outcomes of each algorithm, all of which are summarized in tables.
In the following paragraphs, we consider the term ’standard algorithm’ for algorithms that have been applied as described by their author, while the term ’hybrid algorithm’ is used for algorithms that include the Jacobian pseudoinverse operations.
Figure 5 presents a comparison of data dispersion between standard and hybrid (H) algorithms using a boxplot. It is evident that the standard algorithms,
Figure 5a, exhibit higher dispersion compared to the hybrid algorithms,
Figure 5b. The DE and IWO hybrid algorithms demonstrate similar performance.
Table 5 provides a comparison of the statistical measures obtained by the algorithms, showing that the DE hybrid algorithm (DE-H) achieves the best performance in solving the inverse kinematics of the Puma-560 robot.
Figure 6 illustrates the simulation results for the 7 DOF Baxter robot.
Figure 6a shows the data dispersion of standard algorithms, while
Figure 6b demonstrates that the hybrid DE algorithm achieved the best result.
Table 6 compares the statistical measures obtained by the algorithms in solving the inverse kinematics of the Baxter robot. Similar to the previous case, the hybrid DE algorithm (DE-H) exhibits the best performance.
Finally,
Figure 7 presents the simulation results of KUKA iiwa robot.
Figure 7a displays a boxplot of the error obtained by the standard algorithms, while
Figure 7b shows a boxplot of the performance of the hybrid algorithms. The distribution comparison indicates that hybrid algorithms perform better, with DE and IWO demonstrating similar performance.
Table 7 reveals that DE hybrid algorithm (DE-H) achieves the most significant improvement for the KUKA iiwa Robot.
5.2. Second Simulation Experiment
In this part of the simulations, an edge-case experiment is conducted to evaluate the proposed approach. To solve the inverse kinematics, a desired end-effector position is proposed within the workspace to ensure it is reachable. However, some desired positions cannot be achieved with certain orientations. Therefore, appropriate orientation selection is crucial. This issue makes the inverse kinematics problem challenging to solve.
In these edge cases, gains
and
in Equation (
11) can be adjusted to give priority to minimize the error between the desired and the current end-effector position, rather than orientation errors.
The edge-case experiments involve defining a reachable desired position with an unreachable desired orientation for the Baxter robot. The proposed approach is run independently 100 times for the same pose, and the best fitness value is retained for statistical analysis to compare all considered algorithms. Additionally, position and orientation errors between the desired and current end-effector poses are analyzed (see Equation (
11)).
The experimental setup is conducted as follows: gains are set to
and
to give priority to minimize the position error. Moreover,
,
,
,
, and
. Finally, the desired end-effector pose is defined as
Figure 8 presents the statistical results of the best fitness value achieved by each algorithm. As shown, DE-H outperformed the others, demonstrating a smaller data distribution and lower fitness values. It is worth noting that the best fitness values are around 0.15 due to the significant orientation error. Consequently, position and orientation errors are now compared independently for statistical analysis.
Table 8 presents the position error results. The DE-H algorithm outperformed the others, achieving the lowest mean and standard deviation (std) values. Even the worst position error obtained by DE-H is better than the mean errors of BA-H, PSO-H, and IWO-H. Although the best position error is achieved by ICA-H, its performance is considered an outlier due to the larger data distribution observed in
Figure 8.
In contrast to the position errors, the orientation errors reported in
Table 9 are significantly higher, as the desired orientation is considered unreachable.
As expected, DE-H reported lower mean, standard deviation (std), and worst-case orientation error values compared to those in reachable poses. Although the best orientation error was achieved by PSO-H, its data distribution, as shown in
Figure 8, is considerably larger than that of DE-H.
We present another edge-case experiment involving four randomly selected unreachable desired positions, each with a corresponding reachable desired orientation, for the Baxter robot.
Table 10 presents the position and orientation error results for each case, while
Figure 9 illustrates the performance of the proposed approach in handling these unreachable poses. Coordinate frames in red represent the unreachable poses and coordinate frames in blue the achieved ones. Notice that all coordinate frames are adjusted with respect to orientation errors; however, position errors are not.
The results demonstrate that the proposed approach successfully solves the inverse kinematics problem by minimizing position errors, even when the desired orientation is unreachable.
5.3. Real-World Experimental Results
Real-world experiments were conducted to demonstrate the applicability of the proposed approach. The optimal joint configuration computed by this method can serve as a reference for point-to-point motion planning. For the experiments, a cubic polynomial trajectory was used to compute the joint motion from an initial joint position to the joint reference at a desired run time T.
The experimentation consists of two phases. First, the proposed approach solves the inverse kinematics for a desired end-effector pose to estimate a joint reference . Then, the manipulator robot follows a cubic polynomial trajectory based on the initial joint configuration and a run time T.
A 5 DOF KUKA YouBot was used for experimentation, as shown in
Figure 10. The DH parameters are provided in
Table 11 and the coordinate frame assignment is presented in
Figure 11. The proposed algorithm was implemented using Matlab and the ROS environment. ROS components on the KUKA YouBot provide an internal PID controller in the joint space, which is convenient for the considered trajectory planning. A point-to-point trajectory planning is performed on an external computer with Matlab and the ROS toolbox.
The lower and upper joint limits are defined as
In Experiment 1, a run time of
seconds is set, and the desired pose of the end-effector is specified as follows:
The inverse kinematics solution obtained through the proposed approach is
The initial joint configuration is selected as
The joint position and velocities for the motion planning in Experiment 1 are presented in
Figure 12. Additionally,
Figure 13 illustrates the final joint configuration along with the joint motion results as measured by the encoders.
For Experiment 2, a run time of
seconds is set, and the desired pose of the end-effector is defined as
The inverse kinematics solution for Experiment 2, obtained through the proposed approach, is
and the considered initial joint configuration for this test is
The joint position and velocities of the motion planning for Experiment 2 are presented in
Figure 14. Additionally,
Figure 15 illustrates the final joint configuration along with the joint motion results measured by the encoders.
As observed in
Figure 13b and
Figure 15b, the internal controller follows the given joint references given in
Figure 12 and
Figure 14, respectively. This indicates that the manipulator reached the optimal joint configurations computed by the proposed approach. Furthermore,
Figure 13 and
Figure 15 illustrate the real-world applicability of the proposed approach; the computed joint configurations are physically reachable.
For Experiment 3, a runtime of T = 4 s is set. In this case, a desired end-effector pose is defined with a reachable position but an unreachable orientation. The desired pose is specified as follows:
The inverse kinematics solution for experiment 3 is
The initial joint configuration considered for the polynomial trajectory is as follows:
The joint positions and velocities for the motion planning are shown in
Figure 16. Additionally,
Figure 17 presents the final joint configuration along with the joint motion results measured by the encoders.
The achieved end-effector pose is
As can be seen, the desired position is reached. The desired and current positions are practically the same. However, the desired and current orientations are only approximately aligned. As expected, the proposed approach prioritizes minimizing position errors over orientation errors, given that the desired orientation is not reachable. It is worth noting that the implementation in real-world experiments further demonstrates that the inverse kinematics solutions are physically feasible.
The proposed algorithm was executed on a computer with an Intel i7 processor and 16 GB of RAM. The inverse kinematics estimation took less than one second for each tested point. If further speed is required, the performance of metaheuristic algorithms can be enhanced using parallel architectures and dedicated hardware, such as NVIDIA CUDA.
6. Discussion
The proposed approach was applied in three simulation experiments involving the Puma-560, Baxter, and KUKA iiwa robots. The inverse kinematics were successfully solved in each case, demonstrating the applicability of the system across different configurations. Among the tested algorithms, differential evolution (DE) consistently outperformed BA, PSO, and ICA. While the performance of DE and IWO exhibited similar performance across experiments, DE reported the lowest dispersion of the data.
When comparing the experimental results with and without hybridization, a significant improvement in the solution of the inverse kinematics is evident across all algorithms. The Jacobian step enhances the exploitation capabilities of the algorithm; algorithms like PSO, ICA, and BA exhibit stagnation, which indicates weak exploration capabilities, whereas DE and IWA demonstrate a strong exploration performance.
DE-H reported better fitness value results in all tests, achieving the lowest mean and standard deviation (std) values. This indicates that DE-H achieved the smallest error in both position and orientation with precision, along with the smallest data distribution, reflecting more consistent results. In contrast, ICA and PSO performed poorly in all tests, achieving the worst results in terms of mean and std values. Additionally, the performance of IWO-H was very similar to DE-H. However, DE-H outperformed all the other algorithms by achieving lower mean and std values.
The evaluation of the standard deviation () indicates that the method achieves sufficient precision in both position and orientation, making it suitable for applications such as medical procedures, where fine adjustments are critical.
The proposed approach was also applied in real-world experimentation, where the KUKA YouBot robot was considered as a case study. The application on the real robot demonstrates that the inverse kinematics results are acceptable, confirming that the constrained problem is solved despite the DE algorithm not being specifically designed for constrained problems.
A drawback of the conventional Jacobian pseudoinverse is that the inversion of J cannot always be guaranteed. Singular configurations cause J to become rank deficient, leading to system instability. In this work, a Jacobian pseudoinverse step is used to generate a candidate solution. In the presence of singularities, unfeasible solutions are avoided in the Jacobian pseudoinverse operation, as only improved joint solutions replace the current ones. This mechanism effectively prevents singularities.
Future work will focus on solving inverse kinematics for a mobile manipulator [
16], incorporating the Jacobian step for fine-tuning. Additionally, we aim to extend the use of inverse kinematics to trajectory tracking and address grasping problems on platforms equipped with dual manipulators [
35,
36].
7. Conclusions
The hybrid metaheuristic algorithm approach proposed in this paper has demonstrated its applicability across different robotic manipulators by successfully solving inverse kinematics in two simulated experiments with six and seven degrees of freedom, as well as in an experiment with a real robot with five degrees of freedom.
Among the algorithms tested in this research, DE and IWO exhibited similar performance across the experiments. However, DE achieved the lowest scatter in the data, effectively solving both position and orientation with constraints, even though the algorithm was not designed to work with constraints.
The inclusion of the Jacobian matrix steps shows a significant improvement in the exploitation capabilities of the algorithms, However, algorithms with inherently poor exploration characteristics showed only marginal improvement.
Future work applying the methods proposed in this study promises favorable results for more complex problems, such as dual-arm systems and mobile manipulators. This work considers solving the inverse kinematics for manipulators with open kinematic chains. However, it is appealing to extend this work to solve the inverse kinematics of closed kinematics such as parallel manipulators.