Solving the Inverse Kinematics for Robot Manipulators using Modified Electromagnetism-like Algorithm with Record to Record Travel

A new modification of Electromagnetism-like (EM) algorithm which incorporating the Record-to-Record Travel (RRT) local search algorithm; namely MEMR has been developed to solve the problem of Inverse Kinematics (IK) for a four Degree-of-Freedom (DOF) manipulator. The proposed method is able to generate multiple robot configurations for the IK test performed at different end effect or positions. In addition, the comparison between the proposed MEMR and Genetic Algorithm (GA) was carried out using two mathematical test functions; De Jong and Rastrigin. The tests results show that the proposed MEMR is comparable in performance to GA in terms of both convergence speed and error rate.


INTRODUCTION
The kinematics problem represents the motion of the manipulator, but does not take into account the forces or torques that instigates the motion.From Eq. (1) and Fig. 1 (Jha, 2009), the mapping from joint coordinates which are the set of all joint in the joint space to Cartesian coordinates which are the set of all Cartesian coordinates in the Cartesian space is called Forward Kinematics (FK) (Jha, 2009) The solution for this equation is not trivial and the result may not be unique.In robotics, the design of any task such as path planning, task scheduling and the control of the robot manipulators require Forward Kinematics and followed by Inverse Kinematics.The solution of the Forward Kinematics is simple, due to the fact that it is dependent upon knowing the link parameters and joint variables.The Inverse Kinematics  especially for a redundant robot is far from easy to solve, because the inverse equations are nonlinear and give infinite solutions.Figure 2 shows some of the solutions for a three Degree-of-Freedom (DOF) planar robot.Thus, artificial intelligent optimization theories are proposed to solve this problem.Jasim (2011) has been implemented four Adaptive Neuro-Fuzzy Inference System (ANFIS) systems for solving the IK problem for 4-DOF SCARA robot.The Neuro-fuzzy system is constructed, where the positions of end-effecter are as inputs to the system and the outputs are the joint angles of the manipulator.The membership functions which are Gaussian membership are tuned using learning algorithm.Karlik and Aydin (2000) proposed an improved approach upon finding the best configuration of the Artificial Neural Network (ANN), in order to solve the Inverse Kinematics of a 6-DOF robot manipulator.They proposed the ANN approach to control the motion of a robot manipulator and the learning equations that they used were those of the back-propagation algorithm.Two different configurations for the ANN were constructed.In the first configuration, the neurons are fully connected to each output, with one hidden layer.While in the second configuration, each output of a neural network is designed with two hidden layers.However, a four-layer neural network has already been proposed for predicting IK solutions and an appropriate computer program has been developed using Borland C++ language for the ANN architectures that are being considered in their study.Additionally, 6000 iterations where also used for teaching the ANN.However, this work utilizes a very large data set, without mentioning the possibility of multiple solutions for Inverse Kinematics.Thus, solving the IK problem using ANN faces some difficulties, the first being the selection of the appropriate type of neural network and the generation of a suitable training data set.In order to map the Cartesian configuration into corresponding joint angles, the ANN is used to approximate the Inverse Kinematics relations of the robot manipulator.A large number of training data and iterations are used to improve learning performance.Thus, the provision of such large data set is difficult and the data, which is obtained from deriving the Inverse Kinematics equations, might contain mapping error due to the nonlinear mapping between the joint angle coordinates and Cartesian coordinates, leading to inaccuracies in the predicted Inverse Kinematics solutions (Yin et al., 2011).Zhang et al. (2012) has been proposed an Adaptive Particle Swarm Optimization method (A-PSO) combined the kinematics equations.The proposed method is suggested to solve the Inverse Kinematics for serial manipulator.They modified the conventional PSO because it is easily trapped in local optima and need much population size.The fitness function that is used is defined as the combinatorial matrix deviation from the end of the robot to the object.The proposed method is able to reduce the complexity of the analysis of Inverse Kinematics equations and the adaptive solution can be obtained.They are compared their method with the traditional PSO algorithm and the efficiency of the proposed method is demonstrated in the case study.

PROBLEM DESCRIPTION
The geometric method can be used to find the forward equations for the n-DOF planar robot (  The positional error between the current solution and the goal position (X tp , Y tp ) of the end effector according to Yao and Gupta (2007) is given as follows:

REVIEW OF EM ALGORITHM
Electromagnetism-like algorithm has been proposed in this study to solve the IK problem.It is a Fig. 4: EM algorithm general scheme global optimization algorithm that adapts the attractionrepulsion mechanism to enable it to move sample points in the direction of optimality (Su and Lin, 2011;Filipović et al., 2013).The algorithm commences by randomly sampling points from the feasible region.After that, a mechanism has been constructed, which encourages the convergence of the points to the highly attractive valleys and vice versa (Birbil and Fang, 2003).This idea is mimicked by the authors to fabricate a similarity with the attraction-repulsion mechanism of the electromagnetism theory (Ali and Golalikhani, 2010).Comparing with the basics of electromagnetism, each sample point would be designated as a charged particle released into space.However, in the proposed method, the charge of each point relates to an objective function value, which is trying to optimize.Also, this charge would confirm the magnitude of attraction or repulsion of a point over a sample population-the more superior the objective function value, the higher its magnitude of attraction.After these charges are determined, the samples would be utilized to locate a direction for each point to move in subsequent iterations.This is accomplished via the evaluation of a combination of force exerted on the point via other points.Like the electromagnetic forces, the force is calculated by the addition of vectors of each of other points calculated separately.Finally, it is important that a local search procedure is employed, in order to improve the objective function values in the population (Wu et al., 2006;Lee and Jhang, 2008).
The general scheme for Electromagnetism-like algorithm which consists of four main parts is shown in Fig. 4 (Jolai et al., 2012).

Initialization of the population:
A population with m points is randomly generated, with n coordinates.Each coordinates are uniformly distributed within both the upper u k and lower l k bounds (Chang et al., 2009).An objective function value for each sample f (x i ) is evaluated after the generation of the samples in the population.Then, the point with best objective function is stored in x best (Miao and Jiang, 2012).

Local search:
The procedure searches for a better solution by collecting the localized information from every single sample point (Birbil and Fang, 2003;Gilak and Rashidi, 2009).

Charge and resultant force calculations:
The theory of superposition of electromagnetism posits that a force that exerted on a point by other points is inversely proportional to the distance between the points and directly proportional to the product of their charges (Birbil and Fang, 2003;Tsou and Kao, 2006).
The first step involves the charge determination of each sample point, which is conducted for each generation based on the objective function of this particular point and the objective function for the best point; as in the Eq. ( 6) (Birbil and Fang, 2003;Lee and Chang, 2010 where, f (x best ) is the objective function of the current best solution.It is also worth noting that the charge of a sample point is without sign.An alternative to this is the fact that the direction of a particular force generated between two points would be specified after comparing the objective function value for each existing point (Birbil and Fang, 2003), thus x best would be the point that attracts all the other points in the population.Thus: Then the total force is: where, F i is the total force exerted on sample point x i .A point that has a superior objective function means that it has higher charge, would attract other points, while a point with an inferior objective function value act to repel the others (Birbil et al., 2004).
Movement along the total force: After the completion of the force evaluation, the movement according to force is determined.The particle would update itself according to the direction of the force via random step length Eq. ( 9) (Rocha and Fernandes, 2008).In Eq. ( 9), RNG is designated as a vector, whose components denote the allowed feasible movement toward the upper bound, u k or the lower bound, 1 k .In addition, exerted force on each particle would be normalized in order to maintain feasibility.Therefore: The sample point moves to the direction of upper bound via the random step length when the force is positive and vice versa (Jhang and Lee, 2009).

MODIFIED EM WITH RRT LOCAL SEARCH ALGORITHM
Record to Record Travel algorithm is a local search method (Mafarja and Abdullah, 2013) proposed by Dueck (1993).It relies on the objective function, which is gradually enhanced by exploring neighborhoods and applying perturbation process.Initial solution of the algorithm are usually selected at random and then apply a perturbation value to get the better solution compared to the current best solution found so far (record).The mechanism of this process involves the search in the neighborhood of the current best solution.In the event the new solution is better than the current best solution would replace it as a record and if not, the current best solution would remain unchanged, so if the new solution not much worse than current best solution would be accepted as a neighborhood (Li et al., 2007;Talbi, 2009).Technically, the RRT algorithm guarantees that a move does not accept if it is much worse compared with the best solution found so far.
Moreover, the RRT algorithm possesses a single parameter (DV), where DV represents the maximum allowed deviation determining the amount of worse value accepted as compared to the current record.The utilization of the deviation mechanism provides the algorithm some capability to circumvent the local minimum traps (Radtke et al., 2008;Dhouib et al., 2010).In order to implement the RRT algorithm, assume that x 0 is the initial solution and record = f (x), while x' is the proposed solution (after doing the process of perturbation); x' would be accepted as the next current best solution if f (x') <record.But if f (x') -record<DV, the x' is accepted as neighborhood instead.With the exception of the two aforementioned cases, x' would be deleted and another solution would be chosen.Figure 5 illustrates the pseudo code for the RRT algorithm, while the flow chart of the algorithm is depicted in Fig. 6.
Record to Record Travel algorithm is suggested because it is easy to implement (Dueck, 1993) and only require one parameter which is the deviation.As a result, the algorithm can avoid being trapped in local optima by using this parameter.The structure of the proposed MEMR algorithm is shown in Fig. 7.For GA, arithmetic crossover, uniform mutation and roulette wheel selection operators are used.The value of crossover rate and mutation rate was set at 0.8 and 0.04, respectively.The population size for EMW, MEMR and GA is 50.The number of iterations is 100 for De Jong's function and 1000 for Rastrigin's function for all test methods.The simulation results are shown in Table 1 where S.D. is the Standard Deviation, whereas the performance of EMW, MEMR and GA are compared and depicted in Fig. 8 and 9 for De Jong and Rastrigin functions.The simulation work was carried out repeatedly up to 20 times for each function and algorithm.

After
From Fig. 8 and 9 as the average MEMR and GA converged faster than EMW, but at very earlier iterations EMW is seem to be faster than the others.Both MEMR and GA are competitive in terms of convergence and the accuracy.EMW is the algorithm which lack for the local information in order to enhance the solution.Besides that, GA seems to be more stable than the two other methods, this may be because of its value of Standard Deviation which is less than the value of the others.

CONCLUSION
In order to improve the performance of EM algorithm, RRT has been proposed as a local search algorithm.However, the RRT requires a good selection nonlinear equation, which represents the relationship between the position of the end effector and the manipulator angles.The mapping from the Cartesian variables to the joint values is Inverse Kinematics (

Fig. 3 :
Fig. 3: A schematic of a planar manipulator with n links In this study, a modified Electromagnetism-like (EM) has been proposed which is used Record to Record Travel algorithm (RRT) as a local search.
n-th joint angle (X cur , Y cur ) = The current solution at any point of the task

Fig
Fig. 5: Record to record travel pseudo code Fig. 6: Flowchart for RRT algorithm

Fig. 8 :
Fig. 8: Objective value comparison for De Jong's function developing the MEMR algorithm, simulation results are carried out and tested on Celeron R CPU 2.2 GHz PC and Visual Basic 2008 software, in order to compare the proposed method with Electromagnetismlike Without local search (EMW) and GA.For MEMR the deviation is 0.01 for test of De Jong's function and 2 for test with Rastrigin's function.

Table 1 :
Comparison of objective value results using EMW, MEMR and GA

Table 2 :
Comparison of the objective value using EMW, MEMR and GA to solve IK Target position(100, 50)

Table 3 :
Results for EMW, MEMR and GA for IK test parameter value as well as the selection of perturbation value which would affect the robustness and speed of its solution.EM without local search would not only affect the accuracy of the results, but also need less processing time compare to the original EM algorithm.Therefore, the use of RRT would moderate the search by gathering the local information more effectively.The proposed MEMR and GA have been used to solve mathematical test functions and IK problem.As a conclusion, both algorithms are about comparable in terms of both convergence speed and error rate. of