# The Inverse Solution Algorithm and Trajectory Error Analysis of Robotic Arm Based on MQACA-RBF Network

Authors: Xu Cheng; Ming Zhao
Journal: Journal of Robotics
 (2020)

---

## Abstract

In order to improve the position accuracy and trajectory accuracy of a 6R robotic arm, a robot arm inverse solution algorithm based on the MQACA- (improved quantum ant colony-) RBF network is proposed. This algorithm establishes the prediction model through the neural network and uses the quantum ant colony algorithm to optimize the output weight. In order to solve the problem that the quantum ant colony algorithm has low convergence precision and easy to fall into the local optimal solution in the inverse solution algorithm of the multifreedom robotic arm, improved measures such as 2-opt local optimization and maximum minimum pheromone limit and variation are adopted. By comparing the simulation results of the 6R robotic arm simulation results and the simulation results based on ACA, QACA, and RBF neural networks on the position and motion trajectory of the space point, the advantages in precision are obvious. This proves the feasibility and effectiveness of the scheme.


---

## Body

## 1. Introduction

In modern manufacturing, the robotic arm is a more important electromechanical integration device. It has a wide range of applications. The proportion of 6R robotic arms in these robotic arms is about 90% [1]. In order to adapt to different trajectory planning tasks, the robotic arm will be adjusted accordingly, which is closely related to the diversification of production. On the basis of dynamics and kinematics theory, the accuracy of the inverse solution [2] is a decisive factor for the accuracy and efficiency of the trajectory planning of the robot arm.The inverse solution of the 6R robot arm is the basis and premise of the robot arm trajectory planning. Because the inverse solution equations have high dimensional and nonlinear characteristics, the solution is complex, and it is difficult to find accurate solutions. Traditional inverse solution can be roughly divided into algebraic methods [3–7] and geometric methods [8, 9]; due to poor results, it has been rarely used. In the more popular numerical iterative method at this stage [10–13], evolutionary, bionic and simulated annealing, neural networks, and other algorithms are more common intelligent algorithms [14–16]. Although these methods have achieved remarkable results, they are still unsatisfactory and limited in terms of convergence effect and accuracy of solutions. Therefore, they need to be further explored and improved.In the intelligent algorithm, the RBF neural network is a very important algorithm, which can approximate any nonlinear function within a finite set and arbitrary precision. Some scholars have realized the importance of the neural network and used it to solve the inverse solution of the 6R robotic arm to obtain a relatively ideal effect [17–19]. In this paper, an algorithm based on the MQACA- (improved quantum ant colony-) RBF network is proposed to optimize the output weight of the improved quantum ant colony, and good results are obtained.


## 2. 6R Mechanical Arm Kinematics Model

For the ZrARM arm, the number of degrees of freedom is six, and the joints are all rotating joints. The forward kinematics problem is solved and the ZrARM arm improved DH model coordinate system as shown in Figure1 [20].Figure 1
ZrARM arm improved DH model coordinate system.From [21], it can be seen that the coordinate conversion matrix of the manipulator end joint coordinate system relative to the base coordinate system is(1)T60=T10T21T32T43T54T65=nxoxaxpxnyoyaypynzozazpz0001,px,py,pzT in this matrix represents the position of the end of the manipulator in the base coordinate system. The RPY Euler angle can be described by the following formula [21–23]:(2)α=arctanay,ax,(3)β=arctanaxcosa+aysina,az,(4)γ=arctan−nxsina+nycosa,oycosa−oxsina.From the above formula, it can be seen that since the variables in (1) are all functions of the joint angle θi, the end position p=px,py,pz,α,β,γ can be obtained in the case of θi determination.


## 3. Establishment of Prediction Model of Inverse Solution Based on MQACA-RBF Network

### 3.1. Establishment of the Prediction Model of Mechanical Arm Inverse Solution

In order to find the inverse solution of the robot arm, the inverse solution prediction model of the RBF neural network is established. In order to further improve the inverse solution accuracy, the output weight value is optimized by improving the quantum ant colony algorithm, so that the error between the output and the actual output of the network is minimized.As a kind of the neural network learning algorithm, the structure of the RBF neural network includes the input layer, hidden layer, and output layer. Figure2 shows the structure diagram of the RBF neural network of the n-dof manipulator [20]. In the figure, it is assumed that the input of the RBF neural network is the end position variable x, x=pxpypzαβγT, and the output variable is the inverse solution of the robot arm, that is, n joint angles y, y=θ1θ2⋯θj⋯θnT∈Rn, where yis an n-dimensional vector, and the relationship between x and y is(5)yn=∑i=1kωijexp−12σ2xk−ci2,1≤n,where(6)xk=pxkpykpzkαkβkγkT,ci=c1ic2i⋯chiT,where xk—type k sample input parameters; ci—the node center of the ith hidden layer function; h—number of nodes; ωij—weight from the implicit layer to output layer; yn—the actual output of the n degree of freedom; and σ—variance of hidden layer functions.Figure 2
RBF neural network.Quantum Ant Colony Optimization Algorithm (QACA) is an operation that enables all ants to implement quantum bit coding method and updates by quantum revolving door. Therefore, its population number is relatively small, the algorithm performance is relatively high, and the convergence rate is fast. In addition, the optimization ability of the quantum ant colony is significantly enhanced, and the number of iterations is significantly reduced. Therefore, its vitality and scientific research values are very strong [24, 25]. Although its advantages are very prominent, there are still some problems in optimization efficiency, robustness, and convergence speed, which are closely related to large coding space and complex calculation.In this paper, QACA and RBF neural networks are combined to complement each other’s advantages and make full use of the efficient optimization capability of the quantum ant colony, and improvement measures are proposed to form the inverse solution algorithm of the mechanical arm based on the MQACA-RBF network. MQACA is used to optimize the output weight of the RBF neural network. Improvements to QACA include: (1) using the 2-opt local optimization algorithm to increase the diversity of path selection of the ant colony in the grid; (2) using maximum and minimum pheromone constraints to increase the feasibility of searching for better solutions and ensure the inspiration of experience for the ant colony; (3) on the basis of the optimal path of each group of ant colony, the mutation operation of the genetic algorithm is used to improve the quantum ant colony algorithm to avoid local optimum and ensure the accuracy and convergence of the algorithm.


### 3.2. MQACA Algorithm

The training sample of the inverse solution algorithm of the robotic arm can be obtained by positive kinematics formulas, as long as any joint anglesθ1,θ2,θ3,θ4,θ5,andθ6 are known, through formulas (1)–(4). You can get the corresponding position variables px,py,pz,α,β, and γ. Then, using the idea of MQACA theory [26–28], the output weight of each working area is sought, and the sample selection is based on this.


#### 3.2.1. Coding Scheme

In order to improve the randomness of population initialization coding, the following coding scheme is used to obtain a set of digital codes for each grid point [29]. Let m ants arrive at the end point from the starting point to get the solution of the output weight value ωn. The established decoding formula is(7)ωn=ωij=−1ωi,1⋅∑d=2dωi,d⋅10−d−1,where i=1,2,…,9, j=1,2,…,d×n+2.Combine the output weightωnobtained by decoding to obtain a set of solutions for ω=ω1ω2ω3⋯ωnT. In this group solution, n represents the spatial dimension (6R robotic arm n = 6), when the size of the ant colony does not change, and if the space occupied by the ant increases, the search space can be doubled and the convergence speed can be greatly increased [30].


#### 3.2.2. Status Transfer Rule

In the grid established at each output weight of the RBF network, qubits can represent the quantum pheromones of the nodes in the quantum ant colony algorithm, and their conversion can be completed by the quantum rotation gate. The adjustment form of the quantum rotation gate can be defined as [31](8)αit+1βit+1=cosθi−sinθsinθicosθiαitβit.In the formula,i=1,2,…,m, αit+1,βit+1T is the probability amplitude of the ith qubit of the t iteration, and θi is the rotate angle of the ith qubit.The probability of antk moving from node i to j [29] is defined as(9)pi,j;r,ck=τi,j;r,cαμr,cγ∑i=110τi,j;l,cαμl,cγ,where i,r=1,2,…,9; c=j+1; j=1,2,…,d×n+2;τi,j;r,c is the amount of pheromone that exists between the ωi,j cell point and the ωr,c cell point of the ant k; The information heuristic factor is represented by αα≥0, which reflects the importance of the trajectory relative to the path. The more paths the ant goes, the greater the value of αα≥0 in general is. The network node is represented by μr,c. The quantum information intensity can be expressed as θr,c. The following is its expression:(10)μr,c=1αr,c2.In this expression,αr,c2 represents the probability that the quantum state of the j qubit collapses to 0 [32].


#### 3.2.3. Determine the Fitness Function

It corresponds to a given training sample setxk1,xk2,…,xkn⟶tk1,tk2,…,tkn, k=1,2,…,n, where the training sample number is represented by K. In order to determine the fitness function, it is necessary to calculate the mean square root error of the actual output and expected output of the neural network first and to determine the adaptability function, i.e.,(11)fki=1n∑k=1K∑i=1ndki−yki2,where K—total number of training samples; dki,yki—target output and network operation results for unit i of sample k.


#### 3.2.4. Local Search 2-Opt Algorithm

The 2-opt local optimization algorithm is used to increase the diversity of ant colony and accelerate the convergence rate of the quantum ant colony algorithm.The 2-opt algorithm is an abbreviation of 2-optimization. In simple terms, it is the optimization of two elements, also known as 2-exchange [33].The main purpose of the 2-opt algorithm is to randomly select an interval segment for optimization. This optimization is only about the optimization of the current situation, not the optimization of the global. The steps of the algorithm are shown in Figure3Figure 3
Local optimization process of the 2-opt algorithm.The approach obtained by this algorithm is locally optimal, that is, it is based on the number of iterations. Different results may occur. Therefore, it is not an absolutely accurate result. It is only a relatively correct result after optimization.


#### 3.2.5. Global Update of Pheromones Based on Maximum and Minimum Pheromones

In the process of convergence, the ant colony algorithm may show that the pheromones on one path are much larger than the rest of the paths, resulting in convergence to the local optimal solution. The maximum and minimum pheromone ant colony algorithm limits the amount of information on each path toτmin,τmax, which can effectively avoid local stagnation in the search process [34].Scientific settingτmaxand τmin is crucial to the maximum and minimum pheromone ant colony algorithm. In the search process, the maximum pheromone growing on each iteration path is 1/fki, where fki can represent the current global optimal moderate function, in other words, the mean square root error of the real output and the desired output. When the optimal solution changes in the iterative process, τmax and τmin will change at the same time. The inverse proportional relationship between τmax and f functions and ρ, in contrast, is a positive proportional relationship with “elite ants”. It can be seen that dynamic adjustments can be made to τmax and τmin using the following method. The adjustment strategy is divided into the following steps:(12)τmint=τmaxt20.(a)
Before the initial moment pheromones are not updated, the adjustment strategy is as follows:(13)τmaxt=121−ρ⋅1fki.(b)
After the pheromones are updated, the adjustment strategy is as follows:(14)τmaxt=121−ρ⋅1fki+σfki.In the formula,σ represents the number of “elite ants.”


#### 3.2.6. Variation Operation

On the basis of the maximum minimum pheromone limit and the optimal path of each ant colony, the genetic algorithm (mutation operation) is used to reduce the local optimal solution problem in the search process of the quantum ant colony algorithm.The ant colony algorithm is improved by using genetic algorithm variation [35]. In the process of variation, a certain q node of the ant path is randomly selected to mutate, and q is gradually reduced as the number of iterations increases to ensure the convergence of the ant colony algorithm. Let the number of path nodes of the ant be n, then there is(15)q=roundn⋅1−ttmax.In this formula, the current number of iterations is represented byt, and the maximum number of iterations is represented by tmax. The variation method is to randomly take a 0–9 integer from the selected series of nodes. If the result of the mutation is better than the original, the mutated ant path is replaced by the current path.


### 3.3. MQACA-RBF Network Algorithm Steps

In summary, induction of the MQACA-RBF network algorithm to determineω and the corresponding steps are as follows:Step 1: QACA algorithm population initialization.Step 2: the initial value of the number of evolutions ist=1.Step 3: by coding, the RBF neural network is modeled according toω,c,andσ, and the joint angle prediction accuracy of each group of parameters is obtained.Step 4: update the rotation angle of the quantum rotation door, update the quantum pheromones at different nodes, achieve quantum initialization, and adjust the pheromone content on different paths.Step 5: probability transition formula (9) needs to be chosen to proceed to the next lattice point. When ant k comes to the termination point, it can calculate the f value and then return to step (4) by decoding the formula.Step 6: ifk=m, then enter step 7.Step 7: the optimal adaptation functionf and optimal solution ω∗ in the current ant population are selected, and the global pheromones are updated according to the maximum and minimum pheromones.Step 8: local search 2-opt optimization, mutation, and other measures were carried out forω∗.Step 9: assuming that the optimal adaptive function value and the maximum number of iterations of the ant population have not changed too much, the optimal model parameters can be obtained, and then enter step (11).Step 10: the number of iterations is added by 1, that is,Iter=Iter+1 and then return to step (4).Step 11:ω,c,andσ were calculated as the optimal parameter (the optimal parameter of each joint angle prediction model).Step 12: The MQACA-RBF neural network is modeled onω,c,andσ and predicts the test set. For this reason, the joint angle prediction value can be obtained through the output model.According to the steps above, the flow chart of the MQACA-RBF inverse solution algorithm is obtained as shown in Figure4.Figure 4
MQACA-RBF algorithm for inverse kinematics steps flow chart.


### 3.4. Normalization of Sample Parameters

In the process of calculating the data through the model, due to the influence of many factors, the problem of data overflow may be caused. Therefore, it is necessary to standardize the sample parameters to ensure the computational efficiency of the prediction model. The sample parameters are normalized to range from 0 to 1. The normalization formula is(16)z′=z−zminzmax−zmin,where z—parameters before normalization; zmin—minimum parameter; zmax—maximum parameter; and z′—normalized parameters.


## 3.1. Establishment of the Prediction Model of Mechanical Arm Inverse Solution

In order to find the inverse solution of the robot arm, the inverse solution prediction model of the RBF neural network is established. In order to further improve the inverse solution accuracy, the output weight value is optimized by improving the quantum ant colony algorithm, so that the error between the output and the actual output of the network is minimized.As a kind of the neural network learning algorithm, the structure of the RBF neural network includes the input layer, hidden layer, and output layer. Figure2 shows the structure diagram of the RBF neural network of the n-dof manipulator [20]. In the figure, it is assumed that the input of the RBF neural network is the end position variable x, x=pxpypzαβγT, and the output variable is the inverse solution of the robot arm, that is, n joint angles y, y=θ1θ2⋯θj⋯θnT∈Rn, where yis an n-dimensional vector, and the relationship between x and y is(5)yn=∑i=1kωijexp−12σ2xk−ci2,1≤n,where(6)xk=pxkpykpzkαkβkγkT,ci=c1ic2i⋯chiT,where xk—type k sample input parameters; ci—the node center of the ith hidden layer function; h—number of nodes; ωij—weight from the implicit layer to output layer; yn—the actual output of the n degree of freedom; and σ—variance of hidden layer functions.Figure 2
RBF neural network.Quantum Ant Colony Optimization Algorithm (QACA) is an operation that enables all ants to implement quantum bit coding method and updates by quantum revolving door. Therefore, its population number is relatively small, the algorithm performance is relatively high, and the convergence rate is fast. In addition, the optimization ability of the quantum ant colony is significantly enhanced, and the number of iterations is significantly reduced. Therefore, its vitality and scientific research values are very strong [24, 25]. Although its advantages are very prominent, there are still some problems in optimization efficiency, robustness, and convergence speed, which are closely related to large coding space and complex calculation.In this paper, QACA and RBF neural networks are combined to complement each other’s advantages and make full use of the efficient optimization capability of the quantum ant colony, and improvement measures are proposed to form the inverse solution algorithm of the mechanical arm based on the MQACA-RBF network. MQACA is used to optimize the output weight of the RBF neural network. Improvements to QACA include: (1) using the 2-opt local optimization algorithm to increase the diversity of path selection of the ant colony in the grid; (2) using maximum and minimum pheromone constraints to increase the feasibility of searching for better solutions and ensure the inspiration of experience for the ant colony; (3) on the basis of the optimal path of each group of ant colony, the mutation operation of the genetic algorithm is used to improve the quantum ant colony algorithm to avoid local optimum and ensure the accuracy and convergence of the algorithm.


## 3.2. MQACA Algorithm

The training sample of the inverse solution algorithm of the robotic arm can be obtained by positive kinematics formulas, as long as any joint anglesθ1,θ2,θ3,θ4,θ5,andθ6 are known, through formulas (1)–(4). You can get the corresponding position variables px,py,pz,α,β, and γ. Then, using the idea of MQACA theory [26–28], the output weight of each working area is sought, and the sample selection is based on this.


### 3.2.1. Coding Scheme

In order to improve the randomness of population initialization coding, the following coding scheme is used to obtain a set of digital codes for each grid point [29]. Let m ants arrive at the end point from the starting point to get the solution of the output weight value ωn. The established decoding formula is(7)ωn=ωij=−1ωi,1⋅∑d=2dωi,d⋅10−d−1,where i=1,2,…,9, j=1,2,…,d×n+2.Combine the output weightωnobtained by decoding to obtain a set of solutions for ω=ω1ω2ω3⋯ωnT. In this group solution, n represents the spatial dimension (6R robotic arm n = 6), when the size of the ant colony does not change, and if the space occupied by the ant increases, the search space can be doubled and the convergence speed can be greatly increased [30].


### 3.2.2. Status Transfer Rule

In the grid established at each output weight of the RBF network, qubits can represent the quantum pheromones of the nodes in the quantum ant colony algorithm, and their conversion can be completed by the quantum rotation gate. The adjustment form of the quantum rotation gate can be defined as [31](8)αit+1βit+1=cosθi−sinθsinθicosθiαitβit.In the formula,i=1,2,…,m, αit+1,βit+1T is the probability amplitude of the ith qubit of the t iteration, and θi is the rotate angle of the ith qubit.The probability of antk moving from node i to j [29] is defined as(9)pi,j;r,ck=τi,j;r,cαμr,cγ∑i=110τi,j;l,cαμl,cγ,where i,r=1,2,…,9; c=j+1; j=1,2,…,d×n+2;τi,j;r,c is the amount of pheromone that exists between the ωi,j cell point and the ωr,c cell point of the ant k; The information heuristic factor is represented by αα≥0, which reflects the importance of the trajectory relative to the path. The more paths the ant goes, the greater the value of αα≥0 in general is. The network node is represented by μr,c. The quantum information intensity can be expressed as θr,c. The following is its expression:(10)μr,c=1αr,c2.In this expression,αr,c2 represents the probability that the quantum state of the j qubit collapses to 0 [32].


### 3.2.3. Determine the Fitness Function

It corresponds to a given training sample setxk1,xk2,…,xkn⟶tk1,tk2,…,tkn, k=1,2,…,n, where the training sample number is represented by K. In order to determine the fitness function, it is necessary to calculate the mean square root error of the actual output and expected output of the neural network first and to determine the adaptability function, i.e.,(11)fki=1n∑k=1K∑i=1ndki−yki2,where K—total number of training samples; dki,yki—target output and network operation results for unit i of sample k.


### 3.2.4. Local Search 2-Opt Algorithm

The 2-opt local optimization algorithm is used to increase the diversity of ant colony and accelerate the convergence rate of the quantum ant colony algorithm.The 2-opt algorithm is an abbreviation of 2-optimization. In simple terms, it is the optimization of two elements, also known as 2-exchange [33].The main purpose of the 2-opt algorithm is to randomly select an interval segment for optimization. This optimization is only about the optimization of the current situation, not the optimization of the global. The steps of the algorithm are shown in Figure3Figure 3
Local optimization process of the 2-opt algorithm.The approach obtained by this algorithm is locally optimal, that is, it is based on the number of iterations. Different results may occur. Therefore, it is not an absolutely accurate result. It is only a relatively correct result after optimization.


### 3.2.5. Global Update of Pheromones Based on Maximum and Minimum Pheromones

In the process of convergence, the ant colony algorithm may show that the pheromones on one path are much larger than the rest of the paths, resulting in convergence to the local optimal solution. The maximum and minimum pheromone ant colony algorithm limits the amount of information on each path toτmin,τmax, which can effectively avoid local stagnation in the search process [34].Scientific settingτmaxand τmin is crucial to the maximum and minimum pheromone ant colony algorithm. In the search process, the maximum pheromone growing on each iteration path is 1/fki, where fki can represent the current global optimal moderate function, in other words, the mean square root error of the real output and the desired output. When the optimal solution changes in the iterative process, τmax and τmin will change at the same time. The inverse proportional relationship between τmax and f functions and ρ, in contrast, is a positive proportional relationship with “elite ants”. It can be seen that dynamic adjustments can be made to τmax and τmin using the following method. The adjustment strategy is divided into the following steps:(12)τmint=τmaxt20.(a)
Before the initial moment pheromones are not updated, the adjustment strategy is as follows:(13)τmaxt=121−ρ⋅1fki.(b)
After the pheromones are updated, the adjustment strategy is as follows:(14)τmaxt=121−ρ⋅1fki+σfki.In the formula,σ represents the number of “elite ants.”


### 3.2.6. Variation Operation

On the basis of the maximum minimum pheromone limit and the optimal path of each ant colony, the genetic algorithm (mutation operation) is used to reduce the local optimal solution problem in the search process of the quantum ant colony algorithm.The ant colony algorithm is improved by using genetic algorithm variation [35]. In the process of variation, a certain q node of the ant path is randomly selected to mutate, and q is gradually reduced as the number of iterations increases to ensure the convergence of the ant colony algorithm. Let the number of path nodes of the ant be n, then there is(15)q=roundn⋅1−ttmax.In this formula, the current number of iterations is represented byt, and the maximum number of iterations is represented by tmax. The variation method is to randomly take a 0–9 integer from the selected series of nodes. If the result of the mutation is better than the original, the mutated ant path is replaced by the current path.


## 3.2.1. Coding Scheme

In order to improve the randomness of population initialization coding, the following coding scheme is used to obtain a set of digital codes for each grid point [29]. Let m ants arrive at the end point from the starting point to get the solution of the output weight value ωn. The established decoding formula is(7)ωn=ωij=−1ωi,1⋅∑d=2dωi,d⋅10−d−1,where i=1,2,…,9, j=1,2,…,d×n+2.Combine the output weightωnobtained by decoding to obtain a set of solutions for ω=ω1ω2ω3⋯ωnT. In this group solution, n represents the spatial dimension (6R robotic arm n = 6), when the size of the ant colony does not change, and if the space occupied by the ant increases, the search space can be doubled and the convergence speed can be greatly increased [30].


## 3.2.2. Status Transfer Rule

In the grid established at each output weight of the RBF network, qubits can represent the quantum pheromones of the nodes in the quantum ant colony algorithm, and their conversion can be completed by the quantum rotation gate. The adjustment form of the quantum rotation gate can be defined as [31](8)αit+1βit+1=cosθi−sinθsinθicosθiαitβit.In the formula,i=1,2,…,m, αit+1,βit+1T is the probability amplitude of the ith qubit of the t iteration, and θi is the rotate angle of the ith qubit.The probability of antk moving from node i to j [29] is defined as(9)pi,j;r,ck=τi,j;r,cαμr,cγ∑i=110τi,j;l,cαμl,cγ,where i,r=1,2,…,9; c=j+1; j=1,2,…,d×n+2;τi,j;r,c is the amount of pheromone that exists between the ωi,j cell point and the ωr,c cell point of the ant k; The information heuristic factor is represented by αα≥0, which reflects the importance of the trajectory relative to the path. The more paths the ant goes, the greater the value of αα≥0 in general is. The network node is represented by μr,c. The quantum information intensity can be expressed as θr,c. The following is its expression:(10)μr,c=1αr,c2.In this expression,αr,c2 represents the probability that the quantum state of the j qubit collapses to 0 [32].


## 3.2.3. Determine the Fitness Function

It corresponds to a given training sample setxk1,xk2,…,xkn⟶tk1,tk2,…,tkn, k=1,2,…,n, where the training sample number is represented by K. In order to determine the fitness function, it is necessary to calculate the mean square root error of the actual output and expected output of the neural network first and to determine the adaptability function, i.e.,(11)fki=1n∑k=1K∑i=1ndki−yki2,where K—total number of training samples; dki,yki—target output and network operation results for unit i of sample k.


## 3.2.4. Local Search 2-Opt Algorithm

The 2-opt local optimization algorithm is used to increase the diversity of ant colony and accelerate the convergence rate of the quantum ant colony algorithm.The 2-opt algorithm is an abbreviation of 2-optimization. In simple terms, it is the optimization of two elements, also known as 2-exchange [33].The main purpose of the 2-opt algorithm is to randomly select an interval segment for optimization. This optimization is only about the optimization of the current situation, not the optimization of the global. The steps of the algorithm are shown in Figure3Figure 3
Local optimization process of the 2-opt algorithm.The approach obtained by this algorithm is locally optimal, that is, it is based on the number of iterations. Different results may occur. Therefore, it is not an absolutely accurate result. It is only a relatively correct result after optimization.


## 3.2.5. Global Update of Pheromones Based on Maximum and Minimum Pheromones

In the process of convergence, the ant colony algorithm may show that the pheromones on one path are much larger than the rest of the paths, resulting in convergence to the local optimal solution. The maximum and minimum pheromone ant colony algorithm limits the amount of information on each path toτmin,τmax, which can effectively avoid local stagnation in the search process [34].Scientific settingτmaxand τmin is crucial to the maximum and minimum pheromone ant colony algorithm. In the search process, the maximum pheromone growing on each iteration path is 1/fki, where fki can represent the current global optimal moderate function, in other words, the mean square root error of the real output and the desired output. When the optimal solution changes in the iterative process, τmax and τmin will change at the same time. The inverse proportional relationship between τmax and f functions and ρ, in contrast, is a positive proportional relationship with “elite ants”. It can be seen that dynamic adjustments can be made to τmax and τmin using the following method. The adjustment strategy is divided into the following steps:(12)τmint=τmaxt20.(a)
Before the initial moment pheromones are not updated, the adjustment strategy is as follows:(13)τmaxt=121−ρ⋅1fki.(b)
After the pheromones are updated, the adjustment strategy is as follows:(14)τmaxt=121−ρ⋅1fki+σfki.In the formula,σ represents the number of “elite ants.”


## 3.2.6. Variation Operation

On the basis of the maximum minimum pheromone limit and the optimal path of each ant colony, the genetic algorithm (mutation operation) is used to reduce the local optimal solution problem in the search process of the quantum ant colony algorithm.The ant colony algorithm is improved by using genetic algorithm variation [35]. In the process of variation, a certain q node of the ant path is randomly selected to mutate, and q is gradually reduced as the number of iterations increases to ensure the convergence of the ant colony algorithm. Let the number of path nodes of the ant be n, then there is(15)q=roundn⋅1−ttmax.In this formula, the current number of iterations is represented byt, and the maximum number of iterations is represented by tmax. The variation method is to randomly take a 0–9 integer from the selected series of nodes. If the result of the mutation is better than the original, the mutated ant path is replaced by the current path.


## 3.3. MQACA-RBF Network Algorithm Steps

In summary, induction of the MQACA-RBF network algorithm to determineω and the corresponding steps are as follows:Step 1: QACA algorithm population initialization.Step 2: the initial value of the number of evolutions ist=1.Step 3: by coding, the RBF neural network is modeled according toω,c,andσ, and the joint angle prediction accuracy of each group of parameters is obtained.Step 4: update the rotation angle of the quantum rotation door, update the quantum pheromones at different nodes, achieve quantum initialization, and adjust the pheromone content on different paths.Step 5: probability transition formula (9) needs to be chosen to proceed to the next lattice point. When ant k comes to the termination point, it can calculate the f value and then return to step (4) by decoding the formula.Step 6: ifk=m, then enter step 7.Step 7: the optimal adaptation functionf and optimal solution ω∗ in the current ant population are selected, and the global pheromones are updated according to the maximum and minimum pheromones.Step 8: local search 2-opt optimization, mutation, and other measures were carried out forω∗.Step 9: assuming that the optimal adaptive function value and the maximum number of iterations of the ant population have not changed too much, the optimal model parameters can be obtained, and then enter step (11).Step 10: the number of iterations is added by 1, that is,Iter=Iter+1 and then return to step (4).Step 11:ω,c,andσ were calculated as the optimal parameter (the optimal parameter of each joint angle prediction model).Step 12: The MQACA-RBF neural network is modeled onω,c,andσ and predicts the test set. For this reason, the joint angle prediction value can be obtained through the output model.According to the steps above, the flow chart of the MQACA-RBF inverse solution algorithm is obtained as shown in Figure4.Figure 4
MQACA-RBF algorithm for inverse kinematics steps flow chart.


## 3.4. Normalization of Sample Parameters

In the process of calculating the data through the model, due to the influence of many factors, the problem of data overflow may be caused. Therefore, it is necessary to standardize the sample parameters to ensure the computational efficiency of the prediction model. The sample parameters are normalized to range from 0 to 1. The normalization formula is(16)z′=z−zminzmax−zmin,where z—parameters before normalization; zmin—minimum parameter; zmax—maximum parameter; and z′—normalized parameters.


## 4. Simulation Experiment and Error Analysis of 6R Manipulator

### 4.1. Establishment of a Prediction Model for the Inverse Solution of 6R Robotic Arm

In order to follow the algorithm steps in Section 3.3 for simulation experiments, according to the MQACA algorithm to optimize the output weight of Figure2, the ant gets each output weight in the process of passing through each n ∗ d grid [29]. In the work space of the 6R robotic arm, 8000 points are randomly generated, and 1000 points are selected as training samples. After normalization, the input parameters of the RBF network are formed, i.e., x=Px′Py′Pz′α′β′γ′T. In order to obtain the output parameters of the RBF network, the joint angle (17) needs to be normalized, i.e., y=θ1′θ2′θ3′θ4′θ5′θ6′. Based on this, a prediction model of the 6-input 6-output inverse solution algorithm based on the MQACA-RBF network is established, training in predictive models based on a sample of 1000 points.After determining the position parameters, the number of joint angles between 0 and 1 can be obtained by using the prediction model, and then the reverse normalization is performed, i.e.,(17)θj=θjmin+θj′θjmax−θjmin,j=1,2,…,6,where θj′—the output joint angle predicted after normalization.


### 4.2. Analysis of Spatial Random Point Errors

The space point simulation experiment of the ZrARM 6R manipulator is carried out. The DH parameters of the ZrARM arm are shown in Table1 according to the structural parameters and the external dimensions of the arm.Table 1
DH parameters of ZrARM mechanical arm.
Jointi
a
i−1 (mm)
d
i (mm)
α
i−1 (°)
Θi (°)
1
0
0
0
−160～160
2
0
0
−90
−225～45
3
10
3
0
−45～225
4
3
10
−90
−110～170
5
0
0
90
−100～100
6
0
0
−90
−266～266In the MATLAB software environment, using the modeling in Section3.1 and the 1000 points in the ZrARM model space as samples, the MQACA-RBF network method is used to simulate, and 100 points are randomly selected. Compared with the inverse solution algorithm simulation results of ACA, QACA, and RBF neural networks in the same operating environment, the position error of the four algorithms is shown in Figure 5 according to the distance between the actual coordinate point position and the target coordinate point position.Figure 5
ACA, QACA, RBF, and MQACA-RBF position error comparison.It is clearly seen from Figure5 that the location accuracy of the inverse solution of the MQACA-RBF network is the highest in the four algorithms, and the error is stable and the change is smooth. In order to improve the real-time and convergence speed of the system, the method of online training is used in practice.


### 4.3. Error Analysis of Motion Trajectory

#### 4.3.1. Selection of Locus Points

Figure6 shows the end of the ZrARM robotic arm, a known elliptical trajectory that is simulated in the established model space.Figure 6
Simulation model of the ZrARM robotic arm trajectory.In order to analyze the trajectory error, on this known trajectory curve, according to the trajectory length, 30 feature points are evenly selected as a description of the trajectory. The position of the end of the robot arm corresponding to the selected 30 points is calculated by equations (1)–(4) to obtain 30 sets of known px,py,pz,α,β, and γ position parameter values and the corresponding 30 sets of known inverse θ1,θ2,θ3,θ4,θ5,andθ6 values are obtained, which are used as reference point for trajectory error analysis.


#### 4.3.2. Error Analysis of Inverse Solution of Motion Trajectory

The 30 selected feature points on the trajectory in Section 4.3.1 are used as inputs. After the inverse solution algorithm based on the MQACA-RBF network is calculated and normalized, 30 sets of predicted output values are obtained. In order to evaluate the prediction effect of the model objectively, absolute error index is used to evaluate it. As shown in Figures7 and 8, the inverse solution prediction values of 30 sets of joint angles θ1 to θ6 corresponding to the selected 30 points are compared with the absolute error of the real values in the same posture. Among them, the minimum absolute error differences of θ1,θ2,θ3,θ4,θ5,andθ6 joint angles were 2.1679e − 05 rad, 8.5494e − 05 rad, 3.4619e − 05 rad, 3.1973e − 05 rad, 9.5498e − 05 rad, and 5.8276e − 05 rad, and the maximum absolute error differences were 0.10825 rad, 0.3027 rad, 0.10811 rad, 0.12094 rad, 0.18941 rad, and 0.25166 rad, respectively. According to formula (12), the mean square root errors of joint angle θ1,θ2,θ3,θ4,θ5,andθ6 are 0.12147 rad, 0.37941 rad, 0.11798 rad, 0.19206 rad, 0.28645 rad, and 0.38298 rad, respectively.Figure 7
Absolute error of joint anglesθ1, θ2, and θ3.Figure 8
Absolute error of joint anglesθ4, θ5, and θ6.Therefore, it can be seen that, in the prediction model of the 6R robotic arm inverse solution based on MQACA-RBF, the accuracy error of angular prediction is small, and the prediction accuracy is high.In order to compare with other inverse solutions, randomly select points A (spatial coordinates: 10.6601, −2.0700, and 12.4255) and B (spatial coordinates: 11.5458, −1.7339, and 11.1018) among the above 30 points, The inverse solutions of point A and point B are obtained by using four algorithms: MQACA-RBF network, ACA, QACA, and RBF network. Tables2 and 3 show the inverse results of the four algorithms under the same posture conditions. From the specific data comparison, it can be seen that the RBF network algorithm has better results in the inverse solutions of ACA, QACA, and RBF networks. However, the prediction accuracy of the MQACA-RBF network proposed in this paper is the highest, and it is closer to the real value.Table 2
Comparison of inverse solutions of the ZrARM robotic arm point A and point B (°): A-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.47170
−0.47080
−0.38047
−0.41524
−0.41825
θ
2
−1.54250
−0.12161
−0.20561
−1.54780
−1.55540
θ
3
0.02829
3.59860
3.75210
0.08476
0.08104
θ
4
0.99840
1.59010
1.58180
0.98012
0.98327
θ
5
1.49760
1.45150
0.87234
1.47020
1.48250
θ
6
1.99680
−2.86380
2.28000
1.96020
1.97840Table 3
Comparison of inverse solutions of ZrARM robotic arm point A and point B (°):B-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.40893
−0.41000
−0.39114
−0.45849
−0.42937
θ
2
−1.48010
−0.22064
0.03381
−1.48780
−1.50210
θ
3
0.09107
3.80100
3.50300
0.04151
0.06909
θ
4
0.98341
1.50450
1.23030
1.04950
1.00130
θ
5
1.47510
1.50030
1.32880
1.57430
1.51030
θ
6
1.96680
2.06570
3.03530
2.09910
2.01770


#### 4.3.3. Coordinate Point Error Analysis

In order to analyze the error of the trajectory from the angle of the coordinate point position, for the 30 feature points selected in Figure4, the joint angle data of the inverse solution of each of the four algorithms ACA, QACA, RBF neural network, and MQACA-RBF network are used. After entering the positive solution equation, the actual values corresponding to the x-axis, y-axis, and z-axis coordinate values can be obtained. The coordinate error of the coordinate point position is(18)ewm=pwpm−pwtm,m=1,2,…,30,where m— number of feature point; w— represents x, y, or z coordinates; ewm—absolute error between the actual value x (y or z) of point m coordinates and the true value x (y or z) of the coordinates; pwpm—the actual value of point x (y or z) coordinates; and pwtm—the true value of point x (y or z) coordinates.Figure9 shows the error comparison of the x, y, and z coordinates of the above four algorithms for the 30 feature points. It can be seen that the MQACA-RBF network algorithm has the smallest error.Figure 9
Comparison of coordinate errors of the selected points. (a)X-coordinate error comparison. (b) Y-coordinate error comparison. (c) Z-coordinate error comparison.
(a)
(b)
(c)From the spatial position point of view, the location error comparison of the four algorithms ACA, QACA, RBF network, and MQACA-RBF network can be obtained by calculating the position error formula of equation (19), as shown in Figure 8. Table 4 shows the data comparison of the spatial positions, maximum, minimum, and average of the four algorithms:(19)epm=pxpm−pxtm2+pypm−pytm2+pzpm−pztm2.where epm—location error of point m on trajectory.Table 4
Comparison of coordinate and position errors (mm).
Coordinates
Error
ACA
QACA
RBF
MQACA-RBF
X
Biggest
1.46050
1.30880
0.22370
0.11588
Minimum
0.00067
0.01779
0.00329
0.00016
Average
0.17214
0.31905
0.13219
0.05269
Y
Biggest
0.92384
0.88523
0.28325
0.09689
Minimum
0.00041
0.00989
0.00017
0.02250
Average
0.15881
0.31308
0.05509
0.04109
Z
Biggest
0.99137
1.23370
0.15607
0.09947
Minimum
0.00001
0.02201
0.04758
0.00231
Average
0.27080
0.37015
0.06997
0.04306
Location
Biggest
1.46050
1.36330
0.36006
0.12036
Minimum
0.01075
0.05686
0.04820
0.06407
Average
0.48815
0.69687
0.17773
0.09144As can be seen from Figures9 and 10 and Table 4, the trajectory coordinate error and position error based on the inverse solution algorithm of the MQACA-RBF network are minimal; The average error of x, y, and z coordinates of the actual point position is 0.05269 mm, 0.04109 mm, and 0.04306 mm, respectively. The average error of the actual point position is 0.09144 mm, which is superior to the ACA, QACA, and RBF network algorithms. It can be seen that the coordinate points corresponding to the position error are combined with x, y, and z coordinate points, which best reflect the position error of the end of the manipulator. Based on the inverse solution algorithm of MQACA-RBF network, the fitting error between the end of the robot arm and the set trajectory is minimal, and it is very stable and robust, which proves that the scheme is feasible.Figure 10
Location error comparison of selected points.


## 4.1. Establishment of a Prediction Model for the Inverse Solution of 6R Robotic Arm

In order to follow the algorithm steps in Section 3.3 for simulation experiments, according to the MQACA algorithm to optimize the output weight of Figure2, the ant gets each output weight in the process of passing through each n ∗ d grid [29]. In the work space of the 6R robotic arm, 8000 points are randomly generated, and 1000 points are selected as training samples. After normalization, the input parameters of the RBF network are formed, i.e., x=Px′Py′Pz′α′β′γ′T. In order to obtain the output parameters of the RBF network, the joint angle (17) needs to be normalized, i.e., y=θ1′θ2′θ3′θ4′θ5′θ6′. Based on this, a prediction model of the 6-input 6-output inverse solution algorithm based on the MQACA-RBF network is established, training in predictive models based on a sample of 1000 points.After determining the position parameters, the number of joint angles between 0 and 1 can be obtained by using the prediction model, and then the reverse normalization is performed, i.e.,(17)θj=θjmin+θj′θjmax−θjmin,j=1,2,…,6,where θj′—the output joint angle predicted after normalization.


## 4.2. Analysis of Spatial Random Point Errors

The space point simulation experiment of the ZrARM 6R manipulator is carried out. The DH parameters of the ZrARM arm are shown in Table1 according to the structural parameters and the external dimensions of the arm.Table 1
DH parameters of ZrARM mechanical arm.
Jointi
a
i−1 (mm)
d
i (mm)
α
i−1 (°)
Θi (°)
1
0
0
0
−160～160
2
0
0
−90
−225～45
3
10
3
0
−45～225
4
3
10
−90
−110～170
5
0
0
90
−100～100
6
0
0
−90
−266～266In the MATLAB software environment, using the modeling in Section3.1 and the 1000 points in the ZrARM model space as samples, the MQACA-RBF network method is used to simulate, and 100 points are randomly selected. Compared with the inverse solution algorithm simulation results of ACA, QACA, and RBF neural networks in the same operating environment, the position error of the four algorithms is shown in Figure 5 according to the distance between the actual coordinate point position and the target coordinate point position.Figure 5
ACA, QACA, RBF, and MQACA-RBF position error comparison.It is clearly seen from Figure5 that the location accuracy of the inverse solution of the MQACA-RBF network is the highest in the four algorithms, and the error is stable and the change is smooth. In order to improve the real-time and convergence speed of the system, the method of online training is used in practice.


## 4.3. Error Analysis of Motion Trajectory

### 4.3.1. Selection of Locus Points

Figure6 shows the end of the ZrARM robotic arm, a known elliptical trajectory that is simulated in the established model space.Figure 6
Simulation model of the ZrARM robotic arm trajectory.In order to analyze the trajectory error, on this known trajectory curve, according to the trajectory length, 30 feature points are evenly selected as a description of the trajectory. The position of the end of the robot arm corresponding to the selected 30 points is calculated by equations (1)–(4) to obtain 30 sets of known px,py,pz,α,β, and γ position parameter values and the corresponding 30 sets of known inverse θ1,θ2,θ3,θ4,θ5,andθ6 values are obtained, which are used as reference point for trajectory error analysis.


### 4.3.2. Error Analysis of Inverse Solution of Motion Trajectory

The 30 selected feature points on the trajectory in Section 4.3.1 are used as inputs. After the inverse solution algorithm based on the MQACA-RBF network is calculated and normalized, 30 sets of predicted output values are obtained. In order to evaluate the prediction effect of the model objectively, absolute error index is used to evaluate it. As shown in Figures7 and 8, the inverse solution prediction values of 30 sets of joint angles θ1 to θ6 corresponding to the selected 30 points are compared with the absolute error of the real values in the same posture. Among them, the minimum absolute error differences of θ1,θ2,θ3,θ4,θ5,andθ6 joint angles were 2.1679e − 05 rad, 8.5494e − 05 rad, 3.4619e − 05 rad, 3.1973e − 05 rad, 9.5498e − 05 rad, and 5.8276e − 05 rad, and the maximum absolute error differences were 0.10825 rad, 0.3027 rad, 0.10811 rad, 0.12094 rad, 0.18941 rad, and 0.25166 rad, respectively. According to formula (12), the mean square root errors of joint angle θ1,θ2,θ3,θ4,θ5,andθ6 are 0.12147 rad, 0.37941 rad, 0.11798 rad, 0.19206 rad, 0.28645 rad, and 0.38298 rad, respectively.Figure 7
Absolute error of joint anglesθ1, θ2, and θ3.Figure 8
Absolute error of joint anglesθ4, θ5, and θ6.Therefore, it can be seen that, in the prediction model of the 6R robotic arm inverse solution based on MQACA-RBF, the accuracy error of angular prediction is small, and the prediction accuracy is high.In order to compare with other inverse solutions, randomly select points A (spatial coordinates: 10.6601, −2.0700, and 12.4255) and B (spatial coordinates: 11.5458, −1.7339, and 11.1018) among the above 30 points, The inverse solutions of point A and point B are obtained by using four algorithms: MQACA-RBF network, ACA, QACA, and RBF network. Tables2 and 3 show the inverse results of the four algorithms under the same posture conditions. From the specific data comparison, it can be seen that the RBF network algorithm has better results in the inverse solutions of ACA, QACA, and RBF networks. However, the prediction accuracy of the MQACA-RBF network proposed in this paper is the highest, and it is closer to the real value.Table 2
Comparison of inverse solutions of the ZrARM robotic arm point A and point B (°): A-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.47170
−0.47080
−0.38047
−0.41524
−0.41825
θ
2
−1.54250
−0.12161
−0.20561
−1.54780
−1.55540
θ
3
0.02829
3.59860
3.75210
0.08476
0.08104
θ
4
0.99840
1.59010
1.58180
0.98012
0.98327
θ
5
1.49760
1.45150
0.87234
1.47020
1.48250
θ
6
1.99680
−2.86380
2.28000
1.96020
1.97840Table 3
Comparison of inverse solutions of ZrARM robotic arm point A and point B (°):B-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.40893
−0.41000
−0.39114
−0.45849
−0.42937
θ
2
−1.48010
−0.22064
0.03381
−1.48780
−1.50210
θ
3
0.09107
3.80100
3.50300
0.04151
0.06909
θ
4
0.98341
1.50450
1.23030
1.04950
1.00130
θ
5
1.47510
1.50030
1.32880
1.57430
1.51030
θ
6
1.96680
2.06570
3.03530
2.09910
2.01770


### 4.3.3. Coordinate Point Error Analysis

In order to analyze the error of the trajectory from the angle of the coordinate point position, for the 30 feature points selected in Figure4, the joint angle data of the inverse solution of each of the four algorithms ACA, QACA, RBF neural network, and MQACA-RBF network are used. After entering the positive solution equation, the actual values corresponding to the x-axis, y-axis, and z-axis coordinate values can be obtained. The coordinate error of the coordinate point position is(18)ewm=pwpm−pwtm,m=1,2,…,30,where m— number of feature point; w— represents x, y, or z coordinates; ewm—absolute error between the actual value x (y or z) of point m coordinates and the true value x (y or z) of the coordinates; pwpm—the actual value of point x (y or z) coordinates; and pwtm—the true value of point x (y or z) coordinates.Figure9 shows the error comparison of the x, y, and z coordinates of the above four algorithms for the 30 feature points. It can be seen that the MQACA-RBF network algorithm has the smallest error.Figure 9
Comparison of coordinate errors of the selected points. (a)X-coordinate error comparison. (b) Y-coordinate error comparison. (c) Z-coordinate error comparison.
(a)
(b)
(c)From the spatial position point of view, the location error comparison of the four algorithms ACA, QACA, RBF network, and MQACA-RBF network can be obtained by calculating the position error formula of equation (19), as shown in Figure 8. Table 4 shows the data comparison of the spatial positions, maximum, minimum, and average of the four algorithms:(19)epm=pxpm−pxtm2+pypm−pytm2+pzpm−pztm2.where epm—location error of point m on trajectory.Table 4
Comparison of coordinate and position errors (mm).
Coordinates
Error
ACA
QACA
RBF
MQACA-RBF
X
Biggest
1.46050
1.30880
0.22370
0.11588
Minimum
0.00067
0.01779
0.00329
0.00016
Average
0.17214
0.31905
0.13219
0.05269
Y
Biggest
0.92384
0.88523
0.28325
0.09689
Minimum
0.00041
0.00989
0.00017
0.02250
Average
0.15881
0.31308
0.05509
0.04109
Z
Biggest
0.99137
1.23370
0.15607
0.09947
Minimum
0.00001
0.02201
0.04758
0.00231
Average
0.27080
0.37015
0.06997
0.04306
Location
Biggest
1.46050
1.36330
0.36006
0.12036
Minimum
0.01075
0.05686
0.04820
0.06407
Average
0.48815
0.69687
0.17773
0.09144As can be seen from Figures9 and 10 and Table 4, the trajectory coordinate error and position error based on the inverse solution algorithm of the MQACA-RBF network are minimal; The average error of x, y, and z coordinates of the actual point position is 0.05269 mm, 0.04109 mm, and 0.04306 mm, respectively. The average error of the actual point position is 0.09144 mm, which is superior to the ACA, QACA, and RBF network algorithms. It can be seen that the coordinate points corresponding to the position error are combined with x, y, and z coordinate points, which best reflect the position error of the end of the manipulator. Based on the inverse solution algorithm of MQACA-RBF network, the fitting error between the end of the robot arm and the set trajectory is minimal, and it is very stable and robust, which proves that the scheme is feasible.Figure 10
Location error comparison of selected points.


## 4.3.1. Selection of Locus Points

Figure6 shows the end of the ZrARM robotic arm, a known elliptical trajectory that is simulated in the established model space.Figure 6
Simulation model of the ZrARM robotic arm trajectory.In order to analyze the trajectory error, on this known trajectory curve, according to the trajectory length, 30 feature points are evenly selected as a description of the trajectory. The position of the end of the robot arm corresponding to the selected 30 points is calculated by equations (1)–(4) to obtain 30 sets of known px,py,pz,α,β, and γ position parameter values and the corresponding 30 sets of known inverse θ1,θ2,θ3,θ4,θ5,andθ6 values are obtained, which are used as reference point for trajectory error analysis.


## 4.3.2. Error Analysis of Inverse Solution of Motion Trajectory

The 30 selected feature points on the trajectory in Section 4.3.1 are used as inputs. After the inverse solution algorithm based on the MQACA-RBF network is calculated and normalized, 30 sets of predicted output values are obtained. In order to evaluate the prediction effect of the model objectively, absolute error index is used to evaluate it. As shown in Figures7 and 8, the inverse solution prediction values of 30 sets of joint angles θ1 to θ6 corresponding to the selected 30 points are compared with the absolute error of the real values in the same posture. Among them, the minimum absolute error differences of θ1,θ2,θ3,θ4,θ5,andθ6 joint angles were 2.1679e − 05 rad, 8.5494e − 05 rad, 3.4619e − 05 rad, 3.1973e − 05 rad, 9.5498e − 05 rad, and 5.8276e − 05 rad, and the maximum absolute error differences were 0.10825 rad, 0.3027 rad, 0.10811 rad, 0.12094 rad, 0.18941 rad, and 0.25166 rad, respectively. According to formula (12), the mean square root errors of joint angle θ1,θ2,θ3,θ4,θ5,andθ6 are 0.12147 rad, 0.37941 rad, 0.11798 rad, 0.19206 rad, 0.28645 rad, and 0.38298 rad, respectively.Figure 7
Absolute error of joint anglesθ1, θ2, and θ3.Figure 8
Absolute error of joint anglesθ4, θ5, and θ6.Therefore, it can be seen that, in the prediction model of the 6R robotic arm inverse solution based on MQACA-RBF, the accuracy error of angular prediction is small, and the prediction accuracy is high.In order to compare with other inverse solutions, randomly select points A (spatial coordinates: 10.6601, −2.0700, and 12.4255) and B (spatial coordinates: 11.5458, −1.7339, and 11.1018) among the above 30 points, The inverse solutions of point A and point B are obtained by using four algorithms: MQACA-RBF network, ACA, QACA, and RBF network. Tables2 and 3 show the inverse results of the four algorithms under the same posture conditions. From the specific data comparison, it can be seen that the RBF network algorithm has better results in the inverse solutions of ACA, QACA, and RBF networks. However, the prediction accuracy of the MQACA-RBF network proposed in this paper is the highest, and it is closer to the real value.Table 2
Comparison of inverse solutions of the ZrARM robotic arm point A and point B (°): A-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.47170
−0.47080
−0.38047
−0.41524
−0.41825
θ
2
−1.54250
−0.12161
−0.20561
−1.54780
−1.55540
θ
3
0.02829
3.59860
3.75210
0.08476
0.08104
θ
4
0.99840
1.59010
1.58180
0.98012
0.98327
θ
5
1.49760
1.45150
0.87234
1.47020
1.48250
θ
6
1.99680
−2.86380
2.28000
1.96020
1.97840Table 3
Comparison of inverse solutions of ZrARM robotic arm point A and point B (°):B-point inverse solution result comparison.
True value
ACA
QACA
RBF
MQACA-RBF
θ
1
−0.40893
−0.41000
−0.39114
−0.45849
−0.42937
θ
2
−1.48010
−0.22064
0.03381
−1.48780
−1.50210
θ
3
0.09107
3.80100
3.50300
0.04151
0.06909
θ
4
0.98341
1.50450
1.23030
1.04950
1.00130
θ
5
1.47510
1.50030
1.32880
1.57430
1.51030
θ
6
1.96680
2.06570
3.03530
2.09910
2.01770


## 4.3.3. Coordinate Point Error Analysis

In order to analyze the error of the trajectory from the angle of the coordinate point position, for the 30 feature points selected in Figure4, the joint angle data of the inverse solution of each of the four algorithms ACA, QACA, RBF neural network, and MQACA-RBF network are used. After entering the positive solution equation, the actual values corresponding to the x-axis, y-axis, and z-axis coordinate values can be obtained. The coordinate error of the coordinate point position is(18)ewm=pwpm−pwtm,m=1,2,…,30,where m— number of feature point; w— represents x, y, or z coordinates; ewm—absolute error between the actual value x (y or z) of point m coordinates and the true value x (y or z) of the coordinates; pwpm—the actual value of point x (y or z) coordinates; and pwtm—the true value of point x (y or z) coordinates.Figure9 shows the error comparison of the x, y, and z coordinates of the above four algorithms for the 30 feature points. It can be seen that the MQACA-RBF network algorithm has the smallest error.Figure 9
Comparison of coordinate errors of the selected points. (a)X-coordinate error comparison. (b) Y-coordinate error comparison. (c) Z-coordinate error comparison.
(a)
(b)
(c)From the spatial position point of view, the location error comparison of the four algorithms ACA, QACA, RBF network, and MQACA-RBF network can be obtained by calculating the position error formula of equation (19), as shown in Figure 8. Table 4 shows the data comparison of the spatial positions, maximum, minimum, and average of the four algorithms:(19)epm=pxpm−pxtm2+pypm−pytm2+pzpm−pztm2.where epm—location error of point m on trajectory.Table 4
Comparison of coordinate and position errors (mm).
Coordinates
Error
ACA
QACA
RBF
MQACA-RBF
X
Biggest
1.46050
1.30880
0.22370
0.11588
Minimum
0.00067
0.01779
0.00329
0.00016
Average
0.17214
0.31905
0.13219
0.05269
Y
Biggest
0.92384
0.88523
0.28325
0.09689
Minimum
0.00041
0.00989
0.00017
0.02250
Average
0.15881
0.31308
0.05509
0.04109
Z
Biggest
0.99137
1.23370
0.15607
0.09947
Minimum
0.00001
0.02201
0.04758
0.00231
Average
0.27080
0.37015
0.06997
0.04306
Location
Biggest
1.46050
1.36330
0.36006
0.12036
Minimum
0.01075
0.05686
0.04820
0.06407
Average
0.48815
0.69687
0.17773
0.09144As can be seen from Figures9 and 10 and Table 4, the trajectory coordinate error and position error based on the inverse solution algorithm of the MQACA-RBF network are minimal; The average error of x, y, and z coordinates of the actual point position is 0.05269 mm, 0.04109 mm, and 0.04306 mm, respectively. The average error of the actual point position is 0.09144 mm, which is superior to the ACA, QACA, and RBF network algorithms. It can be seen that the coordinate points corresponding to the position error are combined with x, y, and z coordinate points, which best reflect the position error of the end of the manipulator. Based on the inverse solution algorithm of MQACA-RBF network, the fitting error between the end of the robot arm and the set trajectory is minimal, and it is very stable and robust, which proves that the scheme is feasible.Figure 10
Location error comparison of selected points.


## 5. Conclusion

In this paper, a manipulator inverse solution algorithm based on the MQACA-RBF network is proposed. This method effectively synthesizes the characteristics of the RBF neural network and MQACA algorithm and gives play to their respective strengths. From the results of spatial random selection, trajectory simulation experiments, and position error simulation, it can be seen that the inverse solution algorithm using the MQACA-RBF network is compared with the inverse solution algorithm based on ACA, QACA, and RBF networks, and the position error increased by 3.89%, 6.19%, and 0.76%, respectively. It can be seen that the robot arm inverse solution prediction model based on the MQACA-RBF network has higher accuracy and universality, and it has the reference value for other inverse solution methods and further robot arm spatial path planning.



---

*Source: 7807952-2020-02-28.xml*