A tool wear monitoring and repair method based on artificial intelligence
By combining edge computing and deep learning, the tool wear of CNC machine tools can be monitored and repaired in real time, solving the impact of tool wear on machining accuracy in CNC machine tools and improving fault diagnosis efficiency and machining accuracy.
Patent Information
- Application Number
- CN202411372132.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Existing technologies make it difficult to effectively monitor and diagnose the impact of tool wear on machining accuracy in CNC machine tools, resulting in low efficiency in machining accuracy fault diagnosis and the inability to handle them in a timely manner.
An edge computing-based approach is adopted, combining cloud computing and terminal-layer data collection. Through the power increment diagnosis model and deep learning algorithm, tool wear is monitored in real time, and laser surface enhancement technology is used for repair, combined with the fruit fly algorithm to optimize task allocation.
It achieves accurate monitoring and timely repair of tool wear, improves the accuracy of CNC machining and tool life, and improves diagnostic efficiency and computing efficiency.
Smart Images

Figure CN119217147B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of CNC machine tool processing, and in particular to a tool wear monitoring and repair method based on artificial intelligence. Background Art
[0002] As the core equipment of intelligent manufacturing, CNC machine tools play a vital role in modern manufacturing. In an interdisciplinary context, leveraging emerging technologies such as intelligent sensing and measurement systems based on digital twins, big data analytics, deep learning algorithms, data visualization, and edge computing, combined with traditional machining mechanism models, can effectively optimize machining energy consumption, efficiency, and equipment utilization.
[0003] In the field of CNC machine tools, current big data collection methods and deep learning algorithms have achieved a series of research results in fault diagnosis, processing parameter optimization and processing scheduling optimization. However, the main problems are: CNC machining precision faults cannot fully utilize the fault mechanism to achieve accurate diagnosis, the processing data acquisition rate and training efficiency are low, and the computing architecture efficiency is low; there is a lack of in-depth research on the relationship between tool wear and machining precision faults, and only the tool status (running-in, steady state, failure) can be generally determined. It is difficult to effectively diagnose the impact of the tool on machining precision faults during actual use, and it is impossible to promptly and effectively process and respond based on the machining precision fault diagnosis results.
[0004] In view of this, how to provide strong support for data analysis based on fault mechanisms, how to effectively monitor and diagnose tool wear during CNC machining, how to effectively process the diagnostic results, and how to improve the analytical efficiency of CNC machining diagnosis have important application value and strategic significance. Summary of the Invention
[0005] The purpose of the present invention is to provide a tool wear monitoring and repair method based on artificial intelligence to solve the above problems.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] An artificial intelligence-based tool wear monitoring and repair method is implemented based on an edge computing system. The edge computing system includes a cloud computing layer, an edge computing layer, a terminal layer, a task allocation calculation unit, and a task allocation optimization unit. The cloud computing layer is used to train a power increment diagnosis model, and the edge computing layer is used to retrain the power increment diagnosis model for new processing conditions. The terminal layer includes a CNC machine tool, a working condition parameter acquisition module, a power data acquisition module, and an image acquisition module. The working condition parameter acquisition module is used to collect cutting processing parameters and workpiece types. The power data acquisition module is used to collect cutting processing power in real time. The image acquisition module is used to collect cutting tool images and workpiece surface quality images.
[0008] The method comprises the following steps:
[0009] S1. Collecting raw processing data under the same processing conditions through the terminal layer and uploading it to the cloud computing layer, wherein the raw processing data includes at least processing power, processing parameters, cutting tool images, and workpiece surface quality images, and the processing conditions include at least cutting processing parameters and workpiece type;
[0010] S2. Train a power increment diagnosis model through the cloud computing layer. The input of the power increment diagnosis model is the machining power and cutting tool wear. The output of the power increment diagnosis model is the cutting precision fault diagnosis result. The original machining data and the cutting precision fault diagnosis result are used as source domain data. The source domain data and the power increment diagnosis model are sent to the edge computing layer.
[0011] S3, the terminal layer collects processing data in real time as monitoring data during the processing process, and transmits it to the edge computing layer through the MQTT protocol, and then transmits the processing data to the cloud computing layer through the MQTT protocol;
[0012] S4. The cloud computing layer determines whether the machining conditions have changed based on the monitoring data. If not, the power increment diagnosis model is trained using the edge computing layer based on the deep learning algorithm to obtain the final machining accuracy fault diagnosis model. If so, the monitoring data is used as the target domain data, and a deep learning algorithm model is constructed based on the transfer learning algorithm. The deep learning algorithm model is trained using the edge computing layer to obtain the final machining accuracy fault diagnosis model. The machining accuracy fault diagnosis model is implemented using a long short-term memory neural network combined with a convolutional neural network.
[0013] S5. Utilize the task allocation calculation unit to collect data transmission volume, edge computing processing time, and edge layer computing utilization rate, where the data transmission volume is the total amount of data transmitted from the edge computing layer to the cloud computing layer, the edge computing processing time is the time required for data transmission and algorithm processing under a network environment, and the edge layer computing utilization rate is the utilization efficiency of the edge computing layer; utilize the task allocation optimization unit to construct an edge computing allocation optimization algorithm, and utilize the fruit fly algorithm to solve the optimal task allocation method and perform task scheduling;
[0014] S6. Use the machining accuracy fault diagnosis model to perform real-time diagnosis of the CNC machining process. For machining accuracy faults, obtain the corresponding tool image, obtain the tool wear area based on the tool image, and perform laser surface strengthening treatment on the tool wear area.
[0015] Preferably, the fruit fly algorithm is implemented by the following method:
[0016] Normalize the data transmission volume, edge computing processing time, and edge layer computing utilization rate and use them as optimization targets.
[0017] Initialize the number of fruit fly swarms and randomly initialize the positions of the fruit fly swarms;
[0018] Define the fitness function based on the optimization objective:
[0019] F=argmin(e·Q tmn +f·T op +h·D op )
[0020] Among them, F is the fitness function, Q tmn is the normalized value of data transmission volume, T op is the normalized value of edge computing processing time, D op is the normalized value of edge layer computing utilization;
[0021] Based on the smell search method, the crossover and mutation process is introduced to calculate the fitness function value F;
[0022] Construct an iterative mechanism for visual search. If the fitness function value of an individual fruit fly is better than the fitness function value of the fruit fly group center, the position of the individual fruit fly is used as the new search center.
[0023] Through iterative optimization, the individual fruit flies with the optimal fitness function value are determined as the optimal task allocation method.
[0024] Preferably, the edge computing layer is used to train the deep learning algorithm model in step S4, which is specifically achieved by the following method: analyzing the feature distribution differences between the source domain data and the target domain data, introducing alignment weights to align the data to achieve cross-domain transfer of data; using the Tensorflow deep learning architecture to build a deep learning algorithm for forward computing training; using parameter transfer learning and retaining most of the training parameters, performing back propagation calculations to optimize the feature distribution, using the maximum average difference to measure the difference in probability distribution between the source domain and the target domain, combining the deep learning training cross entropy to characterize the training error results, and using regularized maximum average difference and cross entropy to construct the optimization target of the algorithm; after training, the final processing accuracy fault diagnosis model is obtained for real-time diagnosis during the processing process.
[0025] Preferably, the processing accuracy fault diagnosis model structure in step S4 includes a convolution layer, a pooling layer, an LSTM layer and a fully connected layer. The convolution layer and the pooling layer are used for feature extraction, the LSTM layer is used to process time series data, and the fully connected layer is used for final diagnosis result classification.
[0026] Preferably, the forward computation training is implemented by the following method:
[0027] Randomly initialize the model's weight matrix and bias parameters;
[0028] Input source domain data and target domain data into each layer of the neural network, and output the diagnostic result. The diagnostic result is calculated by the following formula:
[0029]
[0030] Among them, y is the output diagnosis result, x is the input source domain data and target domain data, b is the bias parameter, is the activation function, which uses one of the ReLU function, PReLU function, Softmax function, and Swish function;
[0031] The loss function is used to calculate the error between the output diagnosis result and the true result.
[0032] Preferably, the back propagation calculation is implemented by the following method:
[0033] Calculate the gradient of the loss function with respect to each model parameter. Based on the obtained gradient of each model parameter, use the gradient descent algorithm to update the model parameters of the neural network. Specifically:
[0034] Select an initial point θ0, define θ as the model parameter, and θ0 as the initialization parameter;
[0035] Choose a loss function L(θ) that measures the difference between the predictions given the model parameters θ and the actual observations;
[0036] Determine an appropriate learning rate η, which controls the step size of updating parameters at each iteration;
[0037] Iterative update, for each training sample i, calculate the gradient of the loss function with respect to θ:
[0038]
[0039] Among them, g i is the gradient, x i is the input processing data, y i is the corresponding machining accuracy fault diagnosis result.
[0040] Preferably, step S2 is implemented by the following method:
[0041] S21. Based on the wear curve of the cutting tool, the cutting tool processing life cycle is divided into three periods: the running-in period, the steady-state period, and the failure period. For the running-in period and the steady-state period, a correlation model between tool wear and tool cutting force is established. The correlation model between tool wear and tool cutting force is:
[0042]
[0043] Among them, i is the i-th tool wear state in the cutting tool processing life cycle, A i is the wear amount of the i-th tool under wear state, which is obtained through image analysis, F i is the cutting force corresponding to the i-th tool wear data, F0 is the initial cutting force of the cutting tool, a and b are constants determined based on the wear curve of the cutting tool;
[0044] S22. For the workpiece surface quality image, grayscale image is obtained by grayscale processing, and the fractal dimension of the grayscale surface of the grayscale image is calculated. The grayscale plane of the image is covered by boxes of different sizes, and the number of boxes required to cover the entire grayscale surface is calculated. Then, the fractal dimension is obtained by least squares fitting. The obtained fractal dimension is normalized to obtain the workpiece surface roughness, and the corresponding processing data with surface roughness greater than a preset threshold σ is eliminated;
[0045] S23. Use Matlab software to estimate the cutting force during the machining life cycle, analyze the nonlinear relationship between cutting tool wear and cutting force increment, and define the tool aging coefficient K. cutter , K cutter The solution model is:
[0046]
[0047] Among them, K cutter is the tool aging coefficient, c and d are model parameters;
[0048] S24. Based on the original processing data, establish and train the tool wear power increment model:
[0049] ΔP ik =P i ·f(K cutter )
[0050]
[0051] Where ΔP ik is the machining power increment between the kth tool wear state and the ith tool wear state, P i is the machining power under the i-th tool wear state, f(K cutter ) is a function of the tool aging coefficient, g, h, and n are model parameters;
[0052] Obtaining machining data of other different working conditions, verifying the tool wear power increment model, and optimizing the model parameters;
[0053] A power increment diagnosis model is constructed based on the tool wear power increment model. The input of the power increment diagnosis model is the machining power and the cutting tool wear amount, and the output is the cutting machining accuracy fault diagnosis result.
[0054] Preferably, the wear amount of the tool in the worn state is obtained by the following method:
[0055] Acquire a cutting tool image, where the cutting tool image is obtained by photographing a CCD camera installed at a corresponding position on a CNC machine tool; extract tool feature information using an image feature extraction method, where the tool feature information includes tool contour features, tool surface texture features, tool wear area texture features, and tool wear area edge features; obtain tool geometry information and position and geometry information of the wear area based on the tool feature information; calculate the area and depth of the wear area based on the tool geometry information and the position and geometry information of the wear area, and then calculate the volume of the wear area as the wear amount.
[0056] Preferably, the method further comprises: after establishing the tool wear power increment model, optimizing the tool wear power increment model using an optimization function, wherein the optimized tool wear power increment model is expressed as:
[0057] ΔP final =P·f(K cutter )·δ(K cutter , R i )
[0058]
[0059] Where ΔP final The power increment after optimization, δ(K cutter , R i ) is the optimization function, R i is the surface roughness of the workpiece under the i-th tool wear state, β is a constant, 0<β<0.5.
[0060] Preferably, step S6 includes the following sub-steps:
[0061] S61, using the machining accuracy fault diagnosis model to perform real-time diagnosis on the CNC machining process, and judging whether a machining accuracy fault occurs based on the power increment change, and if so, executing step S62;
[0062] S62, obtaining a corresponding tool image, and obtaining tool profile geometry information and tool wear area geometry information by image feature extraction;
[0063] S63, constructing a three-dimensional model of the tool based on the tool profile geometric information and the tool wear area geometric information;
[0064] S64, based on the geometric information of the tool wear area, dividing the tool wear area into a set of equivalent planes, and setting a zigzag laser scanning path on each equivalent plane to form a plurality of trajectory points;
[0065] S65. Constructing a laser surface strengthening path based on all trajectory points on each equivalent plane;
[0066] S66, establishing tool space coordinates based on tool profile geometry information, determining wear area space coordinates based on tool space coordinates and tool wear area geometry information, performing coordinate conversion on the wear area space coordinates to a robot working coordinate system, and converting the laser surface enhancement path constructed in step S64 to the robot working coordinate system, wherein the robot working coordinate system is a working coordinate system jointly determined by the robot manipulator and the laser;
[0067] S67. Based on the laser surface strengthening path, the robot controls the laser to perform laser surface strengthening on the tool wear area to achieve tool repair.
[0068] After adopting the above technical solution, the present invention has the following beneficial effects compared with the background technology:
[0069] 1. Based on the precision failure mechanism of the CNC machining process, the present invention constructs and trains a power increment diagnosis model, and then uses a transfer learning algorithm to achieve efficient knowledge transfer between different machining conditions. It reuses the labeled data of the source domain, constructs an algorithm to migrate old data from the source domain to the target domain, and reuses the training parameters of the deep learning algorithm in the original machining conditions, which can effectively improve its training accuracy and efficiency.
[0070] 2. The present invention obtains machining accuracy fault diagnosis results by performing real-time CNC machining process diagnosis, and plans laser surface strengthening paths to promptly and effectively repair worn tools. On the one hand, it ensures the machining accuracy of CNC machining, and on the other hand, it also improves the service life and life of the tools.
[0071] 3. The present invention uses laser surface strengthening technology to promptly repair abnormal tool conditions. Based on the laser scanning path of the tool wear image and converting it into the working coordinate system of the laser operation, it can guide the laser surface strengthening operation in real time.
[0072] 4. The present invention improves the computational efficiency of the CNC machining process diagnosis process by constructing an edge computing allocation optimization algorithm, using the fruit fly algorithm to solve the optimal task allocation method and perform task scheduling.
[0073] 5. The present invention fully considers the impact of tool wear on machining power by constructing a tool wear power increment model, identifies abnormal energy patterns in which tool status undergoes significant changes during machining based on the changes in machining power increment, performs rational diagnosis of the CNC machining process, and improves the accuracy and robustness of data diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0076] Example
[0077] The technical concept of this invention is based on digital twin technology. Its application in the field of CNC machine tools creates an exact digital replica of the physical machine tool, simulating the machine tool's operating status and machining process in a virtual environment. This enables comprehensive prediction and analysis of the machine tool's performance, efficiency, and potential problems. Emerging technologies such as intelligent sensing and measurement systems, big data analytics, deep learning algorithms, data preprocessing, data visualization, edge computing, and machining compensation techniques, based on digital twins, combined with traditional machining mechanism models, can effectively implement effective diagnostic analysis and intervention in CNC machining.
[0078] Deep learning, a subset of machine learning, is based on artificial neural networks. The deep nature of the learning process stems from the structure of artificial neural networks, which consist of multiple input, output, and hidden layers. Each layer contains units that transform input data into information that the next layer uses for specific prediction tasks. This structure enables machines to learn through their own data processing.
[0079] Transfer learning is an important concept in the field of machine learning. Its core idea is to use the knowledge learned in one task or domain to accelerate or improve the learning process of another related task or domain. This method is particularly effective in cases of data scarcity or domain migration because it can significantly reduce the need for large amounts of labeled data and improve the learning efficiency and generalization ability of the model.
[0080] An embodiment of the present invention discloses an artificial intelligence-based tool wear monitoring and repair method, which is implemented based on an edge computing system. The edge computing system includes a cloud computing layer, an edge computing layer, a terminal layer, a task allocation calculation unit, and a task allocation optimization unit. The cloud computing layer is used to train a power increment diagnosis model, and the edge computing layer is used to retrain the power increment diagnosis model for new processing conditions. The terminal layer includes a CNC machine tool, a working condition parameter acquisition module, a power data acquisition module, and an image acquisition module. The working condition parameter acquisition module is used to collect cutting processing parameters and workpiece types, the power data acquisition module is used to collect cutting processing power in real time, and the image acquisition module is used to collect cutting tool images and workpiece surface quality images.
[0081] See also Figure 1 The present invention discloses a tool wear monitoring and repair method based on artificial intelligence, which is achieved by the following steps:
[0082] S1. The original processing data under the same processing conditions is collected through the terminal layer and uploaded to the cloud computing layer. The original processing data includes at least processing power, processing parameters, cutting tool images and workpiece surface quality images. The processing conditions include at least cutting processing parameters and workpiece types. For the cutting tool image and the workpiece surface quality image, the cutting tool and the workpiece are segmented from the image respectively through the threshold segmentation algorithm. Image threshold segmentation is based on the grayscale of the image to perform pixel classification. The core of the image segmentation is how to select an appropriate grayscale threshold. The grayscale threshold is determined according to the grayscale histogram of the image. In this embodiment, the threshold segmentation algorithm adopts one of global threshold segmentation, adaptive threshold segmentation, Otsu algorithm, and block variable threshold segmentation. The selection of the segmentation algorithm is based on the segmentation quality and efficiency.
[0083] S2. Train a power increment diagnosis model through the cloud computing layer. The input of the power increment diagnosis model is the processing power and cutting tool wear. Its output is the cutting process accuracy fault diagnosis result. The original processing data and the cutting process accuracy fault diagnosis result are used as the source domain data. The source domain data and the power increment diagnosis model are sent to the edge computing layer. Step S2 is specifically implemented by the following method:
[0084] S21. Based on the wear curve of the cutting tool, the cutting tool processing life cycle is divided into three periods: the running-in period, the steady-state period, and the failure period. For the running-in period and the steady-state period, a correlation model between tool wear and tool cutting force is established. The correlation model between tool wear and tool cutting force is:
[0085]
[0086] Among them, i is the i-th tool wear state in the cutting tool processing life cycle, A i is the wear amount of the i-th tool under wear state, which is obtained through image analysis, F i is the cutting force corresponding to the i-th tool wear data, F0 is the initial cutting force of the cutting tool, and a and b are constants determined based on the wear curve of the cutting tool. In this embodiment, the wear amount of the tool under the wear state is specifically obtained by the following method:
[0087] Acquire a cutting tool image, which is obtained by photographing a CCD camera installed at a corresponding position on a CNC machine tool; utilize an image feature extraction method to extract tool feature information, which includes tool contour features, tool surface texture features, tool wear area texture features, and tool wear area edge features; based on the tool feature information, obtain tool geometry information and the position and geometry information of the wear area; based on the tool geometry information and the position and geometry information of the wear area, calculate the area and depth of the wear area, and then calculate the volume of the wear area as the wear amount.
[0088] S22. For the workpiece surface quality image, a grayscale image is obtained through grayscale processing, and the fractal dimension of the grayscale surface of the grayscale image is calculated. The grayscale plane of the image is covered by boxes of different sizes, and the number of boxes required to cover the entire grayscale surface is calculated. Then, the fractal dimension is obtained by least squares fitting. The obtained fractal dimension is normalized to obtain the surface roughness of the workpiece, and the corresponding processing data with a surface roughness greater than a preset threshold σ is eliminated.
[0089] S23. Use Matlab software to estimate the cutting force during the machining life cycle, analyze the nonlinear relationship between cutting tool wear and cutting force increment, and define the tool aging coefficient K. cutter , K cutter The solution model is:
[0090]
[0091] Among them, K cutter is the tool aging coefficient, c and d are model parameters.
[0092] S24. Based on the original processing data, establish and train the tool wear power increment model:
[0093] ΔP ik =P i ·f(K cutter )
[0094]
[0095] Where ΔP ik is the machining power increment between the kth tool wear state and the ith tool wear state, P i is the machining power under the i-th tool wear state, f(K cutter ) is a function of the tool aging coefficient, g, h, and n are model parameters;
[0096] After establishing the tool wear power increment model, the optimization function is used to optimize the tool wear power increment model. The optimized tool wear power increment model is expressed as:
[0097] ΔP final =P·f(K cutter )·δ(K cutter , R i )
[0098]
[0099] Where ΔP final The power increment after optimization, δ(K cutter , R i ) is the optimization function, Ri is the surface roughness of the workpiece under the i-th tool wear state, β is a constant, 0<β<0.5. The tool wear power increment model is optimized using the surface roughness index, further improving the accuracy and robustness of data diagnosis;
[0100] Obtain machining data of other different working conditions, verify the tool wear power increment model, and optimize the model parameters.
[0101] S25. Construct a power increment diagnostic model based on the tool wear power increment model. The power increment diagnostic model takes machining power and cutting tool wear as input and outputs a cutting accuracy fault diagnosis result. This power increment diagnostic model, while fully considering the impact of tool wear on machining power, identifies abnormal energy patterns indicating significant changes in tool status during machining based on machining power increments. This model then diagnoses the rationality of the CNC machining process, improving the accuracy and robustness of data diagnosis.
[0102] S3. The terminal layer collects processing data in real time as monitoring data during the processing process, transmits it to the edge computing layer via the MQTT protocol, and then transmits the processing data to the cloud computing layer via the MQTT protocol. Those skilled in the art will understand that the cloud computing layer, edge computing layer, and terminal layer involved in the present invention are all deployed with network communication equipment, which is used to transmit data based on the MQTT protocol. The MQTT protocol is a message protocol based on the publish / subscribe paradigm under the ISO standard (ISO / IEC PRF 20922).
[0103] S4. The cloud computing layer determines whether the processing conditions have changed based on the monitoring data. If not, the power increment diagnosis model is trained by the edge computing layer based on the deep learning algorithm to obtain the final processing accuracy fault diagnosis model. If so, the monitoring data is used as the target domain data, and a deep learning algorithm model is constructed based on the transfer learning algorithm. The deep learning algorithm model is trained by the edge computing layer to obtain the final processing accuracy fault diagnosis model. The processing accuracy fault diagnosis model is implemented using a long short-term memory neural network combined with a convolutional neural network, which includes a convolution layer, a pooling layer, an LSTM layer and a fully connected layer. The convolution layer and the pooling layer are used for feature extraction, the LSTM layer is used to process time series data, and the fully connected layer is used for the final diagnosis result classification. Among them, the convolutional layer is the core of the convolutional neural network (CNN), which is used to extract local features in the image; the pooling layer is used to reduce the spatial size of the feature map, thereby reducing the number of parameters and the amount of calculation. It achieves downsampling by applying the maximum operation in a certain area, which helps to improve the invariance of feature detection; LSTM controls the flow of information by introducing a gating mechanism (input gate, forget gate and output gate), enabling it to learn long-term dependencies; each node of the fully connected layer is connected to all the activation values of the previous layer. The fully connected layer is located at the end of the network and is used to integrate the features transferred from the convolutional layer and the pooling layer for final classification or regression.
[0104] In this step, the edge computing layer is used to train the deep learning algorithm model, which is specifically achieved through the following methods: analyzing the feature distribution differences between the source domain data and the target domain data, introducing alignment weights for data alignment to achieve cross-domain data transfer; using the Tensorflow deep learning architecture to build a deep learning algorithm for forward calculation training; using parameter transfer learning and retaining most of the training parameters, performing backpropagation calculations to optimize the feature distribution, using the maximum average difference to measure the difference in probability distribution between the source domain and the target domain, combining deep learning training cross entropy to characterize the training error results, and using regularized maximum average difference and cross entropy to construct the algorithm's optimization target; after training, the final machining accuracy fault diagnosis model is obtained for real-time diagnosis during the machining process.
[0105] The above forward computation training is achieved through the following method:
[0106] Randomly initialize the model's weight matrix and bias parameters;
[0107] Input source domain data and target domain data into each layer of the neural network, and output the diagnostic result. The diagnostic result is calculated by the following formula:
[0108]
[0109] Among them, y is the output diagnosis result, x is the input source domain data and target domain data, b is the bias parameter, is the activation function, which uses one of the ReLU function, PReLU function, Softmax function, and Swish function;
[0110] The loss function is used to calculate the error between the output diagnosis result and the true result.
[0111] The above back propagation calculation is implemented by the following method:
[0112] Calculate the gradient of the loss function with respect to each model parameter. Based on the obtained gradient of each model parameter, use the gradient descent algorithm to update the model parameters of the neural network. Specifically:
[0113] Select an initial point θ0, define θ as the model parameter, and θ0 as the initialization parameter;
[0114] Choose a loss function L(θ) that measures the difference between the predictions given the model parameters θ and the actual observations;
[0115] Determine an appropriate learning rate η, which controls the step size of updating parameters at each iteration;
[0116] Iterative update, for each training sample i, calculate the gradient of the loss function with respect to θ:
[0117]
[0118] Among them, g i is the gradient, x i is the input processing data, y i is the corresponding machining accuracy fault diagnosis result.
[0119] S5. Use the task allocation computing unit to calculate the data transmission volume, edge computing processing time, and edge layer computing utilization. The data transmission volume is the total amount of data transmitted from the edge computing layer to the cloud computing layer. The edge computing processing time is the time required for data transmission and algorithm processing in the network environment. The edge layer computing utilization is the utilization efficiency of the edge computing layer. The data transmission volume of this embodiment represents the data transmission cost. The edge computing processing time reflects the algorithm complexity to a certain extent. The edge layer computing utilization can be derived by combining the algorithm complexity and the computing power of the device.
[0120] The task allocation optimization unit is used to build an edge computing allocation optimization algorithm, and the fruit fly algorithm is used to solve the optimal task allocation method and perform task scheduling. The fruit fly algorithm is specifically implemented through the following methods:
[0121] Normalize the data transmission volume, edge computing processing time, and edge layer computing utilization rate and use them as optimization targets;
[0122] Initialize the number of fruit fly swarms and randomly initialize the positions of the fruit fly swarms;
[0123] Define the fitness function based on the optimization objective:
[0124] F=argmin(e·Q tmn +f·T op +h·D op )
[0125] Among them, F is the fitness function, Q tmn is the normalized value of data transmission volume, T op is the normalized value of edge computing processing time, D op is the normalized value of edge layer computing utilization;
[0126] Based on the smell search method, the crossover and mutation process is introduced to calculate the fitness function value F;
[0127] Construct an iterative mechanism for visual search. If the fitness function value of an individual fruit fly is better than the fitness function value of the fruit fly group center, the position of the individual fruit fly is used as the new search center.
[0128] Through iterative optimization, the individual fruit flies with the optimal fitness function value are determined as the optimal task allocation method.
[0129] S6. Use the machining accuracy fault diagnosis model to diagnose the CNC machining process in real time. For machining accuracy faults, obtain the corresponding tool image, obtain the tool wear area based on the tool image, and perform laser surface strengthening treatment on the tool wear area. This step is specifically as follows:
[0130] S61. Perform real-time diagnosis on the CNC machining process using a machining accuracy fault diagnosis model, and determine whether a machining accuracy fault occurs based on the power increment change. If so, execute step S62.
[0131] S62 , obtaining a corresponding tool image, and obtaining tool profile geometry information and tool wear area geometry information by image feature extraction.
[0132] S63. Construct a three-dimensional model of the tool based on the tool profile geometry information and the tool wear area geometry information.
[0133] S64. Based on the geometric information of the tool wear area, the tool wear area is divided into a set of equivalent planes, and a zigzag laser scanning path is set on each equivalent plane to form multiple trajectory points. Each equivalent plane can be defined as a rectangle, trapezoid, or other shape. Taking a rectangle as an example, the trajectory point setting starts from one vertex of the rectangle, and the trajectory points are set along the long side. Then, according to the area of the rectangle, a set of reciprocating, coherent, and uniform trajectory points are formed within the rectangle. Since the tool wear area is not an ideal plane, the equivalent planes are not on the same plane. Each equivalent plane has a slope feature, which is used to guide the angle of the robot manipulator.
[0134] S65. Based on all trajectory points on each equivalent plane, a laser surface strengthening path is constructed.
[0135] S66. Establish tool space coordinates based on tool contour geometry information. On the basis of tool space coordinates, determine wear area space coordinates based on tool wear area geometry information. Perform coordinate conversion on wear area space coordinates and convert them into robot working coordinate system. Convert the laser surface strengthening path constructed in step S64 into the robot working coordinate system. The robot working coordinate system is a working coordinate system jointly determined by the robot's manipulator and laser.
[0136] S67. Based on the laser surface strengthening path, the robot controls the laser to perform laser surface strengthening on the tool wear area to achieve tool repair.
[0137] Those skilled in the art should understand that laser surface strengthening technology is a heat treatment technology that uses laser to heat and then cool. It can achieve phase change strengthening (i.e., laser shock strengthening) on the tool surface by irradiating the laser spot, thereby achieving a repair effect. It can also repair the worn parts of the tool by laser directed energy deposition.
[0138] From the above description, it can be seen that the present invention plans the laser surface strengthening path based on the processing accuracy fault diagnosis results, and repairs the worn tools in a timely and effective manner. On the one hand, it ensures the processing accuracy of CNC processing, and on the other hand, it also improves the service life and life of the tools. Laser surface strengthening technology is used to promptly repair abnormal tool conditions. Based on the laser scanning path of the tool wear image and converting it into the working coordinate system of the laser operation, it can guide the laser surface strengthening operation in real time. Based on the precision fault mechanism of the CNC processing process, the present invention constructs and trains a power increment diagnosis model, and then uses a transfer learning algorithm to achieve efficient knowledge transfer between different processing conditions, reuses the labeled data of the source domain, constructs an algorithm to migrate old data from the source domain to the target domain, and reuses the training parameters of the deep learning algorithm in the original processing conditions, which can effectively improve its training accuracy and efficiency. The present invention improves the computational efficiency of the CNC processing process diagnosis process by constructing an edge computing allocation optimization algorithm, using the fruit fly algorithm to solve the optimal task allocation method and perform task scheduling.
[0139] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A tool wear monitoring and repair method based on artificial intelligence, characterized in that: The method is implemented based on an edge computing system, which includes a cloud computing layer, an edge computing layer, a terminal layer, a task allocation calculation unit, and a task allocation optimization unit. The cloud computing layer is used to train a power increment diagnosis model, and the edge computing layer is used to retrain the power increment diagnosis model for new processing conditions. The terminal layer includes a CNC machine tool, a working condition parameter acquisition module, a power data acquisition module, and an image acquisition module. The working condition parameter acquisition module is used to acquire cutting processing parameters and workpiece types, the power data acquisition module is used to acquire cutting processing power in real time, and the image acquisition module is used to acquire cutting tool images and workpiece surface quality images. The method comprises the following steps: S1. Collecting raw processing data under the same processing conditions through the terminal layer and uploading it to the cloud computing layer. The raw processing data includes at least processing power, processing parameters, cutting tool images, and workpiece surface quality images. The processing conditions include at least cutting processing parameters and workpiece type. S2. Train a power increment diagnosis model through the cloud computing layer. The input of the power increment diagnosis model is the machining power and cutting tool wear. The output of the power increment diagnosis model is the cutting precision fault diagnosis result. The original machining data and the cutting precision fault diagnosis result are used as source domain data. The source domain data and the power increment diagnosis model are sent to the edge computing layer. S3, the terminal layer collects processing data in real time as monitoring data during the processing process, and transmits it to the edge computing layer through the MQTT protocol, and then transmits the processing data to the cloud computing layer through the MQTT protocol; S4. The cloud computing layer determines whether the machining conditions have changed based on the monitoring data. If not, the power increment diagnosis model is trained using the edge computing layer based on the deep learning algorithm to obtain the final machining accuracy fault diagnosis model. If so, the monitoring data is used as the target domain data, and a deep learning algorithm model is constructed based on the transfer learning algorithm. The deep learning algorithm model is trained using the edge computing layer to obtain the final machining accuracy fault diagnosis model. The machining accuracy fault diagnosis model is implemented using a long short-term memory neural network combined with a convolutional neural network. S5. Utilize the task allocation calculation unit to collect data transmission volume, edge computing processing time, and edge layer computing utilization rate, where the data transmission volume is the total amount of data transmitted from the edge computing layer to the cloud computing layer, the edge computing processing time is the time required for data transmission and algorithm processing under a network environment, and the edge layer computing utilization rate is the utilization efficiency of the edge computing layer; utilize the task allocation optimization unit to construct an edge computing allocation optimization algorithm, and utilize the fruit fly algorithm to solve the optimal task allocation method and perform task scheduling; S6. Use the machining accuracy fault diagnosis model to perform real-time diagnosis of the CNC machining process. For machining accuracy faults, obtain the corresponding tool image, obtain the tool wear area based on the tool image, and perform laser surface strengthening treatment on the tool wear area.
2. The tool wear monitoring and repair method based on artificial intelligence according to claim 1, characterized in that: The fruit fly algorithm is specifically implemented by the following method: Normalize the data transmission volume, edge computing processing time, and edge layer computing utilization rate and use them as optimization targets. Initialize the number of fruit fly swarms and randomly initialize the positions of the fruit fly swarms; Define the fitness function based on the optimization objective: F=argmin(e·Q tmn +f·T op +h·D op ) Among them, F is the fitness function, Q tmn is the normalized value of data transmission volume, T op is the normalized value of edge computing processing time, D op is the normalized value of edge layer computing utilization; Based on the smell search method, the crossover and mutation process is introduced to calculate the fitness function value F; Construct an iterative mechanism for visual search. If the fitness function value of an individual fruit fly is better than the fitness function value of the fruit fly group center, the position of the individual fruit fly is used as the new search center. Through iterative optimization, the individual fruit flies with the optimal fitness function value are determined as the optimal task allocation method.
3. The tool wear monitoring and repair method based on artificial intelligence according to claim 1 or 2, characterized in that: The step S4 of training the deep learning algorithm model using the edge computing layer is specifically implemented by the following method: analyzing the feature distribution differences between the source domain data and the target domain data, introducing alignment weights to perform data alignment to achieve cross-domain data transfer; The deep learning algorithm is constructed using the TensorFlow deep learning architecture for forward computational training. Parameter transfer learning is used while retaining most training parameters. Backpropagation is performed to optimize feature distribution. The maximum mean difference is used to measure the difference in probability distribution between the source and target domains. The cross-entropy of deep learning training is combined to characterize the training error results. The regularized maximum mean difference and cross-entropy are used to construct the algorithm's optimization goal. After training, the final machining accuracy fault diagnosis model is obtained, which is used for real-time diagnosis during the machining process.
4. The tool wear monitoring and repair method based on artificial intelligence according to claim 3, characterized in that: The processing accuracy fault diagnosis model structure in step S4 includes a convolution layer, a pooling layer, an LSTM layer and a fully connected layer. The convolution layer and the pooling layer are used for feature extraction, the LSTM layer is used to process time series data, and the fully connected layer is used for the final diagnosis result classification.
5. The tool wear monitoring and repair method based on artificial intelligence according to claim 4, characterized in that: The forward computation training is achieved by the following method: Randomly initialize the model's weight matrix and bias parameters; Input source domain data and target domain data into each layer of the neural network, and output the diagnostic result. The diagnostic result is calculated by the following formula: Among them, y is the output diagnosis result, x is the input source domain data and target domain data, b is the bias parameter, is the activation function, which uses one of the ReLU function, PReLU function, Softmax function, and Swish function; The loss function is used to calculate the error between the output diagnosis result and the true result.
6. The tool wear monitoring and repair method based on artificial intelligence according to claim 5, characterized in that: The back propagation calculation is achieved by the following method: Calculate the gradient of the loss function with respect to each model parameter. Based on the obtained gradient of each model parameter, use the gradient descent algorithm to update the model parameters of the neural network. Specifically: Select an initial point θ0, define θ as the model parameter, and θ0 as the initialization parameter; Choose a loss function L(θ) that measures the difference between the predictions given the model parameters θ and the actual observations; Determine an appropriate learning rate η, which controls the step size of updating parameters at each iteration; Iterative update, for each training sample i, calculate the gradient of the loss function with respect to θ: Among them, g i is the gradient, x i is the input processing data, y i is the corresponding machining accuracy fault diagnosis result.
7. The tool wear monitoring and repair method based on artificial intelligence according to claim 2, characterized in that: The step S2 is specifically implemented by the following method: S21. Based on the wear curve of the cutting tool, the cutting tool processing life cycle is divided into three periods: the running-in period, the steady-state period, and the failure period. For the running-in period and the steady-state period, a correlation model between tool wear and tool cutting force is established. The correlation model between tool wear and tool cutting force is: Among them, i is the i-th tool wear state in the cutting tool processing life cycle, A i is the wear amount of the i-th tool under wear state, which is obtained through image analysis, F i is the cutting force corresponding to the i-th tool wear data, F0 is the initial cutting force of the cutting tool, a and b are constants determined based on the wear curve of the cutting tool; S22. For the workpiece surface quality image, grayscale image is obtained by grayscale processing, and the fractal dimension of the grayscale surface of the grayscale image is calculated. The grayscale plane of the image is covered by boxes of different sizes, and the number of boxes required to cover the entire grayscale surface is calculated. Then, the fractal dimension is obtained by least squares fitting. The obtained fractal dimension is normalized to obtain the workpiece surface roughness, and the corresponding processing data with surface roughness greater than a preset threshold σ is eliminated; S23. Use Matlab software to estimate the cutting force during the machining life cycle, analyze the nonlinear relationship between cutting tool wear and cutting force increment, and define the tool aging coefficient K. cutter , K cutter The solution model is: Among them, K cutter is the tool aging coefficient, c and d are model parameters; S24. Based on the original processing data, establish and train the tool wear power increment model: ΔP ik =P i ·f(K cutter ) Where ΔP ik is the machining power increment between the kth tool wear state and the ith tool wear state, P i is the machining power under the i-th tool wear state, f(K cutter ) is a function of the tool aging coefficient, g, h, and n are model parameters; Obtain processing data of other different working conditions, verify the tool wear power increment model, and optimize the model parameters. A power increment diagnosis model is constructed based on the tool wear power increment model. The input of the power increment diagnosis model is the machining power and the cutting tool wear amount, and the output is the cutting machining accuracy fault diagnosis result.
8. The tool wear monitoring and repair method based on artificial intelligence according to claim 7, characterized in that: The wear amount of the tool under the wear state is specifically obtained by the following method: Acquire a cutting tool image, where the cutting tool image is obtained by photographing a CCD camera installed at a corresponding position on a CNC machine tool; extract tool feature information using an image feature extraction method, where the tool feature information includes tool contour features, tool surface texture features, tool wear area texture features, and tool wear area edge features; obtain tool geometry information and position and geometry information of the wear area based on the tool feature information; calculate the area and depth of the wear area based on the tool geometry information and the position and geometry information of the wear area, and then calculate the volume of the wear area as the wear amount.
9. The tool wear monitoring and repair method based on artificial intelligence according to claim 8, characterized in that: Also includes: After establishing the tool wear power increment model, the optimization function is used to optimize the tool wear power increment model. The optimized tool wear power increment model is expressed as: ΔP final =P i ·f(K cutter )·δ(K cutter ,R i ) Where ΔP final The power increment after optimization, δ(K cutter ,R i ) is the optimization function, R i is the surface roughness of the workpiece under the i-th tool wear state, β is a constant, 0<β<0.
5.
10. The tool wear monitoring and repair method based on artificial intelligence according to claim 8, characterized in that: The step S6 includes the following sub-steps: S61, using the machining accuracy fault diagnosis model to perform real-time diagnosis on the CNC machining process, and judging whether a machining accuracy fault occurs based on the power increment change, and if so, executing step S62; S62, obtaining a corresponding tool image, and obtaining tool profile geometry information and tool wear area geometry information by image feature extraction; S63, constructing a three-dimensional model of the tool based on the tool profile geometric information and the tool wear area geometric information; S64, based on the geometric information of the tool wear area, dividing the tool wear area into a set of equivalent planes, and setting a zigzag laser scanning path on each equivalent plane to form a plurality of trajectory points; S65. Constructing a laser surface strengthening path based on all trajectory points on each equivalent plane; S66, establishing tool space coordinates based on tool profile geometry information, determining wear area space coordinates based on tool space coordinates and tool wear area geometry information, performing coordinate conversion on the wear area space coordinates to a robot working coordinate system, and converting the laser surface enhancement path constructed in step S64 to the robot working coordinate system, wherein the robot working coordinate system is a working coordinate system jointly determined by the robot manipulator and the laser; S67. Based on the laser surface strengthening path, the robot controls the laser to perform laser surface strengthening on the tool wear area to achieve tool repair.
Citation Information
Patent Citations
Deep hole machining tool wear amount monitoring method based on SSAE-LSTM model
CN110576336A
Automatic production line intelligent monitoring system based on self-learning time-varying digital twinning
CN115129003A