Application of Improved BQGA in Robot Kinematics Inverse Solution
In view of the problem that Bloch Quantum Genetic Algorithm (BQGA) is easy to fall into local optimum, an improved BQGA is proposed. The algorithm can control the step size and the mutation probability in real time in the iterative process, avoiding over the optimal solution and guaranteeing search efficiency. In addition, the improved algorithm further completes the anti-degradation mechanism, which maintains the diversity of the population while preserving the dominant gene to the maximum extent, so that the algorithm is not easy to fall into the local extremum and finally approaches the global optimal solution. The application in the inverse solution of robot kinematics shows that the improved BQGA effectively avoids the premature problem and accelerates the convergence of understanding and the search result is close to the complete solution, which provides a new idea for solving complex nonlinear and multivariate functional equations.
The kinematics problem is the basis for the intelligent development of today’s robotic arms. Research in related fields has made tremendous contributions to the development of science and technology. In document  the solutions of both the forward and inverse kinematics problems for Adept Six 300 6R robot are presented. A matrix method was used in computations. Algorithm based on the derived formulas and logical conditions has been implemented in Adept Smart Controller Cx. Literatures  are based on kinematics for more in-depth path planning studies. This paper innovatively applies BQGA to the inverse kinematics program, which not only expands the application field of intelligent algorithms, but also provides a new perspective for solving kinematic problems.
In robotics , the positive solution problem is relatively simple and will get a unique solution, while the inverse solution problem  is relatively complex, and there may be multiple sets of solutions. The traditional methods of solving them are geometry and algebra methods [5, 6], numerical analysis method [7, 8], etc., but they are limited by structure, space, expressions, etc., so it is not convenient and efficient to solve inverse kinematics problem. With the rapid development of computer programming technology, various intelligent algorithms, such as neural network algorithm , genetic algorithm [10, 11], particle swarm optimization , quantum optimization algorithms, and their various hybrid algorithms, have emerged, which highlight the ability to solve complex problems. For instance, in order to simplify the controller design of the manipulator, document  proposes to train the NN algorithm with entropy clustering method, which effectively solves the multi-value problem; applying an improved genetic algorithm to the inverse kinematics can overcome the structural limitations of the manipulator ; in the inverse solution of the EOD manipulator, the simulated annealing algorithm was used, and the expected effect was obtained . With the development of quantum theory, people are increasingly interested in quantum optimization algorithms. Quantum Genetic Algorithm (QGA) is popular among scholars because of its convenience and efficiency. Therefore, many improved algorithms such as real-coded QGA , adaptive double-chain QGA , and Bloch Quantum Genetic Algorithm (BQGA)  have emerged. Among them, BQGA is a probability optimization algorithm that uses the qubits to represent population elements . Its three-chain coding method is more efficient than the traditional double-chain structure, which makes the GA algorithm take a new step. However, in practical applications, BQGA also has problems such as being easy to pass the optimal solution and population degradation, and sometimes the optimization result is not ideal. Therefore, this paper proposes an improvement plan for these problems in BQGA.
2. Improvement Scheme of BQGA
2.1. Adjustment of Adaptive Corner Value
In the process of updating BQGA’s quantum chromosome, the value of the corner is more complicated. If the planning is unreasonable, it will seriously affect the optimization effect of the algorithm. The look-up table method in literature  provides an effective convergence strategy. However, the look-up table method does not take into account the differences in individual chromosomes and the trend of the evaluation function, making the algorithm easy to cross the optimal solution and less adaptive. Based on the traditional table lookup method, this paper further proposes an adaptive adjustment strategy for corner values. The expression is as follows:where represents evolutionary algebra (same number of iterations), and are the corner sizes of and of the th qubit on the rd chromosome, represents the optimal solution among the three chains of each chromosome in the nd generation, represents the fitness gradient value of the optimal solution for each chromosome in the nd generation, is an evaluation value whose size is determined by the maximum and minimum gradient values in each generation, and and are the corner values associated with the number of iterations, and the expression iswhere and are initial iteration values, which range from to , and is the maximum number of iterations. and are the angle values associated with the gradient. Referring to literature , the expressions constructed are as follows:where and represent the maximum and minimum fitness gradient values of the generation, respectively. It should be pointed out that the discrete optimization problem  and the continuous optimization problem  are calculated differently when acquiring the relevant gradient. For the discrete optimization problem, since does not have a gradient, we can replace the gradient with the difference of the fitness of two adjacent generations ; the expression isThe gradient in the continuous optimization problem isIn the above adaptive strategy, the gradient size (measured by ) determines the calculation formula of the corner. In the formula related to the gradient, the larger the gradient is, the smaller the step size becomes and, in the formula related to the number of iterations, the step size decreases monotonically with the increase of the number of iterations. Thus, the size of the corner varies with the gradient and is again limited by the number of iterations. The purpose is to control the step size in a reasonable range in real time.
2.2. Adaptive Mutation Probability
During the quantum chromosomal mutation of BQGA, the qubits rotate greatly along the Bloch sphere and are not constrained by other chromosomes, which helps to increase population diversity and avoid premature convergence. However, if the probability of mutation is constant throughout the evolution process, it is not conducive to the late convergence of the algorithm. In order to enable the algorithm to expand the global search ability in the early iteration and focus on local search in the late iteration to speed up the convergence, the adaptive mutation probability  is adjusted towhere .
2.3. Anti-Degradation Mechanism
In the process of population evolution, the anti-degradation mechanism can increase the chances of dominant individuals participating in inheritance and variation and reduce the possibility of population degradation, thus ensuring that the algorithm converges with maximum probability within a limited number of iterations. However, the principle of replacement of individual elimination will cause the population diversity to decrease rapidly with the increase of the number of iterations, so that it is easy to fall into local optimum, and it is difficult to jump out only by relying on mutation. In the improved BQGA, the replacement principle of the chain change is adopted. The description is that the chain is changed first, and the entire chromosome is replaced when the chain number is not the same. That is, it is the first to find the optimal solution (corresponding to the optimal chain) and the worst solution (corresponding to the worst chain) in one generation. If the chain numbers are the same, the worst chain is replaced by the optimal chain, and the other two chains remain unchanged; if the two chain numbers are different, replace the entire chromosome. The replacement expression iswhere BEX is the most suitable solution called the contemporary optimal solution, and its chromosome is called the contemporary optimal chromosome [24, 25] recorded as BEC. The same reason BAX is the worst solution and BAC is the worst chromosome, gbads and gbests represent the corresponding chain number. The anti-degradation mechanism of the improved BQGA ensures that the worst chromosomes of each generation have an optimal gene chain while maintaining population diversity.
3. Applying Improved BQGA for Inverse Kinematics
3.1. Establishment of Evaluation Function
Using the improved BQGA to solve the inverse kinematics problem of the robot, an evaluation function needs to be established. According to the kinematics principle of the n-degree-of-freedom manipulator , the kinematics positive solution equation established by the D-H parameter method [27, 28] isThat is, given a set of angles from to , matrix of position and posture of the end effector is uniquely determined. However, in practice it is the opposite; that is, the end position and posture are known to solve the value of the angle of each joint (inverse solution). In order to evaluate each set of inverse solutions, we have established (16) [4, 29] which transforms the inverse solution problem into a multivariate function to find the extremum problem.where is the actual position and posture matrix of the robot arm established by the D-H parameter method, and is the set target position and posture matrix, is the two norm of and  which represents the distance between the two matrices.
Available from (16), when the actual position and posture of the robot arm are equal to or infinitely close to the target position and posture, the minimum value of the evaluation function is zero or approximately zero.
3.2. Coding Method
According to the basis of quantum computing and the three-strand gene coding scheme of quantum chromosomes [18, 31], the initial population expression is as follows:where , ; is the population size, which is the number of chromosomes; is the number of qubits (representing to-be-turned corners); is an evolutionary algebra.
3.3. Transformation of Unit Space Solution to Joint Space Solution
According to the theory of Bloch spherical coordinates, a population can represent the m-group solutions of the search space and map them into the actual solution space to obtain m sets of feasible solutions (, , and ). The mapping formula  is as follows:where ; and correspond to the maximum and minimum values in the range of values for each angle (check Table 1 to get its value); , , and represent the solution, the solution, and the solution of the th gene position of the th chromosome, respectively. According to the decoding process, each of the chains of each chromosome decodes n corresponding robot arm corner values and their values directly fall within the respective range of values.
3.4. Update and Mutation of Quantum Chromosomes
The quantum chromosome is updated by the quantum revolving gate [24, 32], which causes the current chromosome to evolve toward the direction of the contemporary optimal chromosome, producing the next generation. The symbol of the two corners of the quantum revolving door is selected in , and the size is determined by using the adaptive corner value adjustment scheme of Section 2.1. It should be pointed out that since each corner of the robot arm has a specific range of values, the F formed by it cannot be continuously taken. Therefore, the inverse solution is a discrete optimization problem, and it is necessary to replace the gradient with two generations of difference.
The mutation of quantum chromosomes is realized by the non-gate [24, 33], and its role can be seen as an unconstrained large rotation. The adaptive mutation probability scheme in Section 2.2 is used to control the usage of non-gates.
3.5. Steps to Find Inverse Kinematics
Based on the above-mentioned theory of improving BQGA, the flow chart for finding the inverse kinematics is shown in Figure 1.
4. Application Example of Improved BQGA
In this paper, the general PUMA560 is taken as an example, and the inverse solution is obtained by using BQGA and improved BQGA, respectively. It is known that the connecting rod parameters [34, 35] of the PUMA 560 are as shown in Table 1. In the operable space, it is assumed that the target position and posture matrix are randomly generated as
According to the flowchart of the inverse kinematics solution in Figure 1, the initial parameters are ; ;;; . The program is written in Matlab. Under the same initial conditions, the optimization results of BQGA and improved BQGA are shown in Table 2. The convergence is shown in Table 3 and Figure 2.
The values of the two sets of optimal solution in Table 2 are substituted into the kinematics positive equation (15), and the actual position and posture matrix of the BQGA and the improved BQGA are and , respectively.It can be seen that the deviation of the corresponding element values in and is smaller. That is, the optimal solution of the improved algorithm is closer to the actual solution of the target equation (this can also be seen from the F value corresponding to the same number of iterations in Table 3), indicating that the actual position and posture of the end effector of the mechanical arm with improved BQGA can be closer to the set target pose.
It can be seen from Figure 2 and Table 3 that after the BQGA is iterated 250 times, the F value does not change, indicating that it has fallen into the local optimal solution. Not only does the improved BQGA find faster speed, but also the curve gradually approaches the zero axis with the increase of the number of iterations, which highlights the superiority of the improved algorithm not easily falling into the local extremum.
(i) The improved BQGA solves the problems of the BQGA better and has the advantages of high search efficiency, difficulty in overcoming the optimal solution, and difficulty in falling into local extremum.
(ii) The improved BQGA not only solves the problem of inverse kinematics of robots, but also effectively improves the speed and accuracy of robotic control. It provides a method for solving similar complex multivariate functions.
(iii) Although this paper solves the typical discrete optimization problem, it is instructive and versatile for some continuous optimization and other fields of application.
The data used to support the findings of this study are included within the article. The source program used to support the findings of this study is included within the supplementary information file (available here).
Conflicts of Interest
The authors declare that they have no conflicts of interest.
The source program used to support the findings of this study is included within the supplementary information file. (Supplementary Materials)
A. Legowski, “The global inverse kinematics solution in the adept six 300 manipulator with singularities robustness,” in Proceedings of the 20th International Conference on Control Systems and Computer Science, CSCS 2015, pp. 90–97, Romania, 2015.View at: Google Scholar
A. Łegowski, M. Niezabitowski, and T. Grzejszczak, “Orientational path planning for 6R robot,” in Proceedings of the 17th IEEE International Carpathian Control Conference, ICCC 2016, pp. 434–439, Slovakia, June 2016.View at: Google Scholar
Z. X. Cai, Robotics foundation, Mechanical Industry Press, Beijing, China, 2015.
M. Zhao and Y. Dai, “Application of fuzzy ant colony algorithm to robotics arm inverse kinematics problem,” ICIC Express Letters, vol. 10, no. 1, pp. 43–49, 2016.View at: Google Scholar
X. Li, Y. Guo, J. Zhang, and S. Guo, “Inverse kinematics solution and verification of modular 6-DOF manipulator,” Transactions of the Chinese Society for Agricultural Machinery, vol. 44, no. 4, pp. 246–251, 2013.View at: Google Scholar
H.-C. Jiang, S.-R. Liu, and B.-T. Zhang, “Inverse kinematics analysis for 6 degree-of-freedom modular manipulator,” Journal of Zhejiang University(Engineering Science), vol. 44, no. 7, pp. 1348–1354, 2010.View at: Google Scholar
C. Ji, C. F Shan, Y. Sha, and R. K Zhou, “Blind source separation based on grouping simplified particle swarm optimization algorithm,” Journal of Northeastern University (Natural Science), vol. 39, no. 6, pp. 787–791, 2018.View at: Google Scholar
C. Zhang, J. F Yang, and F. Zhang, “Manipulator kinematics inverse solution study based on EC-RBF learning algorithm,” Manufacturing Automation, vol. 35, no. 14, pp. 64–65+72, 2013.View at: Google Scholar
J. L. Wang, G. L. Zhang, B. Jing, and J. Xv, “Research on way of inverse kinematic solution of six DOF manipulator,” Computer Engineering and Applications, vol. 49, no. 22, pp. 266–270, 2013.View at: Google Scholar
Y. F. Zhang and Z. S. Ma, “A simulated annealing neural network solution to inverse kinematics of EOD manipulator,” Computer Measurement & Control, vol. 23, no. 4, pp. 1269–1272, 2015.View at: Google Scholar
S. Y. Li and P. C. Li, Quantum computation and quantum optimization algorithms, Harbin Institute of Technology Press, Harbin, China, 2009.
Q. Zhang and P.-C. Li, “Adaptive grouping difference firefly algorithm for continuous space optimization problems,” Control and Decision, vol. 32, no. 7, pp. 1217–1222, 2017.View at: Google Scholar
R. Zheng, Convergence analysis and improvement method of Double-Chain quantum genetic algorithm, Nanchang Aviation University, 2012.
J. C. Li, K. Han, and T. Z. Bao, “An improved bloch spherical quantum genetic algorithm and its application,” Journal of Railway Science and Engineering, vol. 13, no. 11, pp. 2262–2269, 2016.View at: Google Scholar
P. C Li, Quantum computationwith applications to intelligent optimization and control, Harbin Institute of Technology, 2009.
Z. J. Yi, K. Hou, and R. H. He, “Adaptive quantum genetic algorithm based on Bloch spere,” Computer Engineering and Applications, vol. 48, no. 35, pp. 57–61, 2012.View at: Google Scholar
X. Han, M. Yin, X. Liu, and G. Yin, “Solution of inverse kinematics and movement trajectory simulation for 6R robot,” Journal of Sichuan University(Engineering Science Edition), vol. 47, no. 6, pp. 185–190, 2015.View at: Google Scholar
J. G Zhang and X. F Zhang, Matrix Analysis and Calculation, Wuhan University Press, Wuhan, China, 2013.
F. FQuan and F. Xu, “Quantum evolutionary algorithm based on Bloch spere,” Software Guide, vol. 12, no. 2, pp. 58–60, 2013.View at: Google Scholar
Y. Luo and J. Duo, “Multi-objective reactive power optimization based on quantum immune colonial algorithm,” Electric Power Automation Equipment, vol. 33, no. 9, pp. 31–35, 2013.View at: Google Scholar
Y. Li, W. Z. Zhang, P. Lin, and W. J. Li, “The application of RBF networks in inverse kinematic of PUMA560 robot,” Machinery Design & Manufacture, vol. 7, pp. 94–96, 2009.View at: Google Scholar
M. Sha and Z. L Deng, “Study of space of PUMA560 robot based on matlab,” Machinery Manufacturing Automation, vol. 45, no. 2, pp. 156–159, 2016.View at: Google Scholar