A kind of method calculating function size of cylindrical part
Technical field
The present invention relates to a kind of method calculating function size of cylindrical part, belong to delicate metering and computer application field, the qualification that can be used for cylindrical geometric product in various situation detects, and provides guidance for the improvement of part process and processing technology.
Background technology
Cylinder is one of modal element in mechanical component, and its precision is on quality, the performance of product and have important impact serviceable life, and cylindrical acts is the important technological parameters of cylindrical component.Maximum inscribed cylinder and Minimum circumscribed cylinder are referred to as cylindrical action face, and the radius of maximum inscribed cylinder and the radius of Minimum circumscribed cylinder are referred to as cylindrical acts.
The computing method of maximum inscribed cylinder and Minimum circumscribed cylinder are the computing method set up based on the Cleaning Principle of smooth cylindrical ring gauge.Maximum inscribed cylinder embody measured hole by maximum fitted shaft, thus obtained deviation from cylindrical form can be considered the maximal clearance between measured hole and maximum fitted shaft; And Minimum circumscribed cylinder embody measured axis by minimum mating holes, thus obtained deviation from cylindrical form can be considered the maximal clearance between measured axis and minimum mating holes.
The calculating of right cylinder acts, belongs to non-differentiability complex optimization problem.At present, Chinese scholars mainly adopts traditional optimization, intelligent algorithm, computational geometry method etc.These methods owing to there is computational stability difference, counting yield is low, to adopting, a quantity is restricted, result of calculation is difficult to reach the defects such as exact solution, causes maximum inscribed cylinder method and Minimum circumscribed cylinder method to be difficult to apply in reality detects.Ripe least square method is generally all adopted to calculate the acts of cylindrical part approx in the market.
Summary of the invention
In order to overcome above-mentioned technical disadvantages, the object of this invention is to provide a kind of method calculating function size of cylindrical part.This method not only increases the precision that right cylinder acts measured by surveying instrument, and algorithm stability is good, counting yield is high, can be applied to the calculating of its solid acts.
A kind of method calculating function size of cylindrical part of the present invention, connecing size for calculating cylindrical most imperial palace, mainly comprising the following steps:
Step 1: be placed on measuring table by tested cylinder, measures and obtains the point on periphery in measurement space rectangular coordinate system
,
=1,2 ...,
nrepresent measure-point amount and
nfor being greater than the positive integer of 5; All measuring points
form measuring point collection
.
Step 2: the parameter providing cylinder at random, the i.e. 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 coordinate transform, by measuring point
be projected in
xoyin plane, obtain measuring point
coordinate
; All measuring points
form measuring point collection
.
Step 3: at point set
in, arbitrarily take out 3 measuring points, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
iteration initial value.
Step 4: calculate 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
measuring point corresponding to 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 only have 1 contact point;
If only have 1 contact point, then this contact point is the direction vector of effective contact point, now containment region translation
equal central coordinate of circle
deduct contact point coordinate, jump to step 8;
If contact point quantity is greater than 1, then jump to next step.
Step 6: the contact point set of error in judgement containment region inner boundary
in whether only have 2 contact points;
If only have 2 contact points, then these 2 contact points are the direction vector of effective contact point, now containment region translation
equal central coordinate of circle
deduct the middle point coordinate of 2 contact point lines, jump to step 8;
If contact point quantity is greater than 2, then jump to next step.
Step 7: calculate each contact point
the relative center of circle
phasing degree
,
The phasing degree had point of contact
form set
, right
in element sort, obtain vector
, compute vector
in adjacent 2 phasing degree
difference,
for the quantity of contact point; Calculate
if,
, then meet oxygon criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 the effective contact points of contact point inquired, all the other contact points are the direction vector of invalid contact point, now containment region translation
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
;
First each noncontact measuring point is calculated respectively
with the vertical centering control separated time of one of them effective contact point, then calculate vertical centering control separated time 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 points are corresponding
composition set
, calculate each noncontact measuring point corresponding
to the center of circle
distance
, all
form set
, in set
in, reject
with
incorgruous corresponding element, then query set
in minimum value, be the translation variation of containment region
; According to containment region variation
and moving direction vector
, calculate the coordinate in the center of circle
; Forward step 4 to.
Step 9: carry out the coordinate transform with contrary in step 2, measuring point coordinate reverts to original value, calculates
coordinate after coordinate transform
, be cylinder axis
lon a bit, cylinder axis
lwith
for direction vector.
Step 10: calculate measuring point collection successively
in each measuring point to axis
ldistance; And record measuring point collection
in each measuring point to axis
lthe minimum value of distance, test points set corresponding to institute's recording distance minimum value is the contact point set of containment region inner boundary
, the minimum value of institute's recording distance is the radius of cylinder
r.
Step 11: the contact point set judging 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 sequence by its z-axis coordinate, makes
,
,
's
zaxial coordinate increases progressively, and now error containment region rotates the direction vector of variation
equal axis
direction vector
with
vector multiplication cross; Arrange and rotate variation angle
initial value; Calculate
with
dot product, if dot product result equals 0, jump to step 18, if 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
rotate
direction vector after angle
; Then, 3 contact points are projected in perpendicular to
plane in, and calculate the center of circle of the circumscribed circle of 3 contact points, according to circumcenter with
determine the axis of postrotational cylinder
.
Step 13: calculate all noncontacts point and arrive
distance
if,
, then represent that variation is not enough, the anglec of rotation
become
; Otherwise change excessive, 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 the difference of iterative value of twice be less than setting
error permissible value, then illustrate and find the 4th contact point, then will
assignment is given
, jump to step 10; If
before and after the difference of iterative value of twice be not less than setting
error permissible value, then jump to step 12.
Step 14: the contact point set judging containment region inner boundary
whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, setting 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
, obtain cylinder after dimensional variations, its axis is
, each contact point is to axis
distance equal
relation, obtain following calculating formula,
Wherein
for axis
direction vector,
for axis
on a bit, with
,
for unknown quantity, obtain 4 quaternary nonlinear equations respectively, 4 unknown quantitys can be solved by Nonlinear System of Equations, obtain the axis of cylinder
.
Step 16: calculate all noncontacts point successively and arrive
distance
, all noncontact measuring points are corresponding
composition set
if,
+
, then represent that variation is not enough,
become
; If
+
, then change excessive, all the other noncontact measuring points exceed containment region,
become
;
Judge
before and after the difference of iterative value of 2 times whether be less than setting
error permissible value; If
before and after the difference of iterative value of 2 times be less than setting
error permissible value, illustrates and finds the 5th contact point, will
,
assignment is to axis respectively
lparameter
,
, and judge whether to meet criterion, if meet, jump to step 18, if do not meet criterion, jump to step 10; If
before and after the difference of iterative value of 2 times be not less than setting
error permissible value, then jump to step 15.
Step 17: the contact point set judging containment region inner boundary
whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point is less than 5, jump to step 10;
If the quantity of contact point is more than or equal to 5, with in contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, according in step 15,16 exploratory trace adjustment method determine
;
Judge
whether to be less than setting
error permissible value; If
be less than setting
error permissible value, judges whether to meet criterion, if met, jumps to step 18, if do not meet criterion, changes 1 combination, recalculate
, re-start judgement, iteration is gone down successively; If
be greater than setting
error permissible value, by what calculate
parameter assignment respectively give cylinder axis
lparameter
,
, then jump to step 10.
Step 18: the optimal value exporting deviation from cylindrical form, cylindrical radius
rand cylinder axis
lparameter.
In said method, described step 3, to step 8, may be used solely to the maximum inscribed circle degree and the acts that calculate revolving parts cross section circle.
The present invention's another kind calculates the method for function size of cylindrical part, for calculating cylindrical minimum external size, be characterized in that the computation process connecing size with most imperial palace is basically identical, difference is the inquiry mode of contact point, the variation direction of containment region, comprises the steps:
Step 1: be placed on measuring table by tested cylinder, measures and obtains the point on periphery in measurement space rectangular coordinate system
,
=1,2 ...,
nrepresent measure-point amount and
nfor being greater than the positive integer of 5; All measuring points
form measuring point collection
.
Step 2: the parameter providing cylinder at random, the i.e. 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 coordinate transform, by measuring point
be projected in
xoyin plane, obtain measuring point
coordinate
; All measuring points
form measuring point collection
.
Step 3: at point set
in, arbitrarily take out 3 measuring points, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
iteration initial value.
Step 4: calculate 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
measuring point corresponding to 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 only have 1 contact point;
If only have 1 contact point, then this contact point is the direction vector of effective contact point, now containment region translation
equal contact point coordinate and deduct central coordinate of circle
, jump to step 8;
If contact point quantity is greater than 1, then jump to next step.
Step 6: the contact point set of error in judgement containment region outer boundary
in whether only have 2 contact points;
If only have 2 contact points, then these 2 contact points are the direction vector of effective contact point, now containment region translation
the middle point coordinate equaling 2 contact point lines deducts central coordinate of circle
, jump to step 8;
If contact point quantity is greater than 2, then jump to next step.
Step 7: calculate each contact point
the relative center of circle
phasing degree
,
The phasing degree had point of contact
form set
, right
in element sort, obtain vector
, compute vector
in adjacent 2 phasing degree
difference,
for the quantity of contact point; Calculate
if,
, then meet oxygon criterion or diameter criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 the effective contact points of contact point inquired, all the other contact points are the direction vector of invalid contact point, now containment region translation
the middle point coordinate equaling 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
;
First each noncontact measuring point is calculated respectively
with the vertical centering control separated time of one of them effective contact point, then calculate vertical centering control separated time 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 points are corresponding
composition set
, calculate each noncontact measuring point corresponding
to the center of circle
distance
, all
form set
, in set
in, reject
with
incorgruous corresponding element, then query set
in minimum value, be the translation variation of containment region
; According to containment region variation
and moving direction vector
, calculate the coordinate in the center of circle
; Forward step 4 to.
Step 9: carry out the coordinate transform with contrary in step 2, measuring point coordinate reverts to original value, calculates
coordinate after coordinate transform
, be cylinder axis
lon a bit, cylinder axis
lwith
for direction vector.
Step 10: calculate 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, test points set corresponding to institute's recording distance maximal value is the contact point set of containment region outer boundary
, the maximal value of institute's recording distance is the radius of cylinder
r.
Step 11: the contact point set judging 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 sequence by its z-axis coordinate, makes
,
,
's
zaxial coordinate increases progressively, and now error containment region rotates the direction vector of variation
equal axis
direction vector
with
vector multiplication cross; Arrange and rotate variation angle
initial value; Calculate
with
dot product, if dot product result equals 0, jump to step 18, if 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
rotate
direction vector after angle
; Then, 3 contact points are projected in perpendicular to
plane in, and calculate the center of circle of the circumscribed circle of 3 contact points, according to circumcenter with
determine the axis of postrotational cylinder
.
Step 13: calculate all noncontact measuring points and arrive
distance
if,
, then represent that variation is not enough, the anglec of rotation
become
; If
, change excessive, 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 the difference of iterative value of twice be less than setting
error permissible value, then illustrate and find the 4th contact point, then will
assignment is given
, jump to step 10; If
before and after the difference of iterative value of twice be not less than setting
error permissible value, then jump to step 12.
Step 14: the contact point set judging containment region outer boundary
whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, setting 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
, obtain cylinder after dimensional variations, its axis is
, each contact point is to axis
distance equal
relation, obtain following calculating formula,
Wherein
for axis
direction vector,
for axis
on a bit, with
,
for unknown quantity, obtain 4 quaternary nonlinear equations respectively, 4 unknown quantitys can be solved by Nonlinear System of Equations, obtain the axis of cylinder
.
Step 16: calculate all noncontacts point successively and arrive
distance
, all noncontact measuring points are corresponding
composition set
if,
+
, then represent that variation is not enough,
become
; If
+
, then change excessive, all the other noncontact measuring points exceed containment region,
become
;
Judge
before and after the difference of iterative value of 2 times whether be less than setting
error permissible value; If
before and after the difference of iterative value of 2 times be less than setting
error permissible value, illustrates and finds the 5th contact point, will
,
assignment is to axis respectively
lparameter
,
, and judge whether to meet criterion, if meet, jump to step 18, if do not meet criterion, jump to step 10; If
before and after the difference of iterative value of 2 times be not less than setting
error permissible value, then jump to step 15.
Step 17: the contact point set judging containment region outer boundary
whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point is less than 5, jump to step 10;
If the quantity of contact point is more than or equal to 5, with in contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, according in step 15,16 exploratory trace adjustment method determine
;
Judge
whether to be less than setting
error permissible value; If
be less than setting
error permissible value, judges whether to meet criterion, if met, jumps to step 18, if do not meet criterion, changes 1 combination, recalculate
, re-start judgement, iteration is gone down successively; If
be greater than setting
error permissible value, by what calculate
parameter assignment respectively give cylinder axis
lparameter
,
, then jump to step 10.
Step 18: the optimal value exporting deviation from cylindrical form, cylindrical radius
rand cylinder axis
lparameter.
In said method, described step 3, to step 8, may be used solely to the minimum circumscribed circle degree and the acts that calculate revolving parts cross section circle.
In said method, described technical scheme, can computer memory any direction linearity.
In said method, described step 3, to step 8, can calculate any direction Line To Line parallelism error.First, carry out Rotating Transition of Coordinate, the direction vector of datum line is parallel to
zjust, made corresponding rigid body by the discrete point of survey line simultaneously and rotate, now existed by the containing cylinder of survey line
xoyplane inner projection is circle.Then can apply the step 3 described in said method to step 8, carry out matching to by the projection of the discrete point of survey line.
In said method, described step 3, to step 8, can calculate any direction line opposite error of perpendicularity.First carry out Rotating Transition of Coordinate, the normal vector of reference field is parallel to
zjust, made corresponding rigid body by the discrete point of survey line simultaneously and rotate, now existed by the containing cylinder of survey line
xoyplane inner projection is circle.Then can apply the step 3 described in said method to step 8, carry out matching to by the projection of the discrete point of survey line.
The present invention, according to the feature of cylinder self, on the optimal anchor direction of cylindrical radius, carries out corresponding translation variation to containment region, rotates variation or translation variation, finally calculate cylinder parameter optimal value and deviation from cylindrical form optimal value.
Beneficial effect of the present invention is:
The cylindrical radius calculated is optimal value, and the relative position of contact point meets criterion, and computational stability is good, counting yield is high.
To those skilled in the art, according to application design disclosed by the invention, easily can carry out various distortion and change to the present invention program, it should be noted that all these distortion and change all should belong to scope of the present invention.
Accompanying drawing explanation
Fig. 1 is that the most imperial palace of cylinder of the present invention connects radius calculation process flow diagram.
Fig. 2 is that the most imperial palace of cylinder of the present invention connects radius calculation design sketch.
Fig. 3 is the minimum external radius calculation design sketch of cylinder of the present invention.
Embodiment
Embodiment 1:
Calculate a method for function size of cylindrical part, connecing size for calculating cylindrical most imperial palace, as shown in Figure 1, comprising the steps:
Step 1: be placed on measuring table by tested cylinder, measures and obtains the point on periphery in measurement space rectangular coordinate system
,
=1,2 ...,
nrepresent measure-point amount and
nfor being greater than the positive integer of 5; All measuring points
form measuring point collection
.
Step 2: the parameter providing cylinder at random, the i.e. 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 coordinate transform, by measuring point
be projected in
xoyin plane, obtain measuring point
coordinate
; All measuring points
form measuring point collection
.
Step 3: at point set
in, arbitrarily take out 3 measuring points, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
iteration initial value.
Step 4: calculate 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
measuring point corresponding to 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 only have 1 contact point;
If only have 1 contact point, then this contact point is the direction vector of effective contact point, now containment region translation
equal central coordinate of circle
deduct contact point coordinate, jump to step 8;
If contact point quantity is greater than 1, then jump to next step.
Step 6: the contact point set of error in judgement containment region inner boundary
in whether only have 2 contact points;
If only have 2 contact points, then these 2 contact points are the direction vector of effective contact point, now containment region translation
equal central coordinate of circle
deduct the middle point coordinate of 2 contact point lines, jump to step 8;
If contact point quantity is greater than 2, then jump to next step.
Step 7: calculate each contact point
the relative center of circle
phasing degree
,
The phasing degree had point of contact
form set
, right
in element sort, obtain vector
, compute vector
in adjacent 2 phasing degree
difference,
for the quantity of contact point; Calculate
if,
, then meet oxygon criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 the effective contact points of contact point inquired, all the other contact points are the direction vector of invalid contact point, now containment region translation
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
;
First each noncontact measuring point is calculated respectively
with the vertical centering control separated time of one of them effective contact point, then calculate vertical centering control separated time 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 points are corresponding
composition set
, calculate each noncontact measuring point corresponding
to the center of circle
distance
, all
form set
, in set
in, reject
with
incorgruous corresponding element, then query set
in minimum value, be the translation variation of containment region
; According to containment region variation
and moving direction vector
, calculate the coordinate in the center of circle
; Forward step 4 to.
Step 9: carry out the coordinate transform with contrary in step 2, measuring point coordinate reverts to original value, calculates
coordinate after coordinate transform
, be cylinder axis
lon a bit, cylinder axis
lwith
for direction vector.
Step 10: calculate measuring point collection successively
in each measuring point to axis
ldistance; And record measuring point collection
in each measuring point to axis
lthe minimum value of distance, test points set corresponding to institute's recording distance minimum value is the contact point set of containment region inner boundary
, the minimum value of institute's recording distance is the radius of cylinder
r.
Step 11: the contact point set judging 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 sequence by its z-axis coordinate, makes
,
,
's
zaxial coordinate increases progressively, and now error containment region rotates the direction vector of variation
equal axis
direction vector
with
vector multiplication cross; Arrange and rotate variation angle
initial value; Calculate
with
dot product, if dot product result equals 0, jump to step 18, if 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
rotate
direction vector after angle
; Then, 3 contact points are projected in perpendicular to
plane in, and calculate the center of circle of the circumscribed circle of 3 contact points, according to circumcenter with
determine the axis of postrotational cylinder
.
Step 13: calculate all noncontacts point and arrive
distance
if,
, then represent that variation is not enough, the anglec of rotation
become
; Otherwise change excessive, 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 the difference of iterative value of twice be less than setting
error permissible value, then illustrate and find the 4th contact point, then will
assignment is given
, jump to step 10; If
before and after the difference of iterative value of twice be not less than setting
error permissible value, then jump to step 12.
Step 14: the contact point set judging containment region inner boundary
whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, setting 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
, obtain cylinder after dimensional variations, its axis is
, each contact point is to axis
distance equal
relation, obtain following calculating formula,
Wherein
for axis
direction vector,
for axis
on a bit, with
,
for unknown quantity, obtain 4 quaternary nonlinear equations respectively, 4 unknown quantitys can be solved by Nonlinear System of Equations, obtain the axis of cylinder
.
Step 16: calculate all noncontacts point successively and arrive
distance
, all noncontact measuring points are corresponding
composition set
if,
+
, then represent that variation is not enough,
become
; If
+
, then change excessive, all the other noncontact measuring points exceed containment region,
become
;
Judge
before and after the difference of iterative value of 2 times whether be less than setting
error permissible value; If
before and after the difference of iterative value of 2 times be less than setting
error permissible value, illustrates and finds the 5th contact point, will
,
assignment is to axis respectively
lparameter
,
, each contact point is substituted into following formula respectively,
Wherein
for contact point
the phasing degree of relative axis, thus it is corresponding to obtain each contact point
, construct following discriminant function,
the feasible zone determined by following inequality group:
In above formula, first constraint is vector equation,
represent zero column vector of 4 dimensions, second and third is constrained to numerical value equation,
for the quantity of contact point, judgement is optimum solution discriminant value
whether equal 0, if
equal 0 expression and meet criterion, jump to step 18, if
be not equal to 0 sufficient criterion with thumb down, jump to step 10; If
before and after the difference of iterative value of 2 times be not less than setting
error permissible value, then jump to step 15.
Step 17: the contact point set judging containment region inner boundary
whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point is less than 5, jump to step 10;
If the quantity of contact point is more than or equal to 5, with in contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, according in step 15,16 exploratory trace adjustment method determine
;
Judge
whether to be less than setting
error permissible value; If
be less than setting
error permissible value, the method for applying step 16 judges whether to meet criterion, if met, jumps to step 18, if do not meet criterion, changes 1 combination, recalculate
, re-start judgement, iteration is gone down successively; If
be greater than setting
error permissible value, by what calculate
parameter assignment respectively give cylinder axis
lparameter
,
, then jump to step 10.
Step 18: the optimal value exporting deviation from cylindrical form, cylindrical radius
rand cylinder axis
lparameter.
Below by way of experiment embodiment, the validity that institute of the present invention publish method calculates is described.
On measuring table, obtain 24 points on the surface at cylindrical part, measuring point coordinate is as shown in table 1.The method that application the present invention announces, the radius of action calculating maximum inscribed cylinder is 14.99985062mm, cylinder axis direction vector (-0.000459923841223342,-0.000624025400837475,0.999999699531135), on cylinder axis, a point coordinate is (432.422127159553,137.332674827430,0.252514286852374), cylindricity is 0.03418mm.As shown in Figure 2 (in figure, * is measuring point, and O is contact point), the 5th, 10,14,16, No. 17 measuring point is contact point to the effect calculated.To calculate each contact point respectively
map, and calculate the discriminant value of optimum solution
j, as calculated
j=1.1382e-014, meets criterion, and the cylinder radius of action calculated and deviation from cylindrical form are optimum solution.
The measuring point coordinate of table 1 cylinder (unit:
mm)
Measuring point is numbered
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
Measuring point is numbered
|
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:
Calculating a method for function size of cylindrical part, during for calculating cylindrical minimum external size, comprising the steps:
Step 1: be placed on measuring table by tested cylinder, measures and obtains the point on periphery in measurement space rectangular coordinate system
,
=1,2 ...,
nrepresent measure-point amount and
nfor being greater than the positive integer of 5; All measuring points
form measuring point collection
.
Step 2: the parameter providing cylinder at random, the i.e. 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 coordinate transform, by measuring point
be projected in
xoyin plane, obtain measuring point
coordinate
; All measuring points
form measuring point collection
.
Step 3: at point set
in, arbitrarily take out 3 measuring points, and calculate 3 measuring points and form leg-of-mutton circumcenter
, as the center of circle
iteration initial value.
Step 4: calculate 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
measuring point corresponding to 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 only have 1 contact point;
If only have 1 contact point, then this contact point is the direction vector of effective contact point, now containment region translation
equal contact point coordinate and deduct central coordinate of circle
, jump to step 8;
If contact point quantity is greater than 1, then jump to next step.
Step 6: the contact point set of error in judgement containment region outer boundary
in whether only have 2 contact points;
If only have 2 contact points, then these 2 contact points are the direction vector of effective contact point, now containment region translation
the middle point coordinate equaling 2 contact point lines deducts central coordinate of circle
, jump to step 8;
If contact point quantity is greater than 2, then jump to next step.
Step 7: calculate each contact point
the relative center of circle
phasing degree
,
The phasing degree had point of contact
form set
, right
in element sort, obtain vector
, compute vector
in adjacent 2 phasing degree
difference,
for the quantity of contact point; Calculate
if,
, then meet oxygon criterion or diameter criterion, jump to step 9; If
, inquiry
2 corresponding contact points, 2 the effective contact points of contact point inquired, all the other contact points are the direction vector of invalid contact point, now containment region translation
the middle point coordinate equaling 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
;
First each noncontact measuring point is calculated respectively
with the vertical centering control separated time of one of them effective contact point, then calculate vertical centering control separated time 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 points are corresponding
composition set
, calculate each noncontact measuring point corresponding
to the center of circle
distance
, all
form set
, in set
in, reject
with
incorgruous corresponding element, then query set
in minimum value, be the translation variation of containment region
; According to containment region variation
and moving direction vector
, calculate the coordinate in the center of circle
; Forward step 4 to.
Step 9: carry out the coordinate transform with contrary in step 2, measuring point coordinate reverts to original value, calculates
coordinate after coordinate transform
, be cylinder axis
lon a bit, cylinder axis
lwith
for direction vector.
Step 10: calculate 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, test points set corresponding to institute's recording distance maximal value is the contact point set of containment region outer boundary
, the maximal value of institute's recording distance is the radius of cylinder
r.
Step 11: the contact point set judging 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 sequence by its z-axis coordinate, makes
,
,
's
zaxial coordinate increases progressively, and now error containment region rotates the direction vector of variation
equal axis
direction vector
with
vector multiplication cross; Arrange and rotate variation angle
initial value; Calculate
with
dot product, if dot product result equals 0, jump to step 18, if 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
rotate
direction vector after angle
; Then, 3 contact points are projected in perpendicular to
plane in, and calculate the center of circle of the circumscribed circle of 3 contact points, according to circumcenter with
determine the axis of postrotational cylinder
.
Step 13: calculate all noncontact measuring points and arrive
distance
if,
, then represent that variation is not enough, the anglec of rotation
become
; If
, change excessive, 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 the difference of iterative value of twice be less than setting
error permissible value, then illustrate and find the 4th contact point, then will
assignment is given
, jump to step 10; If
before and after the difference of iterative value of twice be not less than setting
error permissible value, then jump to step 12.
Step 14: the contact point set judging containment region outer boundary
whether the quantity of middle contact point is 4;
If the quantity of contact point equals 4, setting 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
, obtain cylinder after dimensional variations, its axis is
, each contact point is to axis
distance equal
relation, obtain following calculating formula,
Wherein
for axis
direction vector,
for axis
on a bit, with
,
for unknown quantity, obtain 4 quaternary nonlinear equations respectively, 4 unknown quantitys can be solved by Nonlinear System of Equations, obtain the axis of cylinder
.
Step 16: calculate all noncontacts point successively and arrive
distance
, all noncontact measuring points are corresponding
composition set
if,
+
, then represent that variation is not enough,
become
; If
+
, then change excessive, all the other noncontact measuring points exceed containment region,
become
;
Judge
before and after the difference of iterative value of 2 times whether be less than setting
error permissible value; If
before and after the difference of iterative value of 2 times be less than setting
error permissible value, illustrates and finds the 5th contact point, will
,
assignment is to axis respectively
lparameter
,
, and in Application Example 1, the method for step 16 judges whether to meet criterion, if meet, jumps to step 18, if do not meet criterion, jumps to step 10; If
before and after the difference of iterative value of 2 times be not less than setting
error permissible value, then jump to step 15.
Step 17: the contact point set judging containment region outer boundary
whether the quantity of middle contact point is more than or equal to 5;
If the quantity of contact point is less than 5, jump to step 10;
If the quantity of contact point is more than or equal to 5, with in contact point set 4 be 1 combination, and with wherein 1 be combined as calculating object, according in step 15,16 exploratory trace adjustment method determine
;
Judge
whether to be less than setting
error permissible value; If
be less than setting
error permissible value, the method for step 16 in Application Example 1, judges whether to meet criterion, if met, jumps to step 18, if do not meet criterion, changes 1 combination, recalculate
, re-start judgement, iteration is gone down successively; If
be greater than setting
error permissible value, by what calculate
parameter assignment respectively give cylinder axis
lparameter
,
, then jump to step 10.
Step 18: the optimal value exporting deviation from cylindrical form, cylindrical radius
rand cylinder axis
lparameter.
Below by way of experiment embodiment, the validity that institute of the present invention publish method calculates is described.
On measuring table, obtain 24 points on the surface at cylindrical part, measuring point coordinate is as shown in table 2.The method that application the present invention announces, the radius of action calculating maximum inscribed cylinder is 11.9990887mm, cylinder axis direction vector (0.00111825745503225,0.000306176357337651,0.999999327877925), on cylinder axis, a point coordinate is (404.550573605996,126.630909902755,0.0446863090043053), cylindricity is 0.01475mm.As shown in Figure 3 (in figure, * is measuring point, and ☆ is contact point), the 1st, 5,14,19, No. 20 measuring point is contact point to the effect calculated.To calculate each contact point respectively
map, and calculate the discriminant value of optimum solution
j, as calculated
j=2.5931e-014, meets criterion, and the cylinder radius of action calculated and deviation from cylindrical form are optimum solution.
The measuring point coordinate of table 2 cylinder (unit:
mm)
Measuring point is numbered
|
xCoordinate
|
yCoordinate
|
zCoordinate
|
Measuring point is numbered
|
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 |