Machine vision thread form angle compensation method
Technical Field
The invention belongs to the technical field of thread measurement, and relates to a machine vision thread form angle compensation method.
Background
Machine vision can realize screw thread parameter measurement with high efficiency. The thread connection is the most widely applied connection form in mechanical connection, the working surface of the thread connection is a thread flank, the thread flank has a helix angle along the axial direction and is influenced by the shielding or projection overlapping of an extending spiral surface, and the phenomenon of local distortion of thread profile visual images exists no matter a visual image taking a thread shaft section as a target or a visual image taking a thread method section as a target. Compared with a visual image taking the section of the threaded shaft as a target, the visual image taking the section of the threaded shaft as the target has smaller tooth profile distortion degree, but needs image acquisition equipment to perform mechanism adjustment according to the thread helix angle, so that the adjustment is not easy to be accurate, and the subsequent size conversion is very complicated. Therefore, in the actual machine vision thread parameter measurement, the thread profile image acquisition is still carried out in a mode of taking the thread shaft section as a target. However, in this way, the degree of thread profile distortion is high and a reasonably feasible compensation method for the thread profile distortion must be found to obtain an accurate thread profile dimension. The thread profile distortion is not only increased along with the increase of the helix angle, but also has close relation with the focusing precision level of an imager, the reflection degree of the thread profile surface, a light source and the nominal diameter of the thread. The compensation of thread profile distortion requires different compensation quantities for different lead angles, different measuring instruments, different thread profile reflection levels, different light sources and different nominal thread diameters, which makes thread profile compensation very difficult. The main reason for obtaining an accurate profile in thread measurement is the important parameter related to the thread profile angle. The thread profile angle can be directly calculated by utilizing the slope of the thread profile on two sides, but under the influence of a helix angle, the left side and the right side of a thread image are influenced by the shielding or projection overlapping of an extending helical surface. The corresponding thread form angle compensation amount of the thread part made of a certain material and specific parameters in the mechanical manufacturing process is found, so that the thread machining precision can be improved, and the online intelligent detection and manufacturing of the thread can be facilitated.
Disclosure of Invention
The invention aims to provide a machine vision thread form angle compensation method, which solves the problem that thread form angle parameters are difficult to obtain accurately in the current machine vision thread measurement.
The invention adopts the technical scheme that a machine vision thread form angle compensation method specifically comprises the following steps:
step 1, manufacturing a threaded part sample according to a target thread, manufacturing a thread b needing to be detected and a thread section annular groove a without a helix angle on the threaded part sample, and defining an upper thread tooth b according to the orientation of a thread imageTLower side thread bBUpper side thread section ring groove aTLower side screw section annular groove aB;
Step 2, acquiring a thread image on a thread part sample;
step 3, acquiring the slope of the thread image acquired in the step 2;
step 4, calculating the compensation quantity of the left flank angle and the right flank angle of the thread image according to the slope of the thread image obtained in the step 3;
step 5, calculating the average compensation quantity of the left flank angle and the right flank angle of the thread;
step 6, calculating the average compensation quantity C of the thread form angleα。
The present invention is also characterized in that,
the specific process of the step 2 is as follows: to the screw part sampleSide thread bTLower side thread bBAnd an upper side thread section annular groove aTLower side screw section annular groove aBAnd collecting images.
The specific process of the step 3 is as follows: paired screw threads bT、bBAnd a thread section annular groove aT、aBThe image is sequentially obtained according to the same binarization threshold value and boundary obtaining method to obtain the thread bTLeft flank slope KL1Right flank slope KR1Ring groove a of thread cross sectionTLeft flank slope KL0Right flank slope KR0Thread bBLeft flank slope K'L1And right flank slope K'R1And a thread section annular groove aBLeft flank slope K'L0And right flank slope K'R0。
The specific process of the step 4 is as follows:
for the upper side thread, the compensation quantity delta beta of the left flank angle of the thread1
Δβ1=|tan-1KL1-tan-1KL0|;
Right flank angle compensation delta gamma1
Δγ1=|tan-1KR1-tan-1KR0|;
Thread left flank angle compensation delta beta 'for lower thread'1
Δβ'1=|tan-1K'L1-tan-1K'L0|;
For lower thread, thread right flank angle compensation amount delta gamma'1
Δγ'1=|tan-1K'R1-tan-1K'R0|;
Compensation of the ith upper thread, left flanki
Δβi=|tan-1KLi-tan-1KL0|;
I upper side thread, right side offset Δ γi
Δγi=|tan-1KRi-tan-1KR0|;
Ith lower thread, left flank offset Δ β'i
Δβ'i=|tan-1K'Li-tan-1K'L0|;
No ith lower thread, right flank offset Δ γ'i
Δγ'i=|tan-1K'Ri-tan-1K'R0|。
The specific process of the step 5 is as follows:
average compensation of left flank angle
Average compensation amount of right flank angle of thread
The specific process of the step 6 is as follows:
calculating the average compensation quantity C of the thread profile angle according to the following formulaα;
That is to say
The invention has the following beneficial effects:
(1) the technical problem that the thread form angle parameters of machine vision cannot be accurately measured is solved;
(2) compared with the thread manufactured by using the same material and the same thread parameters and the cutter and the thread section circular groove without the helix angle, the method not only eliminates the influence of other factors, but also is easy to realize in the mechanical manufacturing, and has good compensation real-time property;
(3) and a feasible method is provided for realizing efficient online detection of the threads.
Drawings
FIG. 1 is a schematic view of a thread sample;
FIG. 2 is a schematic diagram of a thread profile image acquisition method in a machine vision thread profile angle compensation method according to the present invention;
FIG. 3 is a schematic diagram of a thread profile cross-section ring groove acquisition method in the thread profile angle compensation method for machine vision according to the present invention;
FIG. 4 is a schematic diagram of left and right side angles of an upper thread image and a thread cross-section ring groove image in a machine vision thread profile angle compensation method according to the present invention;
FIG. 5 is a schematic diagram of left and right side angles of an image of a lower thread and an image of a cross-sectional ring groove of a thread in a machine vision thread profile angle compensation method according to the present invention;
FIG. 6 is a schematic diagram of the average compensation amount of the thread form angle in the thread form angle compensation method for machine vision according to the present invention.
In the figure, 1, a clamp, 2, a threaded part sample, 3, an image sensor, 4, a parallel backlight source, and 5, a workbench is moved along the axial direction of the thread.
Detailed Description
The invention relates to a machine vision thread form angle compensation method, which specifically comprises the following steps:
step 1, as shown in fig. 1, a screw part sample 2 is manufactured according to a target screw thread (a screw thread which needs to detect and compensate a thread profile angle), a screw thread b which needs to be detected and a screw thread section annular groove a without a helix angle are manufactured on the screw part sample 2, and an upper side screw thread b is defined according to a screw thread image orientationTLower side thread bBUpper side thread section ring groove aTLower side screw section annular groove aB;
Step 2, as shown in fig. 2 and 3, the upper side thread b of the threaded part sample 2 is sequentially aligned by the fixture 1, the parallel backlight 4, the moving table 5 along the thread axis direction, and the image sensor 3TLower side thread bBAnd an upper side thread section annular groove aTLower side screw section annular groove aBCollecting an image;
the method comprises the steps of processing a thread section annular groove and a thread without a helix angle on the same diameter position of a thread part sample 2 by using the same thread processing cutter, positioning and clamping the thread part sample 2 by using a double-tip clamp 1, opening a parallel backlight source 4 positioned under the thread part sample 2, and intermittently moving a workbench 5 along the direction of a thread axis, so that an image sensor 3 positioned over the thread part sample 2 can sequentially acquire an upper side thread b on the thread part sample 2TAnd an upper side thread section annular groove aTThen moving the table 5 in a direction perpendicular to the axis of the screw thread, and then intermittently moving the table 5 in the direction of the axis of the screw thread, so that the image sensor 3 located directly above the screw part sample 2 can sequentially acquire the upper side screw thread b on the screw part sample 2BAnd an upper side thread section annular groove aBThe image of (a); b can also be obtained by moving intermittently along the thread axis direction once when the image sensor lens has a sufficient field of viewT、bT、bB、aBAnd (4) an image.
Step 3, for the obtained thread bT、bBAnd a thread section annular groove aT、aBThe image is sequentially obtained according to the same binarization threshold value and boundary obtaining method to obtain the thread bTLeft flank slope KL1Right flank slope KR1Ring groove a of thread cross sectionTLeft flank slope KL0Right flank slope KR0Thread bBLeft flank slope K'L1And right flank slope K'R1And a thread section annular groove aBLeft flank slope K'L0And right flank slope K'R0;
In fig. 4, the thread section ring groove profile boundary is drawn in the upper thread image; in FIG. 4, KL0、KR0Is the left side and the right side of the thread in the ring groove image of the cross section of the upper thread, alpha0The included angle of the left side and the right side of the thread cross section annular groove is the actual tooth form angle beta0Is a thread cross section ring grooveLeft-hand angle of the thread in the image, i.e. the actual left-hand angle of the thread, gamma0The right side angle of the thread in the thread cross section ring groove image is the actual right side angle; kL1、KR1Is the left side and the right side (namely the left side and the right side of the obtained thread) of the projected image of the thread, alpha1Is the included angle between the left side and the right side on the projected image of the thread, namely the obtained tooth form angle beta1Is the left side angle of the projected image of the thread, namely the obtained left side angle of the thread; gamma ray1Is the right angle of the projected image of the thread ridge, i.e. the obtained right angle of the thread ridge.
In fig. 5, the thread cross-section groove contour boundary is drawn in the lower thread image; in FIG. 5, K'L0、K’R0Is the left and right sides of the thread in the lower thread cross-section annular groove image, alpha'0Is the included angle between the left side and the right side of the thread tooth section annular groove, namely the actual tooth form angle beta'0Is the left side angle of the thread in the thread section ring groove image, namely the actual left side angle of the thread, gamma'0The right side angle of the thread in the thread cross section ring groove image is the actual right side angle; k'L1、K’R1Is the left side and the right side (namely the left side and the right side of the obtained thread tooth) of the thread tooth projection image alpha'1Is an included angle between the left side and the right side on a thread tooth projection image, namely an obtained tooth form angle beta'1Is the left side angle of the projected image of the thread, namely the obtained left side angle of the thread; gamma's'1Is the right angle of the projected image of the thread ridge, i.e. the obtained right angle of the thread ridge.
Step 4, calculating the compensation quantity of the left flank angle and the right flank angle of the thread;
order to
α0=β0+γ0
αi=βi+γi
α'i=β'i+γ'i
For the upper side thread, the compensation quantity delta beta of the left flank angle of the thread1
Δβ1=|tan-1KL1-tan-1KL0|;
Right flank angle compensation delta gamma1
Δγ1=|tan-1KR1-tan-1KR0|;
For the lower thread, the thread left flank angle compensation amount delta beta 'shown in FIG. 6'1
Δβ'1=|tan-1K'L1-tan-1K'L0|;
In fig. 6, the thread cross-section ring groove images are drawn on the left side in the upper side thread image and the lower side thread image of the thread image, respectively, for comparison; kL0、KR0Is the left side and the right side of the thread in the ring groove image of the cross section of the upper thread, alpha0The included angle of the left side and the right side of the thread cross section annular groove is the actual tooth form angle beta0Is the left side angle of the thread in the ring groove image of the thread section, namely the actual left side angle of the thread, gamma0The right side angle of the thread in the thread cross section ring groove image is the actual right side angle; kL1、KL2、KL3、……、KLn-1、KLnIs the left side of the projected image of the thread, KR1、KR2、KR3、……、KRn-1、KRnIs the right side (i.e. the left and right sides of the thread obtained) of the projected image of the thread, alpha1、α2、α3、……、αn-1、αnThe included angle between the left side and the right side on the projected image of the thread tooth is sequentially obtained, namely the obtained tooth form angle beta1、β2、β3、……、βn-1、βnIs the left side angle of the projected image of the thread, namely the obtained left side angle of the thread; gamma ray1、γ2、γ3、……、γn-1、γnIs the right side angle of the projected image of the thread, namely the obtained right side angle of the thread; k'L0、K’R0Is the left and right sides of the thread in the lower thread cross-section annular groove image, alpha'0Is the left side of the thread cross-section annular grooveThe side-to-right side included an angle, i.e. the actual profile angle, β'0Is the left side angle of the thread in the thread section ring groove image, namely the actual left side angle of the thread, gamma'0The right side angle of the thread in the thread cross section ring groove image is the actual right side angle; k'L1、K’L2、K’L3、……、K’Ln-1、K’LnThe left side (i.e. the obtained left side of the thread tooth), K 'of the lower side of the projected image of the thread tooth are in turn'R1、K’R2、K’R3、……、K’Rn-1、K’RnIn turn is the right side of the underside of the projected image of the thread (i.e. the right side of the thread obtained), α'1、α’2、α’3、……、α’n-1、α’nSequentially forming an included angle between the left side and the right side of the projected image of the thread tooth, namely obtaining a tooth form angle beta of the image of the lower side of the thread tooth'1、β’2、β’3、……、β’n-1、β’nThe left side angle of the lower side of the projected image of the thread, namely the left side angle of the obtained image of the lower side of the thread; gamma's'1、γ’2、γ’3、……、γ’n-1、γ’nSequentially obtaining the right side angle of the lower side of the projected image of the thread, namely the obtained right side angle of the lower side of the thread;
for lower thread, thread right flank angle compensation amount delta gamma'1
Δγ'1=|tan-1K'R1-tan-1K'R0|;
Compensation of the ith upper thread, left flanki
Δβi=|tan-1KLi-tan-1KL0|;
I upper side thread, right side offset Δ γi
Δγi=|tan-1KRi-tan-1KR0|;
Ith lower thread, left flank offset Δ β'i
Δβ'i=|tan-1K'Li-tan-1K'L0|;
No ith lower thread, right flank offset Δ γ'i
Δγ'i=|tan-1K'Ri-tan-1K'R0|。
Step 5, calculating the average compensation quantity of the left flank angle and the right flank angle of the thread, and the average compensation quantity of the left flank angle
Average compensation amount of right flank angle of thread
Step 6, calculating the average compensation quantity C of the thread form angleα;
That is to say
In the formula, alphai-adjacent left and right flank profile angles of the upper image of the thread (see b in fig. 1)TShown);
α0the included angle between the left side and the right side of the upper image of the annular groove of the thread section (as shown in a in figure 1)TShown);
α’i-adjacent left and right flank profile angles (as shown in fig. 1 b) of the thread underside imageBShown);
α’0the included angle between the left side and the right side of the image of the lower side of the annular groove of the thread section (as shown in a in figure 1)BShown).