Predicting the Motion of a Robot Manipulator with Unknown Trajectories Based on an Artificial Neural Network

Mathematically, the motion of a robot manipulator can be computed through the integration of kinematics, dynamics, and trajectories calculations. However, the calculations are complex and only can be applied if the configuration of the robot and the characteristics of the joint trajectories are known. This paper introduces the use of artificial neural networks (ANN) to overcome these shortcomings by solving nonlinear functions and adapting the characteristics of unknown trajectories. A virtual six-degree-of-freedom (DOF) robot manipulator is exploited as an example to show the robustness of the developed ANN topology.


Introduction
Robot manipulators have been widely used in recent decades, for example in heavy industries, on production sites or in the medical sector, due to their ability and efficiency in monotonous work. However, serious accidents have occurred due to lack of awareness about robot machinery or improper manipulation issues. The study of robot manipulator mechanisms and motion has therefore become indispensable.
Mathematically, the motion of a robot manipulator can be computed through the integration of kinematics (forward and inverse kinematics), dynamics and trajectoryplanning calculations . However, it is difficult to apply these mathematical solutions. Problems include failure to derive the kinematic equations and inability to find analytical solutions [23][24][25][26][27][28][29] or to solve the variety of complex mathematical equations. Furthermore, the mathematical method can only be applied if the characteristics of the trajectories are known [7,8,10,12,14,18,22]. It is a complex and tedious process to compute the motion of a robot manipulator by using the conventional approach.
There are also a lot of complex trajectory methods that have been developed to meet different manipulation requirements. For examples, Pan et al. proposed a samplebased planning method to produce smooth trajectory, which consisted of the fundamentals of cubic spline [4]. Macfarlance and Croft proposed a method to reduce the jerk for manipulators in real-time manipulation by integrating the techniques of quintic polynomial and sine wave acceleration function [7]. Hauser and Ng integrated the techniques of straight-line trajectory and parabolic trajectory to produce a fast-smoothing trajectory [11]. Rossi and Savino proposed the 'envelop of tangent method' for point-to-point trajectory [18]. Briot et al. proposed a method to reduce the shaking force for high-speed mobile manipulators by implementing the fundamentals of bangbang and trapezoidal velocity profile trajectories [20], etc. These trajectories possess different characteristics and their trajectory equations are totally different.
In order to compute the motion of a robot, it is crucial to derive the trajectory equations. Sometimes the trajectory equations cannot be derived if the characteristics of a trajectory are unknown. Without the trajectory equations, one might not be able to compute the motion of a robot.
The main motivation of this paper is to propose a method which is able to adapt the characteristics of different trajectories, even those trajectories with unknown characteristics. Artificial neural network (ANN) is strongly recommended for achieving this objective based on its ability in solving nonlinear functions and its cognitive learning ability [10,16,23,[25][26][27][28][29][30][31][33][34]36]. Users are able to compute the position and motion of a robot without deriving any trajectory equations using the current proposed method.
There are various types of neural network, such as the Hopfield (recurrent) network [30,31,36], and Bidirectional Associative Memory (BAM) [37], unsupervised learning networks [38] and self-organizing neural networks [39][40][41]. Among these network models, back-propagation neural network (BPNN) is chosen as a fundamental topology for the current research because it is widely used for pattern recognition problems and is easier to implement with high accuracy [10,16,23,[25][26][27][28][29][30][31]33,34,36,42]. Some researchers have applied ANN to solve trajectory issues such as recurrent neural network [30,31,34,36] and BPNN (single multilayer) [43][44][45]. However, there are certain limitations in such studies. Recurrent neural network allows a robot to follow a specified path (with known trajectory) after training [30,31,34,36] but does not allow prediction of the motion of a robot with unknown trajectory. BPNN possesses the ability to adapt and learn from experiences and analogy, but a single multilayer back-propagation neural network is unable to produce good results in predicting the motion of a robot, especially a robot with a high degree of freedom (≥ 6DOF) [43][44][45]. It is hard for a single multilayer BPNN to adapt multi-nonlinear functions. Therefore, the novelty of this paper is to introduce a neural network topology which consists of multi-BPNNs and can be used for predicting the motion of a high-DOF robot with unknown trajectory.

Kinematics
Robot manipulators are governed by two basic kinematic theories, namely forward kinematics (FK) and inverse kinematics (IK). FK theory calculates the position and orientation of the hand or wrist (end effector) base on the robot's configuration, and the robot's configuration is assumed to be known in terms of all the joint variable angles and the length of links [10,16,17,21,23,34]. Conversely, given the desired position and the orientation of the end effector ( ) t r E , IK theory enables the robot to calculate all the joints values θ, to place itself at the desired location and orientation [10,16,17,21,23,[26][27]29,35].

Dynamics
Other than kinematics, a person has to know the dynamics system of a robot manipulator for computing the robot motion. As mentioned above, inverse kinematics are usually solved at the velocity level. For an n-DOF manipulator, the joint position variable can be denoted by as the time which is required for the entire motion of a manipulator. Assuming that a class of tasks (location of each joint) is described by m variables , the relation between q and x is given by where f is a function representing the forward kinematics. Differentiating x(t) with respect to time yields The pseudo-inverse of J(q(t)) denoted by  The constraints for the dynamic model are given by represents the gravity effects, )) ( ( t q F  represents the friction effects and The inertia matrix is symmetric, positive-definite, and satisfies the following criteria: The inertia and centripetal-Coriolis matrices satisfy the following skew symmetric relationship: The task-space tracking error can be defined as: where m d R x ∈ represents the desired Cartesian task space. The subtask tracking error of the system can be defined as: where g(.) is a vector function which is constructed according to the subtask control objectives such as obstacles avoidance, singularity avoidance, etc. [23][24][25][26][27][28][29][30][31][32][33][34][35][36]. The dynamics model of a robot might affect the rotation time of each joint and thus it can be considered as a crucial part in computing robot motion.

Motion Planning
Basically, there are two types of motion planning for a robot, namely path planning [14][15][16][17] and trajectory planning [7][8][9][12][13][14][18][19][20][21][22]. However, trajectory planning will be more practical compared to path planning as it includes the motion timing, velocities and accelerations. In terms of trajectory planning, trajectories may be planned in joint space or in Cartesian space. In comparison to joint space trajectories, Cartesian space trajectories can be visualized easily but they are more difficult to calculate and plan. On the other hand, if the robot is not required to follow a specific path, joint space trajectories can be applied, as the trajectories are easier to calculate and realistic motions can be generated.
Mathematically, if kinematics, dynamics, and the trajectory equations are known, the robot motion can be computed. The block diagram for computing the motion of a robot manipulator is illustrated in Figure 1. In Figure 1, v K and n R ∈ α represent a diagonal, positive definite gain matrix. The output of the controller will be in the form of a nonlinear function and it is used to eliminate or reduce the dynamic tracking errors.
The main disadvantage of using the mathematical model is that it requires extensive computation. Besides, it is crucial to have kinematics and trajectory equations, or else the robot motion might fail to be computed.

Artificial Neural Networks
Artificial intelligence (AI) approaches such as genetic algorithm (GA) [42], neuro-fuzzy [11,21,33] and ANN [10,23,25,[28][29][30][31]34] have been extensively used for solving robotic problems in various aspects. As stated in the introduction, the computation of robot motion involves solving multi-nonlinear functions and adapting the characteristics of the trajectory. Back-propagation neural network (BPNN) seems to be the most suitable AI approach for solving these issues due to its ability in solving nonlinear functions and its cognitive learning ability, which have been proven by other researchers [10,16,23,[25][26][27][28][29][30][31][33][34]36]. Assume that the BPNN consists of three layers, which are input layer, hidden layer, and output layer. The actual outputs of the neurons in the hidden layer will be where n is the number of inputs for neuron j in the hidden layer, and sigmoid is the sigmoid activation function The same procedures can be repeated by increasing the iteration p until the output error criterion is satisfied [42].

Methodology
Mathematically, the motion of a robot end effector can be computed based on the block diagram in Figure 1. However, it requires complex calculations to derive the mathematical equations. Hence, one of the objectives of the current paper is to use multi-BPNNs to solve the kinematics, dynamics, and trajectory issues instead of deriving the mathematical equations. The method in Figure 3 is used to ease the steps of computing the motion of robot end effector, to help individuals with a lack of knowledge about robotic kinematics, dynamics and trajectories. Trajectory equations are not necessary for the block diagram in Figure 3 and thus the user does not really have to spend time finding out the characteristics of the trajectory.
Although BPNN is able to solve the nonlinear functions, it is still difficult for a single multi-layer BPNN to solve the kinematic, dynamic, and trajectory problems simultaneously. Failure to solve these simultaneously might reduce the training speed and accuracy and the precision of the results. Therefore, the novelty of the proposed method is to develop a multi-BPNNs topology by combining multiple BPNNs which handle different tasks at the same time.

Topology of Neural Network Used in Current Research
The multi-BPNNs topology proposed here can be used for predicting the motion of the entire robot manipulator. For a virtual 6-DOF robot manipulator as shown in Figure 4, the motion of the robot manipulator can be computed by using the proposed multi-BPNNs topology in Figure 5. This architecture consists of eight primitive BPNNs (NN1, NN2, NN3, NNI, NNII, NNIII, NNE, and NNjoint3). There are three main parts in the architecture. Firstly, NN1, NN2, and NN3 are used to predict the required motion time for each joint. Secondly, NNI, NNII, and NNIII are used to predict the joint angle of each joint at certain interval time. Lastly, NNE and NNjoint3 are used to solve FK. The inputs for BPNN1 (NN1) are the initial (θ1(t0) ) and final position (θ1(tf) ) of joint 1 in joint space. Y1 is the output of NN1 which is the required time for the rotation of joint 1. H1 is the outcome of function h(ti,Y1) where ti is an arbitrary interval time and tiε [t0 ,tf]. The main function of h(ti,Y1) is to control the input of NNI.
( ) Y1) is used in conjunction with several BPNNs ( Figure 5) to overcome the weakness of BPNN in adapting two different functions simultaneously. The occurrence of two different functions arises when the required rotation times between joints 1 and 2 are different. As shown in Figure 6, joint 1 is rotating from θ1ito θ1f and the required rotation time is ta. Meanwhile, joint 2 is rotating from θ2ito θ2f and the required rotation time is tb. The variation of angle for joint 1 from time 0 to ta is a completely nonlinear function and thus the characteristic of the function can be adapted by using BPNN and the position (joint space) of joint 1 at any interval time can be predicted. Conversely, there are two portions for joint 2, portion A (nonlinear function) and portion B (linear function). It is a linear function in portion B because joint 2 remains in static mode after completing its rotation. For joint 2, BPNN is unable to predict the position of joint 2 at any interval time correctly because it consists of two different functions. In order to increase the accuracy of the results, the position of joint 2 in portion A will be predicted by using ANN and the position of joint 2 in portion B will be computed by using function h(ti,Y). The use of function h(ti,Y) is to let the model to understand that there is a linear function in portion B, where tb<ti. The function of h(ti,Y) only can be neglected if the rotation time for each joint is the same. The interconnection between NN1 and NNI is illustrated in Figure 7. The output of ANNI will be the angle of joint 1 at interval time ti and ANNE is used to calculate the position (FK) of the end effector in Cartesian space at interval time ti.In comparison to the conventional single multilayer BPNN in Figure 2, this multi-BPNNs topology produces better results because this topology combines multiple BPNNs to handle different tasks. NN1, NN2, and NN3 are able to predict the rotation time, which is normally handled by a complex dynamic model, while NNI, NNII, and NNIII are able to solve the trajectory issue without deriving the trajectory equations.
Similarly, this architecture can be modified and changed to the block diagram in Figure 8

Results and Discussion
The only limitation of this method is that a person has to collect around 150-200 samples for training each of the BPNNs, which may be considered a time-consuming process in the early stage. The activation function for all the neurons is the sigmoid function; the preliminary experiments showed that for sigmoid activation function, a constant learning rate of 0.5 and a momentum term of 0.9 worked well for this architecture. The mean square error (MSE) of the trained results is close to 0 (approximately 1.5 x 10 -4 ). After the BPNNs are trained, the location for each actuator in Cartesian space can be predicted through the block diagram in Figure 5, and the robot link equations can be derived by using equation (9). The general flow of this method is shown in Figure 9.
For an example, the actuators for the virtual robot manipulator in Figure 4 were subjected to the control of unknown trajectories in the aspects of positions, velocities or accelerations. The parameters of an unknown trajectory such as velocity, acceleration, torque, etc., were set randomly by another user. It was assumed that the only information that could be obtained was the positions of the initial point and end point in Cartesian space. Fifty samples with different initial and end points for the end effector were used to test the reliability of the developed ANN topology in predicting the motion of the robot. The results (10 out of 50) are shown in Figure 10. In comparison to the actual results, the results in Figure  10 clearly show that for all the samples, the maximum deviations of the motion for the virtual robot in Cartesian space were less than 0.5 units, while the maximum deviations of orientation were less than 0.1 units. Besides, the root mean square errors (RMSE) were small (maximum=0.2), proving that this topology possessed high accuracy and repeatability in tracking the position and orientation of the robot.
For sample 10, the end effector of the robot was required to move from point A (-3.41, -0.6, 19.62) to point B (13.91, 3.73, 5.24). The motion of the robot manipulator was predicted and shown in Figure 11. The robot manipulator started from rest and stopped at its destination, point B, and took 12 seconds to complete its motion. In other words, this developed ANN is not only able to predict and track the motion of the virtual robot manipulator but also to predict the time taken for the motion. Figures 12  and 13 show the comparison between multi-BPNNs and the actual results for the variation of the robot end effector's position and orientation in Cartesian space. The outputs from developed multi-BPNNs were almost the same as the actual hardware outputs, where the multi-BPNNs output lines almost overlapped with the actual output lines and the absolute value of maximum deviation was less than 0.5 units.
In comparison to the conventional mathematical method, this method can be applied easily without deriving any complex mathematical equations, such as FK equations and trajectory equations. Besides, the main advantage of this method is that it can be used to predict the motion of a robot manipulator even though the characteristics of the joint trajectories are unknown. Other than that, this multi-BPNNs topology is able to solve dynamics, kinematics, and trajectory simultaneously and track the motion of the entire robot manipulator instead of only the end effector.

Conclusions
Motion planning is an important task to prevent the occurrence of accidents. However, by using mathematical solutions, the motion of a robot manipulator might become unpredictable or untraceable if the characteristics of the trajectories are unknown. Complexity of mathematical equations also means they are prone to error. Hence, this paper recommends multi-BPNNS for overcoming these limitations. The developed ANN topology is not only able to adapt and predict the motion of a robot manipulator with unknown trajectories but also for robot orientation. The results showed that the developed multi-BPNNs topology produced accurate (maximum deviation ≤ 0.45 units) and precise (RMSE ≤ 0.2) results in adapting and predicting the motion of a robot manipulator with unknown trajectory.