Available online at www.sciencedirect.com

ScienceDirect

Procedía CIRP 17 (2014) 812 - 817

Variety Management in Manufacturing. Proceedings of the 47th CIRP Conference on Manufacturing

Systems

Use of artificial neural networks for the development of an inverse kinematic solution and visual identification of singularity zone(s)

Luv Aggarwal^*, Kush Aggarwala, Ruth Jill Urbanica

aDepartment of Mechanical, Automotive, and Materials Engineering, University of Windsor, 401 Sunset Avenue, Windsor, Ontario N9B 3P4, Canada * Corresponding author. Tel.: +1-519-980-0588; Tel: +1-519-817-7847. E-mail address: aggarwal@uwindsor.ca

Abstract

This paper presents a non-conventional technique for solving the inverse kinematics problem using artificial neural networks. A feed forward multi-layer perceptron with backpropagation neural network is selected for this research. An inverse kinematic solution for a PUMA 560 robot is developed by training the neural network with the robot's end-effector Cartesian co-ordinates and its corresponding joint configurations. Once the network is well trained (90th percentile) and confident predictions can be achieved, a test input set (singularity conditions) is introduced to the trained network to simulate results. This technique proves promising since it requires little computation time over other traditional methods.

© 2014ElsevierB.V.Thisisanopenaccessarticle under the CC BY-NC-ND license (http://creativecommons.Org/licenses/by-nc-nd/3.0/).

Selectionandpeer-review under responsibilityofthe InternationalScientific Committee of "The 47th CIRP Conference on Manufacturing Systems" in the person of the Conference Chair Professor Hoda ElMaraghy"

Keywords: Inverse Kinematics; Artificial Neural Network (ANN); Multi Layer Perceptron (MLP); Levenberg-Marquardt (LM); Feed Forward Network; Backpropagation; Mean Square Error (MSE); Singularity; PUMA 560

1. Introduction

Serial 6 degree of freedom (DOF) robots and robotic cells are ubiquitous within many manufacturing system domains, and are used for fabrication, assembly, packaging, and so forth. Developing an effective travel path is challenging for many reasons, including the kinematic structure, the robot behavior due to the robot's configuration, and the singularity conditions. To determine the joint angles for a specific end-effector 'posture', a solution for the inverse kinematics is required - a well-known problem in robotics research. Developing an inverse kinematic solution is mathematically complex and computationally expensive. Depending on the manipulator's configuration, a closed form solution may not always be possible. Another issue to be considered is the singularity condition. The American National Standard for Industrial Robots and Robot Systems -Safety Requirements (ANSI/RIA R15.06-1999) defines singularity as "a condition caused by the collinear alignment of two or more robot axes resulting in unpredictable robot motion and velocities" [1]. Singularity

zones should be avoided when computing an inverse kinematic solution. Knowledge about singular conditions of a manipulator provides insight into the determination of the reachable workspace of its end-effector. This paper presents a non-conventional technique for solving the inverse kinematics problem using artificial neural networks (ANNs).

ANNs are proposed as an approach in development of a robust inverse kinematic solution that provides a singularity free work envelope. This neural network approach is then compared with results of other traditional geometric, iterative, or algebraic methods to validate its results. Limited research exists on use of neural networks in development of an inverse kinematic solution that identifies and or successfully avoids singularity space in the complete workspace of the manipulator [2]. Feed forward multi-layer perceptrons (MLPs), used for the purpose of this research, are widely known for identifying nonlinear and complex behaviour within a given data set. An inverse kinematic solution for a PUMA 560 robot is first developed by training the neural network through a data set

2212-8271 © 2014 Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/).

Selection and peer-review under responsibility of the International Scientific Committee of "The 47th CIRP Conference on Manufacturing Systems"

in the person of the Conference Chair Professor Hoda ElMaraghy"

doi:10.1016/j.procir.2014.01.107

consisting of end-effector Cartesian co-ordinates (network input) of the robot and its corresponding joint configurations (network target). The learning and training phase of the network involves optimization of the network weights by minimizing the mean square error (MSE) through the use of Levenberg-Marquardt (LM) technique. The LM technique provides a numerical solution to the problem of minimizing a non-linear function over a space of parameters for the function. The network accuracy that compares the predicted network output and the target value is proposed as basis for identifying the total error in prediction by the trained neural network.

Once the network is well trained (within the 90th percentile range) and confident predictions can be achieved, a test input set (Cartesian co-ordinates at singularity conditions) is introduced to the trained network to simulate results. This is done to successfully predict joint angles that should be avoided for a robust and singularity free inverse kinematic solution. The network output allows for defining singular zones which can be demonstrated using a visual representation in 3D space. A comparison between the neural network results and theoretical results is used to validate the singularity zone (positive and negative limits). This work can be extended to other multi-DOF manipulator configurations for various manufacturers and comparisons can be drawn.

Nomenclature

i-1Ai homogenous transformation matrix

A1-A6 joint angle configuration of robot (radians)

ANN artificial neural network

b bias value

D-H denavit- hartenberg

dm single epoch run

dsm second derivative of error

DOF degrees of freedom

Ei2 error value for input i

I input data

LM levenberg- marquardt

MLP multi-layer perceptron

MSE mean square error

R regression value

R,P,Y orientation angles

RMS root mean square

wi weight of each input value

X,Y,Z cartesian co-ordinates of robot's end-effector

X damping factor

2. Background

Prior research has shown that ANNs can be an important tool in robot path planning and control by providing a solution to the inverse kinematics problem. The network accuracy has been a common problem encountered by various researchers in determining this solution. Kozakiewicz et al. [3] proposed a partitioned neural network architecture to improve the accuracy for the inverse kinematic problem. The partitioned layer, also referred to as the pre-processing layer, helped to divide the entire network into individual smaller networks where the

weights of each portioned network could be attenuated by concentrating on only one output. The network achieved high prediction accuracy for position joints but exhibited higher errors for orientation joints. Further work is required to obtain accurate learning and prediction for the entire range of joints, especially the orientation joints. Lou and Brunn [4] introduced an iterative approach of computing the inverse kinematic problem using ANNs with an offset error compensation method to improve the accuracy of the derived solution. This was done since an offset error always existed when taking the iterative approach that had different values for each required end-effector position. The error compensation improved the accuracy of the network by reducing the average error from 4 to 0.001 percent for a 2 DOF manipulator. This work was extended in a two stage process to 6 DOF manipulators because of computing limitations. Ahmad and Guez [5] also used an iterative approach using ANNs to find the final predicted solution within a specified tolerance. The iterative process provided a two-fold increase in the computational efficiency of a 3 DOF planar robot and the PUMA 560 robot. Yildirim and Eski [6] have used a feed-forward neural network architecture with five different learning techniques namely, Online Back Propagation (OBP), Online Back Propagation Random (OBPR), Batch Back Propagation (BBP), Delta Bar Delta (DBD), and Quick Propagation (QP). These learning techniques were used to predict pre-defined target kinematic parameters of a PUMA 560 robot. It was determined from this study that QP was the best learning technique to update network weights. Here the output(s) of the network exactly matched the target values with a root mean square (RMS) error of 0.21345. The drawback to this technique was the fact that robot(s) without wrist offsets lack rotational capabilities and did not have a closed form inverse kinematic solution. Therefore, this technique could only be implemented as a single-stage network. Koker et al. [7] have also validated neural network as a tool for computing the inverse kinematics of a three joint robot. The network was able to predict the joint angles to its corresponding Cartesian (X,Y,Z) co-ordinates within an acceptable error range. Hasan et al. [2] have addressed the problem of kinematic control through singularity zone(s) by development of an ANN model that learns the characteristic of the robot system rather than specifying an explicit system model. The discussed model has Cartesian coordinates (X,Y,Z) of the end-effector, orientation angles (R,P,Y), and linear velocity of a 6 DOF robot as network inputs and angular position and velocity as the network outputs. The maximum error percentage for the experimental data set introduced to this network was determined to be 6.72% for the Z-co-ordinate and 5.79% for the Y-orientation. This network model can be used for any serial manipulator with a reasonable accuracy. However, the paper did not explore different network topologies to further reduce the network error.

With increasing DOF, a closed form inverse kinematic solution for a robot manipulator is often not possible or is computationally expensive. Featherstone has addressed the complexity of mapping position and velocity transformations between end-effector co-ordinates of a 6 DOF robot and its corresponding joint angles [8]. Cheng et al. have provided a

technique (SICQP) to minimize the tracking errors in singularity direction for a PUMA 560 robot [9]. This method is effective and efficient in solving the inverse kinematic problem but requires decoupling in three-dimensional sub-problems. ANNs provide a quicker response, and have proven to be useful for multiple precise solution(s) to the inverse kinematics problem with real-time adaptive control [7]. However, limited research exists that uses ANNs as a technique for coping with kinematic singularities by either providing a robust inverse kinematic solution or by successfully avoiding these singularity zones [2]. Therefore, an ANN approach investigated in this paper illustrates its potential in robotics' related research.

3. Forward Kinematics

Forward kinematics of a robot manipulator deals with determining the position and orientation of the robot's end-effector for a given input set of joint variables. Denavit-Hartenberg (D-H) parameters are used to define individual homogenous transformation matrices (1-1Ai) that help to compute the forward kinematics equations of the robot. For the PUMA 560 robot, the following D-H parameters were used:

Table 1. D-H parameters of PUMA 560 robot.

Link Offset (cm)

Joint Angle (rad)

Link Length (cm)

Twist Angle (rad)

di = 0

d2 = 0

d3 = 0.1500 d4 = 0.4318 d5 = 0 d6 = 0

9i = Ai

02 = A2

03 = A3

04 = A4

05 = A5

06 = A6

ai = 0 a2 = 0.4318 a3 = 0.0203 a4 = 0 a5 = 0 a6 = 0

a1 = pi/2 a2 = 0 a3 = -pi/2 a4 = pi/2 a5 = -pi/2 a6 = 0

The Cartesian co-ordinates are computed from 0A6 using unique combinations of joint angle ranges (Table 2). A data set is then constructed using the input joint angle values (A1-A6) and their corresponding Cartesian co-ordinates (X, Y, Z).

Table 2. Joint angle ranges of PUMA 560 robot.

(rad) A1 A2 A3 A4 A5 A6

Minimum -2.792 -4.276 -0.785 -1.919 -1.745 -4.642

Maximum 2.792 0.785 3.926 2.967 1.745 4.642

4. Inverse Kinematics

Inverse kinematic solution address the challenging problem of determining joint angles required for a desired orientation and position of the end-effector. This methodology is in direct contrast to the direct kinematics problem. This paper presents an efficient and systematic technique to find the inverse kinematics solution using ANNs. It is important to realize that a solution may or may not exist for an inverse kinematics problem. Moreover, even if a solution exists, often multiple solutions are obtained for the inverse kinematics problem. The special physical structure of the PUMA 560 allows for determining the kinematic solution in a much simpler manner. The first three joints of PUMA 560 determine the position of the end-effector, while the last three joints determine the orientation of the end-effector [4]. Hence, for the purpose of this paper, given the position (X,Y,Z) of the end-effector, the goal of this research is to determine the values for the joint angles (A1, A2, A3, A4, A5, A6) through the use of ANNs. Figure 1 [10] demonstrates the challenges associated with inverse kinematics as the PUMA 560 has four possible solutions for a given position and orientation of the end-effector.

Here, the link offsets (d1_6) and the link lengths (a1_6) are scaled down by a factor of 1000. The forward kinematics equations from 0A6 are subsequently computed using the following equations:

cos#. - cos«, sin#.

sin 0,. 0 0

cosa,, cosö,. sin a,. 0

sin at sin Qi at cos 0,.

- sin at cos 0i at sin

cosa,. dt

o A - 0A * A

A6~ A1 A2

.* A6 =

«11 b12. ?13 Px

n21 b22 ^23 Py

«31 b32 ?33 Pz

0 0 0 1

Here, n, b, and t define the orientation of the end-effector about x, y, and z respectively, and p defines the position of the end-effector (Cartesian co-ordinates X, Y, and Z respectively).

Fig. 1. four possible inverse kinematics solution(s) for PUMA 560 [10].

5. Artificial Neural Networks

5.1. Background

Artificial neural networks (ANNs) are sets of interconnected neurons that are distributed in a parallel sequence and act as information processing systems. These networks learn from an external source (data set), and make changes to their structures to predict linear or non-linear trends present in that data set.

For the purpose of this research, a multi-layer perceptron (MLP) network is used, which specializes in determining highly non-linear complex relationships between various variables in a data set. The MLP network developed here uses a feed forward back propagation technique based on a supervised learning process. In a feed forward network, all information is processed in one direction only, thereby avoiding any feedback loops. Backpropagation refers to the method in which connection weights change after being processed through an activation function layer (consisting of neurons) to produce outputs for the next layer. This change/ adjustment in connection weights of the network is based on the mean square error (MSE) value and is mathematically expressed as:

MSE = — Y2E2 2n '

Here, n is the total number of data defined in a batch, and Sj2 is the error value to the ith input data [11].

A supervised learning process is carried out in which known input and target values are fed to the MLP network to predict the outputs for the network. The final network generated for this study consists of 3 inputs (Cartesian co-ordinates), one hidden layer with 30 neurons, and six outputs (joint angles). Both the hidden layer and the output layer consist of activation functions (sigmoid and linear respectively) for generating/predicting the trend in the data set. The activation function employed in the hidden layer is a hyperbolic tan-sigmoid function which is defined over a range of [-1, 1]. Here, the output layer consists of a linear activation function which allows the hidden layer results to be mapped linearly to the network output without any specified constraints.

A Levenberg-Marquardt (LM) algorithm learning technique is used to train the MLP network. "The Levenberg-Marquardt algorithm provides a numerical solution to the problem of minimizing a (generally nonlinear) function, over a space of parameters for the function" [8]. The LM algorithm technique is considered superior (best performance) to other algorithms since it can reach optimal weights by adjusting the learning rate and can achieve the least MSE values [12]. A LM algorithm is mathematically expressed as:

ds + ex

Here, m defines an epoch run, dm is the first derivative to the error, is the second derivative of the error, e is the natural logarithmic function, and X is the damping factor [11]. LM algorithm technique is based on Newton's method and Gradient Decent method. Here, the main goal is to reach a global minimum error by minimizing all first derivatives (gradient) to zero [11].

5.2. Network Architecture and Training

Figure 2 illustrates the MLP feed forward backpropagation network used to calculate the inverse kinematics for a PUMA 560 robot. Here, a supervised batch learning technique is carried out to generate outputs. In supervised learning, target values are provided to the network (through theoretical calculations) and predictions (outputs) are then generated through the network in accordance with the regression value of a successfully trained network. The mathematical representation for updating the weights (w) and bias (b) values for the network is expressed as:

S = E\ (wi * xi) + b

Here, xi= inputs to the network, wi=weight of each input value, b= bias, and n= number of variables. While training this network, the weights and bias values are updated with each batch (epoch) until the lowest MSE value is reached. After this, the training stage of the neural network is terminated.

Figure 2 is generated in MATLAB workspace using the neural network toolbox with the following criteria:

• Input= [X; Y; Z]

• Output= [A1; A2; A3; A4; A5; A6]

• Hidden layer: Tan-Sigmoid Activation Function (30)

• Output layer: Linear Activation Function (6)

Fig. 2. neural network architecture.

For this research, 70% (700 Samples) of the data set values are chosen randomly for actual training of the network, 15% (150 Samples) for validation, and the rest 15% (150 Samples) for testing. The training of the ANN commences once the network architecture is well established and the raw data set is divided into the three following categories:

• Training Set: This data set is utilized during the training state of the network to update the network weights based on its MSE value.

• Validation Set: This data set is used for network generalization. It stops the training of the network once the generalization value stops improving.

• Testing Set: This data set defines an independent measure of the network's performance during and after the training state.

5.3. Simulation and Validation

Once the neural network is trained, a sample (X,Y,Z) coordinate set from the data set is introduced to the network. This data set has a known corresponding set of joint angle values as calculated from Section 3. At this stage, the data goes through a simulation run through the previously trained network and provides results as network outputs. Table 3 below presents an example of one such condition. Here, a comparison between the neural network predicted value and the actual value is shown. The error predicted in this case is minimal i.e. within the 90th percentile range.

Table 3. Error calculation for predicted joint angles.

Known Input (cm) Joint Angles Actual Output (rad) Predicted Output (rad) Error (%)

A1 -2.793 -2.613 6.429

X -0.808

A2 -0.339 -0.315 7.181

A3 -0.785 -0.854 8.735

Y -0.134

A4 -1.920 -2.014 4.903

A5 -1.745 -1.609 7.811

Z 0.024

A6 -4.643 -4.507 2.920

5.4. Path Prediction through Singular Regions

At or near singular conditions, the control algorithm of the manipulator fails or the joint velocities and accelerations become very large for the smooth operation of the manipulator. Thus, knowledge of such singular configurations allows for the successful implementation of automation in a production process. A sample data set consisting of Cartesian co-ordinates of known singularity points (analytical method) is introduced to the trained ANN. A predicted output along with the error percentage of a sample point is provided below (Table 4):

Table 4. Error calculation for predicted cartesian co-ordinates.

Known Input (cm)

Cartesian Actual Predicted Error

Co-ordinates Output (rad) Output (rad) (%)

A1 -0.310

A2 -2.589

A3 3.927

A4 -1.92

A5 -1.745

A6 -4.634

-0.791

-0.752

Once the complete sample data set is run through the ANN, a maximum (8%) and minimum (1%) error percentage value (rounded up to the next integer) is taken. These values help define an error window that contains the singularity space within the complete workspace of the manipulator. This error window can then be plotted along with the complete workspace (black points) of the manipulator to provide a 3D visual representation (Figure 3) of the singularity zone (red points) predicted using the developed ANN. Here, the internal and boundary singularity conditions for the PUMA 560 robot can be seen in Figure 4.

Fig. 3. complete workspace and singularity zones (orthogonal view)1.

V : j ! fi

» 1, : 1 Is / »

• -s "Si .... 1 \ \ < •

n......... • "...JNH„_* - ' \ Y > k/ *..... * * *

t ** ' " «... ' t \ K «¿1 - 0« « ,

i ! ! ■

■0.4 -0.2

0.2 0.4

Fig. 4. complete workspace and singularity zones (top view)1. 6. Results

Results for determining the singularity zones and the goodness of fit are presented. From Figure(s) 3-4, it is observed that singularity zones (red points) are located throughout the complete workspace of the robot. This is due to the fact that the PUMA 560 robot assumes a singularity condition when joint angle, A5, equals zero radians. To illustrate the goodness of fit, a Regression plot and an Error histogram are presented. The Regression plot, which compares the target values and the network output values is shown in Figure 5. For this network, the regression value obtained is 0.87527 indicating an 87.5% fitness. Shown in Figure 6 is the frequency of errors over the range of the data set. The x-axis indicates various error values of the network while the y-axis indicates the number of instances the error was predicted by the network. In this case, the concentration of error values is at -0.02809 (approx. 0), thereby predicting a good fitness. The neural network results are presented in Table 5.

1 The workspace and subsequently the singularity zones are generated over the range of 6 joint angles (A1 - A6) divided equally into 10 intervals. Therefore, Figure 3 and Figure 4 form a point cloud consisting of 10 individual planes (workspace and singularity zones).

Table 5. ANN training results.

Results Value

Overall Mean Square Error (MSE) 1.21780

Training Performance 1.11963

Testing Performance 1.32051

Validation Performance 1.21779

Overall R value 0.87527

Best validation performance (epoch) 4

Error Histogram centered at (bell curve) -0.02809

Total epoch runs 10

Use of ANNs for development of an inverse kinematic solution proves to be a trade-off between computation time and accuracy. While traditional methods may be nearly accurate, it is not always possible to develop a closed-form solution for complex non-linear equations. Moreover, the computation time to develop such solutions may prove expensive. Trained ANNs can however provide solution(s) for complex non-linear problems within minutes and a specified (acceptable) confidence interval.

<=? 2 +

== -1 II I

Fig. 5. regression plot.

Fig. 6. error histogram.

7. Summary and Conclusions

The ANN approach proves to be an effective method in developing a singularity free inverse kinematic solution for 6 DOF robots. As compared with other traditional geometric, iterative, or algebraic methods, ANNs are computationally inexpensive and can easily identify, map, and predict complex non-linear behaviour(s) in data sets. The ANN developed here is able to confidently predict the inverse kinematic solution of a PUMA 560 robot within a 90th percentile interval. This method is highly beneficial in robot trajectory/path planning and collision detection. The proposed method can successfully aid in design and development of robotic workcell(s) where it crucial to understand the reach conditions of the robot(s) with respect to its environment. A singularity envelop is generated within the complete workspace of the robot using the developed network's maximum and minimum error percentage values. A 3D visual representation of this singularity zone is presented using developed algorithm in MATLAB. It is thus important to avoid such configuration(s) when aiming for a singularity free trajectory. Such inferences are vital to document when planning for automation. Further research in this field needs to be conducted for other robots with varying DOF. This will help in developing an algorithm that can successfully generate a robust and singularity free inverse kinematic solution(s) with a minimized error window.

References

[1] Robot Safety Standard ANSI/RIA R15.06-1999. Risk Assessment and Methodology and Specific Guidelines for Safeguarding Robotic Systems. http://www.welding-robots.com/articles.php?tag=452.

[2] Hasan AT, Ismail N, Hamouda AMS, Sris I, Marhaban MH, Al-Assadi HMAA. Artificial neural network-based kinematics Jacobian solution for serial manipulator passing through singular configurations. Adv in Engg Soft 2010;41:359-367.

[3] Kozakiewicz C, Ogiso T, Miyake N. Partitioned Neural Network architecture for Inverse Kinematic calculation of a 6 dof robot manipulator. IEEE Int Joint Conf Neural Networks 1991;3:2001-2006.

[4] Lou YF, Brunn P. A hybrid artificial neural network inverse kinematic solution for accurate robot path control. Journal of Sys and Cont Engg 1999;213:23-32.

[5] Ahmad Z, Guez A. On the Solution to Inverse Kinematic Problem. IEEE Int Conf on Rob and Auto 1990;3:1692-1697.

[6] Yildirim S, Eski I. A QP Artificial Neural Network Inverse Kinematic Solution for Accurate Robot Path Control. Jou of Mech Sci and Tech 2006;20:917-928.

[7] Koker R, Oz C, Cakar T, Ekiz H. A study of neural network based inverse kinematics solution for a three-joint robot. Rob and Auto Sys 2004;49:227-234.

[8] Featherstone R. Position and velocity transformation betweek robot end-effector co-ordinates and joint angles. The Int Jou of Rob Research 1983;2:35-45.

[9] Cheng FT, Hour TL, Sun YY, Chen TH. Study and Resolution of Singularities for a 6-DOF PUMA Manipulator. IEEE Trans on Sys, Man, and Cyber-part B: Cybernetics 1997;27:332-343.

[10] Craig JJ. Introduction to Robotics: Mechanics and Control. USA. Pearson Education Inc 2005.

[11] Samarsinghe S. Neural Networks for Applied Sciences and Engineering. Boca Raton, FL. Auerbach Publications 2006.

[12] Souza CD. Neural Network Learning by the Levenberg-Marquardt Algorithm with Bayesian Regularization (part 1).

http://www.codeproject.com/Articles/55691/Neural-Network-Learning-by-the-Levenberg-Marquardt. 2010.

: R=0.87527

-4-3-2-1 0 1 2 3 Target