A machine vision-based automatic cutter tool setting method and system
By integrating the milling cutter motion state with machine vision information, the problem of the milling cutter setting system being affected by environmental factors is solved, realizing an efficient and accurate automatic tool setting method, quantifying the impact of tool wear and positioning deviation, and improving the overall performance of the tool setting system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-03-31
AI Technical Summary
Existing milling cutter setting systems are susceptible to factors such as cutting fluid reflection, dry cutting dust and chips, and tool motion blur, resulting in low setting efficiency and accuracy. Furthermore, there is a lack of quantitative analysis of the impact of actual tool wear and positioning deviation.
By deeply fusing milling cutter motion state information with machine vision information, and combining image denoising, motion blur processing, edge detection, and error feature correlation analysis, the current position and wear degree of the milling cutter are obtained, and the path compensation amount is calculated to adjust the tool setting path.
It improves the positioning efficiency and accuracy of milling cutter tool setting, reduces manual intervention, and realizes automatic quantitative adjustment and correction of milling cutter tool setting.
Smart Images

Figure CN121616664B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of milling cutter tool setting technology, and more specifically to a machine vision-based automatic milling cutter tool setting method and system. Background Technology
[0002] In traditional milling cutter setting, the milling machine table is moved manually or mechanically to bring the milling cutter closer to the workpiece. The table is initially moved to a position where the cutter can approach the workpiece, and then fine-tuned to bring the distance between the cutter and workpiece close to the starting position. Finally, a trial cut or manual setting using a tool setter is performed. This method relies heavily on operator experience and suffers from low efficiency, inconsistent accuracy, and high labor costs.
[0003] Existing automatic tool setting systems mostly use contact sensors for tool setting. While this method is more efficient than traditional methods, it carries the risk of equipment wear. Therefore, machine vision-based methods are employed for tool setting. These methods acquire images of the milling cutter to plan its tool setting path, control the cutter's movement along this path, and optimize the path by calculating tool setting deviations through edge detection. However, this method is susceptible to factors such as cutting fluid reflection, dry cutting dust and chips, and tool motion blur, leading to inaccurate cutter positioning and affecting both efficiency and accuracy. Furthermore, the tool setting process typically relies on edge detection to determine the cutter position and optimize the path, without quantifying the impact of actual tool wear and positioning deviations on path optimization. Therefore, further improvements to existing milling cutter tool setting systems are needed to address these shortcomings. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a machine vision-based automatic milling cutter tool setting method and system. By deeply fusing the motion state information of the milling cutter with machine vision information and analyzing the error characteristics of the milling cutter, this invention solves the technical problem that existing milling cutter tool setting systems are susceptible to the influence of tool setting environmental factors, resulting in low tool setting efficiency and accuracy.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] In a first aspect, the present invention provides an automatic milling cutter tool setting method based on machine vision, comprising the following steps:
[0007] The initial tool setting path of the milling cutter and the original tool setting image of the milling cutter in the initial tool setting path are obtained, and the environmental noise in the original tool setting image is removed by a preset image denoising network to obtain the first image;
[0008] Obtain encoder data to detect the motion state of the milling cutter, input the encoder data and the first image into a preset motion blur model for image deblurring processing, and obtain the second image;
[0009] Edge detection is performed on the second image to extract the edge contour of the milling cutter, and the sub-pixel coordinates of the edge points of the edge contour are calculated. Parametric fitting is performed based on the sub-pixel coordinates of the edge points to obtain the current position and posture of the milling cutter.
[0010] The wear degree of the milling cutter is obtained, and the initial tool setting path, the wear degree of the milling cutter, the current position of the milling cutter, and the attitude of the milling cutter are input into a preset error prediction model for error correlation analysis. The spatial statistical error features, wear error features, and attitude error features of the milling cutter are extracted. At the same time, the feature contribution of the spatial statistical error features, wear error features, and attitude error features to the milling cutter motion error is calculated. Based on the feature contribution, the feature values of the spatial statistical error features, wear error features, and attitude error features are weighted, and the current motion error of the milling cutter is output.
[0011] The path compensation amount is calculated based on the current motion error of the milling cutter, and the tool setting path between the current milling cutter position and the target tool setting position is adjusted according to the path compensation amount.
[0012] Further, to obtain the initial tool setting path of the milling cutter, the following steps are performed:
[0013] Acquire an image of the initial position of the milling cutter, input the image of the initial position of the milling cutter into a preset target detection model to locate the initial position of the milling cutter, and map the initial position coordinates of the milling cutter in the spatial coordinate system of the machining scene based on the initial position of the milling cutter;
[0014] Based on the initial position coordinates of the milling cutter and the target tool setting position coordinates, the initial tool setting path of the milling cutter is planned in the machining scene.
[0015] Further, the environmental noise in the original knife-setting image is removed using a preset image denoising network to obtain the first image, and the following steps are performed:
[0016] The original tool-setting image is converted to grayscale, and the grayscale original tool-setting image is input into a preset image denoising network. The preset image denoising network includes an input layer, a feature extraction layer, a feature fusion layer, and a noise separation layer. The feature extraction layer includes a basic feature extraction unit, an oil stain feature extraction unit, and a metal scrap feature extraction unit.
[0017] The basic features, oil stain features, and iron filings features of the milling cutter are extracted from the grayscale original tool setting image using the basic feature extraction unit, oil stain feature extraction unit, and iron filings feature extraction unit, respectively.
[0018] The feature fusion layer adaptively weights and fuses the basic features of the milling cutter, oil stain features, and metal chip features to obtain the fused noise distribution.
[0019] Based on the fusion noise distribution, the noise separation layer performs environmental noise separation on the grayscale original knife-setting image through weighted subtraction, and constrains the residual amplitude during environmental noise separation to between 0 and 1 through the Sigmoid function, outputting the original knife-setting image after environmental noise separation as the first image.
[0020] Further, the encoder data for detecting the milling cutter's motion state is acquired, and the encoder data and the first image are input into a preset motion blur model for image deblurring to obtain the second image. The following steps are then performed:
[0021] The encoder pulse signal sequence used for real-time detection of the milling cutter's motion state is read, and Kalman filtering is used to smooth the encoder pulse signal sequence to obtain encoder data; the milling cutter's motion state includes the milling cutter's rotation angle, angular velocity, and rotational speed;
[0022] The first image is cropped by ROI to obtain the tool area image of the milling cutter, and the encoder data is timestamped and aligned with the tool area image of the milling cutter.
[0023] The encoder data aligned with the timestamp and the tool area image of the milling cutter are respectively input into a preset motion blur model for image deblurring to obtain a second image. The following steps are then performed:
[0024] Multiple CUDA thread blocks are used to perform Fourier transforms on each row and column of the milling cutter's tool region image in parallel to obtain the frequency domain image;
[0025] Based on the encoder data, a frequency domain representation of the fuzzy kernel is generated using a lookup table method;
[0026] Based on the frequency domain representation, the frequency domain image is restored using an inverse filtering formula, and the restored frequency domain image is subjected to an inverse Fourier transform to obtain a second image with deblurring.
[0027] Further, the second image is subjected to edge detection to extract the milling cutter edge contour, and the sub-pixel coordinates of the edge points of the milling cutter edge contour are calculated. Parameterized fitting is then performed based on the sub-pixel coordinates of the edge points to obtain the current milling cutter position and milling cutter posture. The following steps are then executed:
[0028] Edge detection is performed on the second image using image processing algorithms, and multiple milling cutter edge contours are extracted from the second image.
[0029] From multiple milling cutter edge profiles, the milling cutter edge profile with the smallest profile area is selected for sub-pixel edge localization, and the Zernike moment operator is used to calculate the sub-pixel coordinates of the edge points of the milling cutter edge profile;
[0030] The shape of the milling cutter is determined based on the edge contour of the milling cutter. If the shape of the cutter is cylindrical, a straight line is fitted based on the sub-pixel coordinates of the edge points of the edge contour of the milling cutter to obtain the center coordinates and direction angle of the milling cutter.
[0031] If the tool shape is spherical, then the center coordinates and orientation angle of the milling cutter are obtained by performing circle fitting based on the sub-pixel coordinates of the edge points of the milling cutter edge contour;
[0032] If the tool shape is elliptical, then ellipse fitting is performed based on the sub-pixel coordinates of the edge points of the milling cutter edge profile to determine the center coordinates and orientation angle of the milling cutter;
[0033] The center coordinates and orientation angle of the milling cutter are converted into physical coordinates in a spatial coordinate system to obtain the current position and posture of the milling cutter.
[0034] Further, to obtain the wear degree of the milling cutter, the following steps are performed:
[0035] The measured diameter of the milling cutter is calculated based on the sub-pixel coordinates of the edge points of the milling cutter edge profile and the shape fitting of the milling cutter edge profile.
[0036] Obtain the theoretical diameter of the milling cutter and calculate the error between the measured diameter and the theoretical diameter;
[0037] Wear analysis is performed based on the number of times the milling cutter is used, the error value, and the preset wear classification threshold to determine the wear degree of the milling cutter; the wear degree of the milling cutter includes new cutter set, semi-worn cutter set, and old cutter set.
[0038] Further, to obtain the wear degree of the milling cutter, the following steps are performed:
[0039] A convolutional neural network was trained using historical milling cutter wear data and milling cutter wear classification criteria to obtain a milling cutter wear classification model;
[0040] Geometric and statistical feature analysis is performed based on the sub-pixel coordinates of edge points on the edge profile of the milling cutter to extract the geometric and statistical features of the milling cutter.
[0041] The geometric and statistical features of the milling cutter are input into the milling cutter wear classification model for wear identification and classification, and the wear degree of the milling cutter is output.
[0042] Further, the following steps are performed: Calculating the path compensation amount based on the current motion error of the milling cutter, and adjusting the tool setting path between the current milling cutter position and the target tool setting position based on the path compensation amount.
[0043] Based on the weights of the eigenvalues in the current motion error of the milling cutter, the compensation components for the spatial statistical error, wear error, and attitude error of the milling cutter are calculated respectively, and the calculated compensation components are summed to obtain the path compensation amount.
[0044] Based on the current cutter position, the tool setting path between the cutter and the target tool setting position is corrected in real time according to the path compensation amount.
[0045] Secondly, the present invention also provides a machine vision-based automatic milling cutter tool setting system, comprising:
[0046] The initial position acquisition module is used to acquire the initial position image of the milling cutter, input the initial position image of the milling cutter into the preset target detection model to locate the initial position of the milling cutter, and map the initial position coordinates of the milling cutter in the spatial coordinate system of the machining scene based on the initial position of the milling cutter.
[0047] The path planning module is used to plan the initial tool setting path of the milling cutter in the machining scene based on the initial position coordinates of the milling cutter and the target tool setting position coordinates.
[0048] The first image processing module is used to obtain the initial tool setting path of the milling cutter and the original tool setting image of the milling cutter in the initial tool setting path, and to remove environmental noise in the original tool setting image using a preset image denoising network to obtain the first image.
[0049] The second image processing module is used to acquire encoder data for detecting the motion state of the milling cutter, input the encoder data and the first image into a preset motion blur model for image deblurring processing, and obtain the second image.
[0050] The tool positioning module is used to perform edge detection on the second image, extract the edge contour of the milling cutter, calculate the sub-pixel coordinates of the edge points of the edge contour of the milling cutter, and perform parametric fitting based on the sub-pixel coordinates of the edge points to obtain the current position and posture of the milling cutter.
[0051] The error prediction module is used to obtain the wear degree of the milling cutter, and input the initial tool setting path, the wear degree of the milling cutter, the current position of the milling cutter, and the attitude of the milling cutter into the preset error prediction model for error correlation analysis. It extracts the spatial statistical error features, wear error features, and attitude error features of the milling cutter, and calculates the feature contribution of the spatial statistical error features, wear error features, and attitude error features to the motion error of the milling cutter. Based on the feature contribution, the feature values of the spatial statistical error features, wear error features, and attitude error features are weighted, and the current motion error of the milling cutter is output.
[0052] The path optimization module is used to calculate the path compensation amount based on the current motion error of the milling cutter, and adjust the tool setting path between the current milling cutter position and the target tool setting position according to the path compensation amount.
[0053] In summary, the present invention has the following beneficial effects:
[0054] This invention provides an automatic milling cutter setting method based on machine vision. The method removes environmental noise such as oil and metal filings from the original milling cutter setting image using a preset image denoising network to obtain a first image. Simultaneously, encoder data detecting the milling cutter's motion state is fused with the first image, and a preset motion blur model is used for image deblurring to obtain a second image. This deep fusion of the milling cutter's motion state information and machine vision information suppresses positioning deviations caused by high-speed tool rotation, effectively reducing milling cutter motion blur and interference from environmental factors. Furthermore, this invention extracts the milling cutter's edge contour through edge detection and further performs sub-pixel localization. The sub-pixel coordinates of the edge points of the milling cutter's edge contour are calculated and parametrically fitted to obtain the current milling cutter position and posture. Compared to traditional methods using single edge detection for localization, this improves the efficiency and accuracy of milling cutter localization. Finally, this invention integrates the wear degree of the milling cutter, the initial tool setting path, the current position of the milling cutter, and the milling cutter posture to perform error feature correlation analysis. By using a preset error prediction model, the current motion error of the milling cutter is quantitatively predicted, and the path compensation amount is calculated based on the error to adaptively adjust the tool setting path of the milling cutter, reducing manual intervention. At the same time, it realizes automatic quantitative adjustment and correction of the milling cutter tool setting. Attached Figure Description
[0055] Figure 1 This is a flowchart of an automatic milling cutter tool setting method based on machine vision according to the present invention;
[0056] Figure 2 This is a schematic diagram of the preset image denoising network structure of the present invention;
[0057] Figure 3 This is a functional module block diagram of an automatic milling cutter tool setting system based on machine vision according to the present invention. Detailed Implementation
[0058] The present invention will be further described in detail below with reference to the accompanying drawings.
[0059] To make the objectives, solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0060] The following is in conjunction with the appendix of this invention. Figures 1-3 The embodiments of the present invention will be described in detail below.
[0061] Example 1:
[0062] In this embodiment of the invention, reference is made to Figure 1 The present invention discloses an automatic milling cutter tool setting method based on machine vision, which includes the following steps:
[0063] S1: Obtain the initial tool setting path of the milling cutter and the original tool setting image of the milling cutter in the initial tool setting path, and use a preset image denoising network to remove environmental noise in the original tool setting image to obtain the first image;
[0064] S2: Obtain encoder data to detect the motion state of the milling cutter, input the encoder data and the first image into a preset motion blur model for image deblurring processing, and obtain the second image.
[0065] S3: Perform edge detection on the second image, extract the edge contour of the milling cutter, calculate the sub-pixel coordinates of the edge points of the milling cutter edge contour, and perform parameter fitting based on the sub-pixel coordinates of the edge points to obtain the current position and posture of the milling cutter.
[0066] S4: Obtain the wear degree of the milling cutter, and input the initial tool setting path, the wear degree of the milling cutter, the current position of the milling cutter, and the attitude of the milling cutter into the preset error prediction model for error correlation analysis. Extract the spatial statistical error features, wear error features, and attitude error features of the milling cutter. At the same time, calculate the feature contribution of the spatial statistical error features, wear error features, and attitude error features to the milling cutter motion error, and perform feature value weighting on the spatial statistical error features, wear error features, and attitude error features according to the feature contribution, and output the current motion error of the milling cutter.
[0067] S5: Calculate the path compensation amount based on the current motion error of the milling cutter, and adjust the tool setting path between the current milling cutter position and the target tool setting position according to the path compensation amount.
[0068] Furthermore, in step S1 of this embodiment of the invention, obtaining the initial tool setting path of the milling cutter includes, but is not limited to, the following sub-steps:
[0069] S11: Acquire the initial position image of the milling cutter, input the initial position image of the milling cutter into the preset target detection model to locate the initial position of the milling cutter, and map the initial position coordinates of the milling cutter in the spatial coordinate system of the machining scene based on the initial position of the milling cutter;
[0070] S12: Based on the initial position coordinates of the milling cutter and the target tool setting position coordinates, plan the initial tool setting path of the milling cutter in the machining scene.
[0071] Specifically, in this embodiment of the invention, when acquiring the initial position image of the milling cutter in sub-step S11, the image of the milling cutter is mainly obtained by installing a camera on the milling machine tool, including the initial position image of the milling cutter and the original tool setting image during the tool setting process. In this embodiment of the invention, a three-dimensional spatial coordinate system can be constructed based on the machining scene where the milling machine tool is located, and the position coordinates of the camera can be pre-set in the three-dimensional spatial coordinate system for subsequent calculation.
[0072] After acquiring the initial position image of the milling cutter via a camera, this embodiment of the invention uses a preset target detection model to detect and locate the initial position of the milling cutter in the image, and maps the initial position coordinates of the milling cutter to the spatial coordinate system of the machining scene based on the initial position of the milling cutter. Specifically, the preset target detection model is obtained by training a YOLOv5 model using a set of milling cutter images. Different types and specifications of milling cutter images can be used in the milling cutter image set for model training to improve the target detection model's ability to detect and recognize milling cutter types and specifications. The specific training process for the milling cutter target detection model can refer to existing target detection model training procedures, and will not be elaborated further in this embodiment of the invention.
[0073] After the initial position of the milling cutter in the image is detected and located using a preset target detection model, the three-dimensional initial position coordinates of the milling cutter can be calculated using triangulation. Alternatively, the image coordinates of the initial position of the milling cutter can be mapped and converted into three-dimensional initial position coordinates in the spatial coordinate system of the machine tool through camera calibration (intrinsic parameters + extrinsic parameters). When performing coordinate mapping and transformation, one of the coordinate transformation methods can be selected according to actual needs. The specific coordinate transformation process can refer to the existing triangulation coordinate transformation and camera calibration coordinate transformation methods, which will not be elaborated further in this embodiment of the invention.
[0074] Specifically, in step S12 of this embodiment, after obtaining the initial position coordinates of the milling cutter, an initial tool setting path for the milling cutter to perform tool setting can be planned in the machining scene based on the target tool setting position coordinates. The target tool setting position coordinates can be the corresponding spatial coordinates of the workpiece to be machined on the machine tool, or the target machining position coordinates of the milling cutter when machining the workpiece. These two coordinates can be input by the operator, or obtained by scanning and acquiring images using a camera separately installed on the machine tool and performing coordinate calculations.
[0075] Furthermore, in step S1 of this embodiment of the invention, a preset image denoising network is used to remove environmental noise from the original knife-setting image to obtain a first image, including but not limited to the following sub-steps:
[0076] S13: The original tool-setting image is converted to grayscale, and the grayscale original tool-setting image is input into a preset image denoising network. Wherein, refer to... Figure 2As shown, the preset image denoising network includes an input layer, a feature extraction layer, a feature fusion layer, and a noise separation layer; the feature extraction layer includes a basic feature extraction unit, an oil stain feature extraction unit, and an iron filings feature extraction unit.
[0077] In this embodiment of the invention, the preset image denoising network is a multi-branch residual network obtained by training an image denoising network based on a convolutional neural network. By performing branch-specific training on the basic features of oil stains, iron filings and the milling cutter itself during the milling process, the network model can effectively improve the processing efficiency of environmental noise such as oil stains and iron filings in the image, while preserving the original image detail features of the milling cutter to the greatest extent, providing a good image foundation for the subsequent accurate positioning of the milling cutter.
[0078] Specifically, the training process of the preset image denoising network in this embodiment of the invention is as follows:
[0079] Training dataset construction. Multiple milling cutter machining images were acquired, and simulated noise was added to these images to obtain the training dataset. The simulated noise included oil noise simulating splashing effects and dust and metal chip noise simulating different machining conditions.
[0080] The model structure is improved. A feature extraction layer, a feature fusion layer, and a noise separation layer are added after the input layer of the convolutional neural network. The feature extraction layer includes three branches: a basic feature extraction unit, an oil stain feature extraction unit, and a metal scrap feature extraction unit. The input of each branch is connected to the input layer, and the input of the feature fusion layer is connected to the outputs of the three branches. The output of the feature fusion layer is connected to the input of the noise separation layer, resulting in the improved convolutional neural network.
[0081] Model Training. The training dataset is input into an improved convolutional neural network. Feature maps are extracted through the input layer and fed into three branch units for oil stain feature extraction, iron filings feature extraction, and basic feature extraction, respectively. The extracted features are then fed into a feature fusion layer for dynamic weighted fusion to obtain fused features, which are then fed into a noise separation layer for noise separation. The noise separation layer uses residual learning to learn the noise distribution (residual). Finally, the network model uses a multi-scale fusion loss function to adjust the parameters of the improved convolutional neural network, resulting in a trained preset image denoising network. The multi-scale fusion loss function includes a pixel-level loss function, a structural similarity function, and an edge constraint function. To protect the tool's geometric features, this invention introduces a structural similarity function and an edge constraint function into the multi-scale fusion loss function. These functions ensure that the denoised tool contour conforms to the tool shape while maintaining consistency between the denoised edges and the original image edges.
[0082] S14: Denoise the original grayscale image of the knife-wielding object using a preset image denoising network, specifically including:
[0083] S141: The basic features, oil stain features, and iron filings features of the milling cutter are extracted from the grayscale original tool setting image using the basic feature extraction unit, oil stain feature extraction unit, and iron filings feature extraction unit, respectively.
[0084] S142: The basic features of the milling cutter, oil stain features and iron chip features are adaptively weighted and fused through the feature fusion layer to obtain the fused noise distribution;
[0085] S143: Based on the fusion noise distribution, the noise separation layer performs environmental noise separation on the grayscaled original knife-setting image using weighted subtraction. The residual amplitude during environmental noise separation is constrained to between 0 and 1 using the Sigmoid function, and the output original knife-setting image after environmental noise separation is used as the first image. To avoid over-correction of the noise-separated image, this embodiment uses the Sigmoid function to limit the residual amplitude during noise separation. The non-linear characteristics of the Sigmoid function allow the network to adaptively adjust the correction intensity of the residual based on the noise intensity of the input image, preventing excessive weakening of the structural signal due to excessively large residuals.
[0086] This invention improves the denoising quality of the image by using a preset image denoising network to separate environmental noise such as oil stains and iron filings in the original milling cutter setting image.
[0087] Furthermore, based on the above sub-steps S11~S14, in step S2 of this embodiment of the invention, encoder data for detecting the motion state of the milling cutter is obtained, and the encoder data and the first image are input into a preset motion blur model for image deblurring processing to obtain the second image, including but not limited to the following sub-steps:
[0088] S21: Read the encoder pulse signal sequence used for real-time detection of the milling cutter's motion state, and smooth the encoder pulse signal sequence using Kalman filtering to obtain encoder data. The encoder is fixed to the milling machine spindle or the tool motor shaft and is used to detect the milling cutter's motion state in real time. The milling cutter's motion state includes its rotation angle, angular velocity, and speed. The encoder generates encoder data by detecting and acquiring the milling cutter's motion state. During encoder data acquisition, a camera synchronous triggering mechanism can be used, that is, using the encoder's zero-position pulse (Z-phase) to trigger camera exposure, ensuring that the tool is in a fixed phase (e.g., tool tip facing upwards) during each image acquisition, avoiding random motion blur. Alternatively, an asynchronous compensation method can be used, that is, during the time period when the camera acquires the milling cutter image, the encoder's starting angle, ending angle, and speed change are recorded, facilitating subsequent calculation of the milling cutter's motion state using synchronized timestamps.
[0089] S22: Cropping the ROI of the first image yields the tool region image of the milling cutter. Timestamp-aligning the encoder data with the tool region image solves the problem of motion parameters being out of sync with the image due to encoder signal transmission delay. By cropping the ROI of the image, deblurring is performed only on the tool region, reducing the amount of data processed by the model and improving the efficiency of model deblurring.
[0090] S23: Input the timestamp-aligned encoder data and the tool area image of the milling cutter into a preset motion blur model for image deblurring to obtain a second image, including:
[0091] S231: Multiple CUDA thread blocks are used in parallel to perform Fourier transforms on each row and column of the milling cutter's tool area image to obtain a frequency domain image. By using CUDA threads to process part of the computational tasks in the frequency domain transform in parallel, the speed of image deblurring is further improved, which can meet the real-time control requirements of milling cutter machines.
[0092] S232: Based on the encoder data, the frequency domain representation of the fuzzy kernel is generated using a lookup table method.
[0093] S233: Based on the frequency domain representation, the frequency domain image is restored using the inverse filtering formula, and the restored frequency domain image is subjected to inverse Fourier transform to obtain the second image after deblurring.
[0094] Specifically, this embodiment of the invention uses an image deblurring method based on encoder parameters to construct a motion blur model. The specific process of constructing the motion blur model is as follows:
[0095] Collect historical encoder data during milling operations and convert the encoder data into image coordinates through hand-eye calibration.
[0096] High-speed motion-blurred images are acquired synchronously with encoder data during milling operations. Mathematical modeling is then performed based on the motion blur type in these images to construct corresponding blur kernels. The motion blur types include rotational motion blur and linear motion blur; therefore, the blur kernels constructed in this embodiment include rotational blur kernels and linear blur kernels, specifically determined by the motion blur type of the milling cutter.
[0097] Finally, the high-speed motion-blurred image and image coordinates are input into the blur kernel for iterative training of image restoration to obtain the preset motion-blurred model.
[0098] This invention employs an image deblurring method based on encoder feedback to deblur the image, achieving precise compensation for blurring caused by high-speed rotation of the milling cutter, thereby improving the tool setting accuracy of the milling cutter in high-speed machining scenarios.
[0099] Further, in step S3 of this embodiment of the invention, edge detection is performed on the second image to extract the milling cutter edge contour, and the sub-pixel coordinates of the edge points of the milling cutter edge contour are calculated. Parameterized fitting is then performed based on the sub-pixel coordinates of the edge points to obtain the current milling cutter position and milling cutter posture, including but not limited to the following sub-steps:
[0100] S31: Edge detection is performed on the second image using an image processing algorithm to extract multiple milling cutter edge contours from the second image. The image processing algorithm can employ the existing Canny edge detection algorithm to extract the edges of the milling cutters. Alternatively, image processing algorithms such as the Sobel operator and the Laplacian operator can be used to perform edge detection on the second image. The specific choice depends on the actual application requirements or detection needs. The use of the Canny algorithm, Sobel operator, and Laplacian operator for milling cutter edge detection can be implemented by referring to existing image edge detection procedures, which will not be elaborated upon here.
[0101] Alternatively, a deep learning-based model can be used to detect the milling cutter edges in the second image. The U-Net model can be trained on this model. The U-Net deep learning model is used to segment the ROI region of the milling cutter; morphological refinement is performed on the segmentation results to extract single-pixel edges, and the contour of the milling cutter edge is obtained by summing all single-pixel edges. Furthermore, after segmenting the milling cutter edges using the U-Net deep learning model, the distance between the worn edge and the standard edge can be further calculated to quantify the wear degree of the milling cutter, providing a data foundation for subsequent prediction of milling cutter motion errors.
[0102] S32: Select the milling cutter edge contour with the smallest contour area from multiple milling cutter edge contours for sub-pixel edge positioning, and use the Zernike moment operator to calculate the sub-pixel coordinates of the edge points of the milling cutter edge contour.
[0103] In the process of subpixel edge detection, among the multiple milling cutter edge contours obtained by edge detection, the bounding rectangle with the smallest contour area needs to be selected as the base image for subpixel edge detection. During the subpixel localization process, subpixel edge detection is performed on the milling cutter edge contour by using a subpixel interpolation algorithm (such as bilinear interpolation or Gaussian fitting). After obtaining the subpixel edge, the Zernike moment operator is used to calculate the subpixel coordinates of the edge points of the milling cutter edge contour, thereby achieving accurate subpixel localization of the milling cutter.
[0104] Specifically, as a further improvement of the present invention, in the sub-pixel edge detection process, pixels can be extended along the edge normal direction of the milling cutter edge contour to obtain a series of pixel points passing through the edge line, and the gray values corresponding to these pixel points are calculated. Then, based on the mathematical characteristics of the gray distribution of these points, the fitting function and curve are obtained using the fifth orthogonal polynomial least squares fitting principle. The position of the sub-pixel point of the image edge is then determined based on the fitting curve, thereby achieving accurate sub-pixel positioning of the edge point.
[0105] S33: Determine the tool shape of the milling cutter based on the edge contour of the milling cutter. If the tool shape is cylindrical, perform straight line fitting based on the sub-pixel coordinates of the edge points of the milling cutter edge contour to obtain the center coordinates and direction angle of the milling cutter.
[0106] If the tool shape is spherical, then the center coordinates and orientation angle of the milling cutter are obtained by performing circle fitting based on the sub-pixel coordinates of the edge points of the milling cutter edge contour;
[0107] If the tool shape is elliptical, then ellipse fitting is performed based on the sub-pixel coordinates of the edge points of the milling cutter's edge profile to determine the center coordinates and orientation angle of the milling cutter.
[0108] In this embodiment of the invention, a corresponding parametric fitting method is selected based on the shape of a commonly used milling cutter for fitting. Then, the center coordinates and direction angle of the milling cutter are calculated based on the fitting results, thereby determining the position and orientation of the milling cutter, which facilitates further calculation of motion error.
[0109] Specifically, this invention achieves coarse positioning of the milling cutter through edge detection and fine positioning through sub-pixel variation detection. This combination of coarse and fine positioning further improves the positioning accuracy of the milling cutter during machining. In fine milling cutter positioning, the core of model fitting based on sub-pixel contour coordinates is to parametrically fit discrete contour points using geometric models (such as lines, circles, ellipses, etc.) to extract the tool's position (such as center coordinates, midpoint of a line) and orientation (such as direction angle, tilt). Therefore, this invention selects different parametric fitting methods based on the shape of the milling cutter, specifically including: Cylindrical milling cutter: fitting two parallel straight lines (representing the contours on both sides of the cylinder). Ball end mill: fitting a single circle (representing the ball end arc) or a circle + straight line (ball end + cylindrical transition). End mill (multi-blade): fitting multiple circles (each cutting edge arc) or the smallest circumscribed circle. Complex tools: segmented fitting (such as arc segments + straight line segments).
[0110] S34: Convert the center coordinates and orientation angle of the milling cutter into physical coordinates in the spatial coordinate system to obtain the current position and posture of the milling cutter.
[0111] Specifically, during coordinate transformation, the fitting parameters in the image coordinate system (i.e., the center coordinates of the milling cutter) are first converted into three-dimensional coordinates in the camera coordinate system through camera intrinsic parameters. Then, the three-dimensional coordinates in the camera coordinate system are converted into physical coordinates in the machine tool space coordinate system through hand-eye calibration, thereby achieving precise positioning of the milling cutter in the machine tool.
[0112] Example 2: Based on Example 1 above, after obtaining the current milling cutter position and milling cutter posture, it is necessary to further obtain the wear degree of the milling cutter for error correlation analysis and predict the motion error of the milling cutter.
[0113] Specifically, in step S4 of this embodiment of the invention, obtaining the wear degree of the milling cutter includes the following steps:
[0114] The measured diameter of the milling cutter is calculated based on the sub-pixel coordinates of the edge points of the milling cutter edge profile and the shape fitting of the milling cutter edge profile.
[0115] Obtain the theoretical diameter of the milling cutter and calculate the error between the measured diameter and the theoretical diameter;
[0116] Wear analysis is performed based on the number of times the milling cutter is used, the error value, and the preset wear classification threshold to determine the wear degree of the milling cutter; the wear degree of the milling cutter includes new cutter set, semi-worn cutter set, and old cutter set.
[0117] In this embodiment of the invention, error analysis is performed by obtaining the measured diameter of the milling cutter and the theoretical diameter of the milling cutter to obtain the error value caused by wear. At the same time, wear analysis is performed by combining auxiliary information such as the number of times the tool has been used to determine the degree of wear of the milling cutter. Although this method is difficult to accurately determine the degree of wear of the milling cutter, it has low actual operating costs and less analysis time. Combined with the milling cutter precise positioning method of the above embodiment, it can still be applied to machining scenarios that require milling cutter tool setting.
[0118] Furthermore, in another embodiment of the present invention, obtaining the wear degree of the milling cutter in step S4 specifically includes the following steps:
[0119] A convolutional neural network was trained using historical milling cutter wear data and milling cutter wear classification criteria to obtain a milling cutter wear classification model;
[0120] Geometric and statistical feature analysis is performed based on the sub-pixel coordinates of edge points on the edge profile of the milling cutter to extract the geometric and statistical features of the milling cutter.
[0121] The geometric and statistical features of the milling cutter are input into the milling cutter wear classification model for wear identification and classification, and the wear degree of the milling cutter is output.
[0122] Specifically, subpixel coordinates reflect the precise shape of the milling cutter profile. Therefore, this embodiment of the invention further identifies the wear degree of the milling cutter by training a milling cutter wear classification model. When extracting geometric features, specific operations such as profile curvature analysis, radial deviation calculation, and profile symmetry measurement are performed based on the subpixel coordinates of the edge points of the milling cutter's edge profile to analyze the geometric features of the milling cutter, obtaining features such as profile curvature, radial deviation, and profile symmetry. Simultaneously, key areas such as the tool tip and cutting edge can be located, and feature area parameters such as the tool tip radius and cutting edge straightness can be extracted from these key areas as geometric features for wear identification.
[0123] In extracting statistical features, a Fourier transform is performed on the sub-pixel coordinates of edge points to obtain low-frequency coefficients reflecting the overall shape of the milling cutter and high-frequency coefficients reflecting details, which are then used as Fourier descriptors. Simultaneously, the edge contour of the milling cutter is divided into multiple angular intervals, and the point density distribution within each interval is statistically analyzed to obtain the contour point distribution. Finally, the Fourier descriptors and the contour point distribution are used as statistical features for wear identification.
[0124] This invention transforms subpixel coordinates of edge points into quantified wear features and uses a classification model to automatically identify the wear state of milling cutters, providing data support for milling cutter replacement and milling cutter parameter adjustment.
[0125] Specifically, in this embodiment of the invention, after obtaining the wear level of the milling cutter, the motion error of the milling cutter is predicted by combining error distribution feature engineering with an error prediction model.
[0126] The preset error prediction model primarily uses regression algorithms (such as linear regression and random forest) to construct the model, fitting the error against influencing factors (i.e., initial tool setting path, cutter wear, current cutter position, and cutter posture) to predict the cutter's motion error. The specific training process is as follows:
[0127] Data partitioning: The training set (early processed data) and the test set (recent data) are partitioned in chronological order to avoid future data leakage.
[0128] Loss function design: (1) Regression task: Use mean squared error (MSE) or Huber loss (robust to outliers) function to regress the task; (2) Uncertainty estimation: Use negative log-likelihood loss (such as marginal likelihood of GPR) function to estimate uncertainty.
[0129] The model is trained to predict errors based on the training and test sets, and the model weights are adjusted using the loss function.
[0130] Model tuning: Learning rate decay is set to prevent oscillations in the later stages of training, and L2 regularization or Dropout layers are added to the model to suppress overfitting. Finally, Bayesian optimization is used to determine the optimal number of layers, neurons, and regularization coefficients. After model tuning, a preset error prediction model is obtained.
[0131] Specifically, in the error prediction model training process of this invention, error distribution feature engineering is used to extract the spatial statistical error features, wear error features, and attitude error features of the milling cutter for contribution calculation. The spatial statistical error features mainly include global and local features. Global features are obtained by calculating the mean and standard deviation of the error values in the wear degree of the milling cutter. Local features are calculated by segmenting the initial tool setting path into local errors, such as the radial error of the arc segment and the straightness error of the straight segment. Wear error features are obtained by calculating the Pearson correlation coefficient between the wear degree of the milling cutter and the error value, forming a correlation matrix. Attitude error features are obtained by analyzing the coupling relationship between attitude deviation and position error based on the current milling cutter position and attitude, and obtaining the attitude error features based on the coupling relationship.
[0132] After calculating the spatial statistical error features, wear error features, and attitude error features through error distribution feature engineering, it is necessary to quantify the contribution of the input features to error prediction and predict the milling cutter error based on the contribution, so as to facilitate the optimization of the error prediction model. This process specifically includes: calculating the feature contribution of the spatial statistical error features, wear error features, and attitude error features to the milling cutter motion error; weighting the feature values of the spatial statistical error features, wear error features, and attitude error features according to the feature contribution; and outputting the current motion error of the milling cutter based on the weighted result.
[0133] Specifically, the process of error prediction using a preset error prediction model in this embodiment of the invention is as follows:
[0134] Collect current milling cutter status data (i.e., initial tool setting path, milling cutter wear level, current milling cutter position, and milling cutter posture);
[0135] Then, the input vector (i.e., spatial statistical error features, wear error features, and attitude error features) is generated according to the error distribution feature engineering process of the training phase.
[0136] Finally, the model infers the predicted motion error of the milling cutter based on the input vector.
[0137] Further, in step S5 of this embodiment of the invention, the path compensation amount is calculated based on the current motion error of the milling cutter, and the tool setting path between the current milling cutter position and the target tool setting position is adjusted according to the path compensation amount, including:
[0138] Based on the weights of the eigenvalues in the current motion error of the milling cutter, the compensation components for the spatial statistical error, wear error, and attitude error of the milling cutter are calculated respectively, and the calculated compensation components are summed to obtain the path compensation amount.
[0139] Based on the current cutter position, the tool setting path between the cutter and the target tool setting position is corrected in real time according to the path compensation amount, so as to realize error compensation and path optimization based on the wear state of the cutter.
[0140] Specifically, in another embodiment of the present invention, after calculating the path compensation amount, an adaptive tool setting path adjustment strategy is also designed, which mainly includes:
[0141] (1) Dynamic grouping based on tool wear: The tools are divided into new tool group (small and stable error), semi-worn tool group (large error fluctuation) and old tool group (large error and obvious trend) according to the degree of wear.
[0142] (2) Different tool setting paths are used for different groups: New tool group: a fast tool setting path is used (i.e., fewer wear degree detections and a small default path compensation amount). Old tool group: tool setting is performed using multiple wear degree detections + dynamic compensation path (e.g., repeated detections are performed 3 times and the average value is taken, and the path compensation amount is adjusted in real time according to the motion error prediction model). Semi-wear group: the wear degree is detected according to the preset number of wear degree detections, and the path compensation amount is adjusted in real time according to the motion error prediction model.
[0143] Furthermore, in this embodiment of the invention, after each tool setting is completed, the latest tool setting error prediction data is added to the historical database, and the error prediction model is updated in real time by using a sliding window to update the mean and variance. After the error prediction model is updated, the parameters related to the tool setting path (such as the image ROI region and path compensation amount) are adjusted based on the latest error prediction model, forming a "detection-feedback-correction" closed loop, realizing online learning and real-time correction of the error prediction model.
[0144] Specifically, the path compensation amount is calculated, a PID control algorithm is used to generate control commands, and the motion trajectory is dynamically adjusted.
[0145] This invention integrates the wear degree of the milling cutter, the initial tool setting path, the current position of the milling cutter, and the milling cutter posture to perform error feature correlation analysis. The current motion error of the milling cutter is quantitatively predicted by a preset error prediction model, and the path compensation amount is calculated based on the error to adaptively adjust the tool setting path of the milling cutter, reducing manual intervention. At the same time, it realizes automatic quantitative adjustment and correction of the milling cutter tool setting.
[0146] Example 3: Reference Figure 3As shown, based on Embodiments 1 and 2 above, this embodiment of the invention also provides an automatic milling cutter tool setting system based on machine vision, comprising:
[0147] The initial position acquisition module is used to acquire the initial position image of the milling cutter, input the initial position image of the milling cutter into the preset target detection model to locate the initial position of the milling cutter, and map the initial position coordinates of the milling cutter in the spatial coordinate system of the machining scene based on the initial position of the milling cutter.
[0148] The path planning module is used to plan the initial tool setting path of the milling cutter in the machining scene based on the initial position coordinates of the milling cutter and the target tool setting position coordinates.
[0149] The first image processing module is used to obtain the initial tool setting path of the milling cutter and the original tool setting image of the milling cutter in the initial tool setting path, and to remove environmental noise in the original tool setting image using a preset image denoising network to obtain the first image.
[0150] The second image processing module is used to acquire encoder data for detecting the motion state of the milling cutter, input the encoder data and the first image into a preset motion blur model for image deblurring processing, and obtain the second image.
[0151] The tool positioning module is used to perform edge detection on the second image, extract the edge contour of the milling cutter, calculate the sub-pixel coordinates of the edge points of the edge contour of the milling cutter, and perform parametric fitting based on the sub-pixel coordinates of the edge points to obtain the current position and posture of the milling cutter.
[0152] The error prediction module is used to obtain the wear degree of the milling cutter, and input the initial tool setting path, the wear degree of the milling cutter, the current position of the milling cutter, and the attitude of the milling cutter into the preset error prediction model for error correlation analysis. It extracts the spatial statistical error features, wear error features, and attitude error features of the milling cutter, and calculates the feature contribution of the spatial statistical error features, wear error features, and attitude error features to the motion error of the milling cutter. Based on the feature contribution, the feature values of the spatial statistical error features, wear error features, and attitude error features are weighted, and the current motion error of the milling cutter is output.
[0153] The path optimization module is used to calculate the path compensation amount based on the current motion error of the milling cutter, and adjust the tool setting path between the current milling cutter position and the target tool setting position according to the path compensation amount.
[0154] In this embodiment of the invention, the first image is obtained by removing environmental noise such as oil stains and iron filings from the original tool setting image of the milling cutter through a preset image denoising network in the image processing module. At the same time, the encoder data for detecting the motion state of the milling cutter is fused with the first image, and the image is deblurred using a preset motion blur model to obtain the second image. The image processing module suppresses the positioning deviation caused by the high-speed rotation of the tool by deeply fusing the motion state information of the milling cutter with the machine vision information, which can effectively reduce the motion blur of the milling cutter and the interference of environmental factors.
[0155] Furthermore, the tool positioning module in this embodiment of the invention extracts the edge contour of the milling cutter through edge detection, and further performs sub-pixel positioning, calculates the sub-pixel coordinates of the edge points of the milling cutter edge contour and performs parametric fitting to obtain the current position and posture of the milling cutter. Compared with the traditional positioning method using a single edge detection, this improves the positioning efficiency and positioning accuracy of the milling cutter.
[0156] Specifically, the error prediction module of this invention integrates the wear degree of the milling cutter, the initial tool setting path, the current position of the milling cutter, and the attitude of the milling cutter to perform error feature correlation analysis. It quantifies and predicts the current motion error of the milling cutter through a preset error prediction model, and calculates the path compensation amount based on the error to adaptively adjust the tool setting path of the milling cutter. This reduces manual intervention and realizes automatic quantitative adjustment and correction of the milling cutter's tool setting.
[0157] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A machine vision-based automatic tool setting method for a milling cutter, characterized by, The method comprises the following steps: An initial tool setting path of a milling cutter and an original tool setting image of the milling cutter in the initial tool setting path are acquired, and a preset image denoising network is used to remove environmental noise in the original tool setting image to obtain a first image; Encoder data for detecting a motion state of the milling cutter are acquired, and the encoder data and the first image are input into a preset motion blur model for image deblurring to obtain a second image; Edge detection is performed on the second image, and a milling cutter edge profile is extracted, and edge point sub-pixel coordinates of the milling cutter edge profile are calculated, and parameterized fitting is performed according to the edge point sub-pixel coordinates to obtain a current milling cutter position and a milling cutter attitude; A wear degree of the milling cutter is acquired, and the initial tool setting path, the wear degree of the milling cutter, the current milling cutter position and the milling cutter attitude are input into a preset error prediction model for error correlation analysis, and spatial statistical error features, wear error features and attitude error features of the milling cutter are extracted, and characteristic contributions of the spatial statistical error features, the wear error features and the attitude error features to milling cutter motion errors are calculated, and the spatial statistical error features, the wear error features and the attitude error features are weighted according to the characteristic contributions to output a current motion error of the milling cutter; A path compensation amount is calculated according to the current motion error of the milling cutter, and the tool setting path between the current milling cutter position and a target tool setting position is adjusted according to the path compensation amount.
2. The machine vision based cutter auto-indexing method according to claim 1, wherein, The initial tool setting path of the milling cutter is acquired by performing the following steps: An initial position image of the milling cutter is collected, and the initial position image of the milling cutter is input into a preset target detection model to locate an initial position of the milling cutter, and an initial position coordinate of the milling cutter is mapped in a spatial coordinate system of a machining scene according to the initial position of the milling cutter; An initial tool setting path of the milling cutter is planned in the machining scene based on the initial position coordinate of the milling cutter and a target tool setting position coordinate.
3. The machine vision based cutter auto-indexing method according to claim 1, wherein, The preset image denoising network is used to remove environmental noise in the original tool setting image to obtain a first image by performing the following steps: The original tool setting image is subjected to grayscale processing, and the original tool setting image after grayscale processing is input into a preset image denoising network; the preset image denoising network comprises an input layer, a feature extraction layer, a feature fusion layer and a noise separation layer; the feature extraction layer comprises a basic feature extraction unit, an oil stain feature extraction unit and a scrap iron feature extraction unit; The basic feature extraction unit, the oil stain feature extraction unit and the scrap iron feature extraction unit are used to extract a basic feature, an oil stain feature and a scrap iron feature of the milling cutter from the original tool setting image after grayscale processing respectively; The basic feature, the oil stain feature and the scrap iron feature of the milling cutter are adaptively weighted and fused by the feature fusion layer to obtain a fused noise distribution; According to the fused noise distribution, the noise separation layer separates the environmental noise from the original tool setting image after grayscale processing by weighted subtraction, and the residual amplitude during the separation of the environmental noise is constrained between 0 and 1 by a Sigmoid function, and the original tool setting image after the separation of the environmental noise is output as the first image.
4. The machine vision-based cutter auto-indexing method according to claim 1, wherein, The encoder data for detecting the motion state of the milling cutter are acquired, and the encoder data and the first image are input into a preset motion blur model for image deblurring to obtain a second image by performing the following steps: Read the encoder pulse signal sequence for real-time detection of the milling cutter motion state, and smooth the encoder pulse signal sequence by Kalman filtering to obtain the encoder data; the milling cutter motion state includes the rotation angle, angular velocity and rotation speed of the milling cutter; The first image is ROI cropped to obtain a tool region image of the milling cutter, and the encoder data is time stamped with the tool region image of the milling cutter; The time stamped encoder data and the tool region image of the milling cutter are respectively input into a preset motion blur model for image deblurring processing to obtain a second image, and the following steps are performed: A plurality of CUDA thread blocks are used to perform Fourier transform on each row and each column of the tool region image of the milling cutter in parallel to obtain a frequency domain image; According to the encoder data, a look-up table method is used to generate a frequency domain representation of the blur kernel; Based on the frequency domain representation, the frequency domain image is restored by using an inverse filtering formula, and the restored frequency domain image is inverse Fourier transformed to obtain the second image after deblurring processing.
5. The machine vision-based automatic tool setting method for a milling cutter according to claim 1, characterized in that, Edge detection is performed on the second image to extract the milling cutter edge contour, and the edge point sub-pixel coordinates of the milling cutter edge contour are calculated, and the current milling cutter position and milling cutter attitude are obtained by parameterized fitting according to the edge point sub-pixel coordinates, and the following steps are performed: An image processing algorithm is used to perform edge detection on the second image to extract a plurality of milling cutter edge contours from the second image; The smallest milling cutter edge contour in area is selected from the plurality of milling cutter edge contours for sub-pixel edge positioning, and the edge point sub-pixel coordinates of the milling cutter edge contour are calculated using a Zernike moment operator; According to the milling cutter edge contour, the tool shape of the milling cutter is determined, if the tool shape is cylindrical, then a straight line fitting is performed based on the edge point sub-pixel coordinates of the milling cutter edge contour to obtain the center coordinates and the direction angle of the milling cutter; If the tool shape is spherical, then a circle fitting is performed based on the edge point sub-pixel coordinates of the milling cutter edge contour to obtain the center coordinates and the direction angle of the milling cutter; If the tool shape is elliptical, then an ellipse fitting is performed based on the edge point sub-pixel coordinates of the milling cutter edge contour to determine the center coordinates and the direction angle of the milling cutter; The center coordinates and the direction angle of the milling cutter are converted into physical coordinates in a spatial coordinate system to obtain the current milling cutter position and the milling cutter attitude.
6. The machine vision-based cutter auto-dialling method according to claim 1, wherein, The wear degree of the milling cutter is obtained by performing the following steps: Based on the edge point sub-pixel coordinates of the milling cutter edge contour, the measured tool diameter of the milling cutter is calculated by combining the shape fitting of the milling cutter edge contour; The theoretical tool diameter of the milling cutter is obtained, and the error value between the measured tool diameter and the theoretical tool diameter is calculated; Based on the number of uses of the milling cutter, the error value and the preset wear classification threshold, wear analysis is performed to determine the wear degree of the milling cutter; the wear degree of the milling cutter includes a new cutter group, a half-worn group and an old cutter group.
7. The machine vision-based cutter auto-dialling method according to claim 1, wherein, The wear degree of the milling cutter is obtained by performing the following steps: A convolutional neural network is trained based on historical milling cutter wear data and milling cutter wear classification standards to obtain a milling cutter wear classification model; Geometric feature analysis and statistical feature analysis are performed based on the edge point sub-pixel coordinates of the milling cutter edge contour to extract the geometric features and statistical features of the milling cutter; The geometric characteristics and statistical characteristics of the milling cutter are input into a milling cutter wear classification model for wear identification and classification, and the wear degree of the milling cutter is output.
8. The machine vision-based cutter auto-indexing method according to claim 1, wherein, The path compensation amount is calculated according to the current motion error of the milling cutter, and the tool setting path between the current milling cutter position and the target tool setting position is adjusted according to the path compensation amount, and the following steps are performed: According to the weight of the characteristic value in the current motion error of the milling cutter, the compensation components of the spatial statistical error, the wear error and the attitude error of the milling cutter are calculated respectively, and the compensation components are summed to obtain the path compensation amount; Based on the current milling cutter position, the tool setting path between the milling cutter and the target tool setting position is corrected in real time according to the path compensation amount.
9. A machine vision based automatic tool setting system for milling cutter, which is implemented by using the machine vision based automatic tool setting method according to any one of claims 1-8, characterized in that, It comprises: An initial position acquisition module is configured to acquire an initial position image of the milling cutter, input the initial position image of the milling cutter into a preset target detection model to locate the initial position of the milling cutter, and map the initial position coordinates of the milling cutter in the spatial coordinate system of the machining scene according to the initial position of the milling cutter; A path planning module is configured to plan an initial tool setting path of the milling cutter in the machining scene based on the initial position coordinates of the milling cutter and the target tool setting position coordinates; An image processing module is configured to acquire the initial tool setting path of the milling cutter and the original tool setting image of the milling cutter in the initial tool setting path, remove environmental noise in the original tool setting image by using a preset image denoising network to obtain a first image, acquire encoder data for detecting the motion state of the milling cutter, and input the encoder data and the first image into a preset motion blur model for image deblurring to obtain a second image; A tool positioning module is configured to perform edge detection on the second image, extract the edge profile of the milling cutter, calculate the edge point sub-pixel coordinates of the edge profile of the milling cutter, perform parameterized fitting according to the edge point sub-pixel coordinates to obtain the current milling cutter position and the milling cutter attitude; An error prediction module is configured to acquire the wear degree of the milling cutter, input the initial tool setting path, the wear degree of the milling cutter, the current milling cutter position and the milling cutter attitude into a preset error prediction model for error correlation analysis, extract the spatial statistical error feature, the wear error feature and the attitude error feature of the milling cutter, calculate the feature contribution of the spatial statistical error feature, the wear error feature and the attitude error feature to the motion error of the milling cutter, and weight the feature values of the spatial statistical error feature, the wear error feature and the attitude error feature according to the feature contribution, and output the current motion error of the milling cutter; A path optimization module is configured to calculate a path compensation amount according to the current motion error of the milling cutter, and adjust the tool setting path between the current milling cutter position and the target tool setting position according to the path compensation amount.
Citation Information
Patent Citations
Method for automatically measuring abrasion loss of rotating cutter based on machine vision
CN112907556A
Path generation method, device and equipment for multi-axis linkage machining and storage medium
CN119126670A