Disclosure of Invention
The invention provides a numerical control machine tool positioning accuracy compensation method based on a position instruction frequency division algorithm, which can be used for measuring the positioning accuracy of a feeding shaft of the numerical control machine tool through a laser interferometer, and establishing the numerical control machine tool positioning accuracy compensation method based on the position instruction frequency division algorithm, is practical and reliable, and can improve the positioning accuracy of the numerical control machine tool.
The embodiment of the disclosure provides a numerical control machine tool positioning precision compensation method based on a position instruction frequency division algorithm, which comprises the following steps:
establishing an initial origin and a detection end point of the positioning precision detection of the feeding shaft of the numerical control machine tool;
measuring the length and positioning error of the detection stroke of the feeding shaft between the initial origin and the detection end by a laser interferometer;
According to the length of the detection stroke and the positioning error, iteratively optimizing a position instruction frequency division numerator and a position instruction frequency division denominator;
And compensating the positioning precision of the numerical control machine according to the position command frequency dividing numerator and the position command frequency dividing denominator after iterative optimization.
Preferably, the starting origin and the detection end point of the positioning precision detection of the feeding shaft of the numerical control machine tool are established according to a Cartesian coordinate system.
Preferably, iteratively optimizing the position command frequency division numerator and the position command frequency division denominator according to the length of the detection stroke and the positioning error includes:
determining an initial value b of a frequency division denominator of the position instruction;
calculating the initial ratio of the numerator to the denominator according to the initial values X1 and Y1 of the set position instruction frequency division numerator and denominator;
Calculating the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool according to the length of the detection stroke and the positioning error;
calculating the optimal ratio of the precompensated position instruction frequency division numerator to the denominator of the machine tool, and calculating the corresponding numerator and denominator according to the optimal ratio, namely the precompensated position instruction frequency division numerator and denominator;
calculating an iteration threshold according to the optimal ratio;
performing cyclic calculation for the following steps:
step position command frequency division denominator initial value b=b+1;
Calculating a corresponding position instruction frequency division molecule c according to the stepped b and the optimal ratio;
c is taken as an integer to obtain an integer frequency division molecule;
calculating the ratio of the integer frequency division molecules to the stepped b, and rounding the ratio to obtain a processed ratio;
And judging whether the processed ratio is equal to an iteration threshold, if not, stepping b, continuing iteration, and if so, outputting a final position instruction frequency division molecule and a final position instruction frequency division denominator.
Preferably, the ratio of the length of the linear axis movement of the pre-detection machine to the length of the linear axis movement of the actual machine is:
Z2=X3/((Y2-X2)/1000+X3)
Wherein Z2 is the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool, X3 is the length of the detection stroke, Y2 is the positioning error, and X2 is the initial value detected by the laser interferometer when the laser interferometer detects the zero point of the initial position of the linear axis of the machine tool.
Preferably, the optimal ratio of the machine tool precompensated position command frequency division numerator to the denominator is:
K=Z2*Z1
Wherein K is the optimal ratio of the frequency dividing numerator to the denominator of the position instruction after machine tool precompensation, Z2 is the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool, and Z1 is the initial ratio of the numerator to the denominator.
Preferably, the iteration threshold is:
F=Round(K,Y3)
where F is the iteration threshold, round () is the rounding function, Y3 is the rounding starting at the Y3 rd bit after the decimal point.
Preferably, the stepped b corresponds to a position command frequency division molecule:
c=K*b
and c is a position instruction frequency division molecule corresponding to the step b.
Preferably, the ratio after treatment is:
g=Round(e,Y3)
where g is the ratio after processing and e is the ratio of the integer divide-by-frequency molecules to b after stepping.
Preferably, the integer divide numerator is the final position command divide numerator, and the stepped b is the final position command divide denominator.
The beneficial effects are that:
1. The invention can effectively solve the problems of complex calculation for a plurality of times, repeated power-on and power-off of data modification and time for data re-acquisition of the conventional method, and effectively improves the laser detection efficiency.
2. The invention can optimize the position command frequency division numerator and the position command frequency division denominator parameters to optimize the laser detection data to an optimal state, and improve the quality of the laser detection compensation positioning precision.
The method and apparatus of the present invention have other features and advantages which will be apparent from or are set forth in detail in the accompanying drawings and the following detailed description, which are incorporated herein, and which together serve to explain certain principles of the present invention.
Detailed Description
Preferred embodiments of the present invention will be described in more detail below. While the preferred embodiments of the present invention are described below, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein.
In order to facilitate understanding of the solution and the effects of the embodiments of the present invention, a specific application example is given below. It will be understood by those of ordinary skill in the art that the examples are for ease of understanding only and that any particular details thereof are not intended to limit the present invention in any way.
Example 1
Fig. 1 shows a flowchart of the steps of a numerical control machine positioning accuracy compensation method based on a position instruction frequency division algorithm according to an embodiment of the present invention.
The numerical control machine tool positioning accuracy compensation method based on the position instruction frequency division algorithm comprises the steps of establishing an initial origin and a detection end point of numerical control machine tool feeding shaft positioning accuracy detection, measuring the length of a detection stroke and positioning errors of a feeding shaft between the initial origin and the detection end point through a laser interferometer, iteratively optimizing a position instruction frequency division molecule and a position instruction frequency division denominator according to the length of the detection stroke and the positioning errors, and compensating the positioning accuracy of the numerical control machine tool according to the iteratively optimized position instruction frequency division molecule and the position instruction frequency division denominator, wherein the step 103 is shown in the figure 1.
In one example, a starting origin and a detection end point of the numerical control machine tool feed shaft positioning accuracy detection are established in a Cartesian coordinate system.
In one example, iteratively optimizing the position command frequency division numerator, the position command frequency division denominator based on the length of the detection run and the positioning error includes:
determining an initial value b of a frequency division denominator of the position instruction;
calculating the initial ratio of the numerator to the denominator according to the initial values X1 and Y1 of the set position instruction frequency division numerator and denominator;
Calculating the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool according to the length of the detection stroke and the positioning error;
Calculating the optimal ratio of the precompensated position instruction frequency division numerator to the denominator of the machine tool, and calculating the corresponding numerator and denominator according to the optimal ratio, namely the precompensated position instruction frequency division numerator and denominator;
calculating an iteration threshold according to the optimal ratio;
performing cyclic calculation for the following steps:
step position command frequency division denominator initial value b=b+1;
calculating a corresponding position instruction frequency division molecule c according to the stepped b and the optimal ratio;
c is taken as an integer to obtain an integer frequency division molecule;
calculating the ratio of the integer frequency division molecules to the stepped b, and rounding the ratio to obtain a processed ratio;
And judging whether the processed ratio is equal to an iteration threshold, if not, stepping b, continuing iteration, and if so, outputting a final position instruction frequency division molecule and a final position instruction frequency division denominator.
In one example, the ratio of the length of the pre-detection machine linear axis movement to the length of the actual machine linear axis movement is:
Z2=X3/((Y2-X2)/1000+X3)
Wherein Z2 is the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool, X3 is the length of the detection stroke, Y2 is the positioning error, and X2 is the initial value detected by the laser interferometer when the laser interferometer detects the zero point of the initial position of the linear axis of the machine tool.
In one example, the machine tool precompensated position command frequency division numerator to denominator has an optimal ratio of:
K=Z2*Z1
Wherein K is the optimal ratio of the frequency dividing numerator to the denominator of the position instruction after machine tool precompensation, Z2 is the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool, and Z1 is the initial ratio of the numerator to the denominator.
In one example, the iteration threshold is:
F=Round(K,Y3)
where F is the iteration threshold, round () is the rounding function, Y3 is the rounding starting at the Y3 rd bit after the decimal point.
In one example, the stepped b corresponds to a position command frequency division numerator that is:
c=K*b
and c is a position instruction frequency division molecule corresponding to the step b.
In one example, the ratio after processing is:
g=Round(e,Y3)
where g is the ratio after processing and e is the ratio of the integer divide-by-frequency molecules to b after stepping.
In one example, the integer divide numerator is the final position command divide numerator and the stepped b is the final position command divide denominator.
Specifically, a starting origin and a detection end point of the positioning precision detection of the feeding shaft of the numerical control machine tool are established according to a Cartesian coordinate system.
Fig. 2 is a schematic diagram showing a detection result of positioning accuracy of a numerical control machine according to an embodiment of the present invention.
The length of the detection stroke of the feed shaft and the positioning error are measured between the start origin and the detection end point by a laser interferometer, and the positioning error is as shown in fig. 2.
Fig. 3 shows a schematic diagram of a flow of an iterative position instruction frequency division numerator, position instruction frequency division denominator algorithm in accordance with one embodiment of the present invention.
As shown in fig. 3, an original position command frequency division numerator X1, an original position command frequency division denominator Y1, a positioning error X2 of an initial origin, a positioning error Y2 of a detection end point, a length X3 of a detection stroke, a reserved bit number Y3 after calculating an intermediate value decimal point in an iterative process, and iteratively optimizing the position command frequency division numerator and the position command frequency division denominator according to the length and the positioning error of the detection stroke.
Determining an initial value b=1 of the position command frequency division denominator;
According to the set initial values X1 and Y1 of the position instruction frequency division numerator and denominator, the initial ratio Z1=X1/Y1 of the numerator and denominator is calculated, the difference between b and Y1 is that b is a calculated assumed value, the position instruction frequency division denominator value is assumed, and the initial value 1 is assumed, b=b+1, so that the b value is an iteration increasing value, b=1 or 2 or 3. That is, b is to be calculated by artificially assuming that the initial value 1 is increased, Y1 is an initial value existing in the system power-on, and the number is a default random number of the system.
Calculating the ratio Z2 = X3/((Y2-X2)/1000 + X3) of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool according to the length of the detection stroke and the positioning error, wherein X3 is the length of the linear axis movement of the laser interferometer to the machine tool, Y2 is the error value of the positioning precision of the laser interferometer detected by the laser interferometer when the linear axis movement of the laser interferometer to the end position, X2 is the initial value (generally 0) of the detection of the laser interferometer when the laser interferometer detects the zero point of the initial position of the linear axis of the machine tool, the result of (Y2-X2)/1000 is the value of the positioning precision of the laser interferometer detected by the laser interferometer and is converted into micrometers by 1000 conversion units, and the result of Z2 is the ratio of the length of the linear axis movement of the pre-detection machine tool to the length of the linear axis movement of the actual machine tool;
Calculating the optimal ratio K=Z2 of the frequency dividing numerator and the denominator of the position instruction after machine tool precompensation, and calculating the corresponding numerator and denominator according to the optimal ratio, namely the frequency dividing numerator and the denominator of the position instruction after precompensation, wherein the optimized numerator and denominator ratio is calculated according to the machine tool positioning precision error, and the new ratio can eliminate a part of positioning precision error value caused by the machine tool mechanical error, so that parameter compensation is carried out, and the moving distance of the linear axis of the machine tool is more accurate and more accurate.
Calculating an iteration threshold F=round (K, Y3) according to the optimal ratio, and determining the precision of the K value by customizing the Y3 value, wherein the larger the custom Y3 value is, the higher the F value precision is;
performing cyclic calculation for the following steps:
step position command frequency division denominator initial value b=b+1;
Calculating corresponding position instruction frequency division molecules c=k×b according to the stepped b and the optimal ratio;
Taking an integer from c to obtain an integer frequency division numerator d=round (c, 0);
calculating the ratio e=d/b of the integer frequency division molecule and the stepped b, and rounding the ratio to obtain a processed ratio g=round (e, Y3);
and judging whether the processed ratio is equal to an iteration threshold, if not, stepping b, continuing iteration, and if so, outputting an integer frequency dividing molecule as a final position instruction frequency dividing molecule, wherein b after stepping is the final position instruction frequency dividing denominator.
The algorithm is as follows:
b=1
Z1=X1/Y1
Z2=X3/((Y2-X2)/1000+X3)
K=Z2*Z1
F=Round(K,Y3)
Do
b=b+1
c=K*b
d=Round(c,0)
e=d/b
g=Round(e,Y3)
Loop Until g=F
fig. 4 shows a schematic diagram of a detection result of positioning accuracy of an optimized numerically-controlled machine tool according to an embodiment of the present invention.
And compensating the positioning precision of the numerical control machine according to the position command frequency division numerator and the position command frequency division denominator after iterative optimization, wherein the detection result is shown in figure 4.
It will be appreciated by persons skilled in the art that the above description of embodiments of the invention has been given for the purpose of illustrating the benefits of embodiments of the invention only and is not intended to limit embodiments of the invention to any examples given.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described.