A method and system for intelligent detection of machining quality of CNC machine tool workpieces

By using the method of rotating the matching frame to construct edge vectors and calculating the degree of matching in CNC machine tool workpiece processing quality detection, the problem of image contrast imbalance caused by uneven lighting is solved, more accurate workpiece edge and detail recognition is achieved, and the accuracy of processing quality evaluation is improved.

CN119295437BActive Publication Date: 2025-03-28GUANGZHOU TONGFA INTELLIGENT EQUIP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411803477.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-28
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

In the process of image acquisition on the surface of metal parts, the highlights and shadow areas caused by uneven lighting conditions affect the image contrast imbalance, thereby affecting the accurate identification of key points, resulting in low recognition accuracy of edges and details of metal parts.

Method used

By obtaining the real-time image of the workpiece, using the preset matching box to rotate it multiple times around the geometric center, construct the actual edge vector, and calculate the degree of matching with the preset standard edge vector, find the optimal edge to more accurately evaluate the quality of the machining part.

Benefits of technology

By capturing the local features of the workpiece surface from different angles, especially those features of highlights and shaded areas generated by uneven lighting conditions, more accurate edge and detail recognition is achieved, and the evaluation accuracy of workpiece processing quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295437B_ABST
    Figure CN119295437B_ABST
Patent Text Reader

Abstract

The present application relates to the field of machine tool processing quality detection, and in particular to a method and system for intelligent detection of the processing quality of CNC machine tool workpieces. The method comprises the steps of: acquiring a real-time image of the workpiece, taking the geometric center of a preset matching box as the search point, moving within a preset range, and rotating the matching box multiple times around the geometric center after each movement; after each rotation, taking the geometric center of the matching box as the starting point and any pixel point on the actual edge in the matching box as the end point, constructing an actual edge vector; calculating the degree of matching between the actual edge vector and the preset standard edge vector, and taking the actual edge inside the matching box corresponding to the maximum value of all matching degrees after multiple rotations as the optimal edge; and calculating the quality evaluation of the workpiece based on the optimal edge. The present application has the effect of improving recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine tool processing quality detection, and in particular to an intelligent detection method and system for CNC machine tool workpiece processing quality. Background Art

[0002] Cutting by intelligent CNC machine tools refers to the process of machining workpieces using CNC machine tools. Intelligent CNC machine tools can achieve efficient, precise and automated cutting processing through integrated sensors, control systems and software algorithms.

[0003] During the processing of metal parts, it is necessary to perform quality inspection on the processed metal parts. The existing technology usually uses computer vision to collect images of the surface of the metal parts and match and analyze them with standard image templates to determine the quality of the processed metal parts.

[0004] For example, the patent application with patent publication number CN117689654A discloses a method and system for defect detection of workpiece end faces based on deep learning, which uses the SIFT (Scale Invariant Feature Transform) algorithm to detect and describe local features in the image.

[0005] The key points in the SIFT algorithm are some local feature points in the image. These key points are usually corner points, edge points, bright spots in dark areas, and dark spots in bright areas.

[0006] However, in the process of acquiring images of metal surfaces, due to the reflection characteristics of the metal surface to light, especially when the lighting conditions are uneven, obvious highlight and shadow areas will appear in the image, resulting in an imbalance in the image contrast, affecting the accurate recognition of key points and thus the accurate recognition of the edges and details of metal parts. Summary of the invention

[0007] In order to solve the problem of low recognition accuracy, the present application provides a method and system for intelligent detection of workpiece processing quality of CNC machine tools.

[0008] In the first aspect, the present application provides a method for intelligent detection of machining quality of workpieces of CNC machine tools, which adopts the following technical solutions:

[0009] A method for intelligently detecting the machining quality of a workpiece of a numerical control machine tool comprises the following steps: obtaining a real-time image of the workpiece, taking the geometric center of a preset matching frame as a search point, moving within a preset range, and rotating the matching frame multiple times around the geometric center after each movement; after each rotation, taking the geometric center of the matching frame as a starting point and any pixel point on the actual edge in the matching frame as an end point, constructing an actual edge vector; calculating the degree of matching between the actual edge vector and a preset standard edge vector, and taking the actual edge inside the matching frame corresponding to the maximum value of all matching degrees after multiple rotations as the optimal edge; and calculating the quality evaluation of the workpiece according to the optimal edge; the calculation formula of the matching degree is:

[0010] ,in, For the The matching degree between the standard edge and the actual edge, represents the cosine similarity, represents the total number of actual edge vectors, is the vector set of standard edge vectors, Indicates The actual edge vector.

[0011] The beneficial effect is that the purpose of rotating the matching frame is to ensure that local features of the workpiece surface can be captured from different angles, especially those features that may produce highlights and shadows due to uneven lighting conditions. By calculating the degree of matching at different rotation angles, the actual edge with the highest matching degree with the standard edge vector can be found, that is, the optimal edge. The quality of the workpiece can be evaluated based on the obtained optimal edge, thereby more accurately evaluating the processing quality of the workpiece.

[0012] Optionally, after each movement, the matching box is rotated multiple times around the geometric center, the matching box rotates 1° each time, and rotates 360 times after one movement.

[0013] The beneficial effect is that by rotating 1° at a time, 360 rotations means that the match frame will rotate a full circle around its geometric center, which ensures that the edge of the workpiece is analyzed from all possible angles, thereby fully covering all edges within the match frame.

[0014] Optionally, the matching box is the minimum bounding rectangle of the standard edges.

[0015] The beneficial effect is that the matching box of the minimum bounding rectangle is easy to process automatically because it provides a clear boundary, which is convenient for precise control in the automated system.

[0016] Optionally, the maximum value of the matching degree is calculated by fitting the discrete matching degrees to obtain a fitting curve, and calculating the first-order derivative of the fitting curve. The matching degree corresponding to the first-order derivative being 0 is the maximum value of the matching degree.

[0017] The beneficial effect is that compared with directly using the maximum value of the discrete matching degree, the accuracy is higher, because the rotation angle of the matching box is fixed, and the angle corresponding to the maximum value of the matching degree may be the angle between the two rotation angles. By fitting the curve, the changing trend of the matching degree can be captured more accurately, thereby finding a more accurate maximum value.

[0018] Optionally, the quality evaluation of the workpiece is calculated based on the optimal edge, including the steps of: obtaining the overlapping pixel points and the overlapping pixel point set of the optimal edge and the standard edge, taking the mean of the overlapping pixel points on the optimal edge as the minimum reachable density distance, clustering the pixel points on the optimal edge to obtain multiple clustering clusters; deleting the overlapping pixel points on the optimal edge to obtain the deviated pixel points and the deviated pixel point set; taking the minimum Euclidean distance from the deviated pixel point to the overlapping pixel point set as the offset distance of the deviated pixel point; and taking the offset distances of all deviated pixel points as the quality evaluation of the workpiece.

[0019] Optionally, the processing quality evaluation is evaluated and graded, and a first threshold and a second threshold are set. When the workpiece is less than or equal to the first threshold, the evaluation grade corresponding to the processing quality evaluation is excellent. When the workpiece is greater than the first threshold and less than the second threshold, the evaluation grade corresponding to the processing quality evaluation is good. When the workpiece is greater than or equal to the second threshold, the evaluation grade corresponding to the processing quality evaluation is poor.

[0020] Optionally, clustering uses a DBSCAN clustering algorithm.

[0021] In the second aspect, the present application provides an intelligent detection system for machining quality of CNC machine tools, which adopts the following technical solutions:

[0022] A CNC machine tool workpiece processing quality intelligent detection system comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the CNC machine tool workpiece processing quality intelligent detection method described above is implemented.

[0023] The beneficial effect is that the above-mentioned intelligent detection method for the processing quality of CNC machine tools is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a system based on the memory and the processor for easy use.

[0024] This application has the following technical effects:

[0025] 1. By calculating the matching degree at different rotation angles, the actual edge with the highest matching degree with the standard edge vector, that is, the optimal edge, can be found. The quality of the workpiece can be evaluated based on the obtained optimal edge, thereby more accurately evaluating the processing quality of the workpiece.

[0026] 2. The purpose of rotating the match frame is to ensure that local features of the workpiece surface can be captured from different angles, especially those that may produce highlight and shadow areas due to uneven lighting conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-restrictive manner, and the same or corresponding numbers represent the same or corresponding parts.

[0028] Figure 1 It is a method flow chart of an intelligent detection method for machining quality of workpieces of CNC machine tools according to an embodiment of the present application.

[0029] Figure 2 It is a method flow chart of step S4 in a method for intelligent detection of workpiece processing quality of a CNC machine tool according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0031] It should be understood that when the terms "first", "second", etc. are used in the claims, specification and drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0032] The present application discloses a method for intelligently detecting the machining quality of a workpiece of a CNC machine tool. Figure 1 , including steps S1 to S4, which are specifically as follows:

[0033] S1: Get a real-time image of the workpiece, take the geometric center of the preset matching frame as the search point, move within the preset range, and rotate the matching frame around the geometric center multiple times after each movement.

[0034] In one embodiment, a real-time image of a workpiece is acquired and grayscale processed, and multiple continuous edges in the design image of the workpiece processing are used as standard edges to obtain a standard edge set.

[0035] Set a matching box. The shape of the matching box can be set according to the actual application scenario. This application uses the minimum circumscribed rectangle of the standard edge as the matching box. Use the geometric center of the matching box as the search point of the matching box, and traverse the search point within the preset range. The preset range is the image range of the real-time image. If the real-time image contains a background area and a workpiece area, first extract the workpiece area from the real-time image, and then use the workpiece area as the preset range. Exemplarily, the workpiece area can be extracted using existing technologies such as background difference method.

[0036] The matchbox is moved on the real-time image, with the moving unit of each movement being one pixel. After each movement, the matchbox is rotated 1° around the geometric center, and rotated 360 times after each movement before moving to the next position. By rotating 1° each time, 360 rotations means that the matchbox will rotate a full circle around its geometric center, which ensures that the edge of the workpiece is analyzed from all possible angles, thereby fully covering all edges within the matchbox. The rotation angle and number of rotations can be adjusted according to the actual application scenario.

[0037] S2: After each rotation, the actual edge vector is constructed with the geometric center of the matching box as the starting point and any pixel point on the actual edge of the matching box as the end point.

[0038] Each pixel point on the actual edge in the matching box corresponds to an actual edge vector.

[0039] S3: Calculate the matching degree between the actual edge vector and the preset standard edge vector, and after multiple rotations, take the actual edge inside the matching box corresponding to the maximum value of all matching degrees as the optimal edge.

[0040] In one embodiment, the calculation formula of the matching degree is:

[0041] ,in, For the The matching degree between the standard edge and the actual edge, represents the cosine similarity, represents the total number of actual edge vectors, is the vector set of standard edge vectors, Indicates The actual edge vector.

[0042] Cosine similarity is an indicator to measure the similarity of the directions of two vectors, and its value range is arrive The cosine similarity is Indicates that the two vectors are exactly the same, and the cosine similarity is It means the exact opposite, but close to This means that the angle between the vectors is large and the direction difference is significant. Indicates The minimum absolute value of the cosine similarity between the actual edge vector and each standard edge in the vector set. The value is an average value that quantifies the The overall matching degree between the standard edge and all actual edge vectors. The closer this value is to 1, the better the average matching degree between the standard edge and the actual edge.

[0043] In one embodiment, the maximum value of the matching degree is calculated by fitting the discrete matching degrees to obtain a fitting curve, calculating the first-order derivative of the fitting curve, and the matching degree corresponding to the first-order derivative being 0 is the maximum value of the matching degree. Exemplarily, the fitting can be performed by the least squares method, which can be implemented by computer software such as Matlab.

[0044] S4: Quality evaluation of the workpiece based on the optimal edge calculation. Figure 2 , step S4 includes steps S40 to S42, which are specifically as follows:

[0045] S40: Obtain the coincident pixel points and coincident pixel point set of the optimal edge and the standard edge, take the mean of the coincident pixel points on the optimal edge as the minimum reachable density distance, and cluster the pixel points on the optimal edge to obtain multiple cluster clusters.

[0046] Clustering uses the DBSCAN clustering algorithm. For the DBSCAN clustering algorithm, the minimum number of samples and the minimum reachable density distance are two key parameters. The minimum number of samples defines the minimum number of points required to form a cluster. The minimum reachable density distance defines the neighborhood range of a point, that is, the distance within which a point is considered to be a neighbor of another point. For example, the minimum number of samples is 10, which can be adjusted by the user according to the application scenario.

[0047] S41: Delete the overlapping pixel points on the optimal edge to obtain the deviated pixel points and the deviated pixel point set.

[0048] The pixel points of the part on the optimal edge that does not overlap with the standard edge can be found, and these pixel points are used as deviation pixel points, that is, the actual cutting mark and the standard cutting mark may deviate here.

[0049] S42: taking the minimum Euclidean distance from the deviated pixel point to the set of coincident pixel points as the offset distance of the deviated pixel point, and taking the offset distances of all deviated pixel points as the quality evaluation of the workpiece.

[0050] The minimum Euclidean distance from the deviated pixel to the set of coincident pixels is taken as the offset distance of the deviated pixel, providing a quantitative deviation measure for each deviated pixel. The offset distances of all deviated pixels are used as the quality evaluation of the workpiece, quantifying the overall processing quality of the workpiece.

[0051] The processing quality evaluation is evaluated and graded, and a first threshold and a second threshold are set. When the workpiece is less than or equal to the first threshold, the evaluation grade corresponding to the processing quality evaluation is excellent. When the workpiece is greater than the first threshold and less than the second threshold, the evaluation grade corresponding to the processing quality evaluation is good. When the workpiece is greater than or equal to the second threshold, the evaluation grade corresponding to the processing quality evaluation is poor. For example, the first threshold is 0.5 and the second threshold is 0.7. The settings of the first threshold and the second threshold can be set by the user according to actual conditions.

[0052] An embodiment of the present application also discloses an intelligent detection system for the machining quality of workpieces of CNC machine tools, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an intelligent detection method for the machining quality of workpieces of CNC machine tools according to the present application is implemented.

[0053] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0054] In the present application, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high bandwidth memory HBM (High Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device.

[0055] Although this specification has shown and described a plurality of embodiments of the present application, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, modifications and alternatives without departing from the thought and spirit of the present application. It should be understood that in the process of practicing the present application, various alternatives to the embodiments of the present application described herein may be adopted.

[0056] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. An intelligent detection method for machining quality of CNC machine tools, characterized in that: Includes steps: Acquire a real-time image of the workpiece, use the geometric center of the preset matching frame as the search point, move within the preset range, and rotate the matching frame around the geometric center multiple times after each movement; After each rotation, the actual edge vector is constructed with the geometric center of the matching box as the starting point and any pixel point on the actual edge of the matching box as the end point; Calculate the matching degree between the actual edge vector and the preset standard edge vector, and after multiple rotations, take the actual edge inside the matching box corresponding to the maximum value of all matching degrees as the optimal edge; calculate the quality evaluation of the workpiece based on the optimal edge; The formula for calculating the matching degree is: ,in, For the The matching degree between the standard edge and the actual edge, represents the cosine similarity, represents the total number of actual edge vectors, is the vector set of standard edge vectors, Indicates The actual edge vector.

2. The intelligent detection method for machining quality of CNC machine tools according to claim 1 is characterized in that: After each move, the matching box is rotated multiple times around the geometric center. The matching box rotates 1° each time, and rotates 360 times after one move.

3. The intelligent detection method for machining quality of CNC machine tools according to claim 1 is characterized in that: The matching box is the minimum bounding rectangle of the standard edges.

4. The intelligent detection method for machining quality of CNC machine tools according to claim 1, characterized in that: The maximum value of the matching degree is calculated by fitting the discrete matching degrees to obtain a fitting curve, and calculating the first-order derivative of the fitting curve. The matching degree corresponding to the first-order derivative being 0 is the maximum value of the matching degree.

5. The intelligent detection method for machining quality of CNC machine tools according to claim 1, characterized in that: The quality evaluation of the workpiece based on the optimal edge calculation includes the following steps: Obtain the coincident pixel points and coincident pixel point set of the optimal edge and the standard edge, take the mean of the coincident pixel points on the optimal edge as the minimum reachable density distance, cluster the pixel points on the optimal edge to obtain multiple cluster clusters; Delete the overlapping pixels on the optimal edge to obtain the deviated pixels and the deviated pixel set; The minimum Euclidean distance from the deviated pixel point to the set of coincident pixels is taken as the offset distance of the deviated pixel point; The offset distances of all deviating pixel points are used as the quality evaluation of the workpiece.

6. The intelligent detection method for machining quality of CNC machine tools according to claim 5 is characterized in that: The processing quality evaluation is evaluated and graded, and a first threshold and a second threshold are set. When the workpiece is less than or equal to the first threshold, the evaluation grade corresponding to the processing quality evaluation is excellent. When the workpiece is greater than the first threshold and less than the second threshold, the evaluation grade corresponding to the processing quality evaluation is good. When the workpiece is greater than or equal to the second threshold, the evaluation grade corresponding to the processing quality evaluation is poor.

7. The intelligent detection method for machining quality of CNC machine tools according to claim 5, characterized in that: The clustering algorithm used is DBSCAN.

8. An intelligent detection system for machining quality of CNC machine tools, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the intelligent detection method for machining quality of workpieces of CNC machine tools according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Defect detection method and system for workpiece end face based on deep learning

    CN117689654A

  • Roof capping illegal building identification method based on region positioning and local feature matching

    CN114821334A

  • Gesture recognition method and device, equipment and medium

    CN116386130A