A Comparative Study of Soft Computing Methods To S
A Comparative Study of Soft Computing Methods To S
Electrical Engineering
a r t i c l e i n f o a b s t r a c t
Article history: Robot arms are essential tools nowadays in industries due to its accuracy through high speed manufac-
Received 22 October 2016 turing. One of the most challenging problems in industrial robots is solving inverse kinematics. Inverse
Revised 27 July 2017 Kinematic Problem concerns with finding the values of angles which are related to the desired
Accepted 3 August 2017
Cartesian location. With the development of Softcomputing-based methods, it’s become easier to solve
Available online xxxx
the inverse kinematic problem in higher speed with sufficient solutions rather than using traditional
methods like numerical, geometric and algebraic. This paper presents a comparative study between dif-
Keywords:
ferent soft-computing based methods (Artificial Neural Network, Adaptive Neuro Fuzzy Inference System
ANFIS
Forward kinematics
& Genetic Algorithms) applied to the problem of inverse kinematics. With the help of proposed method
GA called minimized error function, both ANN and ANFIS are able to outperform other methods. The exper-
Inverse kinematics imental test are done using 5DOF robot arm and analyzing the results proved the simulation results.
Meta-heuristic Ó 2017 Ain Shams University. Production and hosting by Elsevier B.V. This is an open access article under
NN the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Robot arm
Soft-computing
http://dx.doi.org/10.1016/j.asej.2017.08.001
2090-4479/Ó 2017 Ain Shams University. Production and hosting by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
2 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
0 6 h1 6 360
0 6 h2 6 90
90 6 h3 6 0
90 6 h4 6 90
0 6 h5 6 180
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 3
Y E ¼ ð28 cosðh2 Þ þ 28 cosðh2 þ h3 Þ þ 8 cosðh2 þ h3 þ h4 ÞÞ sinðh1 Þ change the weights connecting these neurons together [19]. ANN
ð9Þ for solving IK problem in this paper uses a set of data for training
Z E ¼ 38 þ 28 sinðh2 Þ þ 28 sinðh2 þ h3 Þ þ 28 sinðh2 þ h3 þ h4 Þ ð10Þ the neurons which will be used later to find the joint angles h0 s
by a given Cartesian location X E , Y E , ZE orientation angles
ð28 cosðh2 Þ þ 28 cosðh2 þ h3 Þ þ 8 cosðh2 þ h3 þ h4 ÞÞ sinðh1 Þ hx ; hy and hz . This set of data must cover the complete workspace
hEz ¼ tan1
ð28 cosðh2 Þ þ 28 cosðh2 þ h3 Þ þ 8 cosðh2 þ h3 þ h4 ÞÞ cosðh1 Þ of the robot to be able to give the solution for any point in the
Cartesian location which robot end effector can reach. Calculating
hEz ¼ tan1 ðtanðh1 ÞÞ
this set of data is done using the forward kinematics equations
hEz ¼ h1 ð11Þ (5), (6), (8), (9) (10) and (11). Exchanging the input and output data
to make the joint angles h0 s as system outputs and Cartesian loca-
3. Traditional methods tion X E , Y E , ZE orientation angles hx ; hy and hz as system inputs,
data will be ready for neural network training.
Using traditional methods as algebraic [6,7], geometric [8–10], Fig. 5 shows the structure of the used feed forward network.
and numerical [11,12], for complex structures of the robot pose dif- ANN has three hidden layers with seven nodes per layer, Training
ficulties in finding IK sufficiently. It is also unsuitable to obtain IK iteration = 150, the learning method is Levenberg-Marquardt,
solution without depending on number of DOF or robot geometry. in-out data samples are 118,233, training data = 70%, testing
Classifications and examples of these methods can be summarized data = 15% and validation data = 15%. Training of the mentioned
in Fig. 4. ANN results in a MSE = 0.113.
In Grobner Bases [16]: Solving the inverse kinematics can be as
solving a set of algebraic equations which can give the values of the 4.2. Adaptive Neuro Fuzzy Inference System method
joint angles h. By transforming these set of equations to an equiv-
alent form but simpler to be solved. Grobner Bases Method can Adaptive Neuro-Fuzzy inference systems (ANFIS) have been
make this transformation to a standard form which has certain developed to merge information processing capability of Fuzzy
properties around the solution of this set of equations. Algebraic Inference Systems (FIS) and learning capability of neural networks
methods usually used to obtain closed form solutions, but don’t for solving systems [20]. ANFIS method for solving inverse kine-
always guarantee closed form solutions. matic problem uses a set of data for training the system which will
Conformal Geometric Algebra [17]: It is the mathematical be used later to find the joint angles h0 s by a given Cartesian loca-
notation of represented rotations and orientations. It also extends tion XE , YE and ZE and the orientation angles hx ; hy and hz . This set
usefulness of geometric algebra by expanding the class of rotors to of data must cover the complete workspace of the robot to be able
be able to express spheres, lines and circles. Rotors are more stable to give the solution for any point in the Cartesian location which
than rotation matrices. The Conformal Geometric Algebra geomet- robot end effector can reach. So we can use the same set of data
ric representation and its algebraic richness offer great flexibility in used before with neural network training. As ANFIS is a multi-
the process of modeling virtual or mechanical objects. Geometric input single output system, the proposed system is composed of
methods has disadvantage that the first three joints of the robot five ANFIS systems. Now we have five different systems each for
manipulator closed form solutions for must exist geometrically. one of the outputs (joint angles). Start training the five systems
Combined Optimization [18]: is based on a combination of with the following settings.
nonlinear programming techniques and the forward recursion for- Fig. 6 shows the structure of ANFIS with three input member-
mulas, with joint limitations of the robot. Combined optimization ship functions for XE , YE and ZE and two membership functions
method is numerically stable because it guarantees to the correct for hx ; hy and hz all with type gbellmf. Linear output membership
answer with virtually any initial approximation. It is not sensitive functions type is used. System has ten training epochs, in-out data
to the singular configuration of the manipulator. samples = 118,233. Training of the mentioned ANFIS resulted in a
The numerical methods solutions are affected by initial value MSE = 0.12 for the 1st structure, 0.23 for the 2nd structure, 0.19
selection and unavailability of multiple solutions. It also do not for the 3rd structure, 0.05 for the 4th structure and 0.02 for the
provide solution if Jacobian matrix of robot is singular. 5th structure.
4.1. Artificial Neural Network Method (ANNs) The genetic algorithm is a method for solving optimization
problems that is based on natural selection. It repeatedly modifies
Neural network (NN) is commonly used for modern control sys- a population of individual solutions. For every step, it selects indi-
tems which depend on training the neurons of the network to viduals at random from the current population to be parents and
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
4 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
uses them to produce the children for the next generation [21]. It is Dy ¼ yik yfk ð14Þ
used for minimizing the error which is the difference between the
desired location and the actual location. Starting this method is by Dz ¼ zik zfk ð15Þ
creating error function to be minimized which will be the MSE
between X, Y, Z and the end effector rotation angles hx ; hy and hz . DhEx ¼ hxik hxfk ð16Þ
Eq. (12) is the error function.
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi DhEy ¼ hyik hyfk ð17Þ
Z¼ Dx2 þ Dy2 þ Dz2 þ Dh2Ex þ Dh2Ey þ Dh2Ez ð12Þ
DhEz ¼ hzik hzfk ð18Þ
where
ik is the inverse kinematics
Dx ¼ xik xfk ð13Þ
fk is the forward kinematics
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 5
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
From Eqs. (12)–(18) the final value of error function is calcu- Z¼ ðxik xfk Þ2 þ ðyik yfk Þ2 þ ðzik zfk Þ2 þ ðhxik hxfk Þ2 þ ðhyik hyfk Þ2 þ ðhzik hzfk Þ2
lated from the following equation: ð19Þ
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
6 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 7
Chromosomes are the joint angles h0 s which are the inputs for Applying the GA for any point in the robot work space with the
the forward kinematics Eqs. (5), (6), (8), (9), (10) and (11). The following setting could give an accurate value for the five joint
inverse kinematics locations xik ; yik and zik is the desired location angles. Number of variables = 5 (h1 ; h2 ; h3 ; h4 ; h5 ). Upper and lower
and hxik ; hyik and hzik is the end effector rotation angles, then the Z bound of variables are ð0 < h1 < 360), (0 < h2 < 90),
will be the fitness function. ð90 < h3 < 0Þ; ð90 < h4 < 90Þ and ð90 < h5 < 90Þ.
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
8 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 9
Table 3
Drawing circle with 3DOF for testing MEF.
therefore presented to handle this kind of error using minimized is the given point to the system which changes every iteration
error function (MEF). This method is detailed below. to minimize the error at the final one. Green curve is the
After training ANN or ANFIS system and calling them for solving actual value of the system for every iteration which is equal
the problem the error for every point throughout the path has an to the desired at the final.
error which is unaccepted. Using the MEF method can minimize Table 3 shows the test of MEF function for drawing a circle
the error with the same trained system before. Briefly it change with a 3DOF planner robot arm. It contains the values of cal-
the value of both coordinates x, y and z which given to the struc- culation time, mean squared error for location and end effector
ture to have the values of the five joint angles h1 ; h2 ; h3 ; h4 ; h5 . orientation angles for ANN and ANFIS before and after using
The new value that given to the system is the last value added to MEF.
the error so the new error will be less than the old one. After After applying this function to minimize the error for both ANN
repeating this for many times the error will decrease to an and ANFIS systems, responses of drawing the previous two curves
accepted value. Fig. 10 illustrates the steps for the proposed for both methods are shown in Figs. 12 and 13 to study the behav-
method of Minimizing Error. ior of the proposed method.
For example if we have any Point Throughout the path of
any curve solved by ANN or ANFIS. This point initial solution ANN Method with MEF results for drawing spring shape are
will be with an error value 2.2 mm with X-Axis, 4.2 mm with shown in Fig. 12.
the Y-Axis and 0.31 mm with the Y-Axis. Start using MEF ANFIS Method with MEF results for drawing spring shape are
method will decrease the value of the error for every iteration shown in Fig. 13.
number which will decrease to a value less than 1% of its ini-
tial value. These results shown in Fig. 11. Blue curve is the Figs. 12, 13 and Table 4 prove that the response of ANN and
desired point which is the same for every iteration. Red curve ANFIS after applying MEF is acceptable enough to rely on in
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
10 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
Fig. 12. Results of drawing spring shape using ANN with MEF method.
industry than before using the proposed MEF. It illustrates the ANN and ANFIS. However, the calculation time has increased due
improvement done to the MSE of end effector Cartesian location to the repetition of calculations for each point. On the other side,
though the use of MEF. Obviously, MSE has minimized for both GA has a low MSE and very high calculation time due to the
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 11
Fig. 13. Results of drawing spring shape using ANFIS with MEF method.
concept of applying GA algorithm for every point as an individ- From all tables and curves shown above we, have three different
ual step. Fig. 14 shows the comparison between five methods for soft computing methods. All methods have smooth curves for all
the end effector translation and orientation error. three joint angles which mean there are no jumps in the joint
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
12 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
Table 4
Drawing spring shape results after using MEF.
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx 13
angles throughout the path. The error between the actual and the 6. Experimental studies
generated path points throughout the path in Cartesian location
and in end effector angles is different in three methods, so as the The robot arm used is a handmade version as an example of a 5
application of robot arm usage we can decide which has the most DOF robot arm for testing the results of the previous work, the
priority the calculation time or the accuracy. In GA method the main body was made of aluminum. Robot arm has a 5 stepper
error is very low that reach to less than micro meter while the cal- motors all driven with 5 V supply. The controller for the robot
culation time is high in comparison with other methods. In ANN arm has microchip PIC microcontroller with a USB connection with
with MEF and ANFIS with MEF methods calculation time is quite the computer. Windows 7 is the operating system for the control
similar and the difference is in accuracy of end effector Cartesian program. The control program was programed using Visual Studio
location and rotation angle. ANN with MEF is less than ANFIS with 2010.
MEF in Cartesian location error while ANN with MEF is more than After the simulation gives very good results, it’s the time to
ANFIS with MEF in rotation angle error. apply the solved inverse kinematics to the five degrees of freedom
Fig. 15. Robot arm real drawing circle and sin wave.
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001
14 A. El-Sherbiny et al. / Ain Shams Engineering Journal xxx (2017) xxx–xxx
robot arm and comparing the real results with the simulated [12] Olsen AL, Petersen HG. Inverse kinematics by numerical and analytical cyclic
coordinate descent. Robotica 2011;29(4):619–26.
results. Drawing a circle and a sine wave on a XY plan will be
[13] Bingul Z, Ertune HM, Oysu C. Comparison of inverse kinematics solutions using
applied on the robot arm. Fig. 14a shows the result of drawing cir- neural network for 6 R robot manipulator with offset. In: Proceedings of the
cle while Fig. 15b shows the result of drawing sine wave. ICSC congress on computational intelligence methods and applications. p. 1–5.
[14] Tabendeh S, Clark C, Melek W. A genetic algorithm approach to solve for
multiple solutions of inverse kinematics using adaptive niching and clustering.
7. Conclusion In: IEEE congress on evolutionary computation. p. 1815–22.
[15] Asada HH. Introduction to robotics. Department of Mechanical Engineering,
Massachusetts Institute of Technology; 2005.
One of the most important problems of using robots in new [16] Cohen Arjeh M, Cuypers Hans, Sterk Hans. Some tapas of computer
industries is the inverse kinematics problem. Its difficulty increases algebra. Springer Science & Business Media; 2013. p. 1–10.
as the increasing of the number of degrees of freedom. For solving [17] Doran C, Lasenby A. Geometric algebra for physicists. Cambridge: Cambridge
University Press; 2003. p. 351–64.
this problem we chose a 5 DOF robot as an example. 5 DOF hand-
[18] watt A, watt M. Advanced animation and rendering techniques. Addison-
made robot arm with the previous specifications was imple- Wesley; 1992.
mented. Three different soft computing methods are presented in [19] Wang S-C. Interdisciplinary computing in java programming. Artif Neural
Network, Part II 2003:81–100.
this work for solving IK problem. Artificial neural network, adap-
[20] Singh Rajesh, Vishal V, Singh TN, Ranjith PG. A comparative study of
tive neuro fuzzy inference system and genetic algorithm methods generalized regression neural network approach and adaptive neuro-fuzzy
were applied for this problem. Simulation results for drawing a inference systems for prediction of unconfined compressive strength of rocks.
spring shape as a general curve was used for testing the behavior Neural Comput Appl 2013;23(2):499–506.
[21] Laboudi Zakaria, Chikhi Salim. Comparison of genetic algorithm and quantum
of the three soft computing methods. For experimental study a cir- genetic algorithm. Int Arab J Inform Technol 2012;9(3).
cle and sinusoidal wave curves were applied to a real handmade 5
DOF robot arm as a planner curve to be drawn. Tables added as a
purpose of comparing accuracy and calculation time of each Ahmed El-Sherbiny is a Researcher in Computers
method. Moreover a method for minimizing error for both ANN Engineering & Control Systems Dept., Mansoura
University. He received a B.Sc. in Computer and Control
& ANFIS is proposed.
Systems Eng. from Obour Higher institute for
All simulation results are obtained using MATLAB version 2015. Engineering and Technology in 2008. His interests are in
The accuracy is improved for both ANN and ANFIS after using MEF. the areas of Artificial intelligence, Control and Robotics.
Although the accuracy of GA is higher than ANN, the accuracy of
ANN is still accepted in many fields of industries. Finally through
the different three methods and after using MEF, we can choose
the most suitable method depending on the field of real robot
arm usage. This choice can save the calculation time depending
on the required level of accuracy.
Please cite this article in press as: El-Sherbiny A et al. A comparative study of soft computing methods to solve inverse kinematics problem. Ain Shams Eng
J (2017), http://dx.doi.org/10.1016/j.asej.2017.08.001