Solving the Inverse Kinematic Equations of Elastic Robot Arm Utilizing

The inverse kinematic equation for a robot is very important to of this equation is complex for the rigid robot due to structure of robot link. In light robot arms, than the rigid link robot because the deformation variables (elongation and bending) kinematic equation. The finding of an inverse kinematic equation and both of the end-effector position and deformations variables. In this work, a neural network solve the problem of inverse kinematic equation. To feed the neural network, experimental data were taken from an elastic robot arm for training the network, these data presented by joint angles, deformation variables and end positions. The results of network training showed a good fit targets data. In addition, this method for finding the inverse of kinematic equation proved its effectiveness and validation when applying the results of neural network real light robot’s position.


Introduction
The forward kinematic equation is a functional relationship between the generalized parameters (joint displacements) and the end positions.By substituting a set of values of generalized parameters into the forward kinematic equation, the considering ends -effector can be obtained.The problem of finding the end position for a given set of generalized parameters is called the direct kinematic problem robot's end-effector positioning and control, it i required to find the generalized parameters that lead the end -effector to the specified position and orientation.This is done by finding the inverse of the forward kinematic equation (inverse *Email: hussalkhafaji@gamil.com **Email: muhsinnah_eng@nahrainuniv.edu.iq 15 March 2016; accepted 14 November 2016) https://doi.org/10.22153/kej.2017.11.002 robot is very important to the control robot's motion and position.The solving of this equation is complex for the rigid robot due to the dependency of this equation on the joint , where the flexibility exists, the solving of this problem is deformation variables (elongation and bending) are present kinematic equation.The finding of an inverse kinematic equation needs to obtain the relation between the joint angles effector position and deformations variables.In this work, a neural network has f inverse kinematic equation.To feed the neural network, experimental data were taken from an elastic robot arm for training the network, these data presented by joint angles, deformation variables and end ng showed a good fit between the output results of the neural network and the targets data.In addition, this method for finding the inverse of kinematic equation proved its effectiveness and neural network practically in the robot's operating software for controlling orward and inverse kinematic equation of elastic robot.Neural networks.
The forward kinematic equation is a functional relationship between the generalized parameters (joint displacements) and the end -effector positions.By substituting a set of values of forward kinematic effector can be obtained.The problem of finding the end-effector position for a given set of generalized parameters called the direct kinematic problem [1].In effector positioning and control, it is required to find the generalized parameters that effector to the specified position done by finding the inverse of the forward kinematic equation (inverse kinematic problem).The complexity of the inverse kinematic problem depends heavily on the number of joints and structure of the robot Flexibility of robot arms will add additional in the forward kinematic equation presented by the deformation variables magnitude of these variables could estimated easily, because their magnitude upon external forces, inertia forces, positions and orientation of robot arms [3].
The importance of the inverse kinematic problems in robot control, and the complications of solving it, make many researches deal with this subject, and many methods investigated to solve the inverse kinematic equation.widely applied solution is the clos

Al-Khwarizmi Engineering Journal
Solving the Inverse Kinematic Equations of Elastic Robot Arm control robot's motion and position.The solving joint configuration and , the solving of this problem is more complicated present in the forward to obtain the relation between the joint angles has been proposed to f inverse kinematic equation.To feed the neural network, experimental data were taken from an elastic robot arm for training the network, these data presented by joint angles, deformation variables and end-effector between the output results of the neural network and the targets data.In addition, this method for finding the inverse of kinematic equation proved its effectiveness and ly in the robot's operating software for controlling the orward and inverse kinematic equation of elastic robot.Neural networks.
kinematic problem).The complexity of the problem depends heavily on the number of joints and structure of the robot [2].
of robot arms will add additional terms in the forward kinematic equation, these terms presented by the deformation variables.The nitude of these variables could be not magnitude depends upon external forces, inertia forces, positions and of the inverse kinematic problems in robot control, and the complications of solving it, make many researches deal with this subject, and many methods investigated to solve The common and widely applied solution is the closed form solution, literatures [3][4][5][6][7][8] presented different methods of closed form.A closed form solution is not always a possible way to find the solution, so various studies have been proposed using other techniques.Juan et.Al. [4] suggested the using of a Fuzzy reasoning system to position the arm of an articulated robot without explicitly solving the inverse kinematic equation.Yong et.al. [5] used Genetic algorithm to solve the inverse kinematic.Kuroe et.al. [11,12] stated the use of neural networks as a new method of solving the inverse kinematics of a rigid robot manipulator.Previous research [13][14][15] examined the use of artificial neural networks to find the inverse kinematic equation for articulated robots.While, Shiv et.Al. [6] applied neuro-fuzzy to obtain the inverse kinematic equation for robot with three degrees of freedom.
Most of researches proposed their solutions for the mathematical model of a rigid manipulator.With the presence of deflection parameters, the problem will be more complicated.Therefore, in this work, the proposed neural network with multiple layers was suggested as a function approximation to find the inverse kinematic equation for an elastic robot arm (ERA).The multiple layer neural network is useful for function approximation because [15]: • It is universal approximations.• It is efficient approximations.• It could be implemented as a learning machine.

Kinematic Equations of an Elastic Robot Arm (with Error)
The flexibility causes elastic deformations of the structural members of the manipulator, resulting in large end-effector errors, especially in long reach manipulator systems.Hence, as a result, the frames defined at the manipulator joints are displaced from their expected locations.So, the use of kinematic equation of the rigid robot to position the manipulator end-effector will place the manipulator in a different position than the desired one.
In Figure 1, the frame O i-1 is the base frame , O i I is the ideal location and O i a is the actual location due to the deflection.The transformation equation between the coordinates O a and O I consists of two parts, rotation and translation.According to the Euler angle principle, the rotation part is the result of three sets of rotations which are roll, pitch and yaw about the axes z, y, x, respectively.The sequence of rotation is: That is a rotation of d about the x axis, followed by a rotation d about the y axis and finally a rotation of d about the z axis.The transformation between coordinates and O I becomes: Here, the δx, δy, δz, d , d and d generalized error parameters.Usually generalized parameters are introduced on the basis of different approximations, such as assumed modes, finite elements, or Ritz-Kantorovich expansions, with different implications on the model complexity and accuracy [9].
The references [17][18][19] have supposed that the generalized deflection parameters are small, so a first order approximation can be applied to their trigonometric functions and product, and higher order equals zero.
Based on these assumptions, the matrix …(8) will be equal to: In this work, the values of deflection's are taken in consideration.Figure 1 shows the coordinate for flexible links, the kinematic equation covering the positions of this links with presence of flexibility is: represents the rotation part of the transformation matrix.The translation matrix … (6) The transformation between coordinates O a …( 7) are called generalized error parameters.Usually, these generalized parameters are introduced on the basis such as assumed Kantorovich expansions, with different implications on the have supposed that the generalized deflection parameters are small, so a first order approximation can be applied to their trigonometric functions and product, and higher deflection's parameters shows the coordinate for serial of the kinematic equation covering the links with presence of flexibility Where: 3 2 , 4 2 , a i and d 2 represent the joint parameter defined as in Figure 2. By using equation (10), the transformation relationship between the two frames can be found.

Fig. 2. The Denavit-Hartenberg notatio
T )*+, may be expressed in form as a nonlinear function of q and T )*+, 5 q, 7 Where: is the set of Cartesian coordinates describing the position and orientation of the manipulator's end-effector with respect to the inertial frame.q 8 q q !⋯ ⋯ ⋯ ⋯  may be expressed in a simple compact form as a nonlinear function of q and 7 vectors: is the set of Cartesian coordinates describing the position and orientation of the effector with respect to the ⋯ q 9: ; …(13) ⋯ 7 <: = …( 14) Where: q is the vector in joint space.7 is a dimensional link deflection vector space, spanned to be the link deflections of the manipulator arm.n is the number of joints.@ generally equals to 6 x m. m is the number of flexible links.The elements of the vector 7 cannot easily specify their values, since these elastic coordinates are dependent on the rigid coordinate q and on the applied forces F. For more generally: By substituting equation …( 16) into equation ( 12), T )*+, will be: As mentioned in the previous section, the two degrees of freedom of the arm robot manipulator used in this study are confined to move within the vertical plane, and so is the deformation of each link.Hence, there is no rotation about the axes x and y, also there is no transformation in the z direction (the parameters δz, d and d are equal zero).Figure 3 shows a single flexible link coordinate system, the O 21 represents the base local coordinate system, and the frame O 2 ( is the local coordinate system assigned to link i in its undeformed position, while the O 2 a is the actual local coordinate system of link i , when it is under deformation.
The homogenous transformation matrix for this single link was derived as follow: • According to the motion of the links within the vertical plane, the homogenous transformation matrix E 2a ( between O 2 a and O 2 I becomes: • The homogenous transformation matrix between the O I and O 1 is presented by the matrix A 1 in equation ( 9).
• The homogeneous transformation matrix for this a single link is found from the relations ( 12) and (18).
Where: As shown in Figure 4, the total kinematic equation of flexible robot of two degrees of freedom is:

Al
The transformation matrix of robot in general form is:   The degree of freedom of the robot arm manipulator which is used in this work, is two degrees of freedom, and confined to move within the vertical plane with the kinematic parameters listed in the Table 1 .
By substituting the values of parameters of the manipulator from the Table 1  Equations (44) to (46) represent the endeffector position with presence of flexibility of robot, which will be called, the flexible kinematic equation.The inverse of these equations will be found by using the neural network.

Work a. The rig of Experiment
In this work, the test rig was represented by two degrees' manipulator (two elastic links) confined to move in a vertical plane.The two links were designed to have properties gathering the lightness approximate to the flexible beam and stiffness approximate to the rigid beam to reduce the vibration effects; the two links are hallow rectangular beams made from the aluminum type (6061-T6) with length 57 cm and 62 cm for first and second arm, respectively.In addition, the manipulator has a measurement system (bonded strain gauges on each arm) and data acquisition system to measure the deflection variable the rotation of the tip of the beam experimentally, the measuring of the deflections at two points along the beam was done points where the strain gauge No.3 and at the tip, and by applying these values of the deflections into the following equation [20] : tan I ∆xS ∆P Where: δy represent the deflection.∆δy represents the difference between the two deflections.∆L represents the distance between the two points where the deflections measured.
The relations between the deflections and the voltages of strain gauges estimated experimentally by curve fitting between deflection and voltage as shown in Figure 5.
strain gauges on each arm) and data acquisition deflection variable, To find the rotation of the tip of the beam dϕ experimentally, the measuring of the deflections at two points along the beam was done at the points where the strain gauge No.The relation between the tip deflection and the

…(51)
The relation between the tip deflection and the voltage of the strain gauge No.2 is: …(52) The relation between the deflection at the point 36 cm from the center of the shaft of the and the voltage of the strain gauge …(53) was experimentally found by extracting the strain from two sensors at the upper and lower surface at the same position of the strain gauge difference value represents the extension of the beam in the longitudinal direction, as represented by the relation [20]: …(54) Figure 6 shows the two degrees robot arm manipulator and the strain gages.44) and (45) to calculate the end effector in x and y coordinate that would be with the measured generalized parameters as input values to the neural network.
for feeding the neural include joint's angle, corresponding enda control mode was designed to operate the robot in specific ch include moving the 30 o step 5 o ) step 5 o ).When , the first link is still , and the second link is still a while at to the next step., the second returns back to the start angle, and the first .At each step and endand saved .This procedure was repeated for ,1,2, and 3) kg hanging at of readings which will be Figure 7 shows of positions during this test.
samples of positions during experimental deformation , which were read in above test, are figure 13), these represent the change of values for δ‚, δƒ at the tip with angles of the two links.These results were used as inputs to equations calculate the end effector in x and y coordinate that would be with the measured generalized parameters as input values to the

Neural Network for Inverse K Equation of Elastic Robot
As mentioned in previous section, there is difficulty to solve the problem for finding the inverse of the kinematic equation with presence the deformation parameters.So, to overcome this difficulty, the neural network was used inverse of the kinematic equations (4 These equations relate the vector of operating (task) space coordinate to the joints and deformations vector, these equations could be presented in compact form: " 5 …, 7 Where: The inverse kinematic problem of rigid robot is defined as giving end effector positions ( the joint variable vector (… , in the elastic robot beside the vector ( " ), there will deformations vector 7 that should be given to get (… .So, the inverse equation will be:

Kinematic
section, there is a difficulty to solve the problem for finding the inverse of the kinematic equation with presence of So, to overcome this used to find the (44) to (46). the vector of operating (task) space coordinate to the joints and deformations vector, these equations could be The inverse kinematic problem of rigid robot is d effector positions (") to get elastic robot.there will be the should be given to get The proposed neural network was used to model the equation (59), which kinematic inverse neural network.many neural networks were trained.The structure of each network was with (one two hidden layers-output layer).Each network had a different number of neurons in the hidden layers.The numbers was chosen randomly.The selection of neurons number was specified by trial and error.The input layer received the eight variables (δy1, δx1, dϕ1, δy2, δ py).The output layer gave the angles ( network result, as shown in Figure 1  Where is the slope parameter.
For the output layer was pure line.The back propagation training algorithm with one variable learning rate was used to train these neural networks.
The input variables (δy1, δx1, d dϕ2) were imported from the results of the test in the part of experimental work and by using these variables with corresponding angles ( in equations ( 44) and (46) to calculate the last two variables (px and py).Hence, these variables were used to train the networks.
The networks that used were simulated by using the scientific and engineering package Matlab.
To find the optimum neural network, the tested networks output was compared with respect to the Khwarizmi Engineering Journal, Vol. 13, No. 1, P.P. 13-25(2017) …(59) The proposed neural network was used to which is called the kinematic inverse neural network.In this work, many neural networks were trained.The structure one input layer and output layer).Each network had a different number of neurons in the hidden layers.The numbers was chosen randomly.The selection of neurons number was specified by trial received the eight δy2, δx2, dϕ2, px, and py).The output layer gave the angles (θ1, θ2) as a Figure 14.
the structure of kinematic inverse neural used in the hidden layers for each network was the hyperbolic tangent function (due to the bipolar value for the as shown in equation [21]: is the slope parameter.the output layer was pure line.The back propagation training algorithm with one variable learning rate was used to train these neural δ δx1, dϕ1, δy2, δx2, 2) were imported from the results of the test in experimental work and by using these variables with corresponding angles (θ1 and θ2 ) to calculate the last two variables (px and py).Hence, these variables were were simulated by using the scientific and engineering package To find the optimum neural network, the tested compared with respect to the angles that were used in equations (44) get px and py.The best fit obtaine network has the following structure, as shown in Figure 14: 1-One input layer (receives the eight variables).

Results and Discussion
Figures 15 and 16 show the comparison between the optimum neural network outputs and the target data for (θ1 and respectively.These figures reveal a good fitting between the network results and the target angles The roots square errors of result networ (0.999742) and (0.999804) for the first and the second angles, respectively.Network training parameters that used in this 8 10 5 show the comparison between the optimum neural network (ONN) outputs and the target data for (θ1 and θ2), respectively.These figures reveal a good fitting between the network results and the target angles.
of result network were (0.999742) and (0.999804) for the first and the Figures 17 and 18 depict the comparison between the px and py, that resulted from the equations ( 44) and (45) with the neural network.Each figure has two curves; the first one is from applying the target angles, and the second one is resulted from applying the ONN.
The Figures from 15 to 18 show a good fitting between the neural network results and the target angles, so that the results of this were used in the control system of the elastic robot to control the motion and position show a good fitting network results and the target the results of this neural network control system of the elastic robot to control the motion and position.

Al
As mentioned above, there are many networks with different structures that were experimented to find the best one.At the beginning, the networks were with one hidden layer trained, but the results were far from the target in spite of increasing the number of neurons.Therefore using networks with two hidden layers, the result began to approach from the target.Figure 22 illustrate the results for some of the networks that were experimented.The way that these networks were named depended upon how many neurons were used in each layer, so the name (network 12-40) means the first layer has 12 neurons, and the second layer has 40 neurons.As mentioned above, there are many networks were experimented to find the best one.At the beginning, the with one hidden layer trained, but the results were far from the target in spite of Therefore, by using networks with two hidden layers, the result Figures 19 to for some of the networks that were experimented.The way that these networks were named depended upon how many neurons were used in each layer, so the name 40) means the first layer has 12 neurons, and the second layer has 40 neurons.

Conclusion
The first advantage of using neural network is to overcome the difficulties of kinematic inverse equation of the flexible robot, and the advantage is that it takes the values of training from the experimental work by operating the robot itself, and measures the variables with presence of more than one effect during the operation (like joint's stiffens, joint's gear box backlash, noise, etc..).These effects will in consideration to establish the network automatically (during learning to find approximation), Therefore, the result when used in the control system of robot will overcome the problem of these effects, but may be when using the other methods algebraic method, the inverse kinematic equation will be solved mathematically and consideration these effects.The proposed neural network gave a good fit with the target.The roots square errors of results network were and (0.999804) for the first and the second angles, respectively.And it is found from the training and testing of many networks that, not conditionally, the increase of number of neurons in the hidden layers will give the best result.Also, this neural network was used in the operating software of ERA robot and showed a good performance to position the end effector of the elastic Mechanical Engineering / University of Technology **College of Engineering/ Al-Nahrain University

Fig. 1 .
Fig. 1.Frame displacement due to errors cos d sin d sin d sin d cos d b !! sin d sin d sin d $ cos d cos d b "! cos d sin d c " cos d sin d cos d $ sin d sin d c !" sin d sin d cos d cos d sin d c "" cos d cos d The equation …(5) represents the rotation part of the transformation matrix.The translation matrix is:

Fig. 3 .
Fig. 3.The coordinates system of a single flexible link under deformation.

Fig. 4 .
Fig. 4. the coordinates systems of two elastic links and the angles of joints 3 and at the tip, values of the deflections … (47) the difference between the two represents the distance between the two The relations between the deflections and the voltages of strain gauges were estimated between deflection The relation between the tip deflection and the …(48) The relation between the tip deflection and the …(49) The relation between the deflection at the from the center of the shaft of the first joint and the voltage of the strain gauge No.3 is: …(50)

Fig. 5 .Fig. 6 .
Fig. 5. the distribution of strain gauges and applied load for the two links.