A method for detecting tool damage in tool magazine
By calculating the correlation point of the pixel point in the tool image and the damage probability value, combined with the central symmetry of the tool, it solves the problem of inaccurate detection caused by the misjudgment of the blade of the blade. Essence
Patent Information
- Application Number
- CN202411471351.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-22
AI Technical Summary
When the prior art determines whether the tool is damaged, it is easy to misjudgment due to blade marks, which affects the accuracy of the detection.
By obtaining the tool image, the correlation of the pixel point is located in the blade area, and the center symmetry of the tool is used to calculate the probability value of the blade damage area at the blade damage area, and finally determine whether to change the tool according to the degree of damage.
Improve the accuracy of the knife damage detection, avoid error detection caused by the misjudgment of the blade, and ensure a more timely and accurate tool replacement.
Smart Images

Figure CN118977138B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tool breakage detection, and more specifically, to a tool magazine tool breakage detection method. Background Art
[0002] When using machine tools for processing, the tool magazine system equipped with the machining center is often used for automated tool replacement. The tool magazine system can quickly and accurately replace tools during the processing process, thereby greatly reducing the time and error of manual tool change. As a consumable item, the cutting part of the tool often breaks during the processing. If the broken tool is taken from the tool magazine for processing, the precision of the processed parts will be insufficient, and even the parts will be scrapped. Therefore, it is necessary to detect whether the tools in the tool magazine are damaged, and replace the damaged tools in time to avoid the machine tool taking out the damaged tools from the tool magazine for processing.
[0003] In the related technology, for example, a Chinese patent application document with publication number CN214771895U discloses a tool damage detection method based on visual inspection of CNC machine tools, including: obtaining an image of the part after processing; filtering and denoising the image and then performing grayscale transformation to obtain a preprocessed image; according to preset feature information, finding and locating the remaining part of the part after processing in the preprocessed image to obtain a part picture; performing edge detection on the cutting marks and drawing edge contours; calculating the edge width of the tool through the edge contours; and outputting the detection result after comparing the actual width of the tool with the preset theoretical standard value.
[0004] At present, Canny edge detection is usually used to extract the edge of the blade part of the tool in the image, and the method of judging whether the tool is damaged is based on the extracted edge. However, this method ignores the process characteristics of the tool and is prone to misjudge normal blade texture as damaged. Then, when judging whether the tool is damaged, the blade texture will affect the accuracy of damage detection of the tool magazine tool. Summary of the invention
[0005] The present invention provides a method for detecting tool breakage in a tool magazine, aiming to solve the problem in the related art that when judging whether a tool is broken, the blade texture will affect the accuracy of damage detection of the tool magazine tool.
[0006] The present invention provides a tool magazine tool breakage detection method, comprising: acquiring a tool image, obtaining a tool area, and calculating the correlation of the pixel point being located in the blade area according to the gray value of the pixel point in the tool area; for any pixel point in the tool area, acquiring a symmetrical pixel point of the pixel point with the tool center point in the tool image as the symmetry center, and obtaining a probability value of the pixel point being in the blade breakage area according to the difference between the correlation of the pixel point and its symmetrical pixel points, and the product of the average value of the correlation of the pixel point and all the pixel points on the line connecting the pixel point and the symmetrical pixel points and the difference, and then obtaining the probability value of all the pixel points in the tool area being in the blade breakage area; acquiring a tool edge map of the tool image, and calculating the degree of damage to the tool, the calculation formula is:
[0007] ;
[0008] In the formula, is the degree of damage of the tool, The first The probability value of a pixel point being in the damaged area of the tool blade, The first The distance between the corresponding position of a pixel point in the tool edge map and the nearest edge in the tool edge map, is the number of pixels in the tool area, exp() is an exponential function with the natural constant e as the base; according to the degree of damage of the tool, it is determined whether to replace the tool.
[0009] The effect is that when calculating the degree of damage of the tool, the influence of the blade texture on its degree of damage is taken into account, and based on the characteristics of the tool (the tool blade structure has central symmetry, and the symmetrical point of a pixel point belonging to the blade area may also be in the blade area), the degree of damage of the tool can be calculated more accurately, thereby improving the accuracy of the detection process.
[0010] Furthermore, acquiring the tool image and obtaining the tool region includes: extracting the tool region from the tool image by using a semantic segmentation method.
[0011] Furthermore, the correlation of the pixel points in the blade area is calculated, and the calculation formula is: ;in, The first The correlation of the pixel points in the blade area, The first The gray value of a pixel, The first The average gray value of the eight neighboring pixels of a pixel. is the maximum gray value of the tool area.
[0012] The effect is that when calculating the correlation of a pixel point located in the blade area, the pixel point and the pixel points in the neighborhood near the pixel point are used, the influence of the blade texture on its damage degree is taken into account, and the accuracy of the detection result is improved.
[0013] Furthermore, the probability value of the pixel point being in the blade damage area is calculated using the following formula: ;in, The first The probability value of a pixel point being in the damaged area of the tool blade, The first The correlation of the pixel points in the blade area, The first The correlation of the symmetrical pixels of the pixels in the blade area, For the The average value of the correlation between a pixel and its symmetrical pixel.
[0014] The effect is that when calculating the probability value of a pixel point being in the blade damage area, the characteristics (symmetry) of the tool are taken into account, making the calculated result more accurate and improving the accuracy of the detection result.
[0015] Furthermore, judging whether to replace the tool is based on the degree of damage of the tool, including: replacing the tool in response to the degree of damage of the tool being greater than a preset threshold; not replacing the tool in response to the degree of damage of the tool being less than a preset threshold.
[0016] Furthermore, the distance between the corresponding position of the pixel point in the tool edge map and the nearest edge in the tool edge map is calculated, including: for any pixel point, obtaining the pixel point at the corresponding position of the pixel point in the tool edge map; obtaining the nearest edge between the pixel point at the corresponding position in the tool edge map, extracting the pixel point closest to the pixel point at the corresponding position in the nearest edge, and calculating the distance between the nearest pixel point and the pixel point at the corresponding position.
[0017] Furthermore, the distance between the nearest pixel point and the pixel point at the corresponding position is calculated, including: calculating the distance between the nearest pixel point and the pixel point at the corresponding position by using a Euclidean distance method.
[0018] Further, edge detection is performed on the tool image to obtain a tool edge map, including: detecting the tool image using a Canny detection algorithm to obtain a tool edge map.
[0019] The effect is that the Canny detection algorithm can accurately detect the real edge in the image and carefully locate the edge pixels, making it easier to extract the edge of the tool image.
[0020] Beneficial effect: When calculating the degree of damage of the tool, the pixel point and the pixel points in the neighborhood near the pixel point are used, taking into account the influence of the blade texture on its degree of damage. Moreover, based on the characteristics of the tool (the tool blade structure has central symmetry, and the symmetrical point of a pixel point belonging to the blade area may also be in the blade area), the degree of damage of the tool can be calculated more accurately, thereby improving the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The following detailed description is read with reference to the accompanying drawings, which illustrate several embodiments of the present invention in an exemplary and non-limiting manner, and in which like or corresponding reference numerals represent like or corresponding parts, wherein:
[0022] Figure 1 is a flow chart schematically illustrating calculation of the damage degree of a tool according to an embodiment of the present invention;
[0023] Figure 2 is a flow chart schematically illustrating obtaining a tool region according to an embodiment of the present invention;
[0024] Figure 3 is a grayscale diagram schematically showing a tool region according to an embodiment of the present invention;
[0025] Figure 4 is a diagram schematically showing a tool edge according to an embodiment of the present invention;
[0026] Figure 5 FIG. 1 is a schematic diagram schematically showing a damaged area of a blade according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0029] As a consumable part, the cutting part of the tool often breaks during the processing. If the broken tool is taken from the tool magazine for processing, the precision of the processed parts will be insufficient, or even the parts will be scrapped. Therefore, it is necessary to detect whether the tool in the tool magazine is broken and replace the broken tool in time to avoid the machine tool from processing the broken tool in the tool magazine. At present, Canny edge detection is usually used to extract the edge of the blade part of the tool in the image, and judge whether the tool is broken based on the extracted edge. However, this method ignores the process characteristics of the tool and is easy to misjudge the normal blade texture as broken. When judging that the tool is broken, the blade texture will affect the accuracy of the damage detection of the tool magazine tool. In order to solve the above problems, the following method can be used.
[0030] like Figure 1-Figure 5 As shown, S101: obtaining a tool area.
[0031] In one embodiment, the tool image is first collected. Specifically, when the tool blade of the tool magazine can be viewed directly and the image contains only one tool, an image acquisition device is arranged. In this embodiment, the image acquisition device can be a camera or an industrial camera. Then, when the tool is transferred from the machine tool to the tool magazine, the tool image is captured by the arranged image acquisition device to obtain the tool image. It should be noted that, since the image will inevitably capture parts other than the tool when the tool image is collected, this part of the image will affect the recognition of tool damage. Therefore, only the tool area in the tool image is identified through semantic segmentation to facilitate further identification of tool damage.
[0032] like Figure 2 As shown, in one embodiment, segmenting the tool region in the tool image by semantic segmentation includes the following steps.
[0033] S11: Constructing a data set. Specifically, images of normal tools and images of damaged tools of all models are collected to form a data set.
[0034] S12: Data labeling. Specifically, the labels of the pixel points in the image are divided into two categories, wherein the pixel points in the tool area in the image are labeled as 1, and the pixel points in the area outside the tool in the image are labeled as 0.
[0035] S13: Network selection. Specifically, in this embodiment, the Unet network structure is used, and the implementer can select a network module in the Unet network structure according to actual conditions.
[0036] In one embodiment, when using a tool, the blade of the tool is the main force-bearing part and is also the part most likely to be damaged. In order to realize the function of the tool blade, the blade of the tool is usually hard and smooth, which also makes the blade of the tool in the image have a higher gray value (e.g. Figure 3 As shown), in order to better detect whether the tool in the tool magazine is damaged, the present invention calculates the correlation of the pixel point in the blade area according to the gray value of the pixel point in the tool area.
[0037] S102: Calculate the correlation of the pixel points in the blade area.
[0038] In one embodiment, the correlation of the pixels is calculated based on the grayscale values of the pixels in the tool area, and the correlation indicates the possibility that the pixels are located in the blade area. The calculation formula is: In the formula, The first The correlation of the pixel points in the blade area, The first The gray value of a pixel, The first The average gray value of the eight neighboring pixels of a pixel. is the maximum gray value of the tool area.
[0039] in, is the normalized value of the grayscale value of the pixel point in the tool area. Since the tool edge in the image and the filamentary texture generated by the tool production process are usually in the bright area with high grayscale value, The smaller the value of The more pixels there are, the more likely they are to be outside the cutting edge of the tool. The larger the value of The more pixels there are, the more likely they are to be in the cutting edge area or on the filamentary texture of the tool.
[0040] In one embodiment, in order to avoid identifying the filamentary pattern area as the blade area, right Make corrections, The first The relative difference between the gray value of a pixel and the average gray value of its eight neighboring pixels. The closer the value of is to 1, the right The smaller the degree of correction; The greater the difference between the value of and 1, the right The greater the degree of correction; at this time, if ,when The more hours, the The smaller the difference between the gray value of a pixel and the average gray value of its eight neighboring pixels, the smaller the possibility that the pixel is in the filamentary texture. The smaller the value of right The greater the upward correction degree of , the greater the possibility that the pixel point is in the blade area. , then when The larger the value of The greater the difference between the gray value of the pixel and the average gray value of its eight neighboring pixels, the smaller the gray value difference between the pixel in the blade area and its neighboring pixels is. The less likely a pixel is to be on the cutting edge of the tool, The larger the value of right The greater the downward correction degree, the less likely the pixel is to be in the blade area.
[0041] S103: Calculate the probability value of a pixel point in the tool area being in the blade damage area.
[0042] In one embodiment, when the blade of a tool is damaged, the surface of the damaged part becomes rough and loses its original smoothness, resulting in a low probability that the corresponding pixel point in the tool area is in the blade area, making it difficult to detect the damage of the tool. Since the blade structure of the tool has central symmetry, a symmetrical point of a pixel point belonging to the blade area may also be in the blade area. Therefore, the present invention calculates the probability value of a pixel point being in the blade damage area based on the correlation between the pixel point in the tool area, the symmetrical pixel point of the pixel point, and the pixel point on the line connecting the pixel point and the symmetrical pixel point in the blade area.
[0043] In one embodiment, the probability value of a pixel point being in a blade damage area is calculated, including: for any pixel point in the tool area, obtaining a symmetrical pixel point of the pixel point with the tool center point in the tool image as the symmetry center, and based on the difference between the correlation of the pixel point and the correlation of its symmetrical pixel point, and calculating the average value of the correlation of all pixels passed by the line connecting the pixel point and the symmetrical pixel point, and taking the product of the difference and the average value as the probability value of the pixel point being in the blade damage area.
[0044] In one embodiment, the average value of the correlation between the pixel point and all the pixels that the line connecting the pixel point and the symmetrical pixel point passes through is calculated. For example, the number of all the pixels that the line connecting the pixel point and the symmetrical pixel point passes through is five, and the correlations of the five pixels are calculated to be , , , , , and then calculate the average value of the correlation of the five pixels, which is equal to ( ) / 5. So far, the average value of the correlation between the pixel and all the pixels through which the line connecting the pixel and the symmetrical pixel passes is obtained.
[0045] In one embodiment, the probability value of a pixel point being in a blade damage area is calculated using the following formula: ;in, The first The probability value of a pixel point being in the damaged area of the tool blade, The first The correlation of the pixel points in the blade area, The first The correlation of the symmetrical pixels of the pixels in the blade area, For the The average value of the correlation between a pixel and its symmetrical pixel.
[0046] in, The first The correlation between the pixel point in the blade area and the The difference between the correlation of the symmetrical pixel of the pixel point in the blade area. Since the blade structure of the tool has central symmetry, if the pixel point is in the blade damage area, then the symmetrical pixel point of the pixel point should also be in the blade area. The larger the The more likely the pixel or its symmetrical pixel is to be in the blade damage area; therefore The more hours, the The pixel point and its symmetrical pixel point are less likely to be in the blade damage area. The more hours, the The less likely a pixel point is to be in the blade area, the smaller its probability of being in the damaged blade area is. The bigger the The more likely a pixel is to be in the blade area, the greater the probability that it is in the damaged blade area. The larger the value of The greater the probability value of a pixel point being in the damaged area of the tool blade, The smaller the value of The smaller the probability value of a pixel point being in the damaged area of the tool blade.
[0047] It should be noted that the blade area includes the intact blade area and the damaged blade area. The larger the value, the The more likely the pixel is to be in the intact blade area or the damaged blade area, the The probability value of a pixel point being in the damaged area of the tool blade is relatively larger.
[0048] In one embodiment, calculating the distance between the corresponding position of a pixel point in a tool edge map and the nearest edge in the tool edge map includes: for any pixel point, obtaining the pixel point at the corresponding position of the pixel point in the tool edge map; obtaining the nearest edge between the pixel point at the corresponding position in the tool edge map, extracting the pixel point closest to the pixel point at the corresponding position in the nearest edge, and calculating the distance between the nearest pixel point and the pixel point at the corresponding position. The distance between the nearest pixel point and the pixel point at the corresponding position can be calculated by the Euclidean distance method.
[0049] It should be noted that, since the structure of the tool blade has central symmetry and continuity, the smaller the average value of the correlation between the pixel point and all the pixels on the line connecting the pixel point and its symmetrical pixel point in the blade area, the smaller the correlation between the pixel point and the symmetrical pixel point in the blade area. The more likely the pixel is not within the range of the tool blade area (including the intact blade area or the damaged blade area), the The smaller the probability value of a pixel point being in the damaged area of the tool blade; The larger the value, the The more likely the pixel is to be within the range of the tool edge area (intact edge area or damaged edge area), the The greater the probability that a pixel point is in the damaged area of the tool blade, the greater the probability that a pixel point is in the damaged area of the tool blade. The larger the value of is, the greater the probability that the pixel is in the damaged area. The greater the probability that a pixel is in the damaged area of the tool blade.
[0050] Step S104: Calculate the damage degree of the tool.
[0051] In one embodiment, during the use of a tool, the blade of the tool is the main force-bearing part, and different positions of the blade play different roles in the use of the tool. Whether the edge area of the blade is damaged as the main force-bearing part of the blade directly affects the accuracy of the processed parts, while the damage inside the blade has less impact on the accuracy of the processed parts compared to the damage at the edge of the blade. Therefore, the degree of damage to the tool can be calculated based on the probability value of the pixel point being in the blade damage area and the distance between the pixel point and the edge in the edge map.
[0052] In one embodiment, edge detection is performed on the tool image to obtain a tool edge map, and the degree of damage to the tool is calculated. Specifically, the tool image is detected using a Canny detection algorithm to obtain a tool edge map (such as Figure 4 As shown). The Canny detection algorithm, also known as the Canny edge detection algorithm, is a widely used image processing algorithm. The algorithm aims to find the optimal edge in the image to ensure good detection, positioning and minimum response. The characteristics of the Canny detection algorithm are: High accuracy: The Canny algorithm can accurately detect the real edge in the image and carefully locate the edge pixels. Noise suppression: Through steps such as Gaussian filtering and non-maximum suppression, the Canny algorithm can effectively suppress noise interference and improve the accuracy of edge detection. Edge connection: Using dual threshold detection and edge connection algorithms, the Canny algorithm can connect weak edges with strong edges to obtain continuous edge lines. Parameter adjustability: The parameters of the Canny algorithm (such as the size of the Gaussian filter, the setting of dual thresholds, etc.) can be adjusted according to the specific application to obtain edge detection results that meet the requirements.
[0053] In one embodiment, the damage degree of the tool is calculated using the following formula: ; In the formula, is the degree of damage of the tool, The first The probability value of a pixel point being in the damaged area of the tool blade, The first The distance between the corresponding position of a pixel point in the tool edge map and the nearest edge in the tool edge map, is the number of pixels in the tool area, and exp() is an exponential function with the natural constant e as the base.
[0054] in, is the relative distance between the pixel and the edge. The larger the value, the more likely the pixel is outside the blade, and the pixel has a smaller impact on whether the tool is broken. The smaller the value, the more likely the pixel is close to the edge of the blade, and the pixel has a greater impact on whether the tool is broken. As The weight of the tool edge damage area The larger the value, the more likely the tool is to be damaged. The smaller it is, the less likely the tool is to be damaged, and the degree of damage to the tool can be obtained through the probability value of the damaged area of the tool blade.
[0055] S105: Determine whether to replace the tool according to the degree of damage of the tool.
[0056] In one embodiment, if the damage degree of the tool is greater than a preset threshold, the tool is replaced; if the damage degree of the tool is less than the preset threshold, the tool does not need to be replaced. In this embodiment, the empirical value of the preset threshold is 0.5. In other embodiments, the empirical value of the preset threshold can be 0.4 or 0.55, etc., which can be set according to specific circumstances.
[0057] Through the above steps, when calculating the damage degree of the tool, the pixel point and the pixel points in the neighborhood of the pixel point are used, taking into account the influence of the blade texture on its damage degree, and according to the characteristics of the tool (the blade structure of the tool has central symmetry, and the symmetrical point of a pixel point belonging to the blade area may also be in the blade area), the damage degree of the tool can be calculated more accurately, and the accuracy of the detection result can be improved. Therefore, the tool damage detection of the tool magazine can detect the damage of the tool more timely and accurately, and avoid the production of defective products.
[0058] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0059] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0060] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A tool magazine tool damage detection method, characterized in that: include: The tool image is collected to obtain the tool area; according to the gray value of the pixel point in the tool area, the correlation of the pixel point in the blade area is calculated, and the calculation formula is: ; in, The first The correlation of the pixel points in the blade area, The first The gray value of a pixel, The first The average gray value of the eight neighboring pixels of a pixel. is the maximum gray value of the tool area; For any pixel point in the tool area, obtain the symmetrical pixel point of the pixel point with the tool center point as the symmetry center, and obtain the probability value of the pixel point being in the blade damage area according to the difference between the correlation between the pixel point and its symmetrical pixel point, and the product of the average value of the correlation between the pixel point and all the pixels on the line connecting the symmetrical pixel point and the difference, and then obtain the probability value calculation formula of all the pixels in the tool area being in the blade damage area: ; in, The first The probability value of a pixel point being in the damaged area of the tool blade, The first The correlation of the symmetrical pixels of the pixels in the blade area, For the The average value of the correlation between a pixel and all the pixels on the line connecting its symmetrical pixels; Obtain the tool edge map of the tool image and calculate the degree of tool damage. The calculation formula is: ; In the formula, is the degree of damage of the tool, The first The distance between the corresponding position of a pixel point in the tool edge map and the nearest edge in the tool edge map, is the number of pixels in the tool area, exp() is an exponential function with the natural constant e as the base; Whether to replace the tool is determined according to the degree of damage of the tool.
2. The tool magazine tool damage detection method according to claim 1, characterized in that: Get the tool image and get the tool area, including: The tool region is extracted from the tool image by using a semantic segmentation method.
3. The tool magazine tool damage detection method according to claim 1, characterized in that: According to the degree of damage of the tool, determining whether to replace the tool includes: In response to the degree of damage of the cutting tool being greater than a preset threshold, replacing the cutting tool; In response to the damage degree of the tool being less than a preset threshold, the tool does not need to be replaced.
4. The tool magazine tool breakage detection method according to claim 1, characterized in that: Calculate the distance between the corresponding position of the pixel point in the tool edge map and the nearest edge in the tool edge map, including: For any pixel point, obtain the pixel point at the corresponding position of the pixel point in the tool edge map; The nearest edge between the pixel point at the corresponding position in the tool edge map is obtained, the pixel point closest to the pixel point at the corresponding position in the nearest edge is extracted, and the distance between the nearest pixel point and the pixel point at the corresponding position is calculated.
5. The tool magazine tool breakage detection method according to claim 4, characterized in that: And calculate the distance between the nearest pixel and the pixel at the corresponding position, including: The distance between the nearest pixel and the pixel at the corresponding position is calculated using the Euclidean distance method.
6. The tool magazine tool damage detection method according to claim 1, characterized in that: Get tool edge map of tool image, including: The tool image is detected using a Canny detection algorithm to obtain a tool edge map.
Citation Information
Patent Citations
Precious metal detection and inspection workbench
CN214771895U
Method for positioning and monitoring wear of ball nose end mill cutter
CN102501140A
Cutter damage detection method based on image region division
CN110930405A