Method and device for detecting straightness of lead screw
Through laser sensor scanning and three-dimensional data processing technology, the problem of limited accuracy in traditional contact measurement tools when detecting the straightness of the screw is solved, and contactless and high-precision straightness detection of the screw is realized, which improves the degree of automation of the detection.
Patent Information
- Application Number
- CN202411546632.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, it is difficult to achieve high accuracy and automation when detecting the straightness of the screw. Especially when the screw surface is complex or there are minor defects, traditional contact measurement tools have problems of limited accuracy and large errors.
The laser sensor is used to scan multiple times along the axis of the screw to generate three-dimensional point cloud data, and data splicing, feature point matching and axis fitting are performed by iterating the nearest point algorithm, scale invariant feature transformation algorithm and weighted least squares method. Calculate the linearity deviation of the screw.
It realizes contactless and high-precision linearity detection on the surface of the screw, avoids the influence of environmental and operating errors, and improves the detection accuracy and automation level.
Smart Images

Figure CN119468990A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of mechanical parts detection, and in particular relates to a method and a device for detecting the straightness of a screw rod. Background Art
[0002] At present, the detection of screw straightness is a key step in mechanical processing and high-precision transmission systems. The straightness of the screw directly affects the accuracy, stability and service life of the equipment. Among the existing detection methods, contact measuring tools such as dial indicators and micrometers are mainly relied on. These tools measure the deviations of different points on the screw surface by contacting the probe with the screw surface, and then calculate the straightness. However, with the continuous improvement of the requirements for accuracy and efficiency in modern manufacturing processes, traditional contact methods have gradually exposed many shortcomings. First, the contact measurement method has the problem of limited accuracy. In actual operation, contact measurement is easily affected by external environmental factors, such as temperature changes, vibration interference, etc. These factors may cause measurement errors, especially in high-precision occasions, where small errors will cause large measurement deviations. In addition, the contact pressure of the measuring tool itself may cause slight deformation on the screw surface, thereby affecting the accuracy of the measurement results. In the prior art, although there are some optical measurement methods and non-contact detection methods, such as the use of grating rulers or laser interferometers, these methods usually require expensive equipment and complex operating environments, and when faced with uneven reflection on the surface of the screw and inconsistent materials, the measurement accuracy is still difficult to guarantee. The prior art cannot fully meet the needs of non-contact, high-precision, and automated screw straightness detection. Especially in modern factories with a high degree of production automation, traditional detection methods are difficult to adapt to the requirements of large-scale and rapid detection. Therefore, there is an urgent need for a technical solution that can achieve high-efficiency and high-precision screw straightness detection under the conditions of non-contact, complex geometric shapes, and tiny defects on the surface. Summary of the invention
[0003] In view of the above-mentioned technical deficiencies, the purpose of the present invention is to propose a method for detecting the straightness of a screw rod, aiming to solve the technical problem that the prior art relies on contact measuring tools such as micrometers and dial indicators, especially when the screw rod surface is complex or there are subtle defects, and high-precision and automated measurement cannot be achieved.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solution: The present invention provides a method for detecting the straightness of a screw rod.
[0005] The method comprises:
[0006] Step S10: Scanning the screw rod multiple times along the screw rod axis direction by a laser sensor for a preset number of times, generating three-dimensional point cloud data of the screw rod surface section each time, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area;
[0007] Step S20: combining the three-dimensional point cloud data generated by each scan, aligning the point cloud data of each section using a stitching method based on an iterative closest point algorithm, and forming an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After confirming that the scanned section data are accurately spliced, constructing the complete geometric structure data of the screw rod according to the overall three-dimensional model of the screw rod;
[0008] Step S30: In the overlapping area of adjacent scans, feature points are extracted using a scale-invariant feature transformation algorithm, and feature points of adjacent cross sections are matched using a fast nearest neighbor search algorithm. After successful matching, coordinate correction is performed on the feature points of adjacent cross sections to obtain optimized overall geometric structure data of the screw rod;
[0009] Step S40: according to the optimized overall geometric structure data of the screw, the coordinates of the geometric center point of each thread of the screw are extracted one by one, and the central axis of the screw is fitted using the weighted least square method. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitted axis.
[0010] Step S50: Calculate the vertical distance from the geometric center point of each thread to the central axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
[0011] Preferably, in step S10, the scanning frequency of the laser sensor is dynamically adjusted according to the thread density on the surface of the screw rod.
[0012] Preferably, in step S20, the iterative closest point algorithm adds rotation and displacement constraints during the alignment process.
[0013] Preferably, in step S50, the straightness deviation can be output in digital format or in graphical form.
[0014] Preferably, in step S50, the straightness deviation result is automatically compared with a preset straightness standard to generate a quality assessment report.
[0015] Preferably, the operating wavelength of the laser sensor is 905 nanometers.
[0016] Preferably, the laser sensor comprises a small laser emitting element.
[0017] The present invention also provides a device, comprising:
[0018] A scanning module is used to scan the screw rod multiple times along the screw rod axis direction according to a preset number of times using a laser sensor, and each scan generates three-dimensional point cloud data of the screw rod surface section, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area;
[0019] A splicing module is used to combine the three-dimensional point cloud data generated by each scan, align the point cloud data of each section using a splicing method based on an iterative closest point algorithm, and form an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After detecting and confirming that the scanned section data is accurately spliced, the complete geometric structure data of the screw rod is constructed according to the overall three-dimensional model of the screw rod;
[0020] The feature point matching module is used to extract feature points in the overlapping area of adjacent scans using a scale-invariant feature transformation algorithm, and match the feature points of adjacent sections using a fast nearest neighbor search algorithm. After successful matching, the coordinates of the feature points of the adjacent sections are corrected to obtain the optimized overall geometric structure data of the screw rod;
[0021] The axis fitting module is used to extract the geometric center point coordinates of each thread of the screw one by one according to the optimized overall geometric structure data of the screw, and use the weighted least squares method to fit the central axis of the screw. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitting axis;
[0022] The deviation calculation module is used to calculate the vertical distance from the geometric center point of each thread to the central axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
[0023] The present invention also provides a device for detecting the straightness of a screw rod, comprising:
[0024] A memory, a processor, and a program for detecting the straightness of a lead screw stored in the memory and executable on the processor. When the program for detecting the straightness of a lead screw is executed by the processor, the method for detecting the straightness of a lead screw is implemented.
[0025] The present invention also provides a computer program product, comprising a program for detecting the straightness of a screw rod, wherein the program for detecting the straightness of a screw rod implements the method for detecting the straightness of a screw rod when executed by a processor.
[0026] The beneficial effect of the present invention is that compared with the prior art which relies on contact measuring tools such as micrometers and dial indicators, especially when the surface of the screw is complex or there are subtle defects, the technical problem of being unable to achieve high-precision and automated measurement, the present application realizes non-contact, high-precision straightness detection of the screw surface through laser scanning, three-dimensional data stitching and algorithm optimization, thereby avoiding the influence of the environment, operating errors and surface defects, and improving the detection accuracy and degree of automation. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 The figure is a flow chart of a first embodiment of a method for detecting the straightness of a lead screw according to the present invention.
[0029] Figure 2 The present invention is a schematic diagram of a device for detecting the straightness of a lead screw.
[0030] Figure 3 The present invention is a schematic diagram of a device for detecting the straightness of a lead screw. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] Embodiment 1: Figure 1 , which is a flow chart of a first embodiment of a method for detecting the straightness of a screw rod according to the present invention, and provides a first embodiment of a method for detecting the straightness of a screw rod according to the present invention.
[0033] In a first embodiment, the method comprises:
[0034] Step S10: Scanning the screw rod multiple times along the screw rod axis direction by a laser sensor for a preset number of times, generating three-dimensional point cloud data of the screw rod surface section each time, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area;
[0035] It should be noted that the laser sensor refers to a sensor used for contactless measurement of the geometric shape of the screw surface, including a laser transmitting module, a laser receiving module and a data processing module. The laser sensor generates accurate geometric data of the screw surface by emitting a laser beam and receiving the light signal reflected from the screw surface. The laser transmitting module is responsible for emitting pulsed lasers, the receiving module is used to capture the reflected light signal, and the data processing module is used to convert the received light signal into processable three-dimensional point cloud data. The preset number refers to the number of times the laser sensor scans the screw surface according to a predetermined plan during the detection process. The preset number is usually set according to the length of the screw, the surface complexity and the required detection accuracy to ensure that the generated three-dimensional point cloud data covers the entire screw surface and the data has sufficient accuracy and resolution. The three-dimensional point cloud data refers to the three-dimensional coordinate point set generated by scanning the screw surface by a laser sensor, including the spatial coordinate information (X, Y, Z) of each point on the screw surface, as well as the detailed position data of the contour points and threaded area of each scanned section. The three-dimensional point cloud data is used to accurately describe the geometric characteristics of the screw surface. Through these data, the threaded area and overall shape of the screw can be accurately analyzed, and then the straightness of the screw can be calculated.
[0036] It should be understood that in order to better achieve high-precision detection of the straightness of the screw, the traditional laser scanning technology is usually based on a fixed scanning frequency and power, and a dynamic adjustment mechanism is introduced in the present invention. By detecting the reflective characteristics of the screw surface, the power and frequency of the laser emission are automatically adjusted. Compared with traditional fixed-frequency laser scanning, the dynamic adjustment mechanism can better adapt to smooth or highly reflective screw surfaces and reduce the possibility of reflection loss data. For example, in areas where the screw surface is relatively smooth, the power can be automatically reduced to avoid data distortion caused by excessive reflection.
[0037] Step S20: combining the three-dimensional point cloud data generated by each scan, aligning the point cloud data of each section using a stitching method based on an iterative closest point algorithm, and forming an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After confirming that the scanned section data are accurately spliced, constructing the complete geometric structure data of the screw rod according to the overall three-dimensional model of the screw rod;
[0038] It should be noted that the stitching method based on the iterative closest point algorithm refers to the use of geometric similarities between point cloud data to align and stitch the three-dimensional point cloud data generated by adjacent scan sections to form a complete three-dimensional model. This method includes adjusting the position and rotation angle of the point cloud by minimizing the distance difference between adjacent point clouds until all point cloud sections are seamlessly stitched. Each iteration of the iterative closest point algorithm gradually optimizes the overlapping area of the point cloud data by finding the nearest neighbor point pairs to ensure that the final stitching result is accurate and bias-free.
[0039] It can be understood that the stitching method of the iterative closest point algorithm can effectively solve the displacement and rotation errors between different scanning sections, especially when there are threads or tiny defects on the surface of the screw rod. The algorithm can gradually eliminate the stitching errors caused by these structural differences through multiple iterations.
[0040] It should be understood that in order to better achieve high-precision stitching and alignment processing of the three-dimensional point cloud data of the screw rod surface, the traditional ICP algorithm is usually based on the point-to-point registration of the minimum Euclidean distance. By introducing rotation angle restrictions and dynamic weight allocation, the stitching is more suitable for complex thread surfaces and defective areas. In the algorithm, the angle limit of the rotation matrix can be controlled to not exceed 0.5 degrees at each iteration to avoid error accumulation caused by excessive rotation. The rotation constraint formula is:
[0041] min∑‖R(θ)·P i +tQ i ‖ 2 |θ|≤0.5
[0042] Among them, R(θ) is the rotation matrix, P i and Q i is a point in the adjacent point cloud, θ is the rotation angle, and t is the translation vector.
[0043] In addition, dynamic weight allocation can give lower weights to surface defect areas, thereby reducing the impact of these areas on the overall stitching accuracy. The formula is as follows:
[0044] d w =∑w i ‖P i -Q i ‖ 2 +α∑θ
[0045] Among them, w i is the dynamic weight of each point, and α is the limiting factor of the rotation angle. In this way, the points in the defect area have less influence on the error minimization process, ensuring a more accurate overall stitching.
[0046] For example, in actual operation, assuming that the total length of the screw is 500mm, divided into 50 sections, each section contains 5,000 point cloud data, and after preliminary scanning, the initial error is 0.3mm. With the traditional ICP algorithm, after 15 iterations, the error can only converge to 0.1mm and cannot be further reduced. However, using the improved ICP algorithm, adding dynamic weights and rotation constraints, after 20 iterations, the error is reduced to 0.02mm. Especially in areas with complex threads, the improved algorithm improves the splicing accuracy by 80% compared to the traditional method.
[0047] Step S30: In the overlapping area of adjacent scans, feature points are extracted using a scale-invariant feature transformation algorithm, and feature points of adjacent cross sections are matched using a fast nearest neighbor search algorithm. After successful matching, coordinate correction is performed on the feature points of adjacent cross sections to obtain optimized overall geometric structure data of the screw rod;
[0048] It should be noted that the scale-invariant feature transform (SIFT) algorithm is an algorithm used to extract stable feature points from images or three-dimensional point cloud data. The main feature of the SIFT algorithm is that it can extract feature points at different scales to ensure that the feature points remain unchanged under rotation, translation and scaling. Therefore, in the screw thread area, the SIFT algorithm can identify the geometric feature points of the thread, such as thread vertices, valleys or edges, as key reference points for splicing point cloud data. The fast nearest neighbor search algorithm (FLANN) is used to quickly match feature points between different scanning sections. It can find similar feature point pairs in a large amount of point cloud data through efficient data structures and search strategies, ensuring the matching speed and accuracy of feature points during the splicing process.
[0049] It is understandable that in the complex geometric structure of the screw (such as the threaded area), there may be rotation, translation and scale changes between different sections, and the feature points extracted by the SIFT algorithm can maintain robustness to these geometric changes, ensuring that the geometric feature points in different scanned sections are consistent. The FLANN algorithm can find similar feature points in adjacent sections in a short time through a fast matching algorithm. After the match is successful, the system will perform precise coordinate correction based on these matched feature points, adjust the adjacent scanned sections to the same coordinate system, eliminate errors caused by rotation and translation, and generate optimized overall geometric structure data.
[0050] Step S40: according to the optimized overall geometric structure data of the screw, the coordinates of the geometric center point of each thread of the screw are extracted one by one, and the central axis of the screw is fitted using the weighted least square method. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitted axis.
[0051] It should be understood that the weighted least squares method can effectively reduce the impact of defects, noise or error data on the fitting results by assigning different weights to each data point. Specifically, normal geometric center points will be given higher weights, while in areas with defects or large noise, these points will be given lower weights, thereby reducing their impact on the overall fitting and ensuring the accuracy and robustness of the central axis.
[0052] It should be understood that in order to better achieve the accurate fitting of the central axis of the screw, the use of weighted least squares to fit the geometric center point of the screw thread can effectively reduce the impact of abnormal data points, such as deviations caused by noise or surface defects. By assigning different weights to each data point, the system can dynamically adjust the contribution of each point in the fitting process to ensure that the final fitting result is more stable and accurate. The specific process of fitting the central axis of the screw using the weighted least squares method can be: first, the geometric center point data extracted from each thread section is input into the algorithm, and the weight of each point is calculated. The weight is allocated based on the geometric position stability or surface defect of each point. For data points with relatively stable positions and high consistency with other points, higher weights are assigned; and for data points with obvious deviations or in noise interference areas, the weights are lower. The goal of the weighted least squares method is to minimize the sum of squares of weighted errors. The formula for this process can be expressed as:
[0053]
[0054] Among them, w i is the weight of the i-th point, r i is the actual coordinate value of the point, is the coordinate value estimated after fitting. With this method, the central axis of the screw can be robustly fitted to ensure that abnormal data will not significantly affect the final fitting result. For example, on a screw with a length of 500 mm, 1000 data points are extracted from the geometric center point of the complex thread area, of which 5% of the data points have large deviations due to defects or surface noise. Through the weighted least squares method, the weights of these defect points can be set to 0.1, while the weights of other normal points are set to 1. The deviation of the central axis of the final fitting is reduced by 30%, ensuring that the fitting result is more consistent with the actual geometric structure of the screw.
[0055] Step S50: Calculate the vertical distance from the geometric center point of each thread to the central axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
[0056] It should be noted that the vertical distance from the center point of the thread to the fitting axis is a key indicator for evaluating the straightness of the screw. Specifically, through geometric calculation, the distance between each thread geometric center point and the fitted center axis can be determined, and the maximum value of all calculated distances is selected as the straightness deviation of the screw. The smaller the deviation value, the higher the straightness of the screw and the better the geometric accuracy.
[0057] It is understood that when calculating the vertical distance from the center point of the thread to the fitting axis, the standard distance formula from a space point to a straight line is applied:
[0058]
[0059] Among them, (x i ,y i ,z i ) is the coordinate of the thread center point, and (A, B, C, D) is the parameter of the fitted center axis. Through this formula, the vertical distance from each thread center point to the axis can be accurately calculated.
[0060] It should be understood that in order to better evaluate the overall straightness of the screw, using the maximum vertical distance as the straightness deviation can effectively identify the most significant geometric deviation point on the screw. Through this maximum value, it is possible to quickly determine whether the screw meets the set straightness tolerance standard. If the maximum vertical distance exceeds the predetermined threshold, the system will mark the screw as unqualified and output the corresponding deviation result. For example, assuming that the design straightness tolerance of the screw is 0.02mm, the maximum value of the vertical distance from the center point of the thread to the fitting axis is 0.015mm, which is lower than the set tolerance, indicating that the straightness of the screw meets the requirements. The corresponding deviation results will be recorded and output for use in the quality assessment report.
[0061] In the second example provided by the present invention, in the step S10, the scanning frequency of the laser sensor is dynamically adjusted according to the thread density on the surface of the screw rod.
[0062] It should be noted that thread density refers to the number of threads per unit length of the thread on the surface of the screw (such as pitch). The higher the thread density, the greater the geometric complexity of the thread. In order to ensure data accuracy during the scanning process, the scanning frequency of the laser sensor needs to be dynamically adjusted according to the thread density. In areas with high thread density, the sensor needs to increase the scanning frequency to capture more detailed information and ensure that the geometric features of the thread are accurately recorded. In areas with low thread density, the scanning frequency can be appropriately reduced to optimize detection efficiency.
[0063] It should be understood that in order to better adapt to the geometric complexity of different areas on the screw surface, dynamically adjusting the scanning frequency of the laser sensor can improve detection efficiency while ensuring data accuracy. In areas with higher thread density, such as fine thread areas, the scanning frequency will be increased to capture finer geometric details and avoid missing key thread feature points; while in areas with lower density, such as smooth shaft sections or widely spaced thread areas, the sensor can reduce the scanning frequency, thereby reducing unnecessary redundant data collection and improving overall detection speed. For example, for a screw with a pitch of 1mm, when the sensor detects a densely threaded area, the scanning frequency can be dynamically increased to 5000Hz to ensure that each scan captures enough thread details, while in larger thread areas with a pitch of 2mm, the scanning frequency can be reduced to 2500Hz, maintaining data quality and improving efficiency.
[0064] In addition, the present invention also provides a device for detecting the straightness of the screw rod, please refer to Figure 2 , the device comprises:
[0065] A scanning module is used to scan the screw rod multiple times along the screw rod axis direction according to a preset number of times using a laser sensor, and each scan generates three-dimensional point cloud data of the screw rod surface section, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area;
[0066] A splicing module is used to combine the three-dimensional point cloud data generated by each scan, align the point cloud data of each section using a splicing method based on an iterative closest point algorithm, and form an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After detecting and confirming that the scanned section data is accurately spliced, the complete geometric structure data of the screw rod is constructed according to the overall three-dimensional model of the screw rod;
[0067] The feature point matching module is used to extract feature points in the overlapping area of adjacent scans using a scale-invariant feature transformation algorithm, and match the feature points of adjacent sections using a fast nearest neighbor search algorithm. After successful matching, the coordinates of the feature points of the adjacent sections are corrected to obtain the optimized overall geometric structure data of the screw rod;
[0068] The axis fitting module is used to extract the geometric center point coordinates of each thread of the screw one by one according to the optimized overall geometric structure data of the screw, and use the weighted least squares method to fit the central axis of the screw. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitting axis;
[0069] The deviation calculation module is used to calculate the vertical distance from each thread center point to the fitting axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
[0070] The present invention provides a device for detecting the straightness of a screw rod, which adopts a method for detecting the straightness of a screw rod in the above embodiment, and can solve a technical problem for detecting the straightness of a screw rod. Compared with the prior art, the beneficial effect of the device for detecting the straightness of a screw rod provided by the present invention is the same as the beneficial effect of the method for detecting the straightness of a screw rod provided by the above embodiment, and other technical features in the device for detecting the straightness of a screw rod are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0071] The present invention provides a device for detecting the straightness of a screw rod, please refer to Figure 3, a device for detecting the straightness of a screw rod comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for detecting the straightness of a screw rod in the above-mentioned embodiment 1. A device for detecting the straightness of a screw rod in an embodiment of the present invention may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. A device for detecting the straightness of a screw rod is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention. A device for detecting the straightness of a screw rod may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. In RAM 1004, various programs and data required for the operation of a device for detecting the straightness of a screw rod are also stored. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow a device for detecting the straightness of a lead screw to communicate wirelessly or wired with other devices to exchange data. Although a device for detecting the straightness of a lead screw with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0072] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the steps of the method for detecting the straightness of a screw rod as described above are implemented. The computer program product provided by the present invention can solve a technical problem for detecting the straightness of a screw rod. Compared with the prior art, the beneficial effects of the computer program product provided by the present invention are the same as the beneficial effects of the method for detecting the straightness of a screw rod provided by the above embodiment, and will not be described in detail here.
[0073] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present invention are executed.
[0074] It should be understood that the various parts disclosed in the present invention can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0075] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for detecting the straightness of a screw rod, characterized in that: The method comprises: Step S10: Scanning the screw rod multiple times along the screw rod axis direction by a laser sensor for a preset number of times, generating three-dimensional point cloud data of the screw rod surface section each time, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area; Step S20: combining the three-dimensional point cloud data generated by each scan, aligning the point cloud data of each section using a stitching method based on an iterative closest point algorithm, and forming an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After confirming that the scanned section data are accurately spliced, constructing the complete geometric structure data of the screw rod according to the overall three-dimensional model of the screw rod; Step S30: In the overlapping area of adjacent scans, feature points are extracted using a scale-invariant feature transformation algorithm, and feature points of adjacent cross sections are matched using a fast nearest neighbor search algorithm. After successful matching, coordinate correction is performed on the feature points of adjacent cross sections to obtain optimized overall geometric structure data of the screw rod; Step S40: according to the optimized overall geometric structure data of the screw, the coordinates of the geometric center point of each thread of the screw are extracted one by one, and the central axis of the screw is fitted using the weighted least square method. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitted axis. Step S50: Calculate the vertical distance from the geometric center point of each thread to the central axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
2. The method for detecting the straightness of a screw rod according to claim 1, characterized in that: In step S10, the scanning frequency of the laser sensor is dynamically adjusted according to the thread density on the surface of the screw rod.
3. The method for detecting the straightness of a screw rod according to claim 1, characterized in that: In step S20, the iterative closest point algorithm adds rotation and displacement constraints during the alignment process.
4. The method for detecting the straightness of a lead screw according to claim 1, characterized in that: In step S50 , the straightness deviation may be output in a digital format or in a graphical display.
5. The method for detecting the straightness of a lead screw according to claim 1, characterized in that: In step S50, the straightness deviation result is automatically compared with the preset straightness standard to generate a quality assessment report.
6. The method for detecting the straightness of a lead screw according to claim 1, characterized in that: The operating wavelength of the laser sensor is 905 nanometers.
7. The method for detecting the straightness of a lead screw according to claim 1, characterized in that: The laser sensor includes a laser emitting element.
8. A device for detecting the straightness of a screw rod, characterized in that: The device comprises: A scanning module is used to scan the screw rod multiple times along the screw rod axis direction according to a preset number of times using a laser sensor, and each scan generates three-dimensional point cloud data of the screw rod surface section, wherein the three-dimensional point cloud data includes the precise coordinates of multiple points on the screw rod surface, the contour points of each scanned section, and the position data of the threaded area; A splicing module is used to combine the three-dimensional point cloud data generated by each scan, align the point cloud data of each section using a splicing method based on an iterative closest point algorithm, and form an overall three-dimensional model of the screw rod by adjusting the position and angle of the scanned section. After detecting and confirming that the scanned section data is accurately spliced, the complete geometric structure data of the screw rod is constructed according to the overall three-dimensional model of the screw rod; The feature point matching module is used to extract feature points in the overlapping area of adjacent scans using a scale-invariant feature transformation algorithm, and match the feature points of adjacent sections using a fast nearest neighbor search algorithm. After successful matching, the coordinates of the feature points of the adjacent sections are corrected to obtain the optimized overall geometric structure data of the screw rod; The axis fitting module is used to extract the geometric center point coordinates of each thread of the screw one by one according to the optimized overall geometric structure data of the screw, and use the weighted least squares method to fit the central axis of the screw. During the fitting process, low weights are given to abnormal data points caused by defects, noise or error points to ensure the accuracy and robustness of the fitting axis; The deviation calculation module is used to calculate the vertical distance from each thread center point to the fitting axis, take the maximum vertical distance as the straightness deviation of the screw rod, and output the deviation result.
9. A device for detecting the straightness of a screw rod, characterized in that: The device comprises: A memory, a processor, and a program for detecting the straightness of a lead screw stored in the memory and executable on the processor. When the program for detecting the straightness of a lead screw is executed by the processor, the method for detecting the straightness of a lead screw is implemented.
10. A computer program product, characterized in that The computer program product includes a program for detecting the straightness of a lead screw, and when the program for detecting the straightness of a lead screw is executed by a processor, the method for detecting the straightness of a lead screw is implemented.