A Precise Positioning Method for a Puncture Robot Based on a PSO-Optimized BP Neural Network Algorithm

.


Introduction
Robots are currently used in industrial and medical applications where high accuracy, repeatability, and stability of the operations are required [1].With the development of modern control technology, robot technology has been widely used in new fields, such as in medical robots.A surgical robot operating system is a collection of a number of modern, complex, high technologies, and the doctor, through the robot system, can perform surgical operations without touching patients.A minimally-invasive surgical robot is a combination of medical image processing technology and the operation of the mechanical arm to perform puncture surgery on the patient, to achieve minimal invasiveness, accuracy, efficiency, and stability.
The most important problem of the serial robot, which is the solution of the kinematics of the manipulator, can be successfully implemented.Robot kinematics handles the mapping between joint space (h) and Cartesian space (x, y, z), where h represents the positions of the joints of a robotic manipulator and (x, y, z) represent the position of the end effector of the manipulator [2].Kinematics analysis of the robot includes two aspects: the forward kinematics and the inverse kinematics.The forward kinematics are the mappings from the joint angle to the Cartesian coordinate system.The inverse kinematics are known to solve the joint variables under the position and posture of the end effector.
Traditionally, there are three methods to solve the inverse kinematics problem of the robot: the geometric method, the algebraic method, and the iterative method.Any method has its own shortcomings in solving the inverse kinematics.For instance, closed-form solutions are not guaranteed for the algebraic methods, and closed-form solutions for the first three joints of the robot must exist geometrically when the geometric method is used.Similarly, the iterative inverse kinematics solution method converges to only one solution that depends on the starting point [1].These methods often require high-performance computer hardware, and the calculation accuracy cannot be guaranteed.For these reasons, researchers have begun to focus on the application of artificial neural networks to the kinematics of the robot.
The inverse kinematics analysis of the six degrees of freedom (DOF) industrial robot is carried out by using the back propagation neural network algorithm [3], but this method cannot solve the problem when the joint angle error is too large.In [4], a method is presented for solving the inverse kinematics of redundant robots and the prevention of singular points.In [5], for the singular series robot arm configuration and uncertainty, a method was proposed based on an artificial neural network, and the training process is very difficult, and needs sensors added to each joint.
There are many researchers focusing on the genetic algorithm to obtain the inverse kinematics of the robot [6][7][8].Kamal and Djamel [6] researched particle swarm optimization (PSO) and genetic algorithms (GA) for finite impulse response (FIR) filter design.Kalra and colleagues [7] used an evolutionary approach based on a real-coded genetic algorithm to obtain the multimodal inverse kinematics problem of industrial robots.In their method, the fitness function is defined in a manner that requires separate evaluation of the positional error of the robot and the total joint displacement.These two approaches can be used together to solve some specific problems.Mustafa and Kerim [8] used four different optimization algorithms (the genetic algorithm (GA), the particle swarm optimization (PSO) algorithm, the quantum particle swarm optimization (QPSO) algorithm, and the gravitational search algorithm (GSA)) for solving the inverse kinematics problem of a four DOF serial robot manipulator.
The main purpose of this paper is to improve the precision of the inverse kinematics solution from a particle swarm optimization (PSO) back propagation (BP) neural network algorithm, especially for processing data in a short period of time, and the time in which the robot is in motion.The particle swarm optimization algorithm is employed to find the global advantage with the BP neural network to find the optimal solution, overcome some inherent defects (easy to fall into local minimum, slow convergence and poor generalization ability etc.) of the BP neural network, and thus further improve the convergence precision of BP neural network, the convergence speed, and generalization ability.The main contribution is that the algorithm is applied to the inverse kinematics of UR six degree of freedom manipulator, which guarantees the accuracy of the end position accuracy of the robot with six degrees of freedom within 0.1 mm, and the robot joint angle at 0.01 degrees.The main innovation of this study is the application of this technique in the precise localization of medical needle surgery.In the experimental part, we achieved very good results and achieved high-precision positioning of the puncture operation.We had to ensure that the experimental puncture accuracy was less than 1 mm, which can meet the needs of medical needle surgery.

The Principle of Precision Positioning of a Puncture Robot
Minimally-invasive surgery (MIS) is a cost-effective alternative to open surgery whereby essentially the same operations are performed using specialized instruments designed to fit into the body through several tiny punctures instead of one large incision [9].The principle of the operation of the puncture robot is shown in Figure 1.
Appl.Sci.2017, 7, 969 3 of 13 body through several tiny punctures instead of one large incision [9].The principle of the operation of the puncture robot is shown in Figure 1.Firstly, patients require a CT scan, and the medical image will be generated by the computer to complete the three-dimensional reconstruction.Then a doctor can observe and diagnose the disease according to the three-dimensional model.Finally, the doctor determines the position of the puncture target point coordinates, and determines the insertion point through the analysis of the patients' skin.Between the target point and insertion point of connection is the puncture route (the green line in Figure 1).The route must avoid the patient's bones, blood vessels, and other organs.The accurate puncture route directly determines the quality of the puncturing operation.Research on precise positioning technology of the manipulator used in this study was conducted to establish the series robot puncture route.The puncture route target point and insertion point coordinates are sent to the robot through the data processing computer, and at the end-effector of the robot, the puncture guide tube accurately positions the needle into the patient's skin, the puncture route keeping with the robot end position and posture.

Analysis of the UR3 Manipulator
The UR3 manipulator (Figure 2) is a new and small six DOF collaborative robotic by the Universal Robots Company (Odense, Denmark).The key features of the UR3 manipulator are that it is a flexible, lightweight, collaborative, and safe table-top robot.The UR3's six joints contribute to the transformational and rotational movements of its end effector.The kinematics analysis of the UR3 is more complex than other manipulators.The Schematic and frame assignment of UR3 is shown in Figure 3.  Firstly, patients require a CT scan, and the medical image will be generated by the computer to complete the three-dimensional reconstruction.Then a doctor can observe and diagnose the disease according to the three-dimensional model.Finally, the doctor determines the position of the puncture target point coordinates, and determines the insertion point through the analysis of the patients' skin.Between the target point and insertion point of connection is the puncture route (the green line in Figure 1).The route must avoid the patient's bones, blood vessels, and other organs.The accurate puncture route directly determines the quality of the puncturing operation.Research on precise positioning technology of the manipulator used in this study was conducted to establish the series robot puncture route.The puncture route target point and insertion point coordinates are sent to the robot through the data processing computer, and at the end-effector of the robot, the puncture guide tube accurately positions the needle into the patient's skin, the puncture route keeping with the robot end position and posture.

Analysis of the UR3 Manipulator
The UR3 manipulator (Figure 2) is a new and small six DOF collaborative robotic by the Universal Robots Company (Odense, Denmark).The key features of the UR3 manipulator are that it is a flexible, lightweight, collaborative, and safe table-top robot.The UR3's six joints contribute to the transformational and rotational movements of its end effector.The kinematics analysis of the UR3 is more complex than other manipulators.The Schematic and frame assignment of UR3 is shown in Figure 3.
body through several tiny punctures instead of one large incision [9].The principle of the operation of the puncture robot is shown in Figure 1.Firstly, patients require a CT scan, and the medical image will be generated by the computer to complete the three-dimensional reconstruction.Then a doctor can observe and diagnose the disease according to the three-dimensional model.Finally, the doctor determines the position of the puncture target point coordinates, and determines the insertion point through the analysis of the patients' skin.Between the target point and insertion point of connection is the puncture route (the green line in Figure 1).The route must avoid the patient's bones, blood vessels, and other organs.The accurate puncture route directly determines the quality of the puncturing operation.Research on precise positioning technology of the manipulator used in this study was conducted to establish the series robot puncture route.The puncture route target point and insertion point coordinates are sent to the robot through the data processing computer, and at the end-effector of the robot, the puncture guide tube accurately positions the needle into the patient's skin, the puncture route keeping with the robot end position and posture.

Analysis of the UR3 Manipulator
The UR3 manipulator (Figure 2) is a new and small six DOF collaborative robotic by the Universal Robots Company (Odense, Denmark).The key features of the UR3 manipulator are that it is a flexible, lightweight, collaborative, and safe table-top robot.The UR3's six joints contribute to the transformational and rotational movements of its end effector.The kinematics analysis of the UR3 is more complex than other manipulators.The Schematic and frame assignment of UR3 is shown in Figure 3.   Currently, there are no exact Matlab models for this robot.In this paper, we researched the precise positioning technique using the UR3 for medical puncture surgery.Kinematic modeling of the robot based on the Denavit-Hartenberg (D-H) parameters provided by the UR3 manual are shown in Table 1.The robot homogeneous transformation matrix for a single joint is expressed in Equations ( 1) and ( 2), which uses four link parameters [10].This transformation is known as the D-H notation: based on the transformation matrix between adjacent links ( = 1,2, … ,6) .Among them, , , depend on the constant of robot structure parameters; ( = 1,2, … 6) represent the joint variables, c = cos , s = sin , s = sin , and c = cos .Thus, we can obtain the transformation matrix from the base to the end effector, whose position matrix by the homogeneous coordinate transformation is given by Equation (3): Among them, × is the rotation matrix of the robot end effector, and × is the position matrix of the robot end effector, where represents the rotational elements of the transformation matrix (i and j = 1, 2, 3) and , , are the elements of the position vector.A UR3 robot with six DOF was used in this study.The manipulator has a six DOF Cartesian position of the end effector (x, y, z), which is obtained directly from the matrix [11].The orientation of the end effector is described according to the RPY (roll-pitch-yaw) rotation.These rotations are the angles around the Z-Y-Z axis, as shown in Equation ( 4): Currently, there are no exact Matlab models for this robot.In this paper, we researched the precise positioning technique using the UR3 for medical puncture surgery.Kinematic modeling of the robot based on the Denavit-Hartenberg (D-H) parameters provided by the UR3 manual are shown in Table 1.The robot homogeneous transformation matrix i−1 i T for a single joint is expressed in Equations ( 1) and ( 2), which uses four link parameters [10].This transformation is known as the D-H notation: based on the transformation matrix between adjacent links i−1 i T(i = 1, 2, . . ., 6).Among them, a i , d i , α i depend on the constant of robot structure parameters; θ i (i = 1, 2, . . .6) represent the joint variables, cθ i = cos θ i , sθ i = sin θ i , sα i = sin α i , and cα i = cos α i .Thus, we can obtain the transformation matrix from the base to the end effector, whose position matrix by the homogeneous coordinate transformation is given by Equation (3): r 11 r 12 r 13 p x r 21 r 22 r 23 p y r 31 r 32 r 33 p z 0 0 0 1 Among them, 0 6 R 3×3 is the rotation matrix of the robot end effector, and 0 6 P 3×1 is the position matrix of the robot end effector, where r ij represents the rotational elements of the transformation matrix (i and j = 1, 2, 3) and p x , p y , p z are the elements of the position vector.
A UR3 robot with six DOF was used in this study.The manipulator has a six DOF Cartesian position of the end effector (x, y, z), which is obtained directly from the 0 6 T matrix [11].The orientation of the end effector is described according to the RPY (roll-pitch-yaw) rotation.These rotations are the angles around the Z-Y-Z axis, as shown in Equation ( 4): Solving the 0 6 T matrix, we can obtain the angles, which are calculated by Equations ( 5)-( 7): γ = Atan2(−r 11 sin α + r 21 cos α, r 22 cos α − r 12 sin α) (7) These equations can provide the robot position, which is relative to the universe coordinate system [12].The coordinates of each joint are used to describe the position and orientation of the robot.The forward kinematics equation of the robot is described by Equation ( 8): As shown in Equation ( 8), when the six joint angles of the robot are known, the Cartesian coordinate system of the robot can be calculated according to the forward kinematics [13].However, the six joint angles of the robot must be computed in an industrial application, so the inverse kinematics equation is solved by Equation ( 9): In the next part, α, β, γ, p x , p y , p z will be used as the input variables of the BP neural network model, and the joint angles θ i (i = 1, 2, . . ., 6) will be used as the output variables of the BP neural network.

BP Neural Network
A BP (back propagation) network, which was proposed by Rumelhart and McCelland in 1986, is a type of error back propagation training algorithm for the multilayer feedforward network.It consists of two processes: the forward spread of information and the reverse propagation of error; the neural network model is one of the most widely used.BP neural networks can be compared to the input and output of the highly nonlinear mapping, which is characterized by the spread of the error to correct the weights and thresholds of the network.By approximating the nonlinear function several times, the BP neural network can approximate the complex function.A BP neural network model of a single neuron is shown in Figure 4.
Solving the matrix, we can obtain the angles, which are calculated by Equations ( 5)-( 7): = Atan2( cos + sin , ) = Atan2(− sin + cos , cos − sin ) These equations can provide the robot position, which is relative to the universe coordinate system [12].The coordinates of each joint are used to describe the position and orientation of the robot.The forward kinematics equation of the robot is described by Equation ( 8): As shown in Equation ( 8), when the six joint angles of the robot are known, the Cartesian coordinate system of the robot can be calculated according to the forward kinematics [13].However, the six joint angles of the robot must be computed in an industrial application, so the inverse kinematics equation is solved by Equation ( 9): In the next part, , , , , , will be used as the input variables of the BP neural network model, and the joint angles ( = 1,2, … ,6) will be used as the output variables of the BP neural network.

BP Neural Network
A BP (back propagation) network, which was proposed by Rumelhart and McCelland in 1986, is a type of error back propagation training algorithm for the multilayer feedforward network.It consists of two processes: the forward spread of information and the reverse propagation of error; the neural network model is one of the most widely used.BP neural networks can be compared to the input and output of the highly nonlinear mapping, which is characterized by the spread of the error to correct the weights and thresholds of the network.By approximating the nonlinear function several times, the BP neural network can approximate the complex function.A BP neural network model of a single neuron is shown in Figure 4.For a given artificial neuron, x j (j = 1, 2, • • • , n) is the component of the input vector of the neuron, ω ij (j = 1, 2, • • • , n) is the weight component of the input vector of the neuron, and ω i0 = θ represents a threshold or bias.Usually, the x 0 input is assigned the value −1, which makes it a bias input with w k0 = θ.This leaves only actual inputs to the neuron: from x 1 to x n .
The output of the y i neuron is expressed in Equation ( 10): where f is the transfer function.We approximate the function by the sigmoid function.If the weight is positive, it means that the corresponding input point is in a state of excitement and has a strengthening effect; if the weight is negative, it has an inhibiting effect.The function is expressed in Equation ( 11): In this paper, according to the network structure, the input layer has six neurons, respectively, corresponding to α, β, γ, p x , p y , p z .The output layer has six neurons: the six joint angles corresponding to the UR3 robot's six angles θ 1 , θ 2 , θ 3 , θ 4 , θ 5 , and θ 6 .The number of hidden layer units is a very complicated problem: its determination needs to agree with the experience of the designer and several tests.The hidden layer unit number with the number of input/output units has a direct relationship; if the number is too great, not only will the training time increase, causing the learning time to become too long, but the error may be large.If the number is too low, then the neural network may have too little information to solve the problem.Therefore, it is very important to select a suitable number of hidden layers [14,15].In this paper, after a large number of comparisons and experiments, two hidden layers are selected: 24 and 18 units, respectively.In this paper, the design of the BP neural network topology is shown in Figure 5.
Appl.Sci.2017, 7, 969 6 of 13 represents a threshold or bias.Usually, the x0 input is assigned the value −1, which makes it a bias input with wk0 = θ.This leaves only actual inputs to the neuron: from x1 to xn.
The output of the yi neuron is expressed in Equation ( 10): where f is the transfer function.We approximate the function by the sigmoid function.If the weight is positive, it means that the corresponding input point is in a state of excitement and has a strengthening effect; if the weight is negative, it has an inhibiting effect.The function is expressed in Equation ( 11): In this paper, according to the network structure, the input layer has six neurons, respectively, corresponding to , , , , , .The output layer has six neurons: the six joint angles corresponding to the UR3 robot's six angles , , , , , and .The number of hidden layer units is a very complicated problem: its determination needs to agree with the experience of the designer and several tests.The hidden layer unit number with the number of input/output units has a direct relationship; if the number is too great, not only will the training time increase, causing the learning time to become too long, but the error may be large.If the number is too low, then the neural network may have too little information to solve the problem.Therefore, it is very important to select a suitable number of hidden layers [14,15].In this paper, after a large number of comparisons and experiments, two hidden layers are selected: 24 and 18 units, respectively.In this paper, the design of the BP neural network topology is shown in Figure 5. Figure 5 illustrates the topology of the designed network which consists of three layers, one of which is a hidden layer, presented to store the internal representation.The fundamental idea underlying the design of the network is that the information entering the input layer is mapped as an internal representation in the units of the hidden layer (s) and the outputs are generated by this internal representation, rather than by the input vector.Given that there are enough hidden neurons, input vectors can always be encoded in such a form that the appropriate output vector can be generated from any input vector [16].
Although BP neural networks have many remarkable characteristics, they also have some inherent defects: easily falling into a local minimum, slow convergence speed, and weak Figure 5 illustrates the topology of the designed network which consists of three layers, one of which is a hidden layer, presented to store the internal representation.The fundamental idea underlying the design of the network is that the information entering the input layer is mapped as an internal representation in the units of the hidden layer (s) and the outputs are generated by this internal representation, rather than by the input vector.Given that there are enough hidden neurons, input vectors can always be encoded in such a form that the appropriate output vector can be generated from any input vector [16].
Although BP neural networks have many remarkable characteristics, they also have some inherent defects: easily falling into a local minimum, slow convergence speed, and weak generalization ability.Therefore, they require some improvement by combining with an optimization algorithm.

PSO Optimization Combined with the BP Neural Network
Particle swarm optimization (PSO) was proposed by Kennedy and Eberhart [17], and is derived from the study of the behavior of bird predation combined with the regularity of the collective activity of birds to establish a simplified model by the population.The PSO algorithm also belongs to the area of evolutionary algorithms (EAs).
PSO, which is similar to a genetic algorithm, is an iterative optimization algorithm [18,19].The system is initialized with a set of random solutions.PSO does not have a genetic algorithm "crossover" and "mutation" operation, rather, it follows the current search to find the optimal value of the global optimum.The PSO algorithm was brought to the attention of academic circles as it has the advantages of easy implementation, high precision, fast convergence, easy adjustment parameters, and so on.PSO has been extensively used in function optimization, neural network training, fuzzy control systems, and genetic algorithms.
Particle swarm optimization (PSO) is a parallel algorithm, and finds the optimal solution by iteration.In each iteration, the particle updates itself by tracking two extremes [20].The first extreme is the optimal solution of the particle itself, called the personal best value (pbest); the other is the group best value (gbest).The target value is set as the best value of the fitness function, and i particles can be expressed as a D-dimensional vector X i = [X i1 , X i2 , . . . ,X id ], and the velocity of particles can be expressed as V i = [X i1 , X i2 , . . . ,X id ].The current best position of the particle is represented as X pbesti = X pbesti1 , X pbesti2 , . . ., X pbestid , and the current optimal position of the individual is represented by X pbesti .The best position of the particle group is represented as X gbesti = X gbest1 , X gbest2 , . . ., X gbestd , X gbest , representing the historical optimal location of a group.In each iteration, the particle swarm updates its speed and position by the individual extreme value, and the group extreme value.The updated formula is shown in Equations ( 12) and ( 13): where X k id and V k id are, respectively, the position and velocity of the i-th particle at the k-th iteration.V is the velocity of the particle, ω is the weighting function, r 1 and r 2 are random numbers between 0 and 1, and c 1 and c 2 are learning factors; usually, c 1 = c 2 = 2. P k ib − X k id is the deviation of the individual extreme value, and P k gd − X k id is the deviation of the group extreme value.In the process of optimization, the velocity of each particle is limited to the maximum speed of V max ; if the update speed is greater than the set V max , then the one-dimensional velocity is limited to V max .
This part of the research setup follows the flowchart based on the PSO-BP neural network as shown in Figure 6, and the steps are as follows: 1.
Firstly, one needs to determine the topology of the neural network, initialize the BP neural network, and determine the initial value and threshold.2.
In the PSO algorithm, one needs to initialize the particle velocity, calculate the corresponding fitness function, and create the individual extreme and extreme groups.3.
Then update the particle's velocity, position, and fitness function; update the individual extreme and extreme groups, and determine whether it meets the conditions.If the conditions are not satisfied, the parameter is updated again.If the conditions are satisfied, the optimal solution is obtained.

4.
Finally, the optimal solution of the PSO algorithm is given by the trained BP neural network, and then the weights and thresholds are updated to determine whether the training results meet the termination condition.If the condition is not satisfied, then the neural network is trained again; if it is satisfied, then finish the network testing and output the result.
The fitness function of the PSO algorithm is defined as the square sum of the difference between the joint angle and the desired joint angle when the BP neural network is trained, expressed in Equation ( 14): The network output θ k is a function of the weight of ω: θ k = f (ω).This part studies the PSO algorithm and BP neural network, using the PSO algorithm to find the global advantages combined with the BP neural network to find the optimal local solution, so as to further improve the BP neural network convergence precision, convergence speed, and generalization ability.The fitness function of the PSO algorithm is defined as the square sum of the difference between the joint angle and the desired joint angle when the BP neural network is trained, expressed in Equation ( 14): The network output is a function of the weight of : = ( ).
This part studies the PSO algorithm and BP neural network, using the PSO algorithm to find the global advantages combined with the BP neural network to find the optimal local solution, so as to further improve the BP neural network convergence precision, convergence speed, and generalization ability.

Experimental Results and Validation
Combined with the BP neural network optimized by the PSO algorithm, the algorithm is trained by using the sample data [21].In the simulation experiment, 950 groups of data were selected as the training samples, and 50 groups of data were used as the test samples by using the UR3 manipulator in the working space of 1000 groups of data.The samples of the UR3 robot end position coordinates and Euler angles were used as the input nodes of the BP neural network, and the UR3 robot's six joint angles for the 50 sets of data output the forecast sample; then, using the PSO algorithm to optimize the convergence, the BP neural network weights and thresholds repeatedly trained the six robot joint angles, providing 50 sets of data for the output prediction samples.
In the course of training, the position vector and the rotation angle of the UR3 robot are used as the input points of the BP neural network, and the values of the six joint angles are the output points.The PSO algorithm is used as the optimization of the fitness function.The weights and thresholds of the BP neural network are obtained by particle swarm optimization, and the output value of each joint variable is obtained by a simulated test.
For the network after training, we get the error range of the test set and the range of the mean square error (MSE) which is shown in Table 2.The error range of 50 sets of joint angles, the error range of the joint angle by the BP neural network was calculated as [-0.3059, 0.4130], and the mean square error (MSE) was in the range of [6.72 × 10 −3 , 8.12 × 10

Experimental Results and Validation
Combined with the BP neural network optimized by the PSO algorithm, the algorithm is trained by using the sample data [21].In the simulation experiment, 950 groups of data were selected as the training samples, and 50 groups of data were used as the test samples by using the UR3 manipulator in the working space of 1000 groups of data.The samples of the UR3 robot end position coordinates and Euler angles were used as the input nodes of the BP neural network, and the UR3 robot's six joint angles for the 50 sets of data output the forecast sample; then, using the PSO algorithm to optimize the convergence, the BP neural network weights and thresholds repeatedly trained the six robot joint angles, providing 50 sets of data for the output prediction samples.
In the course of training, the position vector and the rotation angle of the UR3 robot are used as the input points of the BP neural network, and the values of the six joint angles are the output points.The PSO algorithm is used as the optimization of the fitness function.The weights and thresholds of the BP neural network are obtained by particle swarm optimization, and the output value of each joint variable is obtained by a simulated test.
For the network after training, we get the error range of the test set and the range of the mean square error (MSE) which is shown in Table 2.The error range of 50 sets of joint angles, the error range of the joint angle by the BP neural network was calculated as [-0.3059, 0.4130], and the mean square error (MSE) was in the range of [6.72 × 10 −3 , 8.12 × 10 −2 ]; the error range of the joint angles by the BP neural network-optimized PSO was calculated as [-0.1859, 0.1079], the mean square error (MSE) was in the range of [2.39 × 10 −4 , 6.42 × 10 −3 ].Figures 7-12 show the contrast of the BP neural network, and the PSO-BP neural network for the output robot joint angle error θ. Figure 13 is the comparison of the mean square error (MSE) of the two algorithms.The experimental results show that, after the machine arm BP optimization PSO neural network obtained by the inverse kinematics of the robot is compared with the BP neural network joint angle error to a high level, the value of the mean square error (MSE) is also enhanced by an order of magnitude.The BP neural network based on PSO optimization is used to solve the inverse kinematics of the manipulator and to verify its effectiveness.

PSO (Particle Swarm Optimization)-BP Neural Network
The experimental results show that, after the machine arm BP optimization PSO neural network obtained by the inverse kinematics of the robot is compared with the BP neural network joint angle error to a high level, the value of the mean square error (MSE) is also enhanced by an order of magnitude.The BP neural network based on PSO optimization is used to solve the inverse kinematics of the manipulator and to verify its effectiveness.

PSO (Particle Swarm Optimization)-BP Neural Network
In this part, we researched the puncture surgery experiment built on porcine spine meat, and verified the PSO-optimized BP neural network algorithm for a robot based on the inverse kinematics problem.The experiment has achieved good results, the accurate positioning of the UR3 robot was ensured within 0.1 mm, and the precision of the robot joint angle was ensured at 0.01 degrees.The results fully met the requirements of the puncture positioning accuracy requirements within 1 mm.

Conclusions
In this paper, a hybrid approach has been presented which combines the particle swarm optimization algorithm and BP neural network algorithms to solve the inverse kinematics problem for a six degree manipulator based on end-effector error minimization.The proposed approach combines the characteristics of particle swarm optimization to overcome some inherent defects of BP neural network, and improve the convergence precision of the BP neural network, the convergence speed, and generalization ability.It is difficult to obtain high-precision inverse kinematics solutions because the six DOF robot arm is complex, and there are many problems such as large computational complexity, no guarantee of accuracy, long computation time and so on.In this case, the proposed method will be particularly useful to improve the precision of the result obtained from the PSO-optimized BP neural network algorithm.The joint error and mean square error performance of the PSO-optimized BP neural network are improved by an order of magnitude over the pure BP neural network.
The innovative application of this technology is used in the precise positioning technology of medical puncture surgery; to perform the traditional puncture operation in low precision; to solve poor reliability; to reduce the pain of the patient; to tackle the large labor intensity of the doctor; to eliminate over reliance on the experience of doctors and to address other issues.After obtaining a large number of experimental data, the accuracy can meet the requirements of precise positioning in medical needle surgery, and it has important theoretical and practical value in the research of the key technologies of precise puncturing robots.

Figure 1 .
Figure 1.Position principle of the puncturing robot.

Figure 1 .
Figure 1.Position principle of the puncturing robot.

Figure 1 .
Figure 1.Position principle of the puncturing robot.

Figure 4 .
Figure 4. Model of an artificial neuron.For a given artificial neuron, ( = 1,2, ⋯ , ) is the component of the input vector of the neuron, ( = 1,2, ⋯ , ) is the weight component of the input vector of the neuron, and ω =

Figure 4 .
Figure 4. Model of an artificial neuron.
−2 ]; the error range of the joint angles by the BP neural network-optimized PSO was calculated as [-0.1859, 0.1079], the mean square error (MSE) was in the range of [2.39 × 10 −4 , 6.42 × 10 −3 ].Figures 7-12 show the contrast of the BP neural
Appl.Sci.2017, 7, 969 9 of 13 network, and the PSO-BP neural network for the output robot joint angle error △θ.Figure13is the comparison of the mean square error (MSE) of the two algorithms.

Table 2 .
Error range test set and mean square error.

Table 2 .
Error range test set and mean square error.

Table 2 .
Error range test set and mean square error.