Neural Network-Based Inverse Kinematics for an Industrial Robot and Its Learning Method

The time required for the learning process of neural networks depends on the number of total weights and that of the input-output pairs in the training set. In the proposed learning process, after the learning is progressed, e.g., 1000 iterations, input-output pairs having had worse errors are extracted from the original training set and form a new temporary set. From the next iteration, the temporary set is applied instead of the original set. This means that only pairs with worse errors are used for updating the weights until the mean value of errors decreases to a level. After the learning using the temporary set, the original set is applied again instead of the temporary set. By alternately applying the two types of sets for learning that the calculation load for convergence can be efficiently reduced. The effectiveness of the proposed method is proved by applying to an inverse kinematics problem of an industrial robot.


Introduction
When designing a serial link structure for a multi-legged robot, first of all, its inverse kinematics problem must be solved. Hoang et al. proposed a differential kinematics algorithm to generate omni-directional walking trajectory of a leg based on back-stepping control using Lyapunov stability (1) . Simulation results for walking motion of one leg of a six-legged robot were shown to prove the effectiveness and applicability of the proposed controller. Tejomurtula and Kak proposed a solution of inverse kinematics concerning a simple two link manipulator (2) . Duka designed a feedfoward neural network to solve the inverse kinematics problem of a three-link planar manipulator (3) . Also, Maeda et al. designed a position control scheme for actual robot systems using high dimensional neural networks, in which complex-valued neural network and quaternion neural network learned the inverse kinematics of the robot systems. Two dimensional SCARA robot and three dimensional robot were well controlled using the inverse kinematics (4) . Further, Koker et al. proposed a neural network based inverse kinematics solution for a three joints manipulator (5) and then neural networks and genetic algorithms were fused together to solve the inverse kinematics problem of a Stanford robotic manipulator with six-DOFs while minimize the error at the end effector (6) . Hasan et al. also reported the results about neural networks' based inverse kinematics solution for a three joints serial robot manipulator passing through singularities (7) .
Generally, in making a neural network learn a nonlinear relation properly, a desired training set prepared in advance is used. The training set consists of multiple pairs of an input vector and an output one. Each input vector is given to the input layer for forward calculation, and the corresponding output vector is compared with the vector yielded from the output layer. Also, backward calculation means updating the weights using a back propagation algorithm. One cycle consists of one forward calculation and backward one. The time required for the learning process of the neural network depends on the number of total weights in the neural network and that of the input-output pairs in the training set. Especially, it is by no means easy for some of input-output pairs to converge to a desired error level. As a research for reducing calculation load, Kanan and Khanian proposed a method to reduce training time using an adaptive fuzzy approach (8) . The fuzzy approach was employed to control the learning parameters such as learning rate and momentum. This paper describes a neural network with an efficient weights tuning ability in order to effectively learn the inverse kinematics of an industrial robot. In the proposed learning process, after the learning is progressed, e.g., 1000 iterations, input-output pairs having had worse errors are extracted from the original training set and form a new temporary set (9,10) . Note that one iteration of learning uses all pairs in the training set. From the next iteration, the temporary set is applied instead of the original set. In this case, only pairs with worse errors are used for updating weights until the mean value of errors reduces to a level. After the learning conducted using the temporary set, the original set is applied again instead of the temporary set. It is expected by alternately giving the two kinds of sets that the convergence time can be efficiently reduced. The effectiveness is proved through simulation experiments using a kinematic model of an industrial robot with six-DOFs.  Table 1 tabulates the Denavit-Hartenberg notation (DH) extracted from the robot (11) . a is the link length which is the distance between two adjacent z-axes measured along x-axis, α is the link twist angle between two adjacent z-axes measured around x-axis, d is the link offset which is the distance between two adjacent x-axes measured along z-axis and θ is the joint angle between two adjacent x-axes measured around z-axis.

Industrial Robot Motoman with Six-DOFs
The homogeneous transform matrix k−1 Tk using the four parameters is written by where, e.g., the homogeneous transform Rot(z, θ) conducts the rotation of θ [rad] to right screw direction around z-axis; ; Sθ and Cθ denote sinθ and cosθ, respectively. Hence, 0 T6 is obtained by 3×3 rotational matrix R in 0 T6 has to be transformed into roll, pitch and yaw angles in kinematic simulation (12) . As is known, the inverse kinematics problem of a serial link structure becomes more complex with the increase of the DOFs.

Design of neural network
In this paper, the joint angle vector θ = [θ1 . . . θ6] ⇒ the homogeneous transform matrix 0 T6 is called the forward kinematics and can be analytically calculated through 0 T6= fkine(θ) (12) . Reversely, 0 T6 ⇒ θ is to be the inverse kinematics. It is not easy but complex to obtain the analytical solutions of the inverse kinematics. In this section, it is tried that the mapping of inverse kinematics 0 T6 ⇒ θ is acquired in the neural network shown in Fig. 2, in which xd =[xd yd zd αd βd ] T is transformed from 0 T6; αd and βd are the roll and pitch angles, respectively. The yaw angle can be always fixed to 0 because of the axis symmetry of the sixth axis. The number of the hidden layers and that of neurons are not important for researching the proposed weights tuning method, so that they were tentatively set to 2 and 20, respectively. The neurons in two adjacent layers are Table 1. Denavit-Hartenberg notation for Motoman HP20 (11) . connected with weights randomly initialized within the range from −1 to 1. In the learning process shown in this section, the back propagation algorithm is applied for training of the weights. After here, the neural network is called the NN.
The performance of the proposed efficient learning method is evaluated using the regularly prepared training set consisting of multiple pairs of xdj =[xdj ydj zdj αdj βdj ] T and θdj (1 ≤ j ≤ 481), i.e., the sampled number in the training set is 481. The desired points [x dj y dj z dj ] T included in x dj generated along a spiral path can be viewed as shown in Fig. 3. Roll angle αdj and pitch angle βdj are obtained from normal vector at the respective points. The joint angle θdj in the training set was made by using an inverse kinematics function θdj = ikine(xdj) available on MATLAB (12) .
When the back propagation algorithm is used for adjusting weights in neural network, it is serious problem that much time is required for satisfactory convergence. Especially, undesirable stagnation of learning always depresses us. Here, an efficient training method is introduced by using the case shown in Fig. 3. In this method, when the learning falls into the situation of stagnation, a stimulating extraction from original training set is applied and temporally creates another training set with worse evaluation.

Conventional and orthodox learning process
First of all, the conventional and orthodox learning process is described. Error E i for criterion at the i-th learning process is defined by where ej is the error in case that the j-th sample in training set is given to input and output layers, which is obtained by where θdj ∈ ℜ 6 and θnnj ∈ ℜ 6 are the training vector for the output layer and the actual output from the NN, respectively. k is the number of each joint. j is the sampled number in training set. The learning, i.e., the updating of weights, is continued until the following condition is satisfied.
where Ed is the maximum allowable error. The stagnation of training process can be judged by where Es is the stagnation index. In the conventional learning method used in this section, all samples in the training set, i.e., 481 pairs, are sequentially given for updating 620 weights. Figure 4 shows the learning result, in which the updating of weights by using a back propagation algorithm was  Fig. 2. Neural network with five inputs of xd ∈ ℜ 5 and six outputs of θnn ∈ ℜ 6 . In simulations, the number of the hidden layers and that of neurons are tentatively set to 2 and 20, respectively. conducted 481 times in one learning process on the horizontal axis. In other words, one learning process means 481 times iterative computations using 481 input and output pairs. Also note that one computation for updating the weights consists of a pair of a forward propagation to calculate the error and a back propagation to update 620 weights based on the error. It was confirmed that totally the updating of weights was conducted 81,702×481= 39,298,662 times. In this case, the desired maximum allowable error Ed was set to 0.03. The specification of CPU was Intel(R) Core(TM) i7 4790 3.6 GHz. In this research, the calculation time is not used for criterion because the value of the time depends on the performance of CPU built in PC.

Efficient learning process
On the other hand, in our proposed method, a new  (11) where m is the number of the pairs in the training set extracted from the original set based on Eq. (7), (8) or (9). Finally, the proposed method was applied to the same problem explained in section 3.2 to evaluate the effectiveness. As an example, Table 2 shows three results of the total times of weights updating in case that the numbers of iterative learning of original and extracted sets were set to 1,000 and 4,000, respectively. Figure Table 2. Three results of the total times of weights updating, in which numbers of iterative learning of original and extracted sets were 1,000 and 4,000, respectively.  Table 2.

Conclusions
This paper has introduced a neural network with an efficient weights tuning ability to effectively learn the inverse kinematics of an industrial robot with six-DOFs. In the proposed learning process, after the learning is progressed, e.g., 1000 iterations, input-output pairs with worse errors are extracted from the original training set and form a new temporary set. From the next iteration, the temporary set is applied instead of the original set. After the learning conducted using the temporary set, the original set is applied again instead of the temporary set. The effectiveness was proved through simulation experiments using a kinematic model of an industrial robot MOTOMAN HP20, i.e., the convergence time could be efficiently reduced by alternately applying the two kinds of sets.