Trajectory Planning of Robot Manipulator Based on RBF Neural Network

Robot manipulator trajectory planning is one of the core robot technologies, and the design of controllers can improve the trajectory accuracy of manipulators. However, most of the controllers designed at this stage have not been able to effectively solve the nonlinearity and uncertainty problems of the high degree of freedom manipulators. In order to overcome these problems and improve the trajectory performance of the high degree of freedom manipulators, a manipulator trajectory planning method based on a radial basis function (RBF) neural network is proposed in this work. Firstly, a 6-DOF robot experimental platform was designed and built. Secondly, the overall manipulator trajectory planning framework was designed, which included manipulator kinematics and dynamics and a quintic polynomial interpolation algorithm. Then, an adaptive robust controller based on an RBF neural network was designed to deal with the nonlinearity and uncertainty problems, and Lyapunov theory was used to ensure the stability of the manipulator control system and the convergence of the tracking error. Finally, to test the method, a simulation and experiment were carried out. The simulation results showed that the proposed method improved the response and tracking performance to a certain extent, reduced the adjustment time and chattering, and ensured the smooth operation of the manipulator in the course of trajectory planning. The experimental results verified the effectiveness and feasibility of the method proposed in this paper.


Introduction
With the advancements in automation and robot technology, robots have begun to be widely used in the industrial, agricultural, and medical fields, among many others. Improving the trajectory planning of robot manipulators is one of the core focuses of robot research, and has great research prospects [1]. Precise robot manipulator trajectories can improve the efficiency of a robot's various tasks, such as workshop operations, crop picking, medical surgery and so on.
A robot manipulator is a nonlinear and uncertain system. Manipulator trajectory planning should not only consider obstacle avoidance, trajectory accuracy, smooth operation, energy consumption, among other factors, but also needs to consider the problems of external interference, communication delay, and the nonlinearity and uncertainty of robot manipulators [2][3][4][5]. In order to solve these problems, many researchers have studied the kinematics formula, dynamic model, and control technology of robot manipulators. At present, research into the kinematics formula and dynamic model of robot manipulators has been gradually growing. Research into control technology has mainly focused on the (1) The study proposes a trajectory planning method for a 6-DOF manipulator, which improves its trajectory tracking performance and motion stability, gives it higher versatility, and can be applied to the trajectory planning of a low DOF manipulator. (2) The study designs a new adaptive robust controller based on an RBF neural network, which uses the strong robustness of adaptive control theory and the self-learning and nonlinear characteristics of RBF neural networks to deal with the nonlinearity and uncertainty of high DOF manipulators. (3) The study designs and builds an experimental platform for the trajectory planning of manipulators and carries out the actual trajectory planning experiments based on this experimental platform, which verifies the effectiveness and feasibility of the proposed method.
The rest of this paper is organized as follows: Section 2 describes the related work on optimal trajectory planning and robot control methods. Section 3 covers the design of the trajectory planning experimental platform and introduces the overall framework of the trajectory planning method. Section 4 designs a new adaptive controller based on an RBF neural network and uses a Lyapunov function to analyze its stability and convergence. Section 5 presents the simulation and experimental results and analyzes and discusses the results. Section 6 concludes the paper and offers recommendations for future works.

Related Work
Robot manipulator trajectory planning takes the ideal trajectory kinematics parameters and the robot manipulator system as the input, and takes the displacement, velocity and acceleration of each joint and end effector as the output. The intermediate point pose is usually solved by linear interpolation [8], polynomial interpolation [9], and other interpolation algorithms.
According to differences in the planning space, trajectory planning can be divided into Cartesian space trajectory planning and joint space trajectory planning. They must both meet the kinematic and dynamic constraints of the robot manipulator, and the trajectory must be continuous, smooth, and impact-free within the performance requirements of the robot manipulator's components; that is, the speed and acceleration must not have sudden changes [10]. At present, the research on optimal trajectory planning mainly focuses on time-optimal trajectory planning, energy-optimal trajectory planning, impact-optimal trajectory planning, and hybrid optimal trajectory planning [11][12][13].
Time-optimal trajectory planning has high work efficiency [14]. Yi Fang et al. [15] proposed a smooth and time-optimal S-curve trajectory planning method to improve the planning efficiency of manipulators. Kim et al. [16] used trapezoidal velocity curves to quickly approximate the ideal trajectory, so as to approach time-optimal planning dynamically. Zhang et al. [17] proposed an adaptive cuckoo search algorithm with faster convergence speed and higher accuracy to minimize the total motion time.
Energy-optimal trajectory planning is suitable for robots with limited energy storage, such as space exploration robots, underwater robots and military robots [18]. Liu et al. [19] used screw theory and Kane's equations to establish kinematic and dynamic models to achieve energy optimization under the continuous motion of the manipulator. Bakshi et al. [20] optimized the robot path trajectory in multi-task environments, saving about 5-10% in energy consumption while ensuring the same work efficiency.
Impact-optimal trajectory planning aims to optimize the acceleration of each joint of the manipulator [21]. Ma et al. [22] proposed a new convex optimization method, which transforms non-convex jerk into linear acceleration and solves the acceleration limitation problem. Dai et al. [23] used a greedy algorithm to optimize the path of a robot with large jitters during manufacturing tasks, so as to improve its trajectory acceleration performance.
Hybrid-optimal trajectory planning optimizes the trajectory of the manipulator by considering time, energy consumption, impact, and other factors, and this method includes time-energy optimal, time-impact optimal, and time-impact-acceleration optimal trajectory planning [24]. Chen et al. [25] proposed an improved immune clonal selection algorithm to solve multi-objective trajectory planning. Yin et al. [26] proposed a trajectory planning method based on machine learning to generate time energy consumption optimal trajectories. Zhang et al. [27] proposed an improved dolphin swarm algorithm to generate better localization performance and more energy-efficient trajectories.
Although the above studies were able to optimize the trajectories of manipulators, they did not consider the design of the controller, failed to improve the trajectory accuracy, and did not feature the trajectory tracking error.
In [28], a robust controller based on an RBF neural network was designed to improve the trajectory tracking performance of a 3-DOF robot manipulator. In [29], an adaptive controller based on an RBF neural network was designed to solve the dynamic deviation problem of a 2-DOF robot manipulator. In [30], a sliding mode controller was designed to shorten the circular trajectory error of the 3-DOF robot manipulator. In [31], the researchers proposed a robust noise-free linear feedback control, which can effectively deal with the uncertainty of the manipulator system, suppress the external interference of the manipulator, and avoid control chattering. Ayeb et al. [32] designed an adaptive sliding mode controller based on an RBF neural network to improve the trajectory tracking performance of nonholonomic mobile robots and to avoid jitters. Al-Darraji et al. [33] designed an adaptive robust controller based on an RBF neural network, which takes into account high nonlinearity, high modeling errors, and the interference caused by payload and environmental conditions. It was able to combat effectively the nonlinear and uncertain problems of aerial robot arms. In [34], the adaptive control was used to update the parameters online in order to improve the asymptotic tracking performance of the uncertain nonlinear system, and the overall control process was introduced in detail; this description was drawn on here for the design of the controller.

Problem Description
The design of the controllers has a significant effect on improving the trajectory tracking performance of robot manipulators. However, most of the controllers designed at this stage have been based on low degree of freedom manipulators, and the optimization of the tracking error of manipulators has also primarily been for low degree of freedom manipulators; further, and there have been error instabilities in certain trajectory optimization processes (seen in Figure 1 [28]). Figure 1 presents the trajectory tracking error of the 3-DOF manipulator based on the RBF neural network controller. It can be seen from Figure 1 that only three manipulator joints were tracked; meanwhile, the trajectory error always exists during the trajectory operation, and does not diminish with time. In addition, there has been little research on the design of multi-degree of freedom manipulator controllers. However, at this stage, the application scenarios of 6-DOF robots in various industries are increasing. Therefore, the trajectory optimization problem and the tracking error convergence problem of multi-degree of freedom manipulators need to be solved. It is imperative to design a controller that improves the trajectory tracking performance of 6-DOF manipulators.

Experiment Platform
The experimental setup for manipulator trajectory planning is shown in Figure 2. The upper computer and the control cabinet were connected through a network cable, and the control cabinet and the manipulator were connected through a power supply cable and a signal cable. The main experimental platform for manipulator trajectory planning is shown in Figure 3, which mainly included a robot manipulator, control cabinet, upper computer and working platform. The main components of the robot control system were installed in the control cabinet. The layout of the control cabinet is shown in Figure 4, which mainly included a control module, IO module, braking module, driver module, strong-current module and weakcurrent module, etc.

Trajectory Planning Architecture
The trajectory planning architecture of the robot manipulator is shown in Figure 5. This structure mainly consists of three parts. The first stage is the trajectory planning stage. Firstly, the upper computer will send the pose commands of the key points of the robot manipulator. Secondly, the kinematics model of the manipulator is established based on the D-H method. Then, forward kinematics is used to find the x, y, and z values of the end effector, and inverse kinematics is used to find the θ 1 -θ 6 values of joint angle. Finally, the quintic polynomial interpolation algorithm is employed to obtain the ideal trajectory.
The second stage is the control system stage. Firstly, the dynamic model of manipulator is established based on Lagrange's theorem. Secondly, the torque of each joint under the ideal trajectory is solved by dynamics. Then, the torque information is transmitted to the pose controller. Finally, the pose controller drives the control motor rotation to realize the movement of the manipulator.
The third stage is the trajectory optimization stage. Firstly, whether the pose of the end effector reaches the expected trajectory should be assessed: if it reaches the expected trajectory, the current trajectory should be taken as the actual trajectory; otherwise, the next step should be executed. Secondly, an adaptive robust controller based on an RBF neural network is designed, and the stability and convergence of the controller are analyzed based on a Lyapunov function. Then, the designed controller is used to optimize the tracking trajectory, and the new control command is transmitted to the pose controller. Finally, the trajectory for reaching the expected goal is taken as the actual trajectory of the manipulator.

Kinematics Analysis
Position and angle analysis are the two main parts of kinematics modeling. Firstly, the structural parameters and link coordinate system of the manipulator are obtained based on the D-H method [35]. Secondly, the position of the end effector of the manipulator is obtained based on forward kinematics. Lastly, the angle of each joint of the manipulator is obtained based on inverse kinematics. Kinematics realizes the transformation of the manipulator's coordinates in Cartesian space and joint space, which lays the foundation for the trajectory planning of the manipulator.
The forward kinematics equation is derived by a homogeneous transformation matrix, which can be expressed as Equation (1): where p denote the position vector, a denotes the approach vector, o denotes the direction vector, and n denotes the normal vector.
The position can be expressed as Equation (2): According to Equations (1)-(3) can then be obtained: where the various parameters can be described as Equation (4): The inverse kinematics equation is obtained by the algebraic method. Each joint angle can be expressed as Equation (5):

Dynamics Analysis
Dynamics analysis forms the basis of the manipulator's controller. To date, many methods regarding the dynamics analysis of manipulators have been developed. The common methods include the Newton Euler equation, Lagrange's equation, Kane's equation, Appel's equation, Routh's equation, and so on [36]. The dynamic model of the mechanical system is derived by Lagrange's theorem and can be described as Equation (6): where q is the joint angular displacement vector, • q is the joint angular velocity vector, •• q is the joint angular acceleration vector, M(q) is the 6 × 6 order positive definite inertia matrix, V(q, • q) is the 6 × 6 order inertia matrix, G(q) is the 6 × 1 order gravity matrix, F( • q) is the 6 × 1 order friction matrix, d s is the external interference, τ e is the measurable environmental torque exerted on the robot manipulators, and τ is the control input.
Suppose that the dynamic model of the robot manipulator has unknown but bounded parameters and modeling errors; then, the robot dynamics part and the measurable environmental torque described using the RBF neural network structure can be written as follows: where W are the unknown parameters for robot manipulators, and H is the RBF neural network matrix. The measurable environmental torque described using the RBF neural network structure can be written as follows: where W e are the unknown parameters for robot manipulators, and H e is the RBF neural network matrix of the environment. This model has the general characteristics of a RBF neural network, and can describe different actual environments, including the free motion condition when W e = 0. The optimal estimation parameter for estimating W e is defined as follows: where λ e0 is the bounded set of W e , λ e is the bounded set of x e , and W e is updated online by Equation (10) to guarantee an acceptable estimation of W e .
• W e = K e F e W e where K e > 0, F e > 0, W e is the environmental parameters estimation error, which can be described as follows: We set x e and τ e as the input and output of the RBF neural network respectively.
Then, the optimal estimation parameters W e can be obtained. In this way, we can use the non-power environmental parameters W e in the controller to replace the traditional environmental torque τ e , thereby avoiding the problem of passivity.

Trajectory Planning Algorithm
The trajectory planning algorithm used for the robot manipulator is a quintic polynomial interpolation algorithm [37], which can be described as Equation (12): where t denotes the time, θ(t) denotes the Angular displacement, The constraint condition of each coefficient of the quintic polynomial interpolation algorithm is described as Equation (13): When the constraint condition is satisfied, that is, when (13) is substituted into (12), Equation (14) can then be obtained:

RBF Neural Network Architecture
An RBF network [38] is a three-layer feedforward neural network with a radial basis function as its activation function; its structure is shown in Figure 6. It has been proven that the errors of arbitrary continuous functions can be reduced by RBF neural networks: that is, their nonlinear function approximation ability is strong. They can greatly speed up the learning rate and avoid local minima; they also have higher response speeds that are 1000 to 10,000 times faster than BP neural networks.
The three-layered RBF neural network consists of the input layer, hidden layer, and output layer. The input layer is composed of signal source nodes and transmits input excitation to the hidden layer; the hidden layer adopts gauss radial basis functions to map the low-dimensional input to the high-dimensional space and performs curve fitting; the output layer adopts a linear transformation function to perform weighted evaluation on the hidden layer signal in order to obtain the output value. In the RBF network structure, the following notations are used [39]: X = [x 1 , x 2 , · · · , x n ] T is the input vector in the input layer, W = [w 1 , w 2 , · · · , w m ] T is the weight vector, H = [h 1 , h 2 , · · · , h m ] T is the radial basis vector, and h j is the Gaussian basis function, which can be calculated as follows: where c j = [c 1 , c 2 , · · · , c m ] is the central vector of the j-th node in the network, and σ j is the mean deviation of the j-th node in the network. According to the structure chart, the input vector of the RBF neural network is X = [x 1 , x 2 , · · · , x n ] T . The output of the RBF network can be calculated as follows:

Adaptive Robust Controller Design Based on RBF Neural Network
In robot control, more and more researchers are designing new controllers for nonlinear problems. Because of the problems of control chattering and external interference in multi-degree of freedom manipulators, a stable controller needs to be designed.
In this study, we designed an adaptive robust controller τ based on an RBF neural network, which can achieve good tracking performance under nonlinearity and uncertainty. As indicated in the dynamic model of the system in Equation (6), the manipulator's trajectory tracking aims to make the joint angle vector q(t) = [q 1 (t), q 2 (t), · · · , q n (t)] track the designated joint angle vector q d (t) = [q d1 (t), q d2 (t), · · · , q dn (t)].
The trajectory tracking error and error function are defined as Equations (17) and (18), respectively.
where r, ∧ is the positive diagonal matrix. Substituting (17) and (18) into (6), Equations (19) and (20) are obtained: (20) where f include dynamics parameters and are usually unknown in the actual system, and they can be expressed as follows: It can be seen from the above equations that an accurate mathematical model for manipulators is very necessary, but this is difficult to obtain, for manipulators are nonlinear and uncertain systems. Hence, there will be a great error in the calculated result of f (x). To solve this problem, an RBF neural network is used to approximate f (x). Suppose the input of the RBF neural network is described as follows: The ideal output of the RBF neural network is as follows: where W is the weight matrix of the ideal neural network, and ε(x) = [ε 1 (x), ε 2 (x), · · · , ε n (x)] T is the approximation error of the ideal neural network. Suppose the actual output of the RBF neural network is: Given W = W −Ŵ,Ŵ is the weight for the actual approximation, W is the error between the ideal weight and the actual weight, andf (x) is the actual approximation value of the neural network to f (x).
Then, the adaptive robust controller τ based on the RBF neural network can be designed as Equation (26): where K v > 0, and τ e is the measurable environmental torque. Meanwhile, the adaptive law for online and real-time estimation of the parameters of the radial basis function neural network can be designed as Equation (27): where K > 0, and F > 0. According to the above expression, Equation (28) can be obtained: where ς 1 = W T H(x) + (ε + d s ) + v, v is the robust term used to cope with the approximation error of the RBF neural network and the system external disturbance and modeling error. v is designed as Equation (29): v = −(ε n + b d )sgn(r) (29) where b d is the upper bound of the interference error, and ε n is the upper bound of the approximation error: ε ≤ ε n , d s ≤ b d .
In order for the robot manipulator to achieve good control performance while also ensuring stability, combined with the adaptive law and the control law with robust terms, the lower bound of K v must conform to the Equation (30): Then, the position signal, velocity signal, and acceleration signal are all bounded, and after this, the robot manipulator system tends to be stable. As time increases, the tracking error gradually tends to zero: that is, e(t) → 0 as t → ∞ .

Stability and Convergence Analysis
For the adaptive robust control of the robot manipulator based on the RBF neural network, the Lyapunov function [40] is defined as Equation (31): Then, the derivative of L can be derived as Equation (32): Substituting (28) into (31), Equation (33) can be obtained: Substituting the adaptive law (27) into (33), we can then obtain Equation (34): where the trace of matrix W W − W can be described as Equation (35): Then, the relationship of • L can be derived as Equation (36): When the lower bound of K v meets the Equation (30), Equation (37) can then be obtained: As L ≥ 0, • L ≤ 0; therefore, L is positive and bounded. Meanwhile, M(q) is also positive and bounded, which indicates that r(t), W, andŴ are also bounded. Moreover, when the value of the Lyapunov function is equal to 0, the value of the error function is also equal to 0: that is, r = 0 when • L = 0. According to Barbalat's lemma, the robot manipulator system is asymptotically stable. Therefore, as time increases, the tracking error, the derivative of the tracking error, and the error function all also gradually tend to zero: that is, e(t) → 0 , • e(t) → 0 , and r → 0 as t → ∞ .

Simulation Results
The trajectory tracking simulation results are shown in the figures below. Figure 7 shows the trajectory of the joint angle tracking of the adaptive robust controller based on the RBF neural network. Figure 8 shows the trajectory of the joint position tracking of the adaptive robust controller based on the RBF neural network. The red line represents the actual trajectory, and the blue dotted line represents the ideal trajectory.

Simulation Analysis
Based on the simulation results, the following conclusions can be reached.
(1) In Figures 7 and 8, the estimation f (x) with the RBF neural network is expressed bŷ f (x). We can see thatf (x) almost approximated to f (x) after 0.3 s, and the error was in an acceptable range. (2) It can be seen from Figures 7 and 8 that the adaptive robust controller based on the RBF neural network tracked the trajectory of the manipulator, and therefore the proposed controller improved the response time while reducing the adjustment time. (3) The tracking errors in the simulation strictly converged to zero; this means that the proposed controller can guarantee the stability of manipulators in real applications. In other words, the simulation results reveal that the proposed controller is effective for multi-degree of freedom manipulators faced with uncertainties and external disturbances.
Meanwhile, the controller proposed in this study was compared with other controllers, and the comparison results are shown in Table 1. From Table 1, it can be seen that the controller designed in this study not only considers joint angle tracking and joint position tracking in the trajectory tracking of 6-DOF manipulators, but also considers the external environment interference to ensure the credibility of their trajectories. Compared with other controllers, the trajectory tracking error of this controller is not the smallest, but the error approximation time is very short, and can be applied to a 6-DOF manipulator.

Simulation Discussion
In the process of manipulator trajectory tracking, there was only a large error in the initial state, and the error decreased rapidly in a very short time. Then, the trajectory tracking error gradually converged to 0, and there was no sudden change in the error. This indicates that the adaptive robust controller based on the RBF neural network designed in this study achieved good results in realizing the trajectory tracking of the 6-DOF manipulator, has extremely high stability, and improves the trajectory tracking performance of the manipulator.

Simulation Results
It has been proven that the RBF neural network can fit discrete points with minimal errors, so it can therefore be applied to manipulator trajectory planning. We adopted the quintic polynomial interpolation algorithm to plan the trajectory of the robot manipulator.
The trajectory planning simulation results are shown in the figures below. Figure 9 shows the angular displacement trajectory of each joint of the robot manipulator. Figure 10 shows the angular velocity trajectory of each joint of the robot manipulator. Figure 11 shows the angular acceleration trajectory of each joint of the robot manipulator.

Simulation Analysis
Based on the trajectory planning simulation results, the following conclusions can be reached.
(1) In Figures 9-11, the trajectories of the joint angular displacement, angular velocity, and angular acceleration are smooth, and there are no jumps. This indicates that there were no jitter or impact problems in the trajectory planning of the multi-degree of freedom manipulator. (2) It can be seen from Figures 10 and 11 that the angular velocity and angular acceleration of each joint of the manipulator at the starting and ending position were all 0, which indicates that the manipulator can run smoothly when starting and stopping movement, as well as during the entire process of completing work tasks. (3) It can be seen from Figures 10 and 11 that the velocity and acceleration of joint 3 and joint 4 of the 6-DOF manipulator varied drastically from 3 to 9 s, indicating that the method proposed in this study can improve the trajectory planning speed and shorten the trajectory planning time.

Simulation Discussion
During the trajectory planning of the 6-DOF robot manipulator, the positions of the six joints were constantly changing, which indicates that the method proposed in this paper can realize the full scheduling of the 6-DOF robot manipulator. The velocity and acceleration values of the initial state and the end state of the trajectory planning were all 0, which represents the smooth end of a trajectory planning experiment. The position, velocity, and acceleration curves of the trajectory planning were smooth, indicating that the method proposed in this paper can effectively improve the stability, speed, and accuracy of trajectory planning.

Experiment Results
The trajectory planning experiment data of the manipulator passing through 12 space nodes are shown in Table 2, which shows the actual variables of each joint and the coordinates of the end effector under the 12 space nodes of the manipulator.
According to the Cartesian space coordinates in Table 2, the x-axis, y-axis, and z-axis displacement curves of the end effector of the manipulator are drawn using the quintic polynomial interpolation function, as shown in Figure 12.  Meanwhile, the overall process of the manipulator trajectory planning experiment is shown in Figure 13.

Experiment Analysis
Based on the trajectory planning simulation results, the following conclusions can be reached.
(1) It can be seen from Figure 12 that the three coordinate changes of the end effector were smooth curves, which indicates the rationality of the forward and inverse kinematics model designed in this paper. (2) Figure 13a represents the initial state of manipulator trajectory planning, Figure 13b represents the state when picking up the object, Figure 13c,d represents the state of the moving trajectory, Figure 13e represents the state when the object is placed, and Figure 13f represents the end state of the trajectory. (3) It can be seen from Figure 13 that the manipulator ran smoothly, and the trajectory was smooth and continuous in the wood block grasping experiment, which verifies the feasibility of the method proposed in this paper.

Experiment Discussion
The trajectory planning experiment for the 6-DOF manipulator was conducted to verify the feasibility of the method proposed in this paper. In the actual experiment, it ran smoothly without sudden changes in speed, and could grasp the target, which indicates that the method proposed in this paper not only has theoretical significance, but also has practical application value. It can make up for part of the current gap in the manipulator research field and can provide corresponding technical theoretical support for multi-degree of freedom manipulator trajectory planning.

Conclusions
In this paper, we proposed a powerful trajectory planning method for robot manipulators, which is based on an RBF neural network. The proposed method was evaluated by two simulations. The first simulation evaluated the precision of the trajectory tracking of the manipulator, and the second simulation evaluated the motion stability of the trajectory planning of the manipulator. In addition, the proposed method was verified by an experiment. The experiment not only verified the rationality of the kinematics and dynamics model, but also verified the feasibility and effectiveness of the proposed method. The simulation and experiment results proved that the proposed method can improve the trajectory tracking accuracy and motion efficiency of the manipulator. Meanwhile, the designed controller is robust, able to withstand not only external disturbances but also parameter uncertainties. This paper focuses on the trajectory planning of multi-degree of freedom manipulators and makes corresponding explorations into the development of robots.
In the future, further tests are essential for performance evaluation of the proposed control approach. We will take the motion time and energy consumption into account to obtain a comprehensive optimal trajectory. Meanwhile, we will also continue to study and optimize the control strategies of manipulators.