Enhanced Solution of Inverse Kinematics for Redundant Robot Manipulator Using PSO

- Kinematics of the robot is divided into two parts: the forward kinematics, which evaluates the end-effector’s position from joint angles, and the inverse kinematics, which demonstrates the joint angles from the end-effector's position. The solution of the inverse kinematics problem is too difficult and complicated for the redundant robot arm manipulator. A Particle Swarm Optimization (PSO) algorithm is an effective method to solve global optimization problems. This paper presents the solution of inverse kinematics problem of a three-link redundant manipulator robot arm using PSO without using the inverse kinematics equations. The circle, square and triangle generated trajectories using PSO are enhanced as compared with the trajectories of other works. The enhanced PSO algorithm is successfully found the best generating three joint angles and the best generating end-effector's position of a three-link robot arm. Then according to these joints and positions the circle, square and triangle path trajectories, results are smoother than the path trajectories of other work. This enhanced solution of inverse kinematics using PSO algorithm is too fast due to the short elapsed time in every iteration of trajectory. Besides that, these velocities results have been given evaluated and give an indication that the three-link robot is moving fast during the PSO algorithm. The elapsed time of circle trajectory equals to 20.903981 seconds, the elapsed time of square trajectory equals to 11.747171 seconds and the elapsed time of triangle trajectory equals to 15.729663 seconds. MATLAB R2015b program is used in order to simulate all results. The main benefit of this work is to solve two problems: 1) inverse kinematics is too complex equations of the three-link robot. The solutions of best joint angles using PSO are computed within joint limits without using inverse kinematics equations. 2) Another problem, this work is enhanced three trajectories with respect to the best joint angles and reaches 96% percent as compared with another work. The error is too small according to the start and goal PSO generated points for each trajectory.


Introduction
In modern life, robots are able to impact on many applications such as industrial manufacturing, healthcare transportation, and exploration of space and underwater. Robots can assist humans in their complex tasks [1,2]. Manipulator pointed to the robotic arm. Manipulator redundant robot is consisted of links connected by joints like a chain. Kinematics problem is represented by the manipulator motion without the perception of forces and torques [3]. In general, the inverse kinematics problem of the robot is to get the values of the joint positions given end-effector's position and orientation [1]. There are many artificial intelligence methods solved an inverse kinematics problem of manipulator robot. Some of them are: the numerical algorithm which is based on the fuzzy logic approach that is used for solving the inverse kinematic problem of a SCARA robot. This method is usually difficult, computationally expensive and always gives an approximate solution with large error especially in the corners of robot workspace. In general, one of the most drawbacks of fuzzy logic is that it requires high computation time [4]. The inverse kinematics problem is solved using conventional Genetic Algorithm GA and the Continuous GA (CGA) for robot manipulators. The number of generation convergence speed of the CGA and the average execution time is better than the conventional GA algorithm. The average execution times for these GA algorithms are too long [5]. Many researches have done using Neural Networks. One of the latest was done using back-propagation neural network algorithm of multi-neural networks and solved I.K. problem of the Reis Robot-RV12L robot manipulator. However, the design was too complex with eight large trained Neural Networks [6]. Genetic Algorithm (GA) and Neural Network (NN) approach solved the problem of inverse kinematics for the three-link redundant robot. sine wave and the circle trajectories are also simulated in MATLAB program. The simulation of trajectories results has little accuracy and the generated circle trajectory is not smooth in all areas of trajectory [7]. Particle Swarm Optimization (PSO) is derived from the naturalinspired swarm behavior of some animals such as bird flocks and fish schoolings. It has many advantages such as simple implementation, the global optimal solution is founded with high probability and efficiency, fast converges, no overlap and mutate, the computational time is short. PSO is good for solving difficult problems in order to find accurate mathematical models [8]. In this paper, the inverse kinematics problem is solved and enhanced the trajectories of the threelink robot manipulator using PSO.

Forward Kinematics and Trajectory Equations of Redundant Robot Manipulator
In this section, the forward kinematics and trajectory equations are illustrated as in the following:

I. Forward Kinematics and Joints Limitations
The forward kinematics problem of the robot manipulator has evaluated the end-effector's position and orientation from the given joint angles values [4,5]. In this paper, the three-link redundant robot manipulator is used as shown in Figure 1. Figure 1 shows that the three lengths of robot manipulator (a 1 , a 2 , a 3 ) with three joint angles (TH 1 , TH 2 , TH 3 ). Three links are connected with three joints. Three-link redundant robot manipulator forward kinematics equations can be written as in Eqs. (1) and (2) [7,9].
x E = a 1 cos(TH 1 ) + a 2 cos(TH 1 + TH 2 ) + a 3 cos(TH 1 + TH 2 + TH 3 ) y E = a 1 sin(TH 1 ) + a 2 sin(TH 1 + TH 2 ) + a 3 sin (TH 1 + TH 2 + TH 3 ) (1) Where (x E , y E ) refers to the three-link robot endeffector's position. While (TH E ) refers to threelink robot end-effector's orientation as in Eq. (2): The link parameter table of a three-link redundant robot manipulator is illustrated in Table 1. The four parameters in Table I are called: a i =link length, α i =link twist, d i =link offset, and θ i =joint angle. The three joint angles are: θ 1 * = TH 1 , θ 2 * = TH 2 and θ 3 * = TH 3 . The * symbol means that the angles are changed values with certain ranges.

II. Trajectory Equations
Three-link robot redundant performs three trajectories. These trajectories Eq. (3-6) are illustrated as below: The first circle trajectory equation is expressed as in Eq. (3) [7,9]: Where (x p , y p ) is the desired circle end-effector's position of the robot arm, (x c , y c ) is circle's center position, r is the radius of the circle and the angle as (φ) is [0:2π]. The desired circle of endeffector's orientation is presented as in Eq. (4) [7,9]: Parametric Cartesian space trajectory equations are used to express the square and the triangular trajectories of the three-link robot as shown in Figure 2. These parametric Cartesian space trajectory eqs. (5) and (6) can be written as [10,11]:

Solving Inverse Kinematics for Redundant Robot Manipulator using PSO
This section describes the introduction of PSO and the enhanced solving inverse kinematics for redundant robot manipulator using PSO.

I. Introduction of Particle Swarm Optimization (PSO)
Particle Swarm Optimization (PSO) was derived from the natural-inspired swarm behavior of some animals such as bird flocks and fish schoolings. Russell Eberhart and James Kennedy have invented the PSO algorithm. The natural behavior of swarms has been used in order to solve the optimization problem [9]. The basic idea of PSO is initialized by randomly generating a swarm of particles. Each particle (i) has position namely ( i ), with a certain velocity namely ( i ). Swarm of particles is executed a random iterative search in the space of possible -dimensional solution vectors. This algorithm is related to the objective function value = ( i ), where is the function to be minimized. After iterations, the optimal solution is accomplished. At every iteration, the positions of particles are updated. They depend on two main elements: first is the best historical position direction achieved by each particle individually denotes the individual element (pbest). Second is the position achieved by any particle in the swarm, denotes the global element (gbest). In each iteration, these two elements are updated. The following two main Eqs. (7) and (8) of the PSO algorithm are: , , Where k: denotes the ℎ generation , : ℎ Component of the ℎ particle's position vector , +1 : ℎ Component of the ℎ new particle's position vector , : ℎ Component of the ℎ particle's velocity vector , +1 : ℎ Component of the ℎ new particle's velocity vector 1 , 2 : Random numbers values between 0 and 1 1 , 2 : called cognition and social constants respectively.

II. Enhanced Solving Inverse Kinematics for Redundant Robot Manipulator using PSO
This work presents the solutions of inverse kinematics without using the inverse kinematics equations. The inputs initializations are the randomly three joint angles within the three joints limitations ranges (section (2.1)) of the three-link robot arm. After applying the PSO algorithm procedure as mention in the previous section (3.1) with the fitness, function eq. (9). The position and velocity of particles (θ 1, θ 2, and θ3) are adapted depending to their velocity and positions equations (7,8) within the joint angles limit. The outputs are three best joint angles. These three best joint angles are interring as inputs to the forward kinematics eqs. (1,2) in order to find the best end-effector positions and orientation. After that, the best end-effector positions and orientations are inputs to every three trajectories (circle, triangle, square) eqs. (3)(4)(5)(6) in order to achieve the best three generated end-effector positions and joint angles as shown in Figure 3. Each joint angle variable of three-link redundant robot manipulator arm is expressed as a particle: θ i = (θ 1, θ 2, θ 3 ). Each particle has a velocity during the particle movement: I = ( θ1, θ2, θ3 ). The aim of the PSO algorithm is to minimize the objective function by adjusting joint angles or (θ i ) and get the best solution of joint angles. The minimization of fitness function is represented as in eq. (9) [13]: Where θ T is the target joint angles and θ is the estimated joint angles for i=1:3. If the min error fitness function is equal or less than 0.0001 and the iterations times for each trajectory is equal or less than the values in the below flowchart, then finish the algorithm or if it is larger than 0.0001 choose another joint angle within joints limitations. Ite1, Ite2, and Ite3 are the PSO iteration times for circle, square and triangle trajectories individually as shown in Figure 3.

Simulation Results
In this work, three trajectories (circle, triangle, and square) are simulated of the three-link robot manipulator. The circle trajectory is simulated according to the eq. (3) as in Figure 4. The square and triangle trajectories are also simulated due to parametric Cartesian space trajectory eqs. (5) and (6) The velocity (vi) while PSO is running, is obtained from the following equation:   Table 2. From all results of Table 2

2-
The elapsed time is demonstrated in each trajectory and it is a too short time as in Table 2 results. This is due to the short elapsed time of the PSO algorithm implementation and is too fast.

3-
The best generated results of three trajectories are enhanced as compared with another result that is presented by earlier studies as the following: • The best-generated end-effector positions of circle trajectory are more accurate and smoother than another work in [7,9] as shown in Figure 4.

Conclusion
From the simulation results of this paper for the three-link robot manipulator, the following can be concluded: 1) The best three joint angles are computed using PSO algorithm within the limit joint angles without using inverse kinematics equations.
2) The best end-effector positions are evaluated.
3) The circle, square and triangle of PSO generated-trajectories are enhanced and are smoother than the trajectories of other related studies. In other related works, there are rough trajectories in some areas. This is the main novelty of this paper. 4) This PSO algorithm is too fast due to two reasons: the first is the short elapsed time in each trajectory and the second is the demonstration the velocities results for each three-link robot joint angle results for every trajectory. 5) The elapsed time of circle trajectory equals to 20.903981 seconds, the elapsed time of square trajectory equals to 11.747171 seconds and the elapsed time of triangle trajectory equals to 15.729663 seconds. 6) The minimum fitness function results are acceptable for three trajectories. 7) Three trajectories are optimum trajectories with respect to best end-effectors and best joint angles.