Thread pitch diameter calculation method based on spatial point cloud

By employing a non-contact measurement method based on spatial point clouds, utilizing a line laser scanner and optimization algorithms, the thread pitch diameter is automatically calculated, solving the problems of low efficiency and large errors in traditional measurements, and achieving high-precision and robust thread parameter measurement.

CN121858834APending Publication Date: 2026-04-14EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Traditional contact-based methods for measuring thread parameters are inefficient, difficult to measure internal threads with large depth-to-diameter ratios, and prone to errors.

Method used

A non-contact measurement method based on spatial point clouds is adopted. The three-dimensional point cloud data of the thread is acquired using a line laser scanner, noise points are removed by the DBSCAN algorithm, and the RANSAC and Levenberg-Marquardt algorithms are used for the mid-diameter point location and cylindrical surface fitting to achieve automated measurement.

Benefits of technology

It achieves high-precision, high-efficiency, and robust thread pitch diameter measurement, avoiding human error, and is suitable for measuring internal and external threads of various specifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858834A_ABST
    Figure CN121858834A_ABST
Patent Text Reader

Abstract

The invention provides a thread pitch diameter calculation method and equipment based on spatial point cloud, and belongs to the technical field of precision measurement. The method comprises the following steps: acquiring three-dimensional point cloud data of a measured thread through a laser scanner; preprocessing the point cloud data, including removing noise points based on spatial density filtering, and clustering and segmenting thread flank point clouds by using a DBSCAN algorithm based on a standard slope reference value; a random sampling consistency algorithm is used for fitting thread flank straight lines, intersection points of adjacent straight lines are calculated, and the position of a middle diameter point is determined by optimizing an objective function; performing coordinate system conversion on the intermediate diameter point cloud by using specified system parameters; and finally, all the pitch diameter points are fitted into an ideal cylindrical surface in a machine tool coordinate system by adopting a Levenberg-Marquardt algorithm, and the diameter of the cylinder obtained by fitting is the pitch diameter value of the thread. According to the invention, non-contact, automatic, high-precision and high-robustness measurement of the pitch diameter of the internal thread is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of precision measurement technology and relates to a method for calculating the pitch diameter of a thread based on spatial point clouds. Background Technology

[0002] Threads are the most basic and widely used connection and transmission components in the machinery industry. Their machining quality directly affects the assembly accuracy and reliability of equipment. Therefore, the precise measurement of thread machining parameters is crucial. Traditional contact measurement relies on manual operation, which is inefficient and very difficult to measure internal threads with large depth-to-diameter ratios. Summary of the Invention

[0003] The purpose of this invention is to provide a method for calculating the mean diameter of a thread based on spatial point clouds.

[0004] To address the above problems, this invention provides a method for calculating the pitch diameter of a thread based on spatial point clouds, comprising the following steps: Step 1: Data Acquisition and Preprocessing. The workpiece is fixed on a machine tool, and a line laser scanner is used to scan along the workpiece's axis. The machine tool's rotary axis drives the workpiece to rotate, acquiring the original 3D point cloud data of the thread being measured. The original 3D point cloud data is then processed, removing noise points and interference points, including those at the tooth crest and root, based on neighborhood radius thresholds and upper and lower limit thresholds. A standard slope reference value is introduced, and based on the spatial distribution characteristics of the point cloud, the DBSCAN algorithm is used to segment and cluster the thread flank point cloud, distinguishing the thread flank region for fitting the thread flank straight line in subsequent steps.

[0005] While laser scanners can obtain a large amount of data from a single scan, the data obtained in specific areas of the thread is noisy due to repeated laser reflections at the thread root. Extracting point clouds from the effective area is more beneficial for obtaining high-precision point cloud data. Furthermore, the acquired data also contains noise due to vibration and lighting conditions; properly denoised data better represents the surface features of the thread.

[0006] Step 2, Pitch Diameter Point Location. Based on the spatial distribution characteristics of the point cloud, an algorithm is used to segment the point cloud along the scan line, distinguishing the thread flank region. The Random Sample Consensus Algorithm (RANSAC) is used for piecewise straight line fitting to construct two straight lines on the thread flank. The intersection points of adjacent straight lines are calculated, and an optimization algorithm is used to iteratively optimize the parameters of the pitch diameter line to obtain the optimal result. The intersection point of the pitch diameter line and the flank line is the pitch diameter point on that scan line.

[0007] Here, since the thread pitch diameter is the diameter of the imaginary cylinder where the widths of the thread grooves and protrusions are equal in the axial section of the thread, the objective function is defined as minimizing the difference in the distance between the intersection points of the pitch diameter line and the adjacent straight line. The optimal result is that the widths of the thread grooves and protrusions are equal.

[0008] Step 3, coordinate transformation. Pre-specify the distance from the laser origin to the rotation axis. laser direction and the direction of the line connecting the laser origin and the axis of rotation The included angle Using specified system parameters, the coordinates of the mid-diameter point are transformed from the laser sensor coordinate system to a coordinate system with the workpiece rotation axis as the coordinate system. In the machine tool coordinate system of the axis.

[0009] Step 4, Pitch Diameter Calculation. In the turntable coordinate system, all pitch diameter points are considered to lie on an ideal cylindrical surface. The Levenberg-Marquardt algorithm is used to fit and optimize the diameter and axial direction of the cylindrical surface. The fitted cylindrical diameter is the pitch diameter of the thread.

[0010] Compared with existing methods, the advantages of the present invention are as follows: A method for measuring threads using a non-contact approach and calculating the thread pitch diameter using point calculation is proposed. This method employs a robust and versatile calculation method and utilizes a line laser scanner to perform high-efficiency and high-precision measurement of thread parameters, avoiding the difficulties and errors of manual operation. It provides a reliable method for measuring internal threads with large depth-to-diameter ratios.

[0011] (1) High precision and non-contact: The thread parameters are calculated using three-dimensional point cloud data, avoiding the errors caused by contact measurement. At the same time, high-precision measurement equipment is used to ensure the quality of the collected data. A large amount of point cloud data is used to equalize environmental noise and other errors. Mathematical models and optimization algorithms are used to ensure the accuracy of the results.

[0012] (2) Automation and high efficiency: The process is highly automated. After debugging, no manual intervention is required from data acquisition to result output, which improves the detection efficiency.

[0013] (3) Strong robustness: A large amount of point cloud data is collected, and noise and interference in the point cloud are removed by algorithms to ensure a large amount of reliable data. Robust algorithms such as RANSAC are adopted, and optimization algorithms are added to improve the reliability of the results. In principle, it is applicable to the measurement of internal and external threads of various specifications. By adjusting the scanning parameters and data processing thresholds, it can adapt to different measurement needs. Attached Figure Description

[0014] Figure 1 This is a flowchart of a thread pitch diameter calculation method based on spatial point cloud according to an embodiment of the present invention; Figure 2 For example, the point cloud data of the thread are collected according to one embodiment of the present invention; Figure 3 In response to Figure 2The median diameter is obtained by denoising, clustering, and fitting the point cloud of the spiral vein; Figure 4 The final fitted thread pitch diameter cylinder. Detailed Implementation

[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] like Figures 1 to 4 As shown, this invention provides a method for calculating the pitch diameter of a thread based on spatial point clouds, including: like Figure 2 As shown, in step S1, data acquisition and preprocessing: a laser scanner is used to acquire the three-dimensional point cloud of the thread surface of the workpiece corresponding to each scan line in the form of line scanning; the three-dimensional point cloud of the thread surface is preprocessed to obtain the tooth flank point cloud of the thread corresponding to each scan line. Here, the laser scanner is positioned directly over the threaded surface. As the workpiece rotates, each scan generates a point cloud of the corresponding thread flank.

[0017] A scan line is a set of point cloud data corresponding to a single line scan by a laser scanner. One scan will generate a point cloud of the tooth flank of the thread corresponding to one scan line. Step S2, pitch diameter point positioning: Based on the tooth flank point cloud of the thread corresponding to each scan line, the pitch diameter point on the corresponding scan line is obtained.

[0018] Step S21: For the tooth flank point cloud corresponding to each scan line obtained in step S1, a random sampling consensus algorithm is used to perform piecewise straight line fitting to obtain the tooth flank straight line. Here, the point cloud of the thread flanks corresponding to a single scan line contains multiple complete thread profiles of the thread under that scan line. For example, the left and right flanks of an internal thread constitute a complete thread profile, and multiple thread profiles are continuously distributed along the scan line. After performing linear fitting on the point cloud of the thread flanks of this scan line, multiple thread flank lines are obtained. Each thread profile corresponds to two thread flank lines, one for the left flank and one for the right flank. These lines are arranged sequentially along the length of the scan line.

[0019] Step S22: Calculate the intersection of adjacent straight lines on the same scan line, use the intersection as the sample point, fit the reference line, and then optimize the position of the mid-diameter line based on this. Here, adjacent lateral lines refer to the adjacent lateral lines of adjacent tooth types within the same scan line. For example, the right lateral line of the first tooth type and the left lateral line of the second tooth type are intersected at their intersection points, which are used as the tooth type feature points within the scan line.

[0020] Step S23: Using the reference line as the initial benchmark for the median diameter line, the optimization objective is to minimize the sum of the odd and even differences in the distance between the intersection points of the median diameter line and the adjacent lateral line. The position of the optimized median diameter line is determined by a nonlinear least squares optimization algorithm. Step S24: Calculate the coordinates of the intersection point of the optimized median diameter line and the lateral line, and use it as the median diameter point on the corresponding scan line; Here, the median diameter is derived from the reference line, which is the initial benchmark for the median diameter. The distance between the median diameter and the intersection point in the optimization objective refers to the distance from the reference line (or the median diameter to be optimized) to the intersection point of each tooth flank line. By adjusting the position of this line through nonlinear optimization, the difference in distance between the intersection point at odd and even positions and the line is minimized, and the final result is the optimized median diameter.

[0021] In step 2, after performing straight line fitting, finding intersection points, and optimizing the pitch diameter line on the point cloud corresponding to a single scan line, the intersection point of the pitch diameter line and the straight line of the thread tooth flank corresponding to this scan line is the pitch diameter point on this scan line. Step S3, Coordinate Transformation: Based on the specified line laser scanner pose parameters, transform the midpoints of all scan lines obtained in Step S2 from the laser sensor coordinate system to a coordinate system with the workpiece's axis of rotation as the coordinate system. Using the machine tool coordinate system of the axis, we obtain all the transformed mean diameter points; Here, a single scan line will cover multiple consecutive tooth profiles of the internal thread, for example, five complete tooth profiles along the length of the scan line. After processing in step 2, each complete tooth profile will yield two pitch diameter points. One scan line corresponds to multiple complete tooth profiles, and one complete tooth profile corresponds to two pitch diameter points. Therefore, one scan line will output multiple pitch diameter points, and the number of pitch diameter points should be twice the number of complete tooth profiles covered by the scan line.

[0022] For example, if a single scan line covers 8 complete internal thread profiles, after optimization in step 2, 16 mean diameter points will be obtained; in step 3, these 16 mean diameter points will be transformed together from the laser sensor coordinate system to the machine tool coordinate system.

[0023] In addition, the mid-diameter point of a single scan line can only reflect the local mid-diameter characteristics of that scan, and cannot cover the circumferential or axial distribution of the entire internal thread, so the fitting results will have deviations.

[0024] Multiple scan lines, such as 16 or 32 scan lines evenly distributed along the circumference of the internal thread, can form a comprehensive sampling of the entire internal thread's pitch diameter surface, ensuring that the fitted cylindrical surface conforms to the overall geometric characteristics of the internal thread. Point clouds are collected when the workpiece rotates, with a fixed time interval between each two collections. The number of scan lines collected in one revolution is related to the rotation speed and is not a fixed value.

[0025] Step S4, Pitch Diameter Calculation: In the machine tool coordinate system, all pitch diameter points after the transformation in step S3 are regarded as being located on an ideal cylindrical surface. The ideal cylindrical surface is fitted using a nonlinear least squares algorithm, and the diameter of the fitted cylindrical surface is the pitch diameter value of the internal thread.

[0026] Here, global point cloud data can be used to fit a global cylindrical surface, and the mid-diameter points of all scan lines can be integrated to obtain accurate and comprehensive internal thread mid-diameter values.

[0027] For example, if 20 scan lines are set along the circumference of the internal thread, and each scan line covers 10 complete tooth profiles (corresponding to 20 pitch diameter points), then step 4 will collect 20×20=400 pitch diameter points, fit the cylindrical surface based on these 400 points, and finally output the pitch diameter value.

[0028] This invention enables non-contact, automated, high-precision, and highly robust measurement of the pitch diameter of internal threads.

[0029] In one embodiment of the linear laser measurement method for the pitch diameter of an internal thread of the present invention, the three-dimensional point cloud data is preprocessed to obtain the tooth flank point cloud corresponding to each scanning line, including: Noise points in the 3D point cloud of the thread surface are removed based on the neighborhood density threshold, and the DBSCAN algorithm is used to cluster the 3D point cloud of the thread surface based on the slope reference value corresponding to the standard tooth profile angle, so as to segment the tooth flank point cloud corresponding to each scan line.

[0030] like Figure 2 As shown, in a linear laser measurement method for the pitch diameter of an internal thread in one embodiment of the present invention, noise points in the three-dimensional point cloud of the thread surface are removed based on a neighborhood density threshold, and the DBSCAN algorithm is used to cluster the three-dimensional point cloud of the thread surface based on the slope reference value corresponding to the standard tooth profile angle, segmenting the tooth flank point cloud corresponding to each scan line, including: S11, Threshold filtering and spatial density denoising: Based on the preset upper and lower limits of point cloud distribution, only the tooth flank point cloud within the three-dimensional point cloud of the thread surface is retained; based on the preset neighborhood radius threshold and minimum neighbor point number threshold, the tooth flank point cloud is traversed, and points whose number of points within the neighborhood radius threshold range is lower than the minimum neighbor point number threshold are identified as noise points, and the noise points are removed from the tooth flank point cloud to obtain the denoised tooth flank point cloud; S12, Tooth flank point cloud clustering: Determine the reference slope based on the standard tooth profile angle of the internal thread, calculate the intercept of each point in the denoised tooth flank point cloud relative to the reference slope, and use the intercept as a feature vector. Use the DBSCAN algorithm to cluster the feature vector to segment the tooth flank point cloud of each thread segment in a scan line.

[0031] Here, the tooth flank point cloud corresponding to each scan line includes: tooth flank point clouds of multiple thread segments, with each pair of thread segments corresponding to one tooth profile unit.

[0032] Looking along the thread axis, a thread is composed of a series of repeating tooth profile units arranged continuously. Each repeating unit is a segment of thread, and the cross-section of each segment of thread (perpendicular to the axis) is a complete tooth profile, such as the crest of a triangular tooth profile + left flank + root + right flank.

[0033] For example, an M10×1.5 internal thread has a pitch of 1.5mm. Every 1.5mm along the axial direction is a thread segment, corresponding to a complete triangular tooth profile. Multiple such units are arranged continuously to form the entire thread.

[0034] In a linear laser measurement method for the pitch diameter of an internal thread in one embodiment of the present invention, step S3 includes: Using the pre-specified distance from the laser origin to the axis of rotation The angle between the laser direction and the direction of the line connecting the laser origin and the axis of rotation. By using geometric relationships, the coordinates of the mid-diameter points of all scan lines in the laser sensor coordinate system are transformed to the machine tool coordinate system, thus obtaining all the transformed mid-diameters.

[0035] In a linear laser measurement method for the pitch diameter of an internal thread in one embodiment of the present invention, step S4 includes: Step S41: In the machine tool coordinate system, all the mid-diameter points after the transformation in step S3 are regarded as being located on an ideal cylindrical surface; Step S42: The Levenberg-Marquardt algorithm is used to fit the ideal cylindrical surface. By optimizing the coordinates of a point on the axis of the ideal cylinder, the axis direction vector, and the cylinder radius parameters, the sum of the squares of the distances from all mid-diameter points to the fitted cylindrical surface is minimized. Step S43: Use the diameter of the fitted cylindrical surface as the mean diameter of the internal thread.

[0036] In one embodiment of the present invention, the linear laser measurement method for the pitch diameter of internal threads includes an internal thread surface or an external thread surface. The present invention is also applicable to the measurement of the pitch diameter of internal and external threads.

[0037] like Figure 1 As shown, an embodiment of the present invention provides a method for calculating the pitch diameter of a thread based on spatial point clouds, comprising: Step S1: Determine the spatial distribution of the effective thread area based on the point cloud data features, and determine the lower limit threshold. and upper limit threshold Remove point clouds from the tooth crest and floor; perform density-based spatial filtering on the point cloud data; traverse the points in the point cloud and calculate the neighborhood of each point. Does not include points Number of internal neighbor points ,if Less than the minimum threshold If a point is identified as a noise point, it is removed, resulting in denoised point cloud data. For the denoised point cloud, a standard slope reference value is used... and Iterate through each point in the point cloud data and calculate the intercept of the point relative to the reference slope as the feature vector. The DBSCAN algorithm is used for clustering to segment the point cloud of each thread tooth flank. Step S2 involves multi-stage line fitting. First, using the random sampling consensus algorithm, based on the clustering results obtained in Step S1 (i.e., the point cloud of each thread flank segment), the thread flank straight line is segmented and fitted to obtain the intersection points of adjacent lines. Then, the upper and lower halves are distinguished, and the intersection points of the upper and lower halves are fitted separately to obtain the reference straight line. and The slope and intercept are averaged and used as the initial point for optimization. The objective function is to minimize the difference in the distance between the intersection points of the pitch diameter line and the adjacent straight line. The intersection point of the pitch diameter line and the thread tooth flank is the pitch diameter point on the scan line. Step S3, using the specified system parameters , By transforming the spatial coordinates, the coordinates of the mid-diameter point obtained in step S2 are converted from the laser sensor coordinate system to a coordinate system with the workpiece rotation axis as the coordinate system. In the machine tool coordinate system of the axis; Step S4: In the machine tool coordinate system, all pitch diameter points are considered to lie on an ideal cylindrical surface. The Levenberg-Marquardt algorithm is used to optimize and solve for the best cylindrical parameters, obtaining the optimal diameter and axial direction of the cylindrical surface. The fitted optimal cylindrical diameter is the pitch diameter of the thread.

[0038] Here, the present invention acquires three-dimensional point cloud data of the threaded workpiece under test based on line laser scanning. After denoising and filtering, the thread tooth flank point cloud is obtained. Feature vectors are added to the points in the point cloud using a reference threshold method. The thread tooth flank point cloud is clustered using the DBSCAN algorithm to obtain thread tooth flank point cloud with cluster labels. The thread tooth flank straight line is fitted using the RANSAC algorithm. The reference straight line is obtained by calculating the intersection point and fitting the straight line. The pitch diameter point on each scanning line is determined using an optimization method. Based on specified system parameters, the pitch diameter point is transformed from the sensor coordinate system to the machine tool coordinate system with the workpiece rotation axis as the reference through coordinate transformation. Finally, in the rotary table coordinate system, the cylindrical surface where the pitch diameter is located is fitted using a weighted nonlinear least squares algorithm to calculate the accurate thread pitch diameter value. This invention improves the accuracy and reliability of thread pitch diameter measurement through multi-stage data processing and optimization algorithms: First, denoising removes discrete noise points and interference areas with poor measurement quality, providing a solid data foundation for subsequent clustering analysis; introducing the intercept as a feature value for clustering results in clear features and avoids the classification confusion encountered when directly clustering on point cloud data; RANSAC linear fitting effectively avoids outlier interference in the data, ensuring the accuracy and robustness of the thread flank linear fitting; coordinate transformation is performed based on precise geometric relationships using specified system pose parameters; and axial projection weights and iterative optimization methods are introduced simultaneously in the cylindrical fitting stage, further improving the accuracy of pitch diameter calculation.

[0039] In one embodiment of the thread pitch diameter calculation method based on spatial point cloud of the present invention, step S1 includes: S11, acquire the overall point cloud data of the thread to be tested, determine the spatial distribution of the effective thread area based on the characteristics of the point cloud data, and determine the lower limit threshold. and upper limit threshold Remove point clouds from the tooth crest and floor; perform density-based spatial filtering on the point cloud data, and based on the assumption that the local density around the effective data points is high, perform further filtering on the first... Point cloud obtained during the second scan any point in Define its neighborhood For Centered on, with The set of all points within a circular region of radius : ; in, It is a point and points The Euclidean distance between them can be calculated using the following formula: ; Traverse the points in the point cloud and calculate the neighborhood of each point. Does not include points Number of internal neighbor points .if Less than the minimum threshold If the point is identified as a noise point, it is removed to obtain the denoised point cloud data.

[0040] S12, for the point cloud obtained after denoising, create a standard slope reference value based on the standard tooth profile angle. and , respectively corresponding to angles and Traverse each point in the point cloud data. Calculation points Intercept relative to the reference slope As feature vectors : ; The DBSCAN algorithm is used to analyze the feature vectors. Clustering is performed, and the point cloud distribution density is used to segment the point cloud of each thread tooth side.

[0041] In one embodiment of the thread pitch diameter calculation method based on spatial point cloud of the present invention, step S2 includes: S21, perform linear fitting on the thread flank point cloud. A random sampling consensus algorithm is used for fitting; firstly, several points are randomly selected from the thread flank point cloud to form a random dataset. Calculate and determine model parameters That is, the slope and intercept of the fitted line; given a distance threshold All parameters in the random dataset related to the model parameters The distance is less than The points constitute the current interior point set. : ; in, For the side point of the tooth cloud Points The perpendicular distance to the current line.

[0042] By iterating in sequence, the largest set of interior points is found, and the optimal model is retained, which is the fitted line.

[0043] S22, calculate the intersection points of adjacent thread flank lines, distinguish between the upper and lower halves, and use the RANSAC algorithm to fit the intersection points of the upper and lower halves respectively to obtain the reference lines. and The slope and intercept.

[0044] S23, determine the final parameters of the median diameter using nonlinear least squares optimization. First, obtain the straight line from step S22. and The slope and intercept determine the slope of the median diameter. and intercept The initial pitch diameter position is used as the target for optimization. Since the pitch diameter is the diameter of the imaginary cylinder where the widths of the thread grooves and protrusions are equal in the axial section of the thread, the objective function is to minimize the difference in the distance between the intersection points of the pitch diameter and the adjacent straight lines. The optimal result is that the widths of the thread grooves and protrusions are equal.

[0045] First, calculate the median diameter in sequence. Other effective thread flank straight lines intersection coordinate : ; It is the sequence number of the effective tooth lateral line; Sort the obtained coordinates in numerical order: And calculate the distance between adjacent intersection points. , This refers to the index of adjacent intersection points. The distance sequence is divided into two groups according to odd and even indices and summed. This sum represents the width of the current pitch diameter within the thread axial section, along with the widths of the thread grooves and protrusions. The objective function is set to ensure that the widths of the thread grooves and protrusions within the thread axial section are equal, i.e., minimizing the difference between the sum of odd and even distance groups. Optimize the position of the mid-diameter line to find the optimal one. and This ensures that the intersection points are evenly distributed along the X-axis, guaranteeing an ideal position for the median diameter.

[0046] Odd number groups: D1, D3, D5..., corresponding to the convex width of the thread; Even array: D2, D4, D6..., corresponding to the groove width of the thread.

[0047] S24 calculates the coordinates of the intersection of the pitch diameter line and the thread flank, which is the point cloud coordinates of the scan line located on the pitch diameter line.

[0048] In one embodiment of the thread pitch diameter calculation method based on spatial point cloud of the present invention, step S3 involves using specified system parameters. , By transforming the spatial coordinates, the coordinates of the mid-diameter point obtained in step S2 are converted from the laser sensor coordinate system to a coordinate system with the workpiece rotation axis as the coordinate system. The machine tool coordinate system of the axes includes: S31 specifies the pose of the line laser scanner in the machine tool coordinate system, including the distance from the laser origin to the rotary axis. laser direction and the direction of the line connecting the laser origin and the axis of rotation The included angle ; S32, sequentially transforms each point in the point cloud. (Aligns laser scanning points) , The spatial relationship between the laser scanner, the measured point, and the machine tool's rotary axis can be transformed into linear laser scanning points using the law of cosines. Distance to the machine tool's rotary axis In addition to the rotation angle and This allows the point cloud coordinates to be transformed to a coordinate system with the workpiece's rotation axis as the reference point. In the machine tool coordinate system of the axis. Wherein, for any point in the point cloud... and specified parameters and any point Distance from the machine tool's rotary axis The calculation formula is: .

[0049] In one embodiment of the thread pitch diameter calculation method based on spatial point clouds of the present invention, step S4 involves treating all pitch diameter points as located on an ideal cylindrical surface in the machine tool coordinate system, fitting the optimal cylindrical parameters, and the diameter of this surface is the thread pitch diameter. Specific implementation steps include: S41 defines seven parameters: a point on the cylinder's axis, the direction vector of the cylinder's axis, and the cylinder's radius, used to characterize the cylinder containing the mean diameter of the internal thread in three-dimensional space. Specifically, let the coordinates of a point on the cylinder's axis be... The direction vector is The radius of the cylinder is The initial cylinder can be determined.

[0050] S42, Define an optimization problem: find the optimal parameters that minimize the distance difference between all data points and the cylinder surface. The cylinder radius is obtained using a nonlinear least squares method. The mean diameter of the internal thread is set to twice the optimal cylinder radius R (i.e., diameter 2R).

[0051] The above method for extracting the thread pitch diameter consists of four stages. The first stage removes endpoints and discrete noise based on threshold and spatial density methods, clusters the straight lines on the thread flank, and adds cluster labels to each straight line for subsequent use. The second stage performs piecewise straight line fitting and calculates the pitch diameter line position through nonlinear optimization. The third stage performs coordinate transformation. The fourth stage uses nonlinear optimization to obtain the thread pitch diameter.

[0052] Specifically, to verify the effectiveness of the method provided in this example, a standard external thread was used for experimental verification. The threaded workpiece was rotated by a turntable, and the rotation angle and measurement data from a line laser scanner were collected. To obtain the overall point cloud information of the thread, such as Figure 2 The data shown is the complete measurement data, including the complete thread morphology, the poorly measured tooth root, and other noises other than the thread surface.

[0053] Figure 3 In response to Figure 2 The result of calculating the median diameter using a single scan line is shown in the figure. Figure 4 This is a diagram of the cylinder with the median diameter obtained after spatial coordinate transformation and fitting optimization. Figure 4 Experimental results show that the method provided by the present invention can effectively eliminate the interference of noise points. By using machine tool rotation and laser scanning to obtain point clouds, the thread pitch diameter parameters can be obtained, demonstrating the convenience of the method provided by the present invention.

[0054] According to another aspect of the present invention, a computer-readable storage medium is also provided, having stored thereon computer-executable instructions, wherein when executed by a processor, the computer-executable instructions cause the processor to perform the method described in any of the above embodiments.

[0055] According to another aspect of the present invention, a calculator device is also provided, comprising: Processor; and A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in any of the above embodiments.

[0056] In summary, the method provided by this invention can effectively remove noise and extract the thread pitch diameter parameter through multi-stage fitting. The relevant parameters involved in the calculation process are automatically extracted by pre-setting and adaptive generation.

[0057] This specification provides a progressive description of the disclosed embodiments, with each embodiment emphasizing its unique features that distinguish it from other embodiments. For the same or similar parts between the embodiments, reference can be made to each other.

[0058] Those skilled in the art will understand that the units and algorithm steps in the various examples described in the embodiments herein can be implemented through hardware design, computer software or programs, or a combination of both. To clearly illustrate the interchangeability between hardware and program algorithms, the components and steps of the examples have been generally described above in terms of their functionality. Whether this function is implemented in hardware or software depends on the application scenario and design constraints of the specific technical solution. Those skilled in the art can implement the function using different methods for each specific application scenario, but such implementations should be considered to be included within the scope of this invention.

[0059] It is obvious that those skilled in the art can make various modifications and alterations to this invention without departing from its spirit and scope. Therefore, this invention is also intended to encompass any such modifications and alterations that fall within the scope defined by the claims of this invention and their equivalents.

Claims

1. A method for calculating the pitch diameter of a thread based on spatial point clouds, characterized in that, include: Step S1: Use a laser scanner to obtain the three-dimensional point cloud of the threaded surface of the workpiece corresponding to each scanning line in the form of line scanning; The three-dimensional point cloud of the thread surface is preprocessed to obtain the tooth flank point cloud of the thread corresponding to each scan line; Step S2: Based on the tooth flank point cloud of the thread corresponding to each scan line, obtain the mid-diameter point on the corresponding scan line. Step S3: Based on the specified line laser scanner pose parameters, transform the mid-diameter points of all scan lines obtained in step S2 from the laser sensor coordinate system to a coordinate system with the workpiece's rotation axis as the coordinate system. Using the machine tool coordinate system of the axis, we obtain all the transformed mean diameter points; Step S4: In the machine tool coordinate system, all the pitch diameter points after the transformation in step S3 are regarded as being located on an ideal cylindrical surface. The ideal cylindrical surface is fitted using a nonlinear least squares algorithm. The diameter of the fitted cylindrical surface is the pitch diameter value of the internal thread.

2. The linear laser measurement method for the pitch diameter of internal threads according to claim 1, characterized in that, Step S1, preprocessing the three-dimensional point cloud data to obtain the tooth lateral point cloud corresponding to each scan line, including: Noise points in the 3D point cloud of the thread surface are removed based on the neighborhood density threshold, and the DBSCAN algorithm is used to cluster the 3D point cloud of the thread surface based on the slope reference value corresponding to the standard tooth profile angle, so as to segment the tooth flank point cloud corresponding to each scan line.

3. The linear laser measurement method for the mean diameter of internal threads according to claim 2, characterized in that, Noise points in the 3D point cloud of the thread surface are removed based on a neighborhood density threshold. Then, based on the slope reference value corresponding to the standard tooth profile angle, the DBSCAN algorithm is used to cluster the 3D point cloud of the thread surface, segmenting the tooth flank point cloud corresponding to each scan line, including: S11, based on the preset upper and lower limits of the point cloud distribution, only the tooth flank point cloud within the three-dimensional point cloud of the thread surface is retained; based on the preset neighborhood radius threshold and minimum neighbor point number threshold, the tooth flank point cloud is traversed, and points whose number of points within the neighborhood radius threshold range is lower than the minimum neighbor point number threshold are identified as noise points, and the noise points are removed from the tooth flank point cloud to obtain the denoised tooth flank point cloud. S12. Determine the reference slope based on the standard tooth profile angle of the internal thread, calculate the intercept of each point in the denoised tooth flank point cloud relative to the reference slope, and use the intercept as a feature vector. Use the DBSCAN algorithm to cluster the feature vector to segment the tooth flank point cloud of each thread segment in a scan line.

4. The linear laser measurement method for the mean diameter of internal threads according to claim 1, characterized in that, Step S2 includes: S21, For the tooth lateral point cloud corresponding to each scan line obtained in step S1, a random sampling consensus algorithm is used to perform piecewise straight line fitting to obtain the tooth lateral line; S22, calculate the intersection of adjacent straight lines on the same scan line, use the intersection as the sample point, fit the reference line, and then optimize the position of the mid-diameter line based on this. S23, the reference line is used as the initial reference of the median diameter line. The optimization objective is to minimize the sum of the odd and even differences of the distance between the intersection points of the median diameter line and the adjacent tooth lateral lines. The position of the optimized median diameter line is determined by a nonlinear least squares optimization algorithm. S24, calculate the coordinates of the intersection point of the optimized median diameter line and the straight line of the tooth lateral flank, and use it as the median diameter point on the corresponding scan line.

5. The linear laser measurement method for the pitch diameter of internal threads according to claim 1, characterized in that, Step S3 includes: Using the pre-specified distance from the laser origin to the axis of rotation The angle between the laser direction and the direction of the line connecting the laser origin and the axis of rotation. By using geometric relationships, the coordinates of the mid-diameter points of all scan lines in the laser sensor coordinate system are transformed to the machine tool coordinate system, thus obtaining all the transformed mid-diameters.

6. The linear laser measurement method for the pitch diameter of internal threads according to claim 1, characterized in that, Step S4 includes: Step S41: In the machine tool coordinate system, all the transformed pitch diameter points are regarded as lying on an ideal cylindrical surface; Step S42: The Levenberg-Marquardt algorithm is used to fit the ideal cylindrical surface. By optimizing the coordinates of a point on the axis of the ideal cylinder, the direction vector of the cylinder axis, and the cylinder radius parameters, the sum of the squares of the distances from all mid-diameter points to the fitted cylindrical surface is minimized. Step S43: Use the diameter of the fitted cylindrical surface as the mean diameter of the internal thread.

7. The method for linear laser measurement of the mean diameter of internal threads according to any one of claims 1 to 6, characterized in that, The threaded surface includes: an internal thread surface or an external thread surface.

8. A computer-readable storage medium having stored thereon computer-executable instructions, wherein, When the computer-executable instructions are executed by the processor, the processor causes the processor to perform the method as described in any one of claims 1 to 7.

9. A calculator device, wherein, include: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method as described in any one of claims 1 to 7.