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.
1. Introduction
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 [1] 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 [2] 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 [3], the positive solution problem is relatively simple and will get a unique solution, while the inverse solution problem [4] 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 [9], genetic algorithm [10, 11], particle swarm optimization [12], 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 [13] 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 [14]; in the inverse solution of the EOD manipulator, the simulated annealing algorithm was used, and the expected effect was obtained [15]. 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 [16], adaptive double-chain QGA [17], and Bloch Quantum Genetic Algorithm (BQGA) [18] have emerged. Among them, BQGA is a probability optimization algorithm that uses the qubits to represent population elements [19]. 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 BQGA2.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 [18] 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:(1)Δφij=Δϕ^ij∇fXibt≥aΔϕ~ij∇fXibt<a(2)Δθij=Δθ^ij∇fXibt≥aΔθ~ij∇fXibt<awhere t represents evolutionary algebra (same number of iterations), Δφij and Δθij are the corner sizes of φ and θ of the jth qubit on the ird chromosome, Xibt represents the optimal solution among the three chains of each chromosome in the tnd generation, ∇fXibt represents the fitness gradient value of the optimal solution for each chromosome in the tnd generation, a is an evaluation value whose size is determined by the maximum and minimum gradient values in each generation, and Δφ~ij and Δθ~ij are the corner values associated with the number of iterations, and the expression is(3)Δφ~i=φ0×tmax-ttmax(4)Δθ~i=θ0×tmax-ttmaxwhere φ0 and θ0 are initial iteration values, which range from 0.005π to 0.05π, and tmax is the maximum number of iterations. Δφ^ij and Δθ^ij are the angle values associated with the gradient. Referring to literature [18], the expressions constructed are as follows:(5)Δφ^ij=φ0×exp-∇fXibt-∇ftmin∇ftmax-∇ftmin(6)Δθ^ij=θ0×exp-∇fXibt-∇ftmin∇ftmax-∇ftminwhere ∇fmaxt and ∇fmint represent the maximum and minimum fitness gradient values of the generation, respectively. It should be pointed out that the discrete optimization problem [20] and the continuous optimization problem [21] are calculated differently when acquiring the relevant gradient. For the discrete optimization problem, since fX does not have a gradient, we can replace the gradient with the difference of the fitness of two adjacent generations [22]; the expression is(7)∇fXibt=fXibt-fXibt-1(8)∇ftmax=maxfX1bt-fX1bt-1,⋯,fXmbt-fXmbt-1(9)∇ftmin=minfX1bt-fX1bt-1,⋯,fXmbt-fXmbt-1The gradient in the continuous optimization problem is(10)∇fXibt=∂fXibt∂Xibt(11)∇ftmax=max∂fX1bt∂X1bt,⋯,∂fXmbt∂Xmbt(12)∇ftmin=min∂fX1bt∂X1bt,⋯,∂fXmbt∂XmbtIn the above adaptive strategy, the gradient size (measured by a) 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 [23] is adjusted to(13)pm=pm0×tmax-ttmaxwhere pm0∈0.01,0.5.
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 is(14)BAX←BEXgbads=gbestsBAC←BECgbads≠gbestswhere 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 Kinematics3.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 [26], the kinematics positive solution equation established by the D-H parameter method [27, 28] is(15)An=A10ω1·A21ω2·A32ω3·A43ω4·…·Ann-1ωn=nxoxaxpxnyoyaypynzozazpz0001That is, given a set of angles from ω1 to ωn, matrix An 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.(16)F=An-T2where An is the actual position and posture matrix of the robot arm established by the D-H parameter method, and T is the set target position and posture matrix, Αn-T2 is the two norm of An and T [30] 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 F 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:(17)qit=cosφi1tsinθi1tsinφi1tsinθi1tcosθi1tcosφi2tsinθi2tsinφi2tsinθi2tcosθi2t⋯⋯⋯cosφintsinθintsinφintsinθintcosθintwhere φij∈π/2,3π/2,θij∈0,π,i=1,2,⋯,m, j=1,2,⋯,n; m is the population size, which is the number of chromosomes; n is the number of qubits (representing n to-be-turned corners); t 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 Ω=-2π,2πn to obtain m sets of feasible solutions (Xix, Xiy, and Xiz). The mapping formula [18] is as follows:(18)Xjix=12Vmax1+pjix+Vmin1-pjix(19)Xjiy=12Vmax1+pjiy+Vmin1-pjiy(20)Xjiz=12Vmax1+pjiz+Vmin1-pjizwhere j=1,2,⋯,n; Vmax and Vmin correspond to the maximum and minimum values in the range of values for each angle (check Table 1 to get its value); pjix, pjiy, and pjiz represent the X solution, the Y solution, and the Z solution of the jth gene position of the ith 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.
Connecting rod parameters of PUMA560.
i
αi-1(rad)
ai-1(m)
di(m)
ωi(rad)
Joint angle range(rad)
1
0
0
0
ω1
-8π/9 ~8π/9
2
-π
0
d2
ω2
-5π/4 ~π/4
3
0
a2
0
ω3
-π/4 ~5π/4
4
-π
a3
d4
ω4
-11π/18 ~17π/18
5
π
0
0
ω5
-5π/9 ~5π/9
6
-π
0
0
ω6
-133π/90 ~133π/90
where a2=0.4318, a3=0.02032, d2=0.14909,d4=0.43307.
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 [18], 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.
Flow chart for finding inverse kinematics. where, as for calculating the fitness value with the evaluation function F, the smaller F is, the greater fitness is; GX and GC represent the global optimal solution and the global optimal chromosome, respectively.
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 T are randomly generated as(21)T=0.5322-0.1137-0.83900.0833-0.4697-0.8641-0.18090.1890-0.70440.4903-0.5133-0.49250001.0000
According to the flowchart of the inverse kinematics solution in Figure 1, the initial parameters are m=100; n=6;pm0=0.1;φ0=0.05π;θ0=0.05π; tmax=1000. 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.
Optimization results of BQGA and improved BQGA.
Optimization results
ω1(rad)
ω2(rad)
ω3(rad)
ω4(rad)
ω5(rad)
ω6(rad)
BQGA
-1.2877
-3.5668
2.8165
1.9572
-1.2525
3.0360
Improve BQGA
-1.1290
-3.4995
2.8803
2.0680
-1.2586
3.1212
Comparison of convergence between basic BQGA and improved BQGA.
Number of iterations
50
100
200
400
800
1000
The F value of BQGA
0.0716
0.0643
0.0479
0.0373
0.0373
0.0373
The F value of improve BQGA
0.0273
0.0210
0.0148
0.0085
0.0081
0.0071
Comparison of evaluation function curve.
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 A1 and A2, respectively.(22)A1=0.4988-0.1207-0.85830.1199-0.5406-0.8174-0.19920.1215-0.67750.5633-0.4730-0.48110001.0000(23)A2=0.5336-0.1143-0.83790.0764-0.4743-0.8608-0.18460.1872-0.70020.4959-0.5136-0.49210001.0000It can be seen that the deviation of the corresponding element values in A2 and T 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.
5. Conclusions
(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.
Data Availability
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.
Supplementary Materials
The source program used to support the findings of this study is included within the supplementary information file.
LegowskiA.The global inverse kinematics solution in the adept six 300 manipulator with singularities robustnessProceedings of the 20th International Conference on Control Systems and Computer Science, CSCS 20152015Romania90972-s2.0-84947078990ŁegowskiA.NiezabitowskiM.GrzejszczakT.Orientational path planning for 6R robotProceedings of the 17th IEEE International Carpathian Control Conference, ICCC 2016June 2016Slovakia4344392-s2.0-84979538943CaiZ. X.2015Beijing, ChinaMechanical Industry PressZhaoM.DaiY.Application of fuzzy ant colony algorithm to robotics arm inverse kinematics problem201610143492-s2.0-84952775400LiX.GuoY.ZhangJ.GuoS.Inverse kinematics solution and verification of modular 6-DOF manipulator20134442462512-s2.0-84876450770JiangH.-C.LiuS.-R.ZhangB.-T.Inverse kinematics analysis for 6 degree-of-freedom modular manipulator2010447134813542-s2.0-77955649056LiuY. J.Inverse kinematics and trajectory planning of 6R serial manipulators2012480391510.3901/JME.2012.03.009AnanthanarayananH.OrdóñezR.Real-time Inverse Kinematics of (2n + 1) DOF hyper-redundant manipulator arm via a combined numerical and analytical approach2015912092262-s2.0-8492895175810.1016/j.mechmachtheory.2015.04.011WangW.ZhangS.YuS.Image Resteoration by BP Neural Based on PSO201836470971410.1051/jnwpu/20183640709LINY.Solution of Inverse Kinematics for General Robot Manipulators Based on Multiple Population Genetic Algorithm2017533110.3901/JME.2017.03.001MomaniS.Abo-HammourZ. S.AlsmadiO. M. K.Solution of inverse kinematics problem using genetic algorithms20161012252332-s2.0-8495908861710.18576/amis/100122JiC.F ShanC.ShaY.K ZhouR.Blind source separation based on grouping simplified particle swarm optimization algorithm2018396787791ZhangC.F YangJ.ZhangF.Manipulator kinematics inverse solution study based on EC-RBF learning algorithm201335146465+72WangJ. L.ZhangG. L.JingB.XvJ.Research on way of inverse kinematic solution of six DOF manipulator20134922266270ZhangY. F.MaZ. S.A simulated annealing neural network solution to inverse kinematics of EOD manipulator201523412691272LiuJ.WangH.SunY.FuC.GuoJ.Real-Coded Quantum-Inspired Genetic Algorithm-Based BP Neural Network Algorithm201520151057129510.1155/2015/571295KongH.LiN.ShenY.Adaptive double chain quantum genetic algorithm for constrained optimization problems20152812142282-s2.0-8492272738610.1016/j.cja.2014.12.010LiS. Y.LiP. C.2009Harbin, ChinaHarbin Institute of Technology PressNowotniakR.KucharskiJ.Higher-order quantum-inspired genetic algorithmsProceedings of the 2014 Federated Conference on Computer Science and Information Systems, FedCSIS 20142014Poland46547010.15439/2014F992-s2.0-84912078985YinG. S.CuiX. H.DongY. X.YangX.An improved binary particle swarm optimization for discrete optimization problems2015362191195MR3362266Zbl1340.68152ZhangQ.LiP.-C.Adaptive grouping difference firefly algorithm for continuous space optimization problems2017327121712222-s2.0-85029851800ZhengR.2012Nanchang Aviation UniversityLiJ. C.HanK.BaoT. Z.An improved bloch spherical quantum genetic algorithm and its application2016131122622269C LiP.2009Harbin Institute of TechnologyYiZ. J.HouK.HeR. H.Adaptive quantum genetic algorithm based on Bloch spere201248355761HanX.YinM.LiuX.YinG.Solution of inverse kinematics and movement trajectory simulation for 6R robot20154761851902-s2.0-84949209757ianB.-Q.uJ.-C.hangA.-Q.Dynamic modeling of wave driven unmanned surface vehicle in longitudinal profile based on D-H approach20152212457845842-s2.0-8494995695710.1007/s11771-015-3008-6HerathH. M.GopuraR. A.LalitharatneT. D.An Underactuated Linkage Finger Mechanism for Hand Prostheses2018080212113910.4236/mme.2018.82009DaiY.ZhaoM.Manipulator path-planning avoiding obstacle based on screw theory and ant colony algorithm20161319229272-s2.0-8497348045910.1166/jctn.2016.4894G ZhangJ.F ZhangX.2013Wuhan, ChinaWuhan University PressFQuanF.XuF.Quantum evolutionary algorithm based on Bloch spere20131225860JiJ. Z.ChengL.ZhaoX. W.LiuC. N.Quantum ant colony algorithm for the multi-task coalition problem2013393412419MR3089128LuoY.DuoJ.Multi-objective reactive power optimization based on quantum immune colonial algorithm201333931352-s2.0-84885368456LiY.ZhangW. Z.LinP.LiW. J.The application of RBF networks in inverse kinematic of PUMA560 robot200979496ShaM.L DengZ.Study of space of PUMA560 robot based on matlab2016452156159