Summary of the invention
In order to overcome above-mentioned technical disadvantages, the purpose of this invention is to provide a kind of method of calculating cylindrical part effect size.This method has not only improved the precision of surveying instrument measurement right cylinder effect size, and algorithm stability is good, counting yield is high, can be applied to its solid effect size calculation.
A kind of method of calculating cylindrical part effect size of the present invention be used for to be calculated cylindrical imperial palace and is connect size, mainly may further comprise the steps:
Step 1: tested cylinder is placed on the measuring table, in the measurement space rectangular coordinate system, measure and obtain the point on the periphery
,
=1,2 ...,
nRepresent the measuring point number and
nFor greater than 5 positive integer; All measuring points
Form the measuring point collection
Step 2: provide the parameter of cylinder at random, i.e. the axis of cylinder
LDirection vector
Carry out the rotational transform of coordinate system, make coordinate system
zAxle is parallel to cylinder axis
LDirection vector
After the coordinate transform, with measuring point
Be projected in
XoyIn the plane, obtain measuring point
Coordinate
All measuring points
Form the measuring point collection
Step 3: at point set
In, take out 3 measuring points arbitrarily, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
The iteration initial value.
Step 4: calculate the measuring point collection successively
In each measuring point to the center of circle
Distance; And record measuring point collection
In each measuring point to central coordinate of circle
The corresponding measuring point of the minor increment of distance obtains the contact point set of error containment region inner boundary
Step 5: the contact point set of error in judgement containment region inner boundary
In whether have only 1 contact point;
If have only 1 contact point, then this contact point is effective contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the contact point coordinate, jump to step 8;
If contact point quantity greater than 1, then jumps to next step.
Step 6: the contact point set of error in judgement containment region inner boundary
In whether have only 2 contact points;
If have only 2 contact points, then these 2 contact points are effective contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the middle point coordinate of 2 contact point lines, jump to step 8;
If contact point quantity greater than 2, then jumps to next step.
Step 7: calculate each contact point
The relative center of circle
The phasing degree
,
The phasing degree that has point of contact
Form set
, right
In element sort, obtain vector
, compute vector
In adjacent 2 phasing degree
Poor,
Quantity for contact point; Calculate
If,
, then satisfy the oxygon criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 effective contact points of contact point that inquire, all the other contact points are invalid contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the middle point coordinate of 2 effective contact point lines.
Step 8: calculate containment region successively and vary to and each noncontact measuring point
Center of circle virtual location during contact
Calculate each noncontact measuring point at first respectively
With the vertical centering control separated time of one of them effective contact point, calculate the vertical centering control separated time then and cross the center of circle
And direction vector is
The intersection point of straight line, be containment region and vary to and this measuring point
During contact, the virtual location in the center of circle
, all noncontact measuring point correspondences
Form set
, calculate each noncontact measuring point correspondence
To the center of circle
Distance
, all
Constitute set
, in set
In, reject
With
Incorgruous corresponding element, query set then
In minimum value, be the translation variation of containment region
According to the containment region variation
And moving direction vector
, calculate the coordinate in the center of circle
Forward step 4 to.
Step 9: carry out with step 2 in the coordinate transform of contrary, the measuring point coordinate reverts to original value, calculates
Coordinate after the coordinate transform
, be cylinder axis
LOn a bit, cylinder axis
LWith
Be direction vector.
Step 10: calculate the measuring point collection successively
In each measuring point to axis
LDistance; And record measuring point collection
In each measuring point to axis
LMinimum value and value, record is gathered for the contact point of containment region inner boundary apart from the measuring point set of minimum value correspondence
, the minimum value and value that records is the radius of cylinder
R
Step 11: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is 3;
If the quantity of contact point equals 3, then the butt contact coordinate conversion of carrying out makes coordinate system
zAxle forward and cylinder axis
Direction vector
In the same way and parallel, butt contact carries out ascending ordering by its z axial coordinate, makes
,
,
zAxial coordinate increases progressively, the direction vector of error containment region rotation change this moment
Equal axis
Direction vector
With
Vector multiplication cross; Rotation change angle is set
Initial value; Calculate
With
Dot product, if the dot product result equals 0, jump to step 18, if the dot product result is not equal to 0, jump to next step;
If the quantity of contact point is not 3, jump to step 14.
Step 12: calculate
Around
Rotation
Direction vector after the angle
Then, 3 contact points are projected in perpendicular to
The plane in, and the center of circle of calculating the circumscribed circle of 3 contact points, according to the circumcenter with
Determine the axis of postrotational cylinder
Step 13: calculate all noncontacts and put
Distance
If,
, then represent the variation deficiency, the anglec of rotation
Become
Otherwise, change excessively, all the other noncontact measuring points exceed containment region, the anglec of rotation
Become
Judge
Whether the difference of the iterative value that front and back are twice is less than the error permissible value of setting; If
Before and after twice the difference of iterative value less than setting
The error permissible value, then the 4th contact point found in explanation, then will
Assignment is given
, jump to step 10; If
The difference of the iterative value that front and back are twice is not less than setting
The error permissible value then jumps to step 12.
Step 14: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, set the cylindrical radius recruitment
Initial value, jump to next step;
If the quantity of contact point is not equal to 4, then jump to step 17.
Step 15:
Add current cylindrical radius
Obtain
, obtaining cylinder after the dimensional variations, its axis is
, each contact point is to axis
Distance equal
Relation, obtain following calculating formula,
Wherein
Be axis
Direction vector,
Be axis
On a bit, with
,
Be unknown quantity, obtain 4 quaternary nonlinear equations respectively, can solve 4 unknown quantitys by Nonlinear System of Equations, obtain the axis of cylinder
Step 16: calculate all noncontacts successively and put
Distance
, all noncontact measuring point correspondences
Form set
If,
+
, then represent the variation deficiency,
Become
If
+
, then change excessively, all the other noncontact measuring points exceed containment region,
Become
Judge
Before and after 2 times the difference of iterative value whether less than setting
The error permissible value; If
Before and after 2 times the difference of iterative value less than setting
The error permissible value illustrates and finds the 5th contact point, will
,
Assignment is given axis respectively
LParameter
,
, and judge whether to satisfy criterion, and then jump to step 18 if satisfy, if do not satisfy criterion, jump to step 10; If
The difference of the iterative value that front and back are 2 times is not less than setting
The error permissible value then jumps to step 15.
Step 17: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point jumps to step 10 less than 5;
If the quantity of contact point is more than or equal to 5, with in the contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, determine according to the method that the exploratory trace in the step 15,16 is adjusted
Judge
Whether less than setting
The error permissible value; If
Less than what set
The error permissible value judges whether to satisfy criterion, if satisfy then jump to step 18, if do not satisfy criterion, changes 1 combination, recomputates
, judge that again iteration is gone down successively; If
Greater than what set
The error permissible value is with what calculate
The parameter assignment give cylinder axis respectively
LParameter
,
, jump to step 10 then.
Step 18: the optimal value of output deviation from cylindrical form, cylindrical radius
RAnd cylinder axis
LParameter.
In the said method, described step 3 may be used solely to calculate maximum inscribed circle degree and the effect size of revolving parts cross section circle to step 8.
The another kind of method of calculating cylindrical part effect size of the present invention, be used for calculating the external size of cylindrical minimum, be characterized in connecing size calculation process basically identical with imperial palace, difference is to inquire about the mode of contact point, the change direction of containment region, comprises the steps:
Step 1: tested cylinder is placed on the measuring table, in the measurement space rectangular coordinate system, measure and obtain the point on the periphery
,
=1,2 ...,
nRepresent the measuring point number and
nFor greater than 5 positive integer; All measuring points
Form the measuring point collection
Step 2: provide the parameter of cylinder at random, i.e. the axis of cylinder
LDirection vector
Carry out the rotational transform of coordinate system, make coordinate system
zAxle is parallel to cylinder axis
LDirection vector
After the coordinate transform, with measuring point
Be projected in
XoyIn the plane, obtain measuring point
Coordinate
All measuring points
Form the measuring point collection
Step 3: at point set
In, take out 3 measuring points arbitrarily, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
The iteration initial value.
Step 4: calculate the measuring point collection successively
In each measuring point to the center of circle
Distance; And record measuring point collection
In each measuring point to central coordinate of circle
The corresponding measuring point of the ultimate range of distance obtains the contact point set that error contains area outer
Step 5: the contact point set of error in judgement containment region outer boundary
In whether have only 1 contact point;
If have only 1 contact point, then this contact point is effective contact point, the direction vector of containment region translation this moment
Equal the contact point coordinate and deduct central coordinate of circle
, jump to step 8;
If contact point quantity greater than 1, then jumps to next step.
Step 6: the contact point set of error in judgement containment region outer boundary
In whether have only 2 contact points;
If have only 2 contact points, then these 2 contact points are effective contact point, the direction vector of containment region translation this moment
The middle point coordinate that equals 2 contact point lines deducts central coordinate of circle
, jump to step 8;
If contact point quantity greater than 2, then jumps to next step.
Step 7: calculate each contact point
The relative center of circle
The phasing degree
,
The phasing degree that has point of contact
Form set
, right
In element sort, obtain vector
, compute vector
In adjacent 2 phasing degree
Poor,
Quantity for contact point; Calculate
If,
, then satisfy oxygon criterion or diameter criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 effective contact points of contact point that inquire, all the other contact points are invalid contact point, the direction vector of containment region translation this moment
The middle point coordinate that equals 2 effective contact point lines deducts the center of circle
Coordinate.
Step 8: calculate containment region successively and vary to and each noncontact measuring point
Center of circle virtual location during contact
Calculate each noncontact measuring point at first respectively
With the vertical centering control separated time of one of them effective contact point, calculate the vertical centering control separated time then and cross the center of circle
And direction vector is
The intersection point of straight line, be containment region and vary to and this measuring point
During contact, the virtual location in the center of circle
, all noncontact measuring point correspondences
Form set
, calculate each noncontact measuring point correspondence
To the center of circle
Distance
, all
Constitute set
, in set
In, reject
With
Incorgruous corresponding element, query set then
In minimum value, be the translation variation of containment region
According to the containment region variation
And moving direction vector
, calculate the coordinate in the center of circle
Forward step 4 to.
Step 9: carry out with step 2 in the coordinate transform of contrary, the measuring point coordinate reverts to original value, calculates
Coordinate after the coordinate transform
, be cylinder axis
LOn a bit, cylinder axis
LWith
Be direction vector.
Step 10: calculate the measuring point collection successively
In each measuring point to axis
LDistance; And record measuring point collection
In each measuring point to axis
LThe maximal value of distance, record is gathered for the contact point of containment region outer boundary apart from the measuring point set of maximal value correspondence
, the maximal value of the distance that records is the radius of cylinder
R
Step 11: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is 3;
If the quantity of contact point equals 3, then the butt contact coordinate conversion of carrying out makes coordinate system
zAxle forward and cylinder axis
Direction vector
In the same way and parallel, butt contact carries out ascending ordering by its z axial coordinate, makes
,
,
zAxial coordinate increases progressively, the direction vector of error containment region rotation change this moment
Equal axis
Direction vector
With
Vector multiplication cross; Rotation change angle is set
Initial value; Calculate
With
Dot product, if the dot product result equals 0, jump to step 18, if the dot product result is not equal to 0, jump to next step;
If the quantity of contact point is not 3, jump to step 14.
Step 12: calculate
Around
Rotation
Direction vector after the angle
Then, 3 contact points are projected in perpendicular to
The plane in, and the center of circle of calculating the circumscribed circle of 3 contact points, according to the circumcenter with
Determine the axis of postrotational cylinder
Step 13: calculate all noncontact measuring points and arrive
Distance
If,
, then represent the variation deficiency, the anglec of rotation
Become
If
, change excessively, all the other noncontact measuring points exceed containment region, the anglec of rotation
Become
Judge
Whether the difference of the iterative value that front and back are twice is less than the error permissible value of setting; If
Before and after twice the difference of iterative value less than setting
The error permissible value, then the 4th contact point found in explanation, then will
Assignment is given
, jump to step 10; If
The difference of the iterative value that front and back are twice is not less than setting
The error permissible value then jumps to step 12.
Step 14: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, set the cylindrical radius decrease
Initial value, jump to next step;
If the quantity of contact point is not equal to 4, then jump to step 17.
Step 15:
Deduct current cylindrical radius
Obtain
, obtaining cylinder after the dimensional variations, its axis is
, each contact point is to axis
Distance equal
Relation, obtain following calculating formula,
Wherein
Be axis
Direction vector,
Be axis
On a bit, with
,
Be unknown quantity, obtain 4 quaternary nonlinear equations respectively, can solve 4 unknown quantitys by Nonlinear System of Equations, obtain the axis of cylinder
Step 16: calculate all noncontacts successively and put
Distance
, all noncontact measuring point correspondences
Form set
If,
+
, then represent the variation deficiency,
Become
If
+
, then change excessively, all the other noncontact measuring points exceed containment region,
Become
Judge
Before and after 2 times the difference of iterative value whether less than setting
The error permissible value; If
Before and after 2 times the difference of iterative value less than setting
The error permissible value illustrates and finds the 5th contact point, will
,
Assignment is given axis respectively
LParameter
,
, and judge whether to satisfy criterion, and then jump to step 18 if satisfy, if do not satisfy criterion, jump to step 10; If
The difference of the iterative value that front and back are 2 times is not less than setting
The error permissible value then jumps to step 15.
Step 17: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point jumps to step 10 less than 5;
If the quantity of contact point is more than or equal to 5, with in the contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, determine according to the method that the exploratory trace in the step 15,16 is adjusted
Judge
Whether less than setting
The error permissible value; If
Less than what set
The error permissible value judges whether to satisfy criterion, if satisfy then jump to step 18, if do not satisfy criterion, changes 1 combination, recomputates
, judge that again iteration is gone down successively; If
Greater than what set
The error permissible value is with what calculate
The parameter assignment give cylinder axis respectively
LParameter
,
, jump to step 10 then.
Step 18: the optimal value of output deviation from cylindrical form, cylindrical radius
RAnd cylinder axis
LParameter.
In the said method, described step 3 may be used solely to calculate minimum circumscribed circle degree and the effect size of revolving parts cross section circle to step 8.
In the said method, described technical scheme can computer memory any direction linearity.
In the said method, described step 3 can be calculated any direction Line To Line parallelism error to step 8.At first, carry out Rotating Transition of Coordinate, the direction vector of datum line is parallel to
zJust, done corresponding rigid body rotation by the discrete point of survey line simultaneously, existed by the containing cylinder of survey line this moment
XoyThe plane inner projection is circle.Can use the step 3 described in the said method then to step 8, to being carried out match by the discrete point projection of survey line.
In the said method, described step 3 can be calculated any direction line opposite error of perpendicularity to step 8.At first carry out Rotating Transition of Coordinate, the normal vector of reference field is parallel to
zJust, done corresponding rigid body rotation by the discrete point of survey line simultaneously, existed by the containing cylinder of survey line this moment
XoyThe plane inner projection is circle.Can use the step 3 described in the said method then to step 8, to being carried out match by the discrete point projection of survey line.
The present invention on the optimization direction of cylindrical radius, carries out corresponding translation change, rotation change or translation change to containment region according to the feature of cylinder self, finally calculates cylinder parameter optimal value and deviation from cylindrical form optimal value.
Beneficial effect of the present invention is:
The cylindrical radius that calculates is optimal value, and the relative position of contact point satisfies criterion, and computational stability is good, counting yield is high.
To those skilled in the art, according to use design disclosed by the invention, can easily carry out various distortion and change to the present invention program, should be noted in the discussion above that all these distortion and change all should belong to scope of the present invention.
Embodiment
Embodiment 1:
A kind of method of calculating cylindrical part effect size be used for to be calculated cylindrical imperial palace and is connect size, as shown in Figure 1, comprises the steps:
Step 1: tested cylinder is placed on the measuring table, in the measurement space rectangular coordinate system, measure and obtain the point on the periphery
,
=1,2 ...,
nRepresent the measuring point number and
nFor greater than 5 positive integer; All measuring points
Form the measuring point collection
Step 2: provide the parameter of cylinder at random, i.e. the axis of cylinder
LDirection vector
Carry out the rotational transform of coordinate system, make coordinate system
zAxle is parallel to cylinder axis
LDirection vector
After the coordinate transform, with measuring point
Be projected in
XoyIn the plane, obtain measuring point
Coordinate
All measuring points
Form the measuring point collection
Step 3: at point set
In, take out 3 measuring points arbitrarily, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
The iteration initial value.
Step 4: calculate the measuring point collection successively
In each measuring point to the center of circle
Distance; And record measuring point collection
In each measuring point to central coordinate of circle
The corresponding measuring point of the minor increment of distance obtains the contact point set of error containment region inner boundary
Step 5: the contact point set of error in judgement containment region inner boundary
In whether have only 1 contact point;
If have only 1 contact point, then this contact point is effective contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the contact point coordinate, jump to step 8;
If contact point quantity greater than 1, then jumps to next step.
Step 6: the contact point set of error in judgement containment region inner boundary
In whether have only 2 contact points;
If have only 2 contact points, then these 2 contact points are effective contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the middle point coordinate of 2 contact point lines, jump to step 8;
If contact point quantity greater than 2, then jumps to next step.
Step 7: calculate each contact point
The relative center of circle
The phasing degree
,
The phasing degree that has point of contact
Form set
, right
In element sort, obtain vector
, compute vector
In adjacent 2 phasing degree
Poor,
Quantity for contact point; Calculate
If,
, then satisfy the oxygon criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 effective contact points of contact point that inquire, all the other contact points are invalid contact point, the direction vector of containment region translation this moment
Equal central coordinate of circle
Deduct the middle point coordinate of 2 effective contact point lines.
Step 8: calculate containment region successively and vary to and each noncontact measuring point
Center of circle virtual location during contact
Calculate each noncontact measuring point at first respectively
With the vertical centering control separated time of one of them effective contact point, calculate the vertical centering control separated time then and cross the center of circle
And direction vector is
The intersection point of straight line, be containment region and vary to and this measuring point
During contact, the virtual location in the center of circle
, all noncontact measuring point correspondences
Form set
, calculate each noncontact measuring point correspondence
To the center of circle
Distance
, all
Constitute set
, in set
In, reject
With
Incorgruous corresponding element, query set then
In minimum value, be the translation variation of containment region
According to the containment region variation
And moving direction vector
, calculate the coordinate in the center of circle
Forward step 4 to.
Step 9: carry out with step 2 in the coordinate transform of contrary, the measuring point coordinate reverts to original value, calculates
Coordinate after the coordinate transform
, be cylinder axis
LOn a bit, cylinder axis
LWith
Be direction vector.
Step 10: calculate the measuring point collection successively
In each measuring point to axis
LDistance; And record measuring point collection
In each measuring point to axis
LMinimum value and value, record is gathered for the contact point of containment region inner boundary apart from the measuring point set of minimum value correspondence
, the minimum value and value that records is the radius of cylinder
R
Step 11: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is 3;
If the quantity of contact point equals 3, then the butt contact coordinate conversion of carrying out makes coordinate system
zAxle forward and cylinder axis
Direction vector
In the same way and parallel, butt contact carries out ascending ordering by its z axial coordinate, makes
,
,
zAxial coordinate increases progressively, the direction vector of error containment region rotation change this moment
Equal axis
Direction vector
With
Vector multiplication cross; Rotation change angle is set
Initial value; Calculate
With
Dot product, if the dot product result equals 0, jump to step 18, if the dot product result is not equal to 0, jump to next step;
If the quantity of contact point is not 3, jump to step 14.
Step 12: calculate
Around
Rotation
Direction vector after the angle
Then, 3 contact points are projected in perpendicular to
The plane in, and the center of circle of calculating the circumscribed circle of 3 contact points, according to the circumcenter with
Determine the axis of postrotational cylinder
Step 13: calculate all noncontacts and put
Distance
If,
, then represent the variation deficiency, the anglec of rotation
Become
Otherwise, change excessively, all the other noncontact measuring points exceed containment region, the anglec of rotation
Become
Judge
Whether the difference of the iterative value that front and back are twice is less than the error permissible value of setting; If
Before and after twice the difference of iterative value less than setting
The error permissible value, then the 4th contact point found in explanation, then will
Assignment is given
, jump to step 10; If
The difference of the iterative value that front and back are twice is not less than setting
The error permissible value then jumps to step 12.
Step 14: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, set the cylindrical radius recruitment
Initial value, jump to next step;
If the quantity of contact point is not equal to 4, then jump to step 17.
Step 15:
Add current cylindrical radius
Obtain
, obtaining cylinder after the dimensional variations, its axis is
, each contact point is to axis
Distance equal
Relation, obtain following calculating formula,
Wherein
Be axis
Direction vector,
Be axis
On a bit, with
,
Be unknown quantity, obtain 4 quaternary nonlinear equations respectively, can solve 4 unknown quantitys by Nonlinear System of Equations, obtain the axis of cylinder
Step 16: calculate all noncontacts successively and put
Distance
, all noncontact measuring point correspondences
Form set
If,
+
, then represent the variation deficiency,
Become
If
+
, then change excessively, all the other noncontact measuring points exceed containment region,
Become
Judge
Before and after 2 times the difference of iterative value whether less than setting
The error permissible value; If
Before and after 2 times the difference of iterative value less than setting
The error permissible value illustrates and finds the 5th contact point, will
,
Assignment is given axis respectively
LParameter
,
, with each contact point difference substitution following formula,
Wherein
Be contact point
The relative phasing degree of axis, thus each contact point correspondence obtained
, construct following discriminant function,
Be the feasible zone of being determined by following inequality group:
In the following formula, first constraint is vector equation,
The zero column vector of expression 4 dimensions, second and third is constrained to numerical value equation,
Be the quantity of contact point, judgement is the optimum solution discriminant value
Whether equal 0, if
Equal 0 expression and satisfy criterion, jump to step 18, if
Be not equal to 0 sufficient criterion with thumb down, jump to step 10; If
The difference of the iterative value that front and back are 2 times is not less than setting
The error permissible value then jumps to step 15.
Step 17: judge the contact point set of containment region inner boundary
Whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point jumps to step 10 less than 5;
If the quantity of contact point is more than or equal to 5, with in the contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, determine according to the method that the exploratory trace in the step 15,16 is adjusted
Judge
Whether less than setting
The error permissible value; If
Less than what set
The error permissible value, the method for applying step 16 judges whether to satisfy criterion, if satisfy then jump to step 18, if do not satisfy criterion, changes 1 combination, recomputates
, judge that again iteration is gone down successively; If
Greater than what set
The error permissible value is with what calculate
The parameter assignment give cylinder axis respectively
LParameter
,
, jump to step 10 then.
Step 18: the optimal value of output deviation from cylindrical form, cylindrical radius
RAnd cylinder axis
LParameter.
Below example by experiment illustrates the validity that institute of the present invention publish method is calculated.
On measuring table, obtain 24 points on the cylindrical part surface, the measuring point coordinate is as shown in table 1.Use the method that the present invention announces, the radius of action that calculates maximum inscribed cylinder is 14.99985062mm, cylinder axis direction vector (0.000459923841223342,-0.000624025400837475,0.999999699531135), a point coordinate is (432.422127159553,137.332674827430 on the cylinder axis, 0.252514286852374), cylindricity is 0.03418mm.The effect of calculating is (among the figure, * is measuring point, and O is contact point) as shown in Figure 2, and the 5th, 10,14,16, No. 17 measuring point is contact point.Calculate each contact point respectively
Mapping, and the discriminant value of calculating optimum solution
J, as calculated
J=1.1382e-014 satisfies criterion, and the cylinder radius of action that calculates and deviation from cylindrical form are optimum solution.
The measuring point coordinate of table 1 cylinder (unit:
Mm)
The measuring point numbering
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
The measuring point numbering
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
1
|
447.47556 |
137.3431 |
-92.99958 |
13
|
447.48749 |
137.37276 |
-85.66769 |
2
|
440.00617 |
150.36197 |
-93.05586 |
14
|
439.98814 |
150.36122 |
-85.7225 |
3
|
424.95893 |
150.38625 |
-93.05948 |
15
|
424.97535 |
150.38594 |
-85.72581 |
4
|
417.45656 |
137.3433 |
-93.00753 |
16
|
417.4618 |
137.37364 |
-85.67423 |
5
|
425.00292 |
124.3788 |
-92.95196 |
17
|
424.98576 |
124.38214 |
-85.61846 |
6
|
439.9693 |
124.38485 |
-92.9484 |
18
|
439.98586 |
124.38661 |
-85.61504 |
7
|
439.98027 |
124.38204 |
-89.28298 |
19
|
439.99686 |
124.38255 |
-81.94842 |
8
|
424.99233 |
124.37691 |
-89.28517 |
20
|
424.96931 |
124.37052 |
-81.95173 |
9
|
417.46167 |
137.3578 |
-89.34018 |
21
|
417.459 |
137.38801 |
-82.007 |
10
|
424.96768 |
150.38132 |
-89.3926 |
22
|
424.96877 |
150.40734 |
-82.05929 |
11
|
439.9954 |
150.36113 |
-89.38932 |
23
|
439.98606 |
150.37835 |
-82.05603 |
12
|
447.48307 |
137.35783 |
-89.33457 |
24
|
447.49399 |
137.38793 |
-82.0014 |
Embodiment 2:
A kind of method of calculating cylindrical part effect size when be used for calculating the external size of cylindrical minimum, comprises the steps:
Step 1: tested cylinder is placed on the measuring table, in the measurement space rectangular coordinate system, measure and obtain the point on the periphery
,
=1,2 ...,
nRepresent the measuring point number and
nFor greater than 5 positive integer; All measuring points
Form the measuring point collection
Step 2: provide the parameter of cylinder at random, i.e. the axis of cylinder
LDirection vector
Carry out the rotational transform of coordinate system, make coordinate system
zAxle is parallel to cylinder axis
LDirection vector
After the coordinate transform, with measuring point
Be projected in
XoyIn the plane, obtain measuring point
Coordinate
All measuring points
Form the measuring point collection
Step 3: at point set
In, take out 3 measuring points arbitrarily, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
The iteration initial value.
Step 4: calculate the measuring point collection successively
In each measuring point to the center of circle
Distance; And record measuring point collection
In each measuring point to central coordinate of circle
The corresponding measuring point of the ultimate range of distance obtains the contact point set that error contains area outer
Step 5: the contact point set of error in judgement containment region outer boundary
In whether have only 1 contact point;
If have only 1 contact point, then this contact point is effective contact point, the direction vector of containment region translation this moment
Equal the contact point coordinate and deduct central coordinate of circle
, jump to step 8;
If contact point quantity greater than 1, then jumps to next step.
Step 6: the contact point set of error in judgement containment region outer boundary
In whether have only 2 contact points;
If have only 2 contact points, then these 2 contact points are effective contact point, the direction vector of containment region translation this moment
The middle point coordinate that equals 2 contact point lines deducts central coordinate of circle
, jump to step 8;
If contact point quantity greater than 2, then jumps to next step.
Step 7: calculate each contact point
The relative center of circle
The phasing degree
,
The phasing degree that has point of contact
Form set
, right
In element sort, obtain vector
, compute vector
In adjacent 2 phasing degree
Poor,
Quantity for contact point; Calculate
If,
, then satisfy oxygon criterion or diameter criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 effective contact points of contact point that inquire, all the other contact points are invalid contact point, the direction vector of containment region translation this moment
The middle point coordinate that equals 2 effective contact point lines deducts the center of circle
Coordinate.
Step 8: calculate containment region successively and vary to and each noncontact measuring point
Center of circle virtual location during contact
Calculate each noncontact measuring point at first respectively
With the vertical centering control separated time of one of them effective contact point, calculate the vertical centering control separated time then and cross the center of circle
And direction vector is
The intersection point of straight line, be containment region and vary to and this measuring point
During contact, the virtual location in the center of circle
, all noncontact measuring point correspondences
Form set
, calculate each noncontact measuring point correspondence
To the center of circle
Distance
, all
Constitute set
, in set
In, reject
With
Incorgruous corresponding element, query set then
In minimum value, be the translation variation of containment region
According to the containment region variation
And moving direction vector
, calculate the coordinate in the center of circle
Forward step 4 to.
Step 9: carry out with step 2 in the coordinate transform of contrary, the measuring point coordinate reverts to original value, calculates
Coordinate after the coordinate transform
, be cylinder axis
LOn a bit, cylinder axis
LWith
Be direction vector.
Step 10: calculate the measuring point collection successively
In each measuring point to axis
LDistance; And record measuring point collection
In each measuring point to axis
LThe maximal value of distance, record is gathered for the contact point of containment region outer boundary apart from the measuring point set of maximal value correspondence
, the maximal value of the distance that records is the radius of cylinder
R
Step 11: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is 3;
If the quantity of contact point equals 3, then the butt contact coordinate conversion of carrying out makes coordinate system
zAxle forward and cylinder axis
Direction vector
In the same way and parallel, butt contact carries out ascending ordering by its z axial coordinate, makes
,
,
zAxial coordinate increases progressively, the direction vector of error containment region rotation change this moment
Equal axis
Direction vector
With
Vector multiplication cross; Rotation change angle is set
Initial value; Calculate
With
Dot product, if the dot product result equals 0, jump to step 18, if the dot product result is not equal to 0, jump to next step;
If the quantity of contact point is not 3, jump to step 14.
Step 12: calculate
Around
Rotation
Direction vector after the angle
Then, 3 contact points are projected in perpendicular to
The plane in, and the center of circle of calculating the circumscribed circle of 3 contact points, according to the circumcenter with
Determine the axis of postrotational cylinder
Step 13: calculate all noncontact measuring points and arrive
Distance
If,
, then represent the variation deficiency, the anglec of rotation
Become
If
, change excessively, all the other noncontact measuring points exceed containment region, the anglec of rotation
Become
Judge
Whether the difference of the iterative value that front and back are twice is less than the error permissible value of setting; If
Before and after twice the difference of iterative value less than setting
The error permissible value, then the 4th contact point found in explanation, then will
Assignment is given
, jump to step 10; If
The difference of the iterative value that front and back are twice is not less than setting
The error permissible value then jumps to step 12.
Step 14: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, set the cylindrical radius decrease
Initial value, jump to next step;
If the quantity of contact point is not equal to 4, then jump to step 17.
Step 15:
Deduct current cylindrical radius
Obtain
, obtaining cylinder after the dimensional variations, its axis is
, each contact point is to axis
Distance equal
Relation, obtain following calculating formula,
Wherein
Be axis
Direction vector,
Be axis
On a bit, with
,
Be unknown quantity, obtain 4 quaternary nonlinear equations respectively, can solve 4 unknown quantitys by Nonlinear System of Equations, obtain the axis of cylinder
Step 16: calculate all noncontacts successively and put
Distance
, all noncontact measuring point correspondences
Form set
If,
+
, then represent the variation deficiency,
Become
If
+
, then change excessively, all the other noncontact measuring points exceed containment region,
Become
Judge
Before and after 2 times the difference of iterative value whether less than setting
The error permissible value; If
Before and after 2 times the difference of iterative value less than setting
The error permissible value illustrates and finds the 5th contact point, will
,
Assignment is given axis respectively
LParameter
,
, and the method for step 16 judges whether to satisfy criterion in the Application Example 1, then jumps to step 18 if satisfy, if do not satisfy criterion, jumps to step 10; If
The difference of the iterative value that front and back are 2 times is not less than setting
The error permissible value then jumps to step 15.
Step 17: judge the contact point set of containment region outer boundary
Whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point jumps to step 10 less than 5;
If the quantity of contact point is more than or equal to 5, with in the contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, determine according to the method that the exploratory trace in the step 15,16 is adjusted
Judge
Whether less than setting
The error permissible value; If
Less than what set
The error permissible value, the method for step 16 in the Application Example 1 judges whether to satisfy criterion, if satisfy then jump to step 18, if do not satisfy criterion, changes 1 combination, recomputates
, judge that again iteration is gone down successively; If
Greater than what set
The error permissible value is with what calculate
The parameter assignment give cylinder axis respectively
LParameter
,
, jump to step 10 then.
Step 18: the optimal value of output deviation from cylindrical form, cylindrical radius
RAnd cylinder axis
LParameter.
Below example by experiment illustrates the validity that institute of the present invention publish method is calculated.
On measuring table, obtain 24 points on the cylindrical part surface, the measuring point coordinate is as shown in table 2.Use the method that the present invention announces, the radius of action that calculates maximum inscribed cylinder is 11.9990887mm, cylinder axis direction vector (0.00111825745503225,0.000306176357337651,0.999999327877925), a point coordinate is (404.550573605996,126.630909902755 on the cylinder axis, 0.0446863090043053), cylindricity is 0.01475mm.The effect of calculating is (among the figure, * is measuring point, and ☆ is contact point) as shown in Figure 3, and the 1st, 5,14,19, No. 20 measuring point is contact point.Calculate each contact point respectively
Mapping, and the discriminant value of calculating optimum solution
J, as calculated
J=2.5931e-014 satisfies criterion, and the cylinder radius of action that calculates and deviation from cylindrical form are optimum solution.
The measuring point coordinate of table 2 cylinder (unit:
Mm)
The measuring point numbering
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
The measuring point numbering
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
1
|
416.50196 |
126.62207 |
-42.61907 |
13
|
416.50921 |
126.6223 |
-35.28499 |
2
|
410.49696 |
137.01158 |
-42.60984 |
14
|
410.50862 |
137.01277 |
-35.27656 |
3
|
398.50797 |
136.99947 |
-42.59217 |
15
|
398.51415 |
137.00824 |
-35.25898 |
4
|
392.51838 |
126.62312 |
-42.58308 |
16
|
392.51911 |
126.62285 |
-35.24976 |
5
|
398.49642 |
116.23034 |
-42.59151 |
17
|
398.50985 |
116.23174 |
-35.25818 |
6
|
410.49805 |
116.22964 |
-42.60937 |
18
|
410.50947 |
116.22875 |
-35.27604 |
7
|
410.50638 |
116.22778 |
-38.94272 |
19
|
410.51541 |
116.2301 |
-31.6094 |
8
|
398.50449 |
116.23247 |
-38.92521 |
20
|
398.51512 |
116.23001 |
-31.59186 |
9
|
392.52266 |
126.62223 |
-38.91647 |
21
|
392.51775 |
126.62182 |
-31.58326 |
10
|
398.50907 |
137.00335 |
-38.9252 |
22
|
398.51751 |
137.0105 |
-31.59181 |
11
|
410.50058 |
137.01238 |
-38.94329 |
23
|
410.51169 |
137.01117 |
-31.60976 |
12
|
416.50494 |
126.62223 |
-38.95278 |
24
|
416.51224 |
126.62176 |
-31.61957 |