An aircraft part numerical control machining tool abnormality identification method
By setting camera imaging parameters and feature measurement and characterization methods on CNC machine tools, and combining them with a calibration board database, rapid and accurate tool error prevention judgment was achieved, solving the problem of tool change errors in existing technologies and improving machining quality and equipment automation level.
Patent Information
- Application Number
- CN202410437949.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-04-12
AI Technical Summary
Existing error prevention methods for CNC machine tools are insufficient for achieving fast, efficient, and accurate automated judgment, which can easily lead to errors when changing tools frequently, affecting machining quality and causing economic losses.
By setting camera imaging parameters to acquire tool images, denoising and local interference removal are performed using feature measurement and characterization methods. The tool position is adaptively identified, and a database is built in conjunction with a calibration board to realize the positioning and parameter calculation of key tool points. Minimum interval mapping is then performed to determine whether the tool has been picked up incorrectly.
It improves the accuracy and stability of tool error prevention, reduces damage to parts and machine tools caused by tool mishandling, provides core technical support for automated error prevention, and avoids errors caused by human intervention.
Smart Images

Figure CN118342334B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a tool anomaly detection method, specifically to a tool anomaly identification method for CNC machining tools used for aircraft parts. Background Technology
[0002] In the machining of aircraft parts, cutting based on the relative motion between the tool and the part is still the main machining method. During the machining process, the differences in tool type, parameters and surface quality directly affect the stability of the machining process, the reliability of parts, production efficiency and machining quality. Therefore, if the wrong tool is used, it can directly lead to the scrapping of parts or even the burning of the machine tool.
[0003] In actual machining processes, frequent tool changes are necessary, and in most domestic manufacturing enterprises, tool changes are still done manually. Manual tool changes are easily influenced by individual subjective factors, leading to errors. Even with CNC machine tools that can autonomously change tools, there is still a risk of incorrect tool changes. For aircraft manufacturing companies, most parts machined by CNC machine tools have high added value; tool errors can result in huge economic losses, ranging from hundreds of thousands to millions of yuan. The scrapping of parts due to incorrect tool changes is a loss that companies cannot afford. To reduce or even avoid part scrapping caused by tool changes or tool defects, accurate identification of tool type and parameters is crucial. Therefore, it is essential to determine tool parameters during machining, after tool changes, before machining, or periodically.
[0004] Analysis of existing tool error-proofing methods reveals that current CNC machine tool error-proofing methods are insufficient to meet the needs of rapid, efficient, and accurate online error prevention. To achieve automated tool error prevention while reducing human intervention during part machining to improve equipment automation, tool parameter error-proofing judgment and identification are crucial and represent a pressing issue for the industry.
[0005] To address the technical problems of existing tool error prevention methods, this invention proposes a tool error prevention judgment and analysis method with high error prevention accuracy, good stability of repeatability parameter error prevention, and low implementation cost. Summary of the Invention
[0006] The purpose of this invention is to provide an effective method for identifying abnormal cutting tools in CNC machining of aircraft parts. This method enables the determination of whether the wrong tool has been selected before part processing, and can determine whether the tool meets the specified tool selection requirements. This helps to ensure machining quality and solve the problems of machining quality and part scrap caused by incorrect tool selection. At the same time, it provides a guiding reference method for similar scenarios.
[0007] To achieve the above-mentioned objectives, the technical solution of the present invention is as follows:
[0008] A method for identifying abnormal cutting tools in CNC machining of aircraft parts, characterized by comprising the following steps:
[0009] Step a: Set the camera imaging parameters and acquire the tool image, parse the tool image data and represent it as matrix data M(i);
[0010] Step b: Use the feature measurement representation method to denoise the matrix data M(i) to obtain the dimension-reduced matrix data pimg(i), and then remove local and random interference from the matrix data pimg(i).
[0011] Step c: Adaptively identify and correct the tool position in the interference-removed matrix data to obtain matrix data Fimg;
[0012] Step d: Identify and extract feature regions from the matrix data Fimg to locate the position range of the tool in the image and obtain the matrix data Kimg;
[0013] Step d: Complete the identification and positioning of key tool points in the matrix data Kimg;
[0014] Step e: Use the fabricated calibration plate to image and analyze the image to obtain matrix data ML, construct a one-to-one mapping relationship between the core calibration point data of matrix data ML and the physical length values, obtain a text file recording the core calibration point data, and generate a calibration point database based on the data processing of the text file to obtain the submatrix MS(j).
[0015] Step f: Minimum interval mapping, determine the location of key points in the calibration point database, and calculate the tool length error prevention value;
[0016] Step g: Minimum interval mapping, determine the position of the key point in the calibration point database submatrix MS(j), and calculate the tool diameter error prevention value;
[0017] Step h: The error prevention value is obtained and compared with the set threshold to realize the error prevention judgment.
[0018] Furthermore, the matrix data M(i) is denoised using a feature metric representation method, including:
[0019] In the matrix data M(i), several points are randomly collected in the non-tool region around the tool feature to obtain the point set set1, and the number of corresponding matrix data M(i) is greater than 3.
[0020] Calculate the distance difference between each pair of points in the point set set1 in each submatrix of the matrix data M(i), and record the number of points in each submatrix. If the value of a certain submatrix differs greatly from the value of another submatrix, and the corresponding number of points is the largest, then the matrix data M(i) is reduced in dimension using the value of the corresponding submatrix. The matrix data after dimensionality reduction is denoted as pimg(i).
[0021] Furthermore, the removal of local and random interference from the matrix data pimg(i) includes:
[0022] The designed spatial processing convolutional structure is used to transform the matrix data pimg(i) to highlight the differences between the tool and non-tool regions.
[0023] Set the truncation value numC for the matrix data pimg(i). Perform dimensionality reduction on the data in the matrix pimg(i). Set the minimum value for points smaller than numC, and set the maximum value for points larger than numC. The minimum and maximum values are the range values ∈ [0,28] that can be represented by the image gray levels.
[0024] Design a directed fixed anchor point structure struct to determine the range of the processing area required by the convolution structure;
[0025] Random interference removal is performed on the truncated matrix data pimg(i) based on the designed directed fixed anchor point structure struct.
[0026] Furthermore, the adaptive identification and correction of the tool position in the interference-removed matrix data includes:
[0027] Obtain the number of rows and columns of the matrix data after removing interference. Calculate the minimum row number Rmin and the maximum row number Rmax corresponding to the leftmost column of the matrix data. Record half of the difference between the minimum row number Rmin and the maximum row number Rmax as Rb.
[0028] The tool region features in the matrix data are obtained by rotating the tool region at the same scale and angle with point P(c,r) as the center point; where c is equal to the column of the center point of the matrix, and r represents the corresponding row number, which is equal to the value of Rmin plus Rb.
[0029] Record the tool feature data in the matrix and the corresponding tool matrix data at the same scale after each α angle transformation, and obtain the total number of (Dα+Uα) / α transformed matrix data, denoted as Num; where Uα represents the angle boundary of upward rotation with the horizontal axis as reference, which is negative, and Dα represents the angle boundary of downward rotation with the horizontal axis as reference, which is positive, and the reference horizontal axis value is zero.
[0030] The effective length value L(u) of the tool in column Nc of each matrix data in Num is obtained, where u∈[1,Num]. The effective length value L(u) is the number of matrix data rows in column Nc.
[0031] Similarly, calculate and record the effective length value L(u) for Num matrix data. The calculation method is to count the number of connected effective pixels and save it. In the saving method, u in L(u) corresponds to the number of matrix data.
[0032] By comparing Num L(u), we can find the minimum L(u) in Num matrix data and deduce that the minimum L(u) is the same as the angle α corresponding to the horizontal axis.
[0033] Using point P(c,r) as the transformation center, the matrix data before correction is processed using the same feature scale method. If the value of α is negative, a clockwise equal scale transformation is performed; if the corresponding value of α is positive, a counterclockwise equal scale transformation is performed.
[0034] After processing, the corrected tool feature matrix data Fimg is obtained.
[0035] Furthermore, feature region identification and extraction are performed on the matrix data Fimg, including:
[0036] For the matrix data Fimg, the gradient magnitude and direction corresponding to each coordinate point are calculated based on the first-order gradient formula. For each point with a non-zero gradient, the points with non-zero gradient values in its eight neighborhoods are connected to obtain independent closed regions. The aspect ratio of the obtained closed feature regions is compared. If the aspect ratio of the tool is not satisfied, the corresponding region feature is removed. The remaining feature region is the feature region corresponding to the tool. The corresponding processed matrix data is denoted as Kimg.
[0037] Furthermore, the identification and positioning of key tool points in the completed matrix data Kimg includes:
[0038] Using the horizontal right-center axis as a reference, starting from the leftmost side, scan each point in the feature matrix data Kimg from top to bottom and from left to right until the corresponding value is the high value corresponding to the non-tool area. The corresponding point is the key point PL(x,y) of the tool length value, where x represents the value in the horizontal direction and y represents the value in the vertical direction.
[0039] Based on the obtained key point coordinates, offset to the left by a distance Lp. Based on the offset value, the reference point Pd(x1,y) for diameter measurement can be obtained. Keeping the horizontal coordinate of the reference point Pd unchanged, the key point is searched in the vertical direction. When the point value changes from a low value to a high value, the corresponding gray point is the upper boundary Pu(x1,y1) and lower boundary Pd(x1,y2) corresponding to the tool diameter.
[0040] Similarly, from Pd(x1,y) to PL(x,y), the coordinates of all key points are obtained in the same way as Pu(x1,y1) and Pd(x1,y2), with the number of points of constant y being x-x1.
[0041] In the coordinate point set set(P), two y values with the same x-axis but different y-axis values on the upper and lower sides are grouped into a set of points. The differences of all y values that can form a set of points are compared, and the differences are sorted from smallest to largest. The set of points corresponding to the median of all the differences is the point representing the tool diameter, namely Pdu(x,y) and Pdd(x,y).
[0042] Furthermore, when acquiring the calibration plate image, the calibration plate is placed on the same plane as the tool end face photographed during tool measurement. This plane is collectively referred to as the standard imaging plane, meaning that the distance from the camera's imaging optical axis to the plane where the calibration plate is located is consistent with the distance at which the maximum end face of the tool can be clearly imaged. The calibration plate is adjusted within the standard imaging plane so that the main scale line in the image obtained by the camera is located at the center line of the image. Based on this, the calibration plate is adjusted again so that point O of the calibration plate in the image is located at the far left of the center line. After the adjustment is in place, the calibration plate is imaged to obtain the calibration plate image lab-img.
[0043] Furthermore, the minimum interval mapping, used to determine the location of key points in the calibration point database and to calculate the tool length error-proofing value, includes:
[0044] Determine the position of the key point PL(x,y) corresponding to the tool length value in the calibration point database, and determine the column where the x value of the corresponding y row in the calibration point database is located based on the x value corresponding to the key point PL(x,y).
[0045] Determine the distances disL and disR of the data points on the left and right sides of the x-axis in the y-axis.
[0046] If disL < disR, it means that the key point PL(x,y) is closer to the left. Based on the coordinate point (x-disL,y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j) and calculate the corresponding tool length value.
[0047] If disL>disR, it means that the key point PL(x,y) is closer to the right. Based on the coordinate point (x+disR,y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j) and calculate the corresponding tool length value.
[0048] For keypoints PL(x,y) that coincide with the calibration points in the submatrix MS(j) of the same calibration point database, the corresponding values do not require difference calculations; they can be obtained by directly reading the values of each corresponding submatrix.
[0049] Furthermore, the minimum interval mapping, used to determine the position of the key point in the calibration point database submatrix MS(j) and calculate the tool diameter error-proofing value, includes:
[0050] Determine the position of the key point Pdu(x,y) corresponding to the tool diameter value in the calibration point database, and determine the x column of the corresponding y value in the calibration point database based on the x value corresponding to the key point Pdu(x,y).
[0051] Determine the distances disU and disD of the data points in column x that are closest to the top and bottom points of column y.
[0052] If disU>disD, it means that the key point Pdu(x,y) is closer to the bottom. Based on the coordinate point (x,y-disU), extract the corresponding three sub-matrix values in the calibration point database sub-matrix MS(j) and calculate the corresponding tool diameter relative to the upper value num1 of the horizontal geometric centerline.
[0053] If disU≤disD, it means that the key point Pdu(x,y) is closer to the top. Based on the coordinate point (x,y+disD), extract the corresponding three sub-matrix values in the calibration point database sub-matrix MS(j) and calculate the corresponding tool diameter relative to the upper value num1 of the horizontal geometric centerline.
[0054] Similarly, the key point Pdd(x,y) is obtained in the same way as the key point Pdu(x,y) to obtain the corresponding value num2 relative to the lower side of the horizontal geometric center line; the corresponding tool diameter value is the sum of the values num1 and num2.
[0055] For keypoints Pdu(x,y) and Pdd(x,y) that coincide with the calibration points in the submatrix MS(j) of the same calibration point database, the corresponding values do not need to be differencing; they can be obtained by directly reading the values of each corresponding submatrix.
[0056] In summary, the present invention has the following advantages:
[0057] The tool anomaly identification method of this invention does not affect the error prevention effect even if the imaging position deviation is caused by the tool error prevention device. The designed position-based calibration strategy can significantly improve the granularity of the results and avoid problems such as scrapping of parts and machine tools due to tool mishandling. It lays a solid foundation and guarantee for the mass production and delivery of aircraft. At the same time, it fills the gap in the core technology of automated tool error prevention device. The technical foundation provided by this invention can serve as the core technical support for realizing tool error prevention equipment and devices. Attached Figure Description
[0058] Figure 1 This is a diagram illustrating the implementation steps of the present invention;
[0059] Figure 2 A schematic diagram illustrating the representation of data as matrix data M(i) for parsing tool images;
[0060] Figure 3 This is a schematic diagram of obtaining standard matrix data based on the calibration board. Detailed Implementation
[0061] To more clearly illustrate the present invention, the following description, in conjunction with preferred embodiments and accompanying drawings, further clarifies the invention. Those skilled in the art should understand that the specific description below is illustrative rather than restrictive and should not be construed as limiting the scope of protection of the present invention.
[0062] This invention provides a method for identifying abnormal cutting tools in CNC machining of aircraft parts, comprising the following steps:
[0063] Step 1: Based on the structural differences of the tool imaging device, set the parameters for the camera to acquire tool images, and then obtain high-quality tool feature matrix data.
[0064] The parameter setting strategy and specific method for the camera to acquire tool images are as follows: 1. The distance from the camera to the tool axis is set to the focal point (FOC) value based on the principle of clear imaging; 2. Exposure (Vn) is the most critical parameter. The set Vn value should be as small as possible, while the corresponding feature difference between the tool and non-tool areas should be large, thus ensuring that the background and tool outlines are distinct and there is no blurring in the transition zone. This value should not be changed after setting; 3. The brightness (Vb), gain (Ve), white balance (Vb), contrast (Vc), and sharpness (Vf) values are all set to fixed values. The setting criterion is that test imaging can obtain tool images with significant differences. The test imaging steps are: change the above parameters until the parameter with the optimal segmentation accuracy between the tool and background areas in the image (i.e., the image is clear while the color difference between the tool foreground and non-tool areas is obvious) is the set parameter. The camera installation angle should ensure that the number of rows in the obtained image is less than the number of columns.
[0065] After setting the imaging parameters, the tool image is acquired as follows: the tool rotates at a low speed with the spindle (the rotation speed is the lowest adjustable speed of the machine tool), and the camera is set to acquire the tool image b_image(i) at the maximum frame rate Vmax. The low-level image parsing software code b_image(i) developed based on C language represents the data as matrix data M(i). Each matrix value contains three sub-matrices, meaning each corresponding point in the matrix has three values. The acquisition time of the matrix data is T, i∈[1,n], where n represents the total number of matrix data obtained within time T. The corresponding time should satisfy T≥360° / (360° / Vmax). The area where the tool's length direction is located in the matrix data should be near the geometric center line of the matrix data to reduce errors introduced by distortion and improve error prevention accuracy.
[0066] Step 2: To improve the quality of the tool matrix data M(i), a feature metric representation method is used to process the noisy data. The specific steps are as follows:
[0067] 1) Randomly collect several points in the non-tool region around the tool feature in the matrix data M(i) to obtain the point set set1, and the number of corresponding matrix data M(i) is greater than 3;
[0068] 2) Calculate the distance differences between each pair of points in the point set set1 within the three sub-matrices of the matrix data M(i), and record the number of points in each sub-matrix. If the value of one sub-matrix differs significantly from the values of the other two sub-matrices, and the corresponding sub-matrix has the largest number of recorded points, then the corresponding sub-matrix is beneficial for separating the non-tool region from the tool region. The three sub-matrix matrix data M(i) is then dimensionality-reduced using the values of the corresponding sub-matrixes, resulting in the dimensionality-reduced matrix data denoted as p. img (i).
[0069] To improve matrix data p img (i) Quality: Local and random disturbances are removed from the matrix data. The specific steps are as follows:
[0070] 1) Based on the designed spatial processing 3*3 convolutional structure {0,-1,0,-1,5,-1,0,-1,0} for matrix data p img (i) Perform transformation processing to highlight the differences between the tool and non-tool areas;
[0071] 2) Set matrix data p img (i) Numerical truncation of the value numC to modify the matrix p img (i) performs dimensionality reduction on the data to improve the speed of the entire process error-proofing calculation and analysis. Points smaller than numC are set to the minimum value, and those larger than numC are set to the maximum value. The minimum and maximum values are the range of values that the image gray levels can represent ∈ [0, 2]. 8 ];
[0072] 3) Design a directed fixed anchor point structure struct. The purpose is to use this structure to determine the range of the area to be processed by the convolution structure. Directed means that the representation area of the structure has directionality. The anchor point is the value of the covered point assigned to the value of the point when performing anomaly removal.
[0073] To ensure that the influence of tool characteristics is minimized while the filtering effect of anomalies is maximized, the designed structure struct has a width of w, with an empirical value of 1, and a length of numL. numL should not be too large or too small. If it is too small, it will affect the ability to filter anomalies; if it is too large, it will cause changes in the characteristics of the tool.
[0074] In this embodiment, the mathematical model of the structure (struct) can be represented as:
[0075]
[0076] Wherein, if represents the judgment condition, struct represents the result value after removing local and random interference from the matrix data, H(cols,rows) represents the value corresponding to the anchor point; cols represents the column corresponding to the data point in the matrix; rows represents the row corresponding to the data point in the matrix; a represents the total number of columns in the matrix after adding a columns in the column direction, which is an integer multiple of the length of the anchor structure; b represents the total number of rows in the matrix after adding b rows in the row direction, which is an integer multiple of the width of the anchor structure; count represents the summation operation; H(x,y) represents the value corresponding to the operation; length = numL, which represents the structure length; step_x and step_y represent the step size of the processing, respectively.
[0077] 4) Random interference removal is performed on the truncated matrix data pimg(i) based on the designed structure struct. This yields the matrix data pimg(i) processed by the directed fixed anchor point structure struct.
[0078] Step 3: Adaptive identification and correction of tool position in matrix data pimg(i).
[0079] The purpose of the correction is to quickly and accurately position the tool axis, correcting it to row / 2, where row is the row number corresponding to the data in matrix data pimg(i). The horizontal tilt angle corresponding to the tool in matrix data pimg(i) is 0, thereby reducing the measurement error caused by position deviation. The specific steps of adaptive identification and correction are as follows:
[0080] 1) Calculate matrix data p using the number of rows and columns of the direct number matrix. img(i) The minimum row number Rmin and the maximum row number Rmax corresponding to the leftmost column, the difference between Rmax and Rmin, and the value of half the difference is Rb;
[0081] 2) The tool region features in the matrix data are rotated at the same scale and angle with point P(c,r) as the center point. Here, c is equal to the column of the center point of the matrix, and r represents the corresponding row number, which is equal to the value of Rmin plus Rb. The purpose of the rotation is to transform the data to obtain corrected intermediate process data. The corresponding equal scale means that the data of the tool-occupied points in the rotation matrix remain unchanged before and after the tool-related feature data. The equal angle means that the angles corresponding to the transformations before and after are equal in size, both of which are α∈[Uα,Dα], where α is a decimal greater than or equal to zero. Uα represents the angle boundary of upward rotation with the horizontal axis as the reference, which is a negative value. Dα represents the angle boundary of downward rotation with the horizontal axis as the reference, which is a positive value. The reference horizontal axis value is zero.
[0082] 3) Record the tool feature data in the matrix and the corresponding tool matrix data at the same scale after each α angle transformation. A total of (Dα+Uα) / α transformed matrix data can be obtained. The value of (Dα+Uα) / α after the operation is recorded as the quantity Num.
[0083] 4) Obtain the effective length value L(u) of the tool in column Nc for each matrix data in Num. u corresponds to the subscript of the corresponding transformation matrix data, u∈[1,Num]. The effective length value L(u) is the number of matrix data rows in column Nc.
[0084] 5) Similarly, calculate and record the effective length value L(u) for Num matrix data. The calculation method is to count the number of connected effective pixels and save it. In the saving method, u in L(u) corresponds to the number of matrix data.
[0085] 6) Compare Num L(u) values to find the minimum L(u) value in Num matrix data, and deduce that the minimum L(u) value is the same as the α angle corresponding to the horizontal axis.
[0086] 7) The matrix data before correction is processed with point P(c,r) as the transformation center point. The processing method is the equal feature scale method, that is, the size of the tool in the matrix data will not change with the transformation and the area occupied by the tool in the matrix data space. If the value of α is negative, the clockwise equal scale transformation is performed; if the corresponding value of α is positive, the counterclockwise equal scale transformation is performed.
[0087] 8) After processing, the corrected tool feature matrix data is obtained, denoted as Fimg.
[0088] Step 4: Complete the feature matrix data Fimg feature region identification and region acquisition.
[0089] The purpose of this step is to more accurately locate the position range of the tool in the image, which is a prerequisite for key point identification. The specific steps for feature region identification and region acquisition are as follows:
[0090] The processed feature matrix data Fimg calculates the gradient magnitude and direction for each coordinate point based on the first-order gradient formula. For each point with a non-zero gradient, its eight neighboring points with non-zero gradient values are connected, resulting in independent closed regions. Since the features enclosed by the tool region have a large aspect ratio, the aspect ratios of the obtained closed feature regions are directly compared. If the aspect ratio does not meet the tool's characteristics, the corresponding region feature is removed, and the remaining feature region is the feature region corresponding to the tool. Let the corresponding processed result matrix data be denoted as Kimg.
[0091] Step 5: Complete the identification and positioning of key tool points in the feature matrix data Kimg.
[0092] The purpose of this step is to obtain tool parameters based on the obtained key points, in order to prepare for error prevention. The specific implementation method of tool key point data identification and positioning is as follows:
[0093] 1) Using the horizontal right-center axis as a reference, scan each point in the matrix data Kimg starting from the leftmost side. If the corresponding value matches the value represented by the tool area, continue searching to the right. The scanning method is to compare the value of each point from left to right, and to use a top-down and left-to-right approach until the corresponding value is a high value that is not in the tool area. The corresponding point is the key point PL(x,y) corresponding to the tool length value, where x represents the value in the horizontal direction and y represents the value in the vertical direction.
[0094] 2) Based on the coordinates of the obtained key point PL(x,y), offset it to the left by a distance Lp. The reason for offsetting is that the calibration data is completed in a discrete manner. Based on the offset value, the reference point Pd(x1,y) for diameter measurement can be obtained. Based on the corresponding x1, the key point is searched in the vertical direction. During the search, x1 remains unchanged, while y is searched. The search includes upward and downward searches. For upward searches, when the corresponding point value changes abruptly from a low value to a high value, the corresponding low value point is the upper boundary Pu(x1,y1) corresponding to the tool diameter. Similarly, for downward searches, when the corresponding point value changes abruptly from a low value to a high value, the corresponding low value point is the upper boundary Pu(x1,y1) corresponding to the tool diameter. The high-value point corresponds to the lower boundary Pd(x1,y2) of the tool diameter. Similarly, from Pd(x1,y) to PL(x,y), the number of points with constant y is x-x1. The same acquisition method is used for Pu(x1,y1) and Pd(x1,y2) to obtain the coordinate set set(P) of all key points. Two different y values above and below the same x-value constitute a set of points. The differences of all y values that can form a set of points in the coordinate set set(P) are compared, and the differences are sorted from smallest to largest. The set of points corresponding to the median of all sorted differences is the point representing the tool diameter, i.e., Pd. u (x,y) and Pd d (x,y).
[0095] Step Six: Calibration Board Fabrication. The purpose of the calibration board is to improve the accuracy of data mapping and achieve the effect and objective of super-resolution measurement. Standard matrix data is obtained based on the calibration board.
[0096] The calibration plate was made as a transparent flat calibration plate, which was placed vertically without any local warping.
[0097] The scale on the calibration plate corresponds to the actual physical length contained in its corresponding area.
[0098] The main scale line on the calibration plate is located at the geometric center of the calibration plate along its length, and the distance between unit calibration points is I. L This ensures that each calibration point has its corresponding scale value;
[0099] The secondary scale line is a straight line perpendicular to the corresponding primary scale line, and the distance between unit calibration points is I. W Each calibration point has its corresponding scale value.
[0100] Step 7: Data calibration board imaging strategy, which maps each pixel on the calibration board to its corresponding scale space, in order to provide reference data for tool data acquisition.
[0101] When acquiring calibration plate images, the calibration plate is placed on the same plane as the tool end face photographed during tool measurement. This plane is collectively called the standard imaging plane, meaning the distance from the camera's imaging optical axis to the plane where the calibration plate is located is consistent with the distance at which the maximum end face of the tool can be clearly imaged. The calibration plate is adjusted within the standard imaging plane so that the main scale line in the image obtained by the camera is located at the center line of the image. Based on this, the calibration plate is adjusted again so that point O of the calibration plate in the image is located at the far left of the center line. The purpose of this adjustment is to facilitate the construction of the calibration database. After the adjustment is in place, the calibration plate is imaged to obtain the calibration plate image lab-img.
[0102] Step 8: Constructing a one-to-one mapping relationship between the core calibration point data of the matrix data and the physical length values. The purpose of this step is to automatically determine the actual physical length value corresponding to each point in the calibration points. The steps for constructing the one-to-one mapping relationship are as follows:
[0103] 1) Read the calibration board image lab-img and parse it into matrix data ML. The parsing method is implemented directly using low-level software code developed in C language, ensuring that each point in the two-dimensional space of the image has the same spatial distribution relationship in the matrix data ML. The number of columns corresponding to each unit calibration point on the main scale in the matrix data ML is calculated. All columns of the calibration points are read sequentially from left to right, and the corresponding data is stored in a text file. Each point on the main scale line corresponds to one line in the text file, and the data format is {N_L_P, w1=p1_w2=p2_ … wn=pn}, where N is the marker bit, L represents the actual physical length L, and P represents the column value corresponding to the length L in the matrix data ML;
[0104] 2) Read the unit distance I of the sub-scale corresponding to each unit calibration point on the main scale in the matrix data ML. W The corresponding row numbers, from the main tick line upwards, are p1 for sub-tick w1, p2 for sub-tick w2, and so on until pn for sub-tick wn;
[0105] 3) After processing all data points, a text file containing the core calibration point data is obtained.
[0106] Step 9: Implementation strategy for generating the calibration point database, resulting in the submatrix MS(j). The purpose of the database submatrix MS(j) is to enable rapid and efficient location and calculation of key point data based on the calibrated point data during error-proofing tool installation. The specific steps for generating the calibration point database implementation strategy are as follows:
[0107] 1) Based on the size data of matrix data M(i), generate three submatrices of the same size, i.e., the values of the elements in each submatric are all zero, denoted as MS(j), where j belongs to 1, 2, and 3;
[0108] 2) Read the first line of data from the text file containing core calibration point data, and parse the data into a string, denoteing the corresponding line of characters as str;
[0109] 3) Find the index number Bloc corresponding to the character after the "N_" character in str. The index number of the entire str starts from 0. At the same time, find the index number Eloc corresponding to the character before the second "_" character in str.
[0110] 4) Extract the corresponding interval of the string Lstr from str based on the index values Bloc and Eloc, and convert the string Lstr to a floating-point number to obtain the floating-point number Lnum;
[0111] 5) Find the index Dloc of the character before the first character "," and the index Floc of the character after the second character "_" in str;
[0112] 6) Extract the corresponding range of string from str based on the index numbers Floc and Dloc, and convert the string to the integer type Znum;
[0113] 7) By using the integer Znum and the row value corresponding to the geometric center of the main scale line on the calibration plate along the length direction of the calibration plate, we can obtain the point Ptemp. The coordinates of the corresponding point in the submatrix MS(j) can be determined. The floating-point number Lnum is parsed into three numbers that can be represented by three submatrices using different data representation modes. The integer part of Lnum is assigned to the first submatrix in Ptemp, the decimal part of Lnum is assigned to the second submatrix in Ptemp ("." is represented by 0), and the decimal part of Lnum is assigned to the third submatrix in Ptemp.
[0114] 8) Continue parsing the remaining characters "," in the first line of str, and the length I between adjacent unit reference points. W The coordinates of Znum at the corresponding point in MS(j) are determined using the same principle as Ptemp assignment, based on the data p1 after "w1=", to determine the corresponding values of the three submatrices at the corresponding point.
[0115] 9) Process {w2=p2_ in sequence … The values corresponding to wn=pn} are assigned to the three submatrix data of the corresponding points in MS(j) in the same way until all the data corresponding to all lines in the text file are processed, and then the calibrated submatrix MS(j) is obtained.
[0116] Step 10: Minimum interval mapping to determine the location of the error-proofing point in the calibration point database and to calculate the error-proofing value for tool length. The real-time steps of minimum interval mapping are as follows:
[0117] 1) Determine the position of the key point PL(x,y) corresponding to the tool length value in the calibration point database. Based on the x value corresponding to the key point PL(x,y), determine the column where the x value in the corresponding y row of the calibration point database is located. Then, determine the distances between the x value in the y row and the calibration data points to its left and right, denoted as disL and disR. The left and right calibration tables are denoted as PointL and PointR respectively. The physical length between the two points is denoted as D. LR The corresponding number of pixels is Vp;
[0118] 2) If disL < disR, it means that the key point PL(x,y) is closer to the left. Based on the coordinate point ((x-disL), y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j). The first submatrix is the integer part value V1, the second submatrix is the decimal point marker V2, and the third submatrix is the decimal part value V3. The remaining disL represents the physical length D. E The solution is obtained by using the difference method, i.e., D. E =(D LR The corresponding tool length value, / Vp)*disL, can be expressed as (D LR / Vp)*disL+V1+V3;
[0119] 3) If disL > disR, it means that the key point PL(x,y) is closer to the right. Based on the coordinate point ((x+disR), y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j). The first submatrix is the integer part value V1', the second submatrix is the decimal point marker V2', and the third submatrix is the decimal part value V3'. The extra disR represents the physical length D. s The solution is obtained by using the difference method, i.e., D. s =(D LR The corresponding tool length value, / Vp)*disR, can be expressed as V1'+V3'-(D LR / Vp)*disR;
[0120] 4) For key points PL(x,y) that coincide with the calibration points in the submatrix MS(j) of the same calibration point database, the corresponding values do not need to be interpolated; they can be obtained by directly reading the values of each corresponding submatrix.
[0121] Step 11: Minimum interval mapping to determine the position of the error-proofing point in the calibration point database submatrix MS(j), and to calculate the error-proofing value of the tool diameter. The calculation method is as follows:
[0122] 1) Key point Pd corresponding to the tool diameter value u The position of (x, y) in the calibration point database is determined based on key point Pd. u In the coordinate (x, y) array, the x-value corresponding to the y-value is located in the x-column of the calibration point database. The distances between the y-value and the calibration data points above and below it in the x-column are denoted as disU and disD, respectively. The upper and lower calibration point tables are denoted as PointU and PointD, respectively, and the physical length between the two points is denoted as D. LR (The minimum physical length for calibration is equal for the horizontal and vertical directions), and the corresponding number of pixels is Vq;
[0123] 2) If disU > disD, it means the key point is Pd. u (x, y) is closer to the bottom. Based on the coordinate point (x, (y-disU)), the corresponding three sub-matrix values are extracted from the calibration point database sub-matrix MS(j). The first sub-matrix is the integer part value V1", the second sub-matrix is the decimal point marker V2", the third sub-matrix is the decimal part value V3", and the remaining disU represents the physical length D. E The solution is obtained by using the difference method, i.e., D. E =(D LR The corresponding tool diameter relative to the upper side of the horizontal geometric center line can be expressed as (D) * disU. LR / Vq)*disU+V1”+V3”;
[0124] 3) If disU≤disD, it means the key point Pd u (x, y) is closer to the top. Based on the coordinates (x, (y+disD)), the corresponding values of the three sub-matrixes are extracted from the calibration point position in the calibration point database sub-matrix MS(j). The first sub-matrix contains the integer part value V1”', the second sub-matrix contains the decimal point marker V2”', and the third sub-matrix contains the decimal part value V3”'. The extra disD represents the physical length D. s The solution is obtained by using the difference method, i.e., D. s =(D LR / Vq)*disD, the corresponding tool diameter relative to the upper value num1 on the horizontal geometric center line can be expressed as V1”'+V3”'-(D LR / Vq)*disD;
[0125] 4) Similarly, the key point Pd d (x,y) uses the same key point Pdu The corresponding value num2 relative to the lower side of the horizontal geometric center line is obtained in the same way as (x,y); the corresponding tool diameter value is the sum of the values num1 and num2.
[0126] 5) For key point Pd u (x,y) and Pd d (x,y) falls at the position where the calibration point coincides in the submatrix MS(j) of the same calibration point database. The corresponding value does not need to be interpolated; it can be obtained by directly reading the value of each submatrix.
[0127] Step 12: Compare the obtained error prevention value with the set threshold to determine the error prevention. If the error prevention parameter meets the deviation requirement, the selected tool is correct; otherwise, there is a problem, indicating that the wrong tool was selected, thus achieving the purpose of error prevention.
[0128] It is worth noting that the purpose of this invention is not to measure the tool parameters with high accuracy, but to determine whether the tool has been picked up incorrectly. That is, the measurement results are allowed to have a certain deviation from the actual results. In actual testing, the measurement deviation is negligible compared with the machining error and tolerance. The determination of whether the tool has been picked up incorrectly can be made before machining on the CNC machine tool and after tool changing.
[0129] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for identifying abnormal cutting tools in CNC machining of aircraft parts, characterized in that, Includes the following steps: Step a: Set the camera imaging parameters and acquire the tool image, parse the tool image data and represent it as matrix data M(i); Step b: Denoise the matrix data M(i) using a feature metric representation method to obtain the dimension-reduced matrix data p. img (i) Then, for the matrix data p img (i) Perform local and random interference removal; Step c: Adaptively identify and correct the tool position in the interference-removed matrix data to obtain matrix data Fimg; Step d: Identify and extract feature regions from the matrix data Fimg to locate the position range of the tool in the image and obtain the matrix data Kimg; Step e: Complete the identification and positioning of key tool points in the matrix data Kimg; Step f: Use the fabricated calibration plate to image and analyze the image to obtain matrix data ML, construct a one-to-one mapping relationship between the core calibration point data and physical length values of matrix data ML, obtain a text file recording the core calibration point data, and generate a calibration point database based on the data processing of the text file to obtain the submatrix MS(j). Step g: Minimum interval mapping, determine the location of key points in the calibration point database, and calculate the tool length error prevention value; Step h, minimum interval mapping, determines the location of key points in the calibration point database and calculates the tool diameter error prevention value; Step 1: Compare the obtained error prevention value with the set threshold to determine the error prevention mechanism; The aforementioned denoising process for matrix data M(i) using a feature metric representation method includes: In the matrix data M(i), several points are randomly collected in the non-tool region around the tool feature to obtain the point set set1, and the number of corresponding matrix data M(i) is greater than 3. Calculate the pairwise distance differences between each point in the point set set1 and each submatrix of the matrix data M(i), and record the number of points in each submatrix. If the value of a certain submatrix differs significantly from the values of other submatrixes, and the corresponding number of points is the largest, then the matrix data M(i) is reduced in dimensionality using the value of the corresponding submatrix; the resulting dimension-reduced matrix data is denoted as p. img (i); The aforementioned matrix data p img (i) Perform local and random interference removal, including: The designed spatial processing convolutional structure is used to transform the matrix data pimg(i) to highlight the differences between the tool and non-tool regions. Given matrix data pimg(i), the truncated value numC is numi. For matrix p... img The data in (i) undergoes dimensionality reduction processing. Points smaller than numC are set to the minimum value, and points larger than numC are set to the maximum value. The minimum and maximum values are the range of values that the image grayscale levels can represent, ∈ [0, 2]. 8 ]; Design a directed fixed anchor point structure struct to determine the range of the processing area required by the convolution structure; Random interference removal is performed on the truncated matrix data pimg(i) based on the designed directed fixed anchor point structure struct; The adaptive identification and correction of tool position in the interference-removed matrix data includes: Obtain the number of rows and columns of the matrix data after removing interference. Calculate the minimum row number Rmin and the maximum row number Rmax corresponding to the leftmost column of the matrix data. Record half of the difference between the minimum row number Rmin and the maximum row number Rmax as Rb. The tool region features in the matrix data are obtained by rotating the tool region at the same scale and angle with point P(c,r) as the center point; where c is equal to the column of the center point of the matrix, and r represents the corresponding row number, which is equal to the value of Rmin plus Rb. The tool feature data in the recording matrix is in each α After angle transformation, the corresponding tool matrix data at the same scale is obtained as (Dα+Uα) / α, which is the total number of transformed matrix data, denoted as Num; where Uα represents the angle boundary of upward rotation with the horizontal axis as the reference, which is a negative value, and Dα represents the angle boundary of downward rotation with the horizontal axis as the reference, which is a positive value, and the reference horizontal axis value is zero. The effective length value L(u) of the tool in column Nc of each matrix data in Num is obtained, where u∈[1, Num]. The effective length value L(u) is the number of matrix data rows in column Nc. Similarly, calculate and record the effective length value L(u) for Num matrix data. The calculation method is to count the number of connected effective pixels and save it. In the saving method, u in L(u) corresponds to the number of matrix data. By comparing Num L(u) values, we find the L(u) value that minimizes the corresponding value in the Num matrix data, and then deduce that the minimum L(u) value is the same as the value corresponding to the horizontal axis. α angle; Using point P(c,r) as the transformation center, the uncorrected matrix data is processed using an equal feature scale method. α If the value is negative, a clockwise isoscale transformation is performed; if the corresponding value is negative... α If the value is positive, perform a counterclockwise equal-scale transformation; After processing, the corrected tool feature matrix data Fimg is obtained; The aforementioned feature region identification and extraction of matrix data Fimg includes: For the matrix data Fimg, the gradient magnitude and gradient direction corresponding to each coordinate point are calculated based on the first-order gradient formula; for each point with a non-zero gradient, the points with non-zero gradient values in its eight neighborhoods are connected to obtain independent closed regions; the aspect ratio of the obtained closed feature regions is compared, and if it does not meet the aspect ratio feature of the tool, the corresponding region feature is removed, and the remaining feature region is the feature region corresponding to the tool. The corresponding processing result matrix data is denoted as Kimg. The identification and positioning of tool key points in the completed matrix data Kimg includes: Using the horizontal right-center axis as a reference, starting from the leftmost side, scan each point in the feature matrix data Kimg from top to bottom and from left to right until the corresponding value is the high value corresponding to the non-tool area. The corresponding point is the key point PL(x,y) of the tool length value, where x represents the value in the horizontal direction and y represents the value in the vertical direction. Based on the obtained key point coordinates, offset to the left by a distance Lp. Based on the offset value, the reference point Pd(x1,y) for diameter measurement can be obtained. Keeping the horizontal coordinate of the reference point Pd unchanged, the key point is searched in the vertical direction. When the point value changes from a low value to a high value, the corresponding gray point is the upper boundary Pu (x1,y1) and lower boundary Pd (x1,y2) corresponding to the tool diameter. Similarly, from Pd(x1,y) to PL(x,y), the coordinates of all key points are obtained by using the same method as Pu(x1,y1) and Pd(x1,y2), with the number of points of constant y being x-x1. In the coordinate point set set(P), two y values with the same x-axis but different y-axis values on the upper and lower sides are grouped into a set of points. The differences of all y values that can form a set of points are compared, and the differences are sorted from smallest to largest. The set of points corresponding to the median of all the differences is the point representing the tool diameter, namely Pdu(x,y) and Pdd(x,y).
2. The method for identifying abnormal cutting tools in CNC machining of aircraft parts according to claim 1, characterized in that, When acquiring images of the calibration plate, the calibration plate is placed on the same plane as the tool end face photographed during tool testing. This plane is collectively referred to as the standard imaging plane, meaning that the distance from the camera's imaging optical axis to the plane where the calibration plate is located is consistent with the distance at which the maximum end face of the tool can be clearly imaged. The calibration plate is adjusted within the standard imaging plane so that the main scale line in the image obtained by the camera is located at the center line of the image. Based on this, the calibration plate is adjusted again so that point O of the calibration plate in the image is located at the far left of the center line. After the adjustment is in place, the calibration plate is imaged to obtain the calibration plate image lab-img.
3. The method for identifying abnormal cutting tools in CNC machining of aircraft parts according to claim 1, characterized in that, The minimum interval mapping, used to determine the location of key points in the calibration point database and to calculate tool length error-proofing values, includes: Determine the position of the key point PL(x,y) corresponding to the tool length value in the calibration point database, and determine the column where the x value of the corresponding y row in the calibration point database is located based on the x value corresponding to the key point PL(x,y). Determine the distances disL and disR of the data points on the left and right sides of the x-axis in the y-axis. If disL < disR, it means that the key point PL(x,y) is closer to the left. Based on the coordinate point (x-disL,y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j) and calculate the corresponding tool length value. If disL>disR, it means that the key point PL(x,y) is closer to the right. Based on the coordinate point (x+disR,y), extract the corresponding three submatrix values in the calibration point database submatrix MS(j) and calculate the corresponding tool length value. For keypoints PL(x,y) that coincide with the calibration points in the submatrix MS(j) of the same calibration point database, the corresponding values do not require difference calculations; they can be obtained by directly reading the values of each corresponding submatrix.
4. The method for identifying abnormal cutting tools in CNC machining of aircraft parts according to claim 1, characterized in that, The aforementioned minimum interval mapping, used to determine the location of key points in the calibration point database and calculate the tool diameter error-proofing value, includes: Determine the position of the key point Pdu(x,y) corresponding to the tool diameter value in the calibration point database, and determine the x column of the corresponding y value in the calibration point database based on the x value corresponding to the key point Pdu(x,y). Determine the distances disU and disD of the data points in column x that are closest to the top and bottom points of column y. If disU>disD, it means that the key point Pdu(x,y) is closer to the bottom. Based on the coordinate point (x,y-disU), extract the corresponding three sub-matrix values in the calibration point database sub-matrix MS(j), and calculate the corresponding tool diameter relative to the upper value num1 of the horizontal geometric centerline. If disU≤disD, it means that the key point Pdu(x,y) is closer to the top. Based on the coordinate point (x,y+disD), extract the corresponding three sub-matrix values in the calibration point database sub-matrix MS(j) and calculate the corresponding tool diameter relative to the upper value num1 of the horizontal geometric centerline. Similarly, the key point Pdd(x,y) is obtained in the same way as the key point Pdu(x,y) to obtain the corresponding value num2 relative to the lower side of the horizontal geometric center line; the corresponding tool diameter value is the sum of the values num1 and num2. For key points Pdu(x,y) and Pdd(x,y) that coincide with the calibration points in the submatrix MS(j) of the same calibration point database, the corresponding values do not need to be differencing; they can be obtained by directly reading the values of each corresponding submatrix.
Citation Information
Patent Citations
Method for measuring tool dimension, measurement device, and machine tool
CN103189712A
Monitoring method based on image features and LLTSA algorithm for tool wear state
CN107378641A