IPDE algorithm-based articulated coordinate measuring machine calibration method
1. A joint type coordinate measuring machine calibration method based on IPDE algorithm is characterized in that: the method comprises the following specific steps:
step one, establishing a mathematical model of the articulated coordinate measuring machine containing all structural parameters according to the structure of the articulated coordinate measuring machine;
collecting a plurality of groups of joint corner data by using a joint type coordinate measuring machine;
step three, establishing a fitness function F (U) as shown in a formula (2),
in the formula (2), U is a structural parameter set of the measuring machine; x is the number ofm、ym、zmMeasuring head space coordinates obtained by theoretical calculation are measuring head theoretical sphere center coordinate values;n is the group number of the joint corner data;
identifying kinematic parameters of the measuring machine by using an IPDE algorithm;
4-1. initializing correlation coefficient: initializing maximum population size NaMaximum iteration times T and a space dimension D; initialized maximum inertia coefficient w of PSO algorithmmaxInitializing the minimum inertia coefficient wmin4. Initializing the acceleration factor c1、c2Initializing the maximum speed vmaxInitial velocity v0Initializing a control coefficient m; initializing a variation contraction factor Q and a cross factor CR of the DE algorithm; the initialization penalty factor r of the interior point method is 0.05;
4-2, respectively generating populations of a PSO algorithm and a DE algorithm in the search space, wherein the scales of the two populations are both N; population of PSO algorithmPopulation of DE algorithmWherein the content of the first and second substances,and1,2 … N; individualsEach element in (1), and an individualD structural parameters of the articulated coordinate measuring machine corresponding to each element in the (1); taking t as an iteration ordinal number, iterating until an iteration termination condition is reached to obtain the best individual position of the populationThe process of a single iteration is as shown in step 4-3 to step 4-5;
4-3, calculating the first generation population X of the PSO algorithm according to the fitness function1Inner individual bodyIs adapted toComputing DE Algorithm first generation population P1Inner individual bodyIs adapted toAt each degree of adaptabilityAnd each fitnessTaking the minimum value as the optimal fitness of the first-generation population of the PSO algorithm and the DE algorithmThe individual corresponding to the fitness is the optimal individual
4-4 PSO Algorithm for population X1Updating the speed and the position of all the individuals; DE algorithm for population P1All individuals in the system perform mutation, hybridization and selection operations;
4-4-1.PSO Algorithm
1) Individual flight velocity of particleAnd individual locationThe update changes are shown in equations (3) and (4), i ═ 1,2 … N;
in the formula (3), w ═ wmin+(wmax-wmin)·exp[-m·(t/T)2],The best individual position of the contemporary population;the optimal individual position in the population corresponding to the PSO algorithm; in the first time of the optimization,) Comparing and determining the optimal population position of the next generation population in the PSO algorithmAs shown in formula (5);
DE Algorithm 4-4-2
1) According toProduced under variant operationAs shown in formula (6);
in the formula (6), r1, r2, r3 ∈ {1,2 … N } are different integers and are different from i,
2) according toAndgenerated under a cross operationAs shown in formula (7);
in the formula (7), jrandIs a uniformly distributed random integer of the set {1,2 … D }, j ═ 1, 2.., D;
3) comparing and determining next generation populationAs shown in formula (8);
4) the next generation is clusteredSubstituting into the fitness function to calculate the fitnessComparing to obtain the best individual
4-5. both PSO algorithm and DE algorithm derive the best individual of own populationAndthe corresponding fitness F of the two is comparedPSOAnd FDESize, selecting the best individual position of the contemporary population
And step five, inputting all the structural elements in the final individual obtained in the step four into the articulated coordinate measuring machine as the kinematic parameter set of the measuring machine to finish calibration.
2. The calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 1, wherein: in the iteration process of the step four, judging whether the convergence of the algorithm has a stagnation state, wherein the stagnation state means that the continuous 6 generations of optimal individuals are not improved; and if the stagnation state occurs, executing an interior point method to replace part of individuals in the population.
3. The calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 2, wherein: the specific process of the interior point method is as follows:
1) constructing a penalty function of the system, as shown in a formula (9);
equation (9) shows that under constraint conditions, the fitness function F (β) is minimized; β ═ β1,β2…βDIs a set of structural parameters, βmaxAnd betaminRespectively is a set consisting of an upper limit and a lower limit of the numerical value of each structural parameter;
2) converting the constrained optimization problem into an unconstrained problem according to an interior point method to obtain a new fitness function R (beta), which is shown as a formula (10);
in the formula (10), r is a penalty factor;
3) and carrying out one-time unconstrained optimization on the target function R (beta) to obtain new individuals, and respectively replacing the worst individuals in the two populations with the new individuals.
4. The calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 1, wherein: in the first step, the articulated coordinate measuring machine adopts a six-degree-of-freedom articulated coordinate measuring machine; the mathematical model of the articulated coordinate measuring machine is shown as formula (1);
in the formula (1), θiA joint rotation angle of the ith joint; theta0,iThe deflection angle of the encoder at the initial position of the ith joint; alpha is alphaiThe joint torsion angle on the ith rod piece; a isiThe rod offset of the ith joint; diThe length of the ith rod piece; i is a joint serial number and takes a value of 1-6; l is the probe length, θ0,i、αi、ai、diL is 25 structural parameters of the articulated coordinate measuring machine;
the theoretical set of structural parameters U and the set of angles θ are as follows:
U=(θ0,1…θ0,6,α1…α6,a1…a6,d1…d6,l)
θ=(θ1…θ6)
theoretical sphere center coordinate (x) of measuring headm,ym,zm) Comprises the following steps:
xm=fx(U,θ),ym=fy(U,θ),zm=fz(U,θ)
the actual set of kinematic parameters Δ U is established as:
ΔU=(Δθ0,1…Δθ0,6,Δα1…Δα6,Δa1…Δa6,Δd1…Δd6,Δl)
Δθ0,iencoder deflection angle theta at initial position0,iThe actual parameter of (2); delta alphaiFor the angle of torsion alpha of the joint on the rodiThe actual parameter of (2); Δ aiOffset a of the rodiThe actual parameter of (2); Δ diIs the length d of the rod memberiThe actual parameter of (2); delta l is an actual parameter of the length l of the measuring head;
actual center coordinates (Δ x) of stylusm,Δym,Δzm) Comprises the following steps:
Δxm=fx(ΔU,θ),Δym=fy(ΔU,θ),Δzm=fz(ΔU,θ)。
5. the calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 1, wherein: the specific process of the second step is as follows: placing a single-point conical nest calibration piece in a measured space by adopting a single-point calibration method, and measuring and sampling the single-point conical nest by using an articulated coordinate measuring machine for n times, wherein n is more than or equal to 40; different postures are adopted for each sampling, and n groups of joint rotation angle data are obtained.
6. The calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 1, wherein: in step 4-1, the correlation coefficients are initializedIn (1), initializing the maximum population size Na60, 2000, and D, structural parameters; initialized maximum inertia coefficient w of PSO algorithmmaxInitialized minimum inertia coefficient w of 0.9min0.4, initialized acceleration factor c1=c2Initial maximum speed v of 1.5maxInitial velocity v 20=rand(0,vmax) Initializing a control coefficient m to be 3; the initial variant shrinkage factor Q and the initial crossover factor CR of the DE algorithm are 0.5 and 0.9 respectively; the initialization penalty factor r of the interior point method is 0.05.
7. The calibration method of the articulated coordinate measuring machine based on the IPDE algorithm as claimed in claim 1, wherein: in the step 4-2, the articulated coordinate measuring machine adopts a six-degree-of-freedom articulated coordinate measuring machine, and the total number of the articulated coordinate measuring machine is 25; individuals of the first generationAnd individuals1 to 6 elements of (a) are respectively in theta0,1、θ0,2、θ0,3、θ0,4、θ0,5、θ0,6The upper part and the lower part float within 1 degree; 7 to 12 elements are respectively in alpha1、α2、α3、α4、α5、α6The upper part and the lower part float within 1 degree; 13 to 18 elements are respectively in a1、a2、a3、a4、a5、a6The upper part and the lower part float within 10 mm; 19 to 25 elements are respectively in d1、d2、d3、d4、d5、d6And l is within a range of 10mm floating up and down.
Background
The articulated coordinate measuring machine is a non-orthogonal coordinate measuring machine and is an open chain structure formed by connecting a measuring arm and a rotary joint in series. Compared with the traditional orthogonal system coordinate measuring machine, the measuring machine has the advantages of high flexibility, small volume, large measuring range, simple and convenient operation, good environmental adaptability and the like. However, the serial structure has the defect of accumulated error amplification, so that the structural parameter errors of each level of joint are amplified step by step, and the measurement accuracy is reduced. Before use, the articulated coordinate measuring machine is subjected to kinematic calibration, and the influence of the structural parameters on the measurement precision is reduced to the minimum so as to ensure that the articulated coordinate measuring machine meets the precision requirement of design.
With the continuous development of intelligent algorithms, many intelligent algorithms such as genetic algorithm, differential evolution algorithm and the like are also applied in the calibration of the articulated coordinate measuring machine. The improved genetic algorithm used by the schwarren et al has no requirement on an iteration initial value and has good convergence rate, but the global convergence capability is weak, and a global optimal solution is not easy to find; jiadongli et al propose a mixed differential evolution algorithm based on chaos and local optimization of gauss, etc.; a calibration method of an articulated coordinate measuring machine based on a hybrid genetic least square algorithm is provided in a patent CN 110398219A; patent CN110276101A proposes a simplex differential evolution algorithm as a calibration method for articulated coordinate measuring machines.
The algorithm cannot simultaneously meet the requirements of identification speed, identification precision and convergence in the calibration process of the articulated coordinate measuring machine.
Disclosure of Invention
The invention aims to provide a calibration method of an articulated coordinate measuring machine based on an IPDE algorithm.
The method comprises the following specific steps:
step one, establishing a mathematical model of the articulated coordinate measuring machine containing all structural parameters according to the structure of the articulated coordinate measuring machine.
And step two, collecting a plurality of groups of joint corner data by using a joint type coordinate measuring machine.
Step three, establishing a fitness function F (U) as shown in a formula (2),
in the formula (2), U is a structural parameter set of the measuring machine; x is the number ofm、ym、zmMeasuring head space coordinates obtained by theoretical calculation are measuring head theoretical sphere center coordinate values;n is the number of sets of joint angle data.
And step four, identifying kinematic parameters of the measuring machine by using an IPDE algorithm.
4-1. initializing correlation coefficient: initializing maximum population size NaMaximum iteration times T and a space dimension D; initialized maximum inertia coefficient w of PSO algorithmmaxInitializing the minimum inertia coefficient wmin4. Initializing the acceleration factor c1、c2Initializing the maximum speed vmaxInitial velocity v0Initializing a control coefficient m; initializing a variation contraction factor Q and a cross factor CR of the DE algorithm; the initialization penalty factor r of the interior point method is 0.05.
And 4-2, generating populations of a PSO algorithm and a DE algorithm respectively in the search space, wherein the two populations have the size of N. Population of PSO algorithmPopulation of DE algorithmWherein the content of the first and second substances,andindividualsAnd the individual Pi 1D structural parameters of the articulated coordinate measuring machine corresponding to each element in (a). Taking t as an iteration ordinal number, iterating until an iteration termination condition is reached to obtain the best individual position of the populationThe process of a single iteration is shown in steps 4-3 through 4-5.
4-3, calculating the first generation population X of the PSO algorithm according to the fitness function1Inner individual bodyIs adapted toComputing DE Algorithm first generation population P1Inner individual Pi 1Fitness F (P)i 1) (ii) a At each degree of adaptabilityAnd each fitness F (P)i 1) Taking the minimum value as the optimal fitness of the first-generation population of the PSO algorithm and the DE algorithmThe individual corresponding to the fitness is the optimal individual
4-4 PSO Algorithm for population X1Updating the speed and the position of all the individuals; DE algorithm for population P1All individuals in (1) perform mutation, hybridization, and selection operations.
4-4-1.PSO Algorithm
1) Individual flight velocity of particleAnd individual locationThe update change is as shown in equations (3) and (4), i ═ 1,2 … N.
In the formula (3), w ═ wmin+(wmax-wmin)·exp[-m·(t/T)2],The best individual position of the contemporary population;the optimal individual position in the population corresponding to the PSO algorithm; in the first time of the optimization,
2) comparing and determining the optimal population position of the next generation population in the PSO algorithmAs shown in formula (5).
DE Algorithm 4-4-2
1) According toProduced under variant operationAs shown in equation (6).
In the formula (6), r1, r2, r3 ∈ {1,2 … N } are different integers and are different from i,
2) according to Pi t=(Pi1,Pi2…PiD) Andgenerated under a cross operationAs shown in equation (7).
In the formula (7), jrandIs a uniformly distributed random integer of the set {1,2 … D }, j ═ 1, 2.
3) The next generation population P is comparatively determinedi t+1As shown in formula (8).
4) The next generation of population Pi t+1Substituting into the fitness function, calculating the fitness F (P)i t+1) Comparing to obtain the best individual
4-5. both PSO algorithm and DE algorithm derive the best individual of own populationAndthe corresponding fitness F of the two is comparedPSOAnd FDESize, selecting the best individual position of the contemporary population
And step five, inputting all the structural elements in the final individual obtained in the step four into the articulated coordinate measuring machine as the kinematic parameter set of the measuring machine to finish calibration.
Preferably, in the iteration process of the step four, whether the convergence of the algorithm has a stagnation state is judged, and the stagnation state means that the optimal individuals of 6 successive generations are not improved. And if the stagnation state occurs, executing an interior point method to replace part of individuals in the population.
Preferably, the specific process of the interior point method is as follows:
1) and constructing a penalty function of the system, as shown in a formula (9).
Equation (9) shows that under constraint conditions, the fitness function F (β) is minimized; β ═ β1,β2…βDIs a set of structural parameters, βmaxAnd betaminThe upper limit and the lower limit of the numerical value of each structural parameter are respectively formed into a set.
2) And (3) converting the constrained optimization problem into an unconstrained problem according to an interior point method to obtain a new fitness function R (beta), which is shown as a formula (10).
In the formula (10), r is a penalty factor.
3) And carrying out one-time unconstrained optimization on the target function R (beta) to obtain new individuals, and respectively replacing the worst individuals in the two populations with the new individuals.
Preferably, in the first step, the articulated coordinate measuring machine is a six-degree-of-freedom articulated coordinate measuring machine. The mathematical model of the articulated coordinate measuring machine is shown as formula (1).
In the formula (1), θiA joint rotation angle of the ith joint; theta0,iThe deflection angle of the encoder at the initial position of the ith joint; alpha is alphaiThe joint torsion angle on the ith rod piece; a isiThe rod offset of the ith joint; diIs the length of the ith rod piece. i is the joint number and takes the value of 1-6. l is the probe length, θ0,i、αi、ai、diAnd l is 25 structural parameters of the articulated coordinate measuring machine.
The theoretical set of structural parameters U and the set of angles θ are as follows:
U=(θ0,1…θ0,6,α1…α6,a1…a6,d1…d6,l)
θ=(θ1…θ6)
theoretical sphere center coordinate (x) of measuring headm,ym,zm) Comprises the following steps:
xm=fx(U,θ),ym=fy(U,θ),zm=fz(U,θ)
the actual set of kinematic parameters Δ U is established as:
ΔU=(Δθ0,1…Δθ0,6,Δα1…Δα6,Δa1…Δa6,Δd1…Δd6,Δl)
Δθ0,iencoder deflection angle theta at initial position0,iThe actual parameter of (2); delta alphaiFor the angle of torsion alpha of the joint on the rodiThe actual parameter of (2); Δ aiOffset a of the rodiThe actual parameter of (2); Δ diIs the length d of the rod memberiThe actual parameter of (2); Δ l is the actual parameter of the stylus length l.
Actual center coordinates (Δ x) of stylusm,Δym,Δzm) Comprises the following steps:
Δxm=fx(ΔU,θ),Δym=fy(ΔU,θ),Δzm=fz(ΔU,θ)。
preferably, the specific process of step two is as follows: placing a single-point conical nest calibration piece in a measured space by adopting a single-point calibration method, and measuring and sampling the single-point conical nest by using an articulated coordinate measuring machine for n times, wherein n is more than or equal to 40; different postures are adopted for each sampling, and n groups of joint rotation angle data are obtained.
Preferably, in step 4-1, the maximum population size N is initialized among the initialized correlation coefficientsa60, 2000, and D, structural parameters; initialized maximum inertia coefficient w of PSO algorithmmaxInitialized minimum inertia coefficient w of 0.9min0.4, initialized acceleration factor c1=c2Initial maximum speed v of 1.5maxInitial velocity v 20=rand(0,vmax) Initializing a control coefficient m to be 3; the initial variant shrinkage factor Q and the initial crossover factor CR of the DE algorithm are 0.5 and 0.9 respectively; the initialization penalty factor r of the interior point method is 0.05.
Preferably, in step 4-2, the articulated coordinate measuring machine adopts a six-degree-of-freedom articulated coordinate measuring machine, and the total number of the articulated coordinate measuring machine is 25. Individuals of the first generationAnd individual Pi 11 to 6 elements of (a) are respectively in theta0,1、θ0,2、θ0,3、θ0,4、θ0,5、θ0,6The upper part and the lower part float within 1 degree. 7 to 12 elements are respectively in alpha1、α2、α3、α4、α5、α6The upper part and the lower part float within 1 degree. 13 to 18 elements are respectively in a1、a2、a3、a4、a5、a6The upper part and the lower part float within 10 mm. 19 to 25 elements are respectively in d1、d2、d3、d4、d5、d6And l is within a range of 10mm floating up and down.
The invention has the beneficial effects that:
1. the invention relates to a joint type coordinate measuring machine calibration method based on an IPDE algorithm. The DE algorithm has stronger global optimization performance, but the optimization iteration convergence speed is slow, and local optimization is easy to fall into when the later-stage optimal solution is close to the optimal solution; the PSO algorithm has general optimization capability, but has extremely high convergence rate; the interior point method is relatively strict in value of the penalty factor when optimizing the function, but the local optimization capability of the algorithm is good, and the optimal solution obtained by using the interior point method as a constraint optimization algorithm is certain in a feasible domain. The PSO algorithm and the interior point method are embedded into the differential algorithm. The method comprises the steps of firstly, improving the convergence speed of the PSO algorithm by parallel operation of the PSO algorithm and the DE algorithm and utilizing the rapid convergence of the PSO algorithm, and then, carrying out local search with higher precision by an interior point method to improve the probability of finding the optimal solution. The IPDE algorithm is utilized, the identification precision and speed of the kinematic parameters of the articulated coordinate measuring machine are improved, and the effectiveness of the method is verified through simulation experiments.
2. The invention adopts IPDE algorithm to calibrate the parameters of the articulated coordinate measuring machine, needs to optimize a multidimensional function, the mixture of a plurality of algorithms can increase the complexity of operation, phase change increases time cost, and the invention considers that the inner point method is started under specific conditions, namely when the algorithm is stopped for optimization, the operation complexity caused by embedding the inner point method is reduced.
3. The invention adopts a parameter calibration method, calibrates the articulated coordinate measuring machine by using the IPDE algorithm, and can improve the speed and the precision of calibrating the measuring machine without adding extra equipment.
Drawings
FIG. 1 is a flow chart of identifying kinematic parameters of a measuring machine using an IPDE algorithm in step four of the present invention;
FIG. 2 is a graph comparing the convergence curves of the present invention and the prior DE algorithm;
FIG. 3 is a comparison graph of measurement errors respectively calibrated for articulated coordinate measuring machines using the present invention and DE algorithm;
Detailed Description
The present invention is further described below.
An IPDE algorithm-based articulated coordinate measuring machine calibration method is used for six-degree-of-freedom articulated coordinate measuring machine kinematic parameter calibration, and specifically comprises the following steps:
step one, establishing a mathematical model of the articulated coordinate measuring machine.
According to the modeling theory of the articulated coordinate measuring machine, modeling is carried out according to a common DH model, and the modeling is shown as a formula (1)
In the formula (1), θiA joint rotation angle of the ith joint; theta0,iThe deflection angle of the encoder at the initial position of the ith joint; alpha is alphaiThe joint torsion angle on the ith rod piece; a isiThe rod offset of the ith joint; diIs the length of the ith rod piece. i is the joint number and takes the value of 1-6. l is the length of the measuring head, and the value is 98 mm; the DH model of the articulated coordinate measuring machine has 25 structural parameters in total, and the specific values are shown in Table 2
TABLE 2 structural parameter values of articulated coordinate measuring machine
The theoretical set of structural parameters U and the set of angles θ are as follows:
U=(θ0,1…θ0,6,α1…α6,a1…a6,d1…d6,l)
θ=(θ1…θ6)
at this time, the probe theoretical sphere center coordinate (x)m,ym,zm) Comprises the following steps:
xm=fx(U,θ),ym=fy(U,θ),zm=fz(U,θ)
in practical situations, the structural parameters of the articulated coordinate measuring machine deviate from theoretical design values due to problems of machining, assembly and the like.
Thus, the actual kinematic parameter set Δ U is established as:
ΔU=(Δθ0,1…Δθ0,6,Δα1…Δα6,Δa1…Δa6,Δd1…Δd6,Δl)
Δθ0,iencoder deflection angle theta at initial position0,iThe actual parameter of (2); delta alphaiFor the angle of torsion alpha of the joint on the rodiThe actual parameter of (2); Δ aiOffset a of the rodiThe actual parameter of (2); Δ diIs the length d of the rod memberiThe actual parameter of (2); Δ l is the actual parameter of the stylus length l.
The actual spherical center coordinates (Δ x) of the stylusm,Δym,Δzm) Comprises the following steps:
Δxm=fx(ΔU,θ),Δym=fy(ΔU,θ),Δzm=fz(ΔU,θ)
and step two, collecting corner data of the articulated coordinate measuring machine.
The method comprises the steps of placing a single-point conical fossa calibration piece in a measured space by adopting a single-point calibration method, measuring and sampling the single-point conical fossa by using an articulated coordinate measuring machine, sampling n times (n is more than or equal to 40 times), and obtaining n groups of joint corner data by adopting different postures in each sampling.
Step three, establishing a fitness function F (U) as shown in a formula (2),
in the formula (2), U is a structural parameter set of the measuring machine; x is the number ofm、ym、zmMeasuring head space coordinates obtained by theoretical calculation are measuring head theoretical spherical center coordinate values obtained by combining the structural parameter set U and the n groups of angle sets theta;
and step four, as shown in figure 1, identifying kinematic parameters of the measuring machine by using an IPDE algorithm.
The DE algorithm is an evolutionary algorithm based on population parallel random search. The algorithm is used for deriving a new population from an original population through mutation, hybridization and selection of several genetic operations, and can realize the search of the global optimal solution through gradual iteration and continuous evolution. But also has the defects that the optimization iteration convergence speed is slow, and the optimization is easy to fall into local optimization when the later period is close to the optimal solution. In order to solve the problems that the convergence speed is slow and the algorithm is easy to fall into local optimization, the PSO algorithm and the interior point method are embedded into the differential evolution algorithm, the optimization capability of the DE algorithm is improved by utilizing the rapid convergence of the PSO algorithm and the local optimization capability of the interior point method, the IPDE algorithm for calibrating the articulated coordinate measuring machine is provided, the flow chart of the algorithm is shown in figure 1, and the specific steps of the algorithm are as follows:
4-1. initialize the correlation coefficients of all algorithms: initializing maximum population size Na60, 2000 and 25 respectively for the maximum iteration time T and the spatial dimension D; initialized maximum inertia coefficient w of PSO algorithmmaxInitialized minimum inertia coefficient w of 0.9min0.4, initialized acceleration factor c1=c2Initial maximum speed v of 1.5maxInitial velocity v 20=rand(0,vmax) Initializing a control coefficient m to be 3; initialization of the DE algorithm with the initialized variant puncturing factor Q equal to 0.5, initializationThe crossover factor CR is 0.9; the initialization penalty factor r of the interior point method is 0.05.
4-2, dividing the population scale into two, wherein the population scales of the PSO algorithm and the DE algorithm are both N (N)a2N). Randomly generating two groups of first generation population in the search space, the population of PSO algorithm (or called population position)And population of DE algorithmWherein the content of the first and second substances,and Pi 1=(Pi1,Pi2…PiD) I is 1,2 … N; individuals25 elements of, and individual Pi 125 parameters of the articulated coordinate measuring machine corresponding to 25 elements, 1-6 elements are respectively arranged at theta0,1、θ0,2、θ0,3、θ0,4、θ0,5、θ0,6The upper part and the lower part float within 1 degree. 7 to 12 elements are respectively in alpha1、α2、α3、α4、α5、α6The upper part and the lower part float within 1 degree. 13 to 18 elements are respectively in a1、a2、a3、a4、a5、a6The upper part and the lower part float within 10 mm. 19 to 25 elements are respectively in d1、d2、d3、d4、d5、d6And l is within a range of 10mm floating up and down.
4-3, calculating the first generation population X of the PSO algorithm according to the fitness function F (U)1Each target individualIs adapted toComputing DE Algorithm first generation population P1Each target individual Pi 1Fitness F (P)i 1) (ii) a At each degree of adaptabilityAnd each fitness F (P)i 1) Taking the minimum value as the optimal fitness of the first-generation population of the PSO algorithm and the DE algorithmThe individual corresponding to the fitness is the optimal individual
4-4, carrying out optimization calculation by two algorithms simultaneously: PSO algorithm, for population X1Updating the speed and the position of all the individuals; DE Algorithm, for population P1All individuals in (1) perform mutation, hybridization, and selection operations.
4-4-1.PSO Algorithm
1) Individual flight velocity of particleAnd individual locationThe update change is as shown in equations (3) and (4), i ═ 1,2 … N.
In the formula (3), w ═ wmin+(wmax-wmin)·exp[-m·(t/T)2]M is a control coefficient, in order to ensure the smoothness of the w transformation curve,the best individual position of the contemporary population;the optimal individual position in the population corresponding to the PSO algorithm; in the first time of the optimization,
2) comparing and determining the optimal population position of the next generation population in the PSO algorithmAs shown in formula (5).
DE Algorithm 4-4-2
1) According toProduced under variant operationAs shown in equation (6).
In the formula (6), r1, r2, r3 ∈ {1,2 … N } are random integers different from each other and different from i,
2) according to Pi t=(Pi1,Pi2…PiD) Andgenerated under a cross operationAs shown in(7) As shown.
In the formula (7), jrandIs a uniformly distributed random integer of the set 1,2 … D to ensureCan be derived from variant individualsResulting in at least one component, j ═ 1, 2.
3) The next generation population P is comparatively determinedi t+1As shown in formula (8).
4) The next generation of population Pi t+1Substituting into the fitness function, calculating the fitness F (P)i t+1) Comparing to obtain the best individual
4-5. both PSO algorithm and DE algorithm derive the best individual of own populationAndthe corresponding fitness F of the two is comparedPSOAnd FDESize, selecting the best individual to be the best individual of the whole populationAs the basis for the next generation evolution of these two algorithms.
And 4-6, judging whether the convergence of the algorithm has a stagnation state, wherein the stagnation state means that the optimal individuals of 6 successive generations are not improved. If the stagnation state does not occur, the execution continues to execute 4-4 and 4-5; if a stall condition occurs, then step 4-7 is performed once.
And 4-7, taking the current best individual as an initial point, starting an interior point method, performing one-time iterative calculation, and replacing the worst individual in the current population with the calculation result.
4-7.1. interior point method
The interior point method belongs to a constraint optimization algorithm. The basic idea of the constraint optimization algorithm is as follows: the constrained optimization problem is converted into an unconstrained problem by introducing a utility function method, and then the utility function is continuously updated by utilizing an optimization iteration process so as to make the algorithm converge.
1) And constructing a penalty function of the system, as shown in a formula (9).
Equation (9) shows that under constraint conditions, the fitness function F (β) is minimized; β ═ β1,β2…βDIs a set of structural parameters, βmaxAnd betaminThe upper limit and the lower limit of the numerical value of each structural parameter are respectively formed into a set, which means that each structural parameter can not exceed the corresponding upper limit and lower limit.
2) And (3) converting the constrained optimization problem into an unconstrained problem according to an interior point method to obtain a new fitness function R (beta), which is shown as a formula (10).
In the formula (10), r is a penalty factor which is continuously reduced along with the increase of the iteration number,(k is the number of iterations). Here only one iteration is considered and r needs to be set to a smaller value.Is set betamaxThe ith element of (1).Is set betaminThe ith element of (1).
3) After the constrained optimization problem is converted into an unconstrained problem, the built-in function fminum of matlab can be used for carrying out once unconstrained optimization on the target function R (beta).
4-8. if T ═ T, the best individuals in the T +1 th generation population are assignedTaking the final individual obtained by the algorithm as a fifth step; otherwise, the iteration number is added once, and t is t +1, and the steps 4-4 to 4-7 are executed.
And step five, inputting the 25 elements in the final individual obtained in the step four into the articulated coordinate measuring machine as a measuring machine kinematic parameter set to finish calibration.
In order to verify the rapid convergence of the algorithm, the IPDE algorithm and the DE algorithm calibrate the same set of calibration experimental data, and a comparison graph of the two algorithms is shown in FIG. 2. The comparison shows that the convergence rate of the invention is obviously faster than that of the DE algorithm. The resulting structural parameters of the two algorithms are shown in table 3.
TABLE 3 structural parameter values of articulated coordinate measuring machine
In order to verify the identification accuracy of the algorithm, 880 random points in a measurement space are simulated by adopting two groups of structural parameters obtained by calculation of the algorithm and the DE algorithm, and the measurement error (the deviation between the measured point and the measured average value of the point) compensated by the two calibration algorithms is measured and compared. The comparison graph of the measurement errors after the calibration of the invention and the DE algorithm is shown in FIG. 3, the result analysis is shown in Table 4, and the maximum measurement error, the minimum measurement error, the measurement average error and the standard deviation are respectively listed in Table 4.
TABLE 4 measurement error (mm) of two calibration algorithms
From the above results, the algorithm provided by the invention can effectively improve the measurement accuracy of the measuring machine.
The joint type coordinate measuring machine calibration method based on the IPDE algorithm utilizes the IPDE algorithm to calibrate, does not need a complex high-precision measuring instrument, has low cost and does not introduce secondary errors. The inner point method and the PSO algorithm are embedded into the DE algorithm, the optimization capability of the DE algorithm is improved by utilizing the rapid convergence of the PSO algorithm and the local optimization capability of the inner point method, experiments show that the IPDE algorithm has a better effect than the DE algorithm, the standard deviation of the measurement error is reduced by 0.0130mm, the standard deviation of the measurement error is reduced by 0.0152mm, and the average measurement precision is improved by 51.0%.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种土工织物厚度测定装置