A CNC machining path optimization method based on deep learning
Through the CNC machining path optimization method based on deep learning, the problems of low path optimization efficiency and poor adaptability in traditional methods are solved, and more efficient and accurate machining path generation and real-time optimization are achieved.
Patent Information
- Application Number
- CN202410988265.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Traditional CNC machining path optimization methods are difficult to generate the optimal path, resulting in long processing time, high energy consumption, serious tool wear, and lack of adaptive capabilities and efficient simulation verification mechanisms.
Using a deep learning-based method, by automatically collecting and preprocessing historical processing data, the neural network model is trained to identify the optimal path pattern, and the optimal processing path is generated based on actual task parameters, for simulation verification and real-time optimization.
It significantly improves machining efficiency and path accuracy, reduces machining time and energy consumption, reduces tool wear, has adaptive optimization capabilities, and can make real-time adjustments according to different tasks and workpiece characteristics.
Smart Images

Figure CN118938807B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motion recognition technology, and in particular to a CNC machining path optimization method based on deep learning. Background Art
[0002] CNC machining technology is one of the indispensable and important technologies in modern manufacturing, and is widely used in the fields of automobiles, aerospace, medical equipment, etc. CNC machining technology uses computers to control machine tools to perform precise cutting, drilling, milling and other operations to achieve high-precision and high-efficiency processing. However, with the continuous development of industrial production, CNC machining is facing more and more complex tasks and high requirements, which puts higher requirements on the optimization of processing paths.
[0003] Traditional CNC machining path optimization methods mainly rely on preset rules or experience-based optimization algorithms, such as ant colony algorithms, genetic algorithms, etc. These methods usually require manual setting of parameters and rules, are not flexible enough to respond to complex and changeable machining tasks, and are difficult to generate optimal machining paths, resulting in long machining time, high energy consumption, and severe tool wear. In addition, these methods lack adaptive capabilities and are difficult to adjust and optimize in real time according to different machining tasks and workpiece characteristics, resulting in the inability to guarantee machining quality and efficiency.
[0004] Traditional methods are inefficient when dealing with complex and variable processing tasks, and it is difficult to generate the optimal processing path. This is because traditional optimization algorithms usually require a lot of computing resources and time, especially when facing high-dimensional, multi-constrained optimization problems, it is difficult to quickly converge to the optimal solution. This not only increases processing time and energy consumption, but also leads to low production efficiency.
[0005] Traditional path optimization methods lack adaptive capabilities and are difficult to adjust and optimize in real time according to different processing tasks and workpiece characteristics. Specifically, different material types, hardness, processing requirements, etc. will affect the generation of the optimal path, but traditional methods often cannot flexibly adjust the optimization strategy, resulting in insufficient robustness and flexibility of path planning.
[0006] Traditional methods usually rely on limited experience and rules, and fail to fully utilize the large amount of data generated during CNC machining. These data include machining paths, machining time, tool wear, material properties, etc., which contain rich optimization information, but have not been effectively utilized, thus limiting the improvement of optimization effects.
[0007] In traditional methods, the generated machining paths often lack sufficient simulation verification, which may lead to deviations in actual machining and affect machining quality and accuracy. Simulation verification is an important step to ensure the effectiveness and reliability of the path, but due to computing resource and algorithm limitations, traditional methods are difficult to perform efficient simulation verification and iterative optimization.
[0008] Therefore, how to provide a CNC machining path optimization method based on deep learning is an urgent problem that technicians in this field need to solve. Summary of the invention
[0009] One purpose of the present invention is to propose a CNC machining path optimization method based on deep learning, which can significantly improve machining efficiency and path accuracy, and avoid errors caused by rule setting and lack of experience in traditional methods.
[0010] A method for optimizing a CNC machining path based on deep learning according to an embodiment of the present invention comprises the following steps:
[0011] S1,automatically collect historical processing data sets from the operation of CNC machine tools;
[0012] S2, preprocessing the historical processing data set, removing noise and invalid data, and performing standardization processing;
[0013] S3. Based on the preprocessed historical processing data set, a deep learning algorithm is used to train a neural network model so that the deep learning model can learn and identify the optimal path mode under different processing conditions;
[0014] S4, input the input parameters according to the material type and processing requirements of the actual processing task into the trained deep learning model;
[0015] S5. Generate the optimal processing path through deep learning model;
[0016] S6. Perform simulation verification on the generated processing path to ensure the effectiveness and reliability of the path;
[0017] S7, monitor the processing status in real time during the processing and collect feedback data;
[0018] S8. According to the feedback data from real-time monitoring, the deep learning model is dynamically adjusted and optimized, and the optimized path parameters are updated to the processing path in real time;
[0019] S9, upload the optimized processing path to the CNC machine tool and execute the processing task.
[0020] Optionally, the S1 includes the following steps:
[0021] S11, automatically collecting NC machining path data from the operation of the NC machine tool, wherein the NC machining path data includes the machine tool movement trajectory, feed speed and machining sequence, and recorded as P(t), where P i (t) represents the i-th path data at time t:
[0022]
[0023] Among them, x ij (t), y ij (t), z ij (t) represents the coordinates of the jth position of the ith path in three-dimensional space, v ij (t) represents the feed speed, s ij (t) indicates the processing sequence;
[0024] S12, automatically collecting CNC machining time data from the operation of the CNC machine tool, wherein the CNC machining time data includes a start time, an end time and a machining cycle, and is recorded as T(t), where T i (t) represents the i-th time data at time t:
[0025]
[0026] Among them, δ start (t′) and δ end (t′) represents the indicator function of the time point of the start and end of processing, respectively, and α and β are time decay factors;
[0027] S13, automatically collecting CNC tool wear data from the operation of the CNC machine tool, wherein the CNC tool wear data includes tool usage time, tool wear degree and replacement record, recorded as W(t), where W i (t) represents the i-th tool wear data at time t:
[0028]
[0029] Among them, ω k represents the tool wear weight factor, u ik (t) represents the usage status of the i-th tool at time t, τ ik (t) represents the tool usage time;
[0030] S14, automatically collecting processing material property data from the operation of the CNC machine tool, wherein the processing material property data includes material type, hardness and surface finish, and recorded as M(t), where M i (t) represents the i-th material characteristic data at time t:
[0031]
[0032] Among them, μ l represents the material property weighting factor, κ il (t) represents the material type, ρ il (t) represents the material hardness, σ il (t) indicates the surface finish of the material;
[0033] S15, integrating the CNC machining path data P(t), CNC machining time data T(t), CNC tool wear data W(t) and machining material property data M(t) to construct a historical machining data set D(t):
[0034] D(t)={(P i (t), T i (t), W i (t), M i (t))|i=1, 2, ..., N};
[0035] Where N is the total number of samples collected.
[0036] Optionally, S3 includes the following steps:
[0037] S31, dividing the preprocessed historical processing data set D(t) into a training data set and a verification data set;
[0038] S32. Construct an improved deep learning model, wherein the improved deep learning model includes an input layer, an adaptive convolution layer, a hybrid LSTM-GRU layer, a multi-head attention mechanism layer and an output layer. The structure of the improved deep learning model is as follows:
[0039] InputLayer→AdaptiveConvolutionLayer→HybridLSTM-GRULayer→Multi-headAttentionLayer→OutputLayer;
[0040] S33, in the input layer, the pre-processed NC machining path data P(t), NC machining time data T(t), NC tool wear data W(t) and machining material property data M(t) are input, and the input of the input layer is expressed as:
[0041] X(t)={P i (t), T i (t), W i (t), M i (t)|i=1,2,...,N};
[0042] S34. In the adaptive convolution layer, the local features of the data are extracted through the adaptive convolution operation. The output of the adaptive convolution layer is expressed as:
[0043]
[0044] Among them, σ is the activation function, w k(t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term;
[0045] S35, the output C of the adaptive convolution layer adapt (t) is input into the hybrid LSTM-GRU layer to capture the long-term and short-term dependencies of the time series. The output of the hybrid LSTM-GRU layer is expressed as:
[0046] i t =σ(W i ·[C adapt (t), h t-1 ]+b i );
[0047] f t =σ(W f ·[C adapt (t), h t-1 ] f );
[0048] o t =σ(W o ·[C adapt (t), h t-1 ]+b o );
[0049]
[0050] r t =σ(W r ·[C adapt (t), h t-1 ] r );
[0051] z t =σ(W z ·[C adapt (t), h t-1 ]+b z );
[0052]
[0053] H mix (t) = [h t , c t ];
[0054] Among them, r t is the reset gate, z t is the update gate, i t is the input gate, f t For the forget gate, t is the output gate, is the candidate memory state, ct For memory status;
[0055] S36. After the hybrid LSTM-GRU layer, a multi-head attention mechanism is introduced to weight the output of the hybrid layer and calculate the weighted output A multi (t):
[0056]
[0057] Where H is the number of attention heads, is the attention score of the h-th head, and the other symbol definitions are the same as those of single-head attention;
[0058] S37. Output A of the multi-head attention mechanism multi (t) Input to the output layer to generate the final optimal path mode prediction result
[0059]
[0060] Among them, W out is the weight matrix of the output layer, b out is the bias term of the output layer;
[0061] S38. Define the loss function L(θ) to calculate the error between the model prediction result and the actual path data:
[0062]
[0063] in, is the i-th path data predicted by the model, Y i (t) is the actual i-th path data, θ is the model parameter;
[0064] S39. Optimize the loss function L(θ) through the gradient descent algorithm, update the model parameter θ, and the iterative formula is expressed as:
[0065]
[0066] Where η is the learning rate, is the gradient of the loss function with respect to the model parameters;
[0067] S310, training the improved deep learning model to make the improved deep learning model parameter θ converge, and obtain the final optimal deep learning model θ * .
[0068] Optionally, S4 includes the following steps:
[0069] S41, according to the material type and processing requirements of the actual processing task, obtain an input parameter set Q(t), the input parameter set including the material type Mtype (t), material hardness M hard (t), processing accuracy P acc (t) and feed speed v(t);
[0070] S42, combining the input parameter set Q(t) with the preprocessed historical processing data set D(t) to form a complete input data set I(t):
[0071] I(t) = {Q(t), D(t)};
[0072] The historical processing data set D(t) includes NC processing path data P(t), NC processing time data T(t), NC tool wear data W(t) and processed material property data M(t), specifically:
[0073] D(t)={P i (t), T i (t), W i (t), M i (t)|i=1, 2, ..., N};
[0074] S43, input the input data set I(t) into the trained optimal deep learning model θ * In the example, the input layer’s input is represented as:
[0075] X(t)={I i (t)|i=1, 2, ..., N};
[0076] Among them, the input data I i (t) includes all parameters corresponding to time t:
[0077] I i (t) = {M type,i (t), M hard,i (t), P acc,i (t), v i (t), P i (t), T i (t), W i (t), M i (t)};
[0078] S44. In the optimal deep learning model θ * In , the input data set I(t) is processed in sequence by the adaptive convolution layer, the hybrid LSTM-GRU layer, and the multi-head attention mechanism layer to generate the intermediate feature representation F(t), which is expressed as:
[0079] F(t)=A multi (t);
[0080] Among them, the intermediate feature representation F(t) is generated by the following steps:
[0081]
[0082] Among them, the output C of the adaptive convolution layer adapt (t) represents the extraction of local features of data through adaptive convolution operation, σ is the activation function, and w k (t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term;
[0083] {h t , c t}=HybridLSTM-GRU(C adapt (t));
[0084] The output h of the hybrid LSTM-GRU layer t and c t It represents capturing the long-term and short-term dependencies of time series;
[0085] S45, inputting the intermediate feature representation F(t) into the output layer to generate the final optimal path mode prediction result;
[0086] S46. Obtain the prediction result of the optimal processing path through steps S41-S45 as the path optimization solution for the actual processing task.
[0087] Optionally, the optimal processing path is generated according to the prediction result of the optimal path mode. opt (t) is expressed as:
[0088]
[0089] Optionally, the S6 comprises the following steps:
[0090] S61, the generated optimal processing path P opt (t) is input into the CNC machining simulation system. The input of the simulation system is expressed as:
[0091] P input (t) = P opt (t);
[0092] S62, in the simulation system, simulate the processing path P opt (t), and record the simulation result data R(t), which includes the path accuracy E path (t), processing time T sim (t) and tool wear W sim (t), where:
[0093] Path Accuracy E path (t) is expressed as:
[0094]
[0095] Among them, P sim,i (t) is the actual execution trajectory of the ith path in the simulation system, L i is the length of the i-th path;
[0096] Processing time T sim (t) is expressed as:
[0097]
[0098] Among them, v sim,i (t) is the feed rate of the i-th path in the simulation system;
[0099] Tool wear condition W sim (t) is expressed as:
[0100]
[0101] Among them, λ i is the tool wear coefficient, f sim,i (t) is the cutting force;
[0102] S63, calculating the deviation between the simulation result data R(t) and the actual processing requirements, the deviation is expressed as:
[0103] The path accuracy deviation ΔE(t) is expressed as:
[0104] ΔE(t)=E path (t)-E req (t);
[0105] Among them, E req (t) is the path accuracy required for actual processing;
[0106] The processing time deviation ΔT(t) is expressed as:
[0107] ΔT(t)=T sim (t)-T req (t);
[0108] Among them, T req (t) is the processing time required for actual processing;
[0109] The tool wear deviation ΔW(t) is expressed as:
[0110] ΔW(t)=W sim (t)-W req (t);
[0111] Among them, W reg (t) is the tool wear condition required by actual processing;
[0112] S64, the optimal machining path P generated according to the path accuracy deviation ΔE(t), the machining time deviation ΔT(t) and the tool wear deviation ΔW(t) opt-new (t) Adjustment and optimization:
[0113]
[0114] Among them, η is the learning rate, α and β are weight factors;
[0115] S65, through iterative simulation verification and optimization, finally determine the optimal processing path P that meets the processing requirements opt-final (t):
[0116]
[0117] in, represents the optimization result of the kth iteration;
[0118] S66, ensure the final optimal processing path P opt-final (t) meets all machining requirements, including path accuracy, machining time and tool wear. The final optimization formula is expressed as:
[0119] P opt-final (t) = argmin P (ΔE(t)+αΔT(t)+βΔW(t)).
[0120] The beneficial effects of the present invention are:
[0121] (1) The method of the present invention can significantly improve processing efficiency and path accuracy by automatically generating the optimal processing path through improving the deep learning model, and avoid the errors caused by rule setting and lack of experience in traditional methods. Compared with traditional methods, the deep learning model is more efficient in processing complex and changeable processing tasks, and can quickly generate the optimal path, reduce processing time, and improve processing efficiency.
[0122] (2) The method of the present invention effectively reduces energy consumption and tool wear during the machining process by optimizing the machining path. By generating the optimal machining path, the optimal planning of the machining path is achieved, thus avoiding unnecessary path duplication and excessive machining time.
[0123] (3) The method of the present invention has adaptive optimization capabilities and can perform real-time adjustment and optimization according to different processing tasks and workpiece characteristics. By obtaining the input parameter set of the actual processing task, the deep learning model can adapt to different processing tasks and realize personalized and intelligent path optimization. When faced with different material types, hardnesses and processing requirements, it can flexibly adjust the optimization strategy to ensure the best effect of the processing path. BRIEF DESCRIPTION OF THE DRAWINGS
[0124] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0125] Figure 1 This is a flow chart of a CNC machining path optimization method based on deep learning proposed in the present invention. DETAILED DESCRIPTION
[0126] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0127] refer to Figure 1 , a CNC machining path optimization method based on deep learning, comprising the following steps:
[0128] S1,automatically collect historical processing data sets from the operation of CNC machine tools;
[0129] S2, preprocess the historical processing data set, remove noise and invalid data, and perform standardization;
[0130] S3. Based on the preprocessed historical processing data set, a deep learning algorithm is used to train a neural network model so that the deep learning model can learn and identify the optimal path mode under different processing conditions;
[0131] S4, input the input parameters according to the material type and processing requirements of the actual processing task into the trained deep learning model;
[0132] S5. Generate the optimal processing path through deep learning model;
[0133] S6. Perform simulation verification on the generated processing path to ensure the effectiveness and reliability of the path;
[0134] S7, monitor the processing status in real time during the processing and collect feedback data;
[0135] S8. According to the feedback data from real-time monitoring, the deep learning model is dynamically adjusted and optimized, and the optimized path parameters are updated to the processing path in real time;
[0136] S9, upload the optimized processing path to the CNC machine tool and execute the processing task.
[0137] In this implementation, S1 includes the following steps:
[0138] S11, automatically collect NC machining path data from the operation of the NC machine tool, the NC machining path data includes the machine tool movement trajectory, feed speed and machining sequence, and is recorded as P(t), where P i (t) represents the i-th path data at time t:
[0139]
[0140] Among them, x ij (t), y ij (t), z ij (t) represents the coordinates of the jth position of the ith path in three-dimensional space, v ij (t) represents the feed speed, s ij (t) indicates the processing sequence;
[0141] S12, automatically collect NC processing time data from the operation of the NC machine tool, the NC processing time data includes the start time, the end time and the processing cycle, recorded as T(t), where T i (t) represents the i-th time data at time t:
[0142]
[0143] Among them, δ start (t′) and δ end (t′) represents the indicator function of the time point of the start and end of processing, respectively, and α and β are time decay factors;
[0144] S13, automatically collecting CNC tool wear data from the operation of the CNC machine tool, the CNC tool wear data including tool usage time, tool wear degree and replacement record, recorded as W(t), where W i (t) represents the i-th tool wear data at time t:
[0145]
[0146] Among them, ω k represents the tool wear weight factor, u ik (t) represents the usage status of the i-th tool at time t, τ ik (t) represents the tool usage time;
[0147] S14. Automatically collect the material property data of the processing from the operation of the CNC machine tool. The material property data of the processing includes material type, hardness and surface finish, and is recorded as M(t). i (t) represents the i-th material characteristic data at time t:
[0148]
[0149] Among them, μ l represents the material property weighting factor, κ il (t) represents the material type, ρ il (t) represents the material hardness, σ il (t) indicates the surface finish of the material;
[0150] S15, integrating the CNC machining path data P(t), the CNC machining time data T(t), the CNC tool wear data W(t) and the machining material property data M(t) to construct a historical machining data set D(t):
[0151] D(t)={(P i (t), T i (t), W i (t), M i (t))|i=1, 2, ..., N};
[0152] Where N is the total number of samples collected.
[0153] In this implementation, S3 includes the following steps:
[0154] S31, dividing the preprocessed historical processing data set D(t) into a training data set and a verification data set;
[0155] S32. Build an improved deep learning model. The improved deep learning model includes an input layer, an adaptive convolution layer, a hybrid LSTM-GRU layer, a multi-head attention mechanism layer and an output layer. The structure of the improved deep learning model is as follows:
[0156] InputLayer→AdaptiveConvolutionLayer→HybridLSTM-GRULayer→Multi-headAttentionLayer→OutputLayer;
[0157] S33, in the input layer, the pre-processed NC machining path data P(t), NC machining time data T(t), NC tool wear data W(t) and machining material property data M(t) are input, and the input of the input layer is expressed as:
[0158] X(t)={Pi (t), T i (t), W i (t), M i (t)|i=1,2,...,N};
[0159] S34. In the adaptive convolution layer, the local features of the data are extracted through the adaptive convolution operation. The output of the adaptive convolution layer is expressed as:
[0160]
[0161] Among them, σ is the activation function, w k (t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term;
[0162] S35, the output C of the adaptive convolution layer adapt (t) is input into the hybrid LSTM-GRU layer to capture the long-term and short-term dependencies of the time series. The output of the hybrid LSTM-GRU layer is expressed as:
[0163] i t =σ(W i ·[C adapt (t), h t-1 ]+b i );
[0164] f t =σ(W f ·[C adapt (t), h t-1 ]+b f );
[0165] o t=σ(W o ·[C adapt (t), h t-1 ]+b o );
[0166]
[0167] r t =σ(W r ·[C adapt (t), h t-1 ]+b r );
[0168] z t =σ(W z ·[C adapt (t), h t-1 ]+b z );
[0169]
[0170] H mix (t) = [h t , c t ];
[0171] Among them, r t is the reset gate, z t is the update gate, i t is the input gate, f t For the forget gate, t is the output gate, is the candidate memory state, c t For memory status;
[0172] S36. After the hybrid LSTM-GRU layer, a multi-head attention mechanism is introduced to weight the output of the hybrid layer and calculate the weighted output A multi (t):
[0173]
[0174] Where H is the number of attention heads, is the attention score of the h-th head, and the other symbol definitions are the same as those of single-head attention;
[0175] S37. Output A of the multi-head attention mechanism multi (t) Input to the output layer to generate the final optimal path mode prediction result
[0176]
[0177] Among them, W out is the weight matrix of the output layer, b out is the bias term of the output layer;
[0178] S38. Define the loss function L(θ) to calculate the error between the model prediction result and the actual path data:
[0179]
[0180] in, is the i-th path data predicted by the model, Y i (t) is the actual i-th path data, θ is the model parameter;
[0181] S39. Optimize the loss function L(θ) through the gradient descent algorithm, update the model parameter θ, and the iterative formula is expressed as:
[0182]
[0183] Where η is the learning rate, is the gradient of the loss function with respect to the model parameters;
[0184] S310, training the improved deep learning model to make the improved deep learning model parameter θ converge, and obtain the final optimal deep learning model θ * .
[0185] In this implementation, S4 includes the following steps:
[0186] S41. According to the material type and processing requirements of the actual processing task, an input parameter set Q(t) is obtained. The input parameter set includes the material type M type (t), material hardness M hard (t), processing accuracy P acc (t) and feed speed v(t);
[0187] S42, combining the input parameter set Q(t) with the preprocessed historical processing data set D(t) to form a complete input data set I(t):
[0188] I(t) = {Q(t), D(t)};
[0189] The historical processing data set D(t) includes NC processing path data P(t), NC processing time data T(t), NC tool wear data W(t) and processed material property data M(t), specifically:
[0190] D(t)={P i (t), T i (t), W i (t), M i (t)|i=1, 2, ..., N};
[0191] S43, input the input data set I(t) into the trained optimal deep learning model θ * In the example, the input layer’s input is represented as:
[0192] X(t)={I i (t)|i=1, 2, ..., N};
[0193] Among them, the input data I i (t) includes all parameters corresponding to time t:
[0194] I i (t) = {M type,i (t), M hard,i (t), P acc,i (t), v i (t), P i (t), T i(t), W i (t), M i (t)};
[0195] S44. In the optimal deep learning model θ*, the input data set I(t) is processed in sequence by the adaptive convolution layer, the hybrid LSTM-GRU layer, and the multi-head attention mechanism layer to generate an intermediate feature representation F(t), which is expressed as:
[0196] F(t)=A multi (t);
[0197] Among them, the intermediate feature representation F(t) is generated by the following steps:
[0198]
[0199] Among them, the output C of the adaptive convolution layer adapt (t) represents the extraction of local features of data through adaptive convolution operation, σ is the activation function, and w k (t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term;
[0200] {h t , c t}=HybridLSTM-GRU(C adapt (t));
[0201] The output h of the hybrid LSTM-GRU layer t and c t It represents capturing the long-term and short-term dependencies of time series;
[0202] S45, inputting the intermediate feature representation F(t) into the output layer to generate the final optimal path mode prediction result;
[0203] S46. Obtain the prediction result of the optimal processing path through steps S41-S45 as the path optimization solution for the actual processing task.
[0204] In this embodiment, the optimal processing path is generated according to the optimal path mode prediction result. opt (t) is expressed as:
[0205]
[0206] In this implementation, S6 includes the following steps:
[0207] S61, the generated optimal processing path P opt (t) is input into the CNC machining simulation system. The input of the simulation system is expressed as:
[0208] P input (t) = P opt (t);
[0209] S62, in the simulation system, simulate the processing path P opt (t) execution process, record the simulation result data R(t), the simulation result data includes the path accuracy E path (t), processing time T sim (t) and tool wear W sim (t), where:
[0210] Path Accuracy E path (t) is expressed as:
[0211]
[0212] Among them, P sim,i (t) is the actual execution trajectory of the ith path in the simulation system, L i is the length of the i-th path;
[0213] Processing time T sim (t) is expressed as:
[0214]
[0215] Among them, v sim,i (t) is the feed rate of the i-th path in the simulation system;
[0216] Tool wear condition W sim (t) is expressed as:
[0217]
[0218] Among them, λ i is the tool wear coefficient, f slm,i (t) is the cutting force;
[0219] S63, calculating the deviation between the simulation result data R(t) and the actual processing requirements, the deviation is expressed as:
[0220] The path accuracy deviation ΔE(t) is expressed as:
[0221] ΔE(t)=E path (t)-E req (t);
[0222] Among them, E req (t) is the path accuracy required for actual processing;
[0223] The processing time deviation ΔT(t) is expressed as:
[0224] ΔT(t)=T sim (t)-T req (t);
[0225] Among them, T req (t) is the processing time required for actual processing;
[0226] The tool wear deviation ΔW(t) is expressed as:
[0227] ΔW(t)=W sim (t)-W req (t);
[0228] Among them, W req (t) is the tool wear condition required by actual processing;
[0229] S64, the optimal machining path P generated according to the path accuracy deviation ΔE(t), the machining time deviation ΔT(t) and the tool wear deviation ΔW(t) opt-new (t) Adjustment and optimization:
[0230]
[0231] Among them, η is the learning rate, α and β are weight factors;
[0232] S65, through iterative simulation verification and optimization, finally determine the optimal processing path P that meets the processing requirements opt-final (t):
[0233]
[0234] in, represents the optimization result of the kth iteration;
[0235] S66, ensure the final optimal processing path P opt-final (t) meets all machining requirements, including path accuracy, machining time and tool wear. The final optimization formula is expressed as:
[0236] P opt-final (t) = argmin P (ΔE(t)+αΔT(t)+βΔW(t)).
[0237] Embodiment 1:
[0238] In a large automotive parts manufacturer, CNC machine tools are widely used for precision machining of various complex parts. The factory's production workshop handles a large number of different types of parts every day, and the processing tasks are complex and diverse, including various material types, hardness and processing accuracy requirements. Traditional CNC machining path optimization methods have been unable to meet the needs of efficient production, and there are problems such as long processing time, high energy consumption, and severe tool wear. To solve these problems, the workshop decided to use the CNC machining path optimization method based on deep learning of the present invention for production optimization.
[0239] During the implementation process, a large amount of historical processing data was first automatically collected from the operation of CNC machine tools. These data include CNC processing path data, CNC processing time data, CNC tool wear data, and processed material property data. After data preprocessing, noise and invalid data were removed and standardized. The preprocessed historical processing data set was used to train the deep learning model, enabling it to learn and identify the optimal path pattern under different processing conditions.
[0240] In a specific production task, the workshop needs to process a batch of complex parts made of different materials (such as aluminum alloy, titanium alloy and stainless steel). The processing requirements of these parts vary, including high-precision cutting and milling of complex surfaces. According to the material type and processing requirements of the actual processing task, the input parameter set is obtained, including material type, material hardness, processing accuracy and feed speed. These parameters are input into the trained deep learning model to generate the optimal processing path.
[0241] The generated optimal machining path was simulated and verified in the CNC machining simulation system. The simulation system simulated the execution process of the machining path and recorded the simulation result data such as path accuracy, machining time and tool wear. By calculating the deviation between the simulation results and the actual machining requirements, and adjusting and optimizing the generated machining path according to the deviation, the optimal machining path that meets the machining requirements was finally determined.
[0242] In the comparative experiment between the method of the present invention and the traditional method, we selected parts of three different materials (aluminum alloy, titanium alloy and stainless steel) for processing. Ten parts of each material were processed, and the processing time, energy consumption and tool wear were recorded. The following are the detailed data comparison results:
[0243] Aluminum alloy parts: The average processing time of the traditional method is 45 minutes / piece, the average energy consumption is 15kWh / piece, and the tool wear is 0.03mm / piece; the average processing time of the present invention is 30 minutes / piece, the average energy consumption is 10kWh / piece, and the tool wear is 0.015mm / piece;
[0244] Titanium alloy parts: The average processing time of the traditional method is 60 minutes / piece, the average energy consumption is 25kWh / piece, and the tool wear is 0.05mm / piece; the average processing time of the present invention is 40 minutes / piece; the average energy consumption is 18kWh / piece; the tool wear is 0.025mm / piece;
[0245] Stainless steel parts: The average processing time of the traditional method is 50 minutes / piece, the average energy consumption is 20kWh / piece, and the tool wear is 0.04mm / piece. The average processing time of the present invention is 35 minutes / piece, the average energy consumption is 14kWh / piece, and the tool wear is 0.02mm / piece.
[0246] From the above data, it can be seen that the method of the present invention is significantly superior to the traditional method in terms of processing time, energy consumption and tool wear. The optimal processing path generated by the deep learning model greatly reduces the processing time and improves production efficiency. At the same time, due to the optimization of the path, energy consumption has also been significantly reduced, and the processing energy consumption of each component has been reduced by 30%-40%. In addition, the tool wear has also been reduced by about 50%, which has extended the service life of the tool and reduced production costs.
[0247] Through the implementation of the present invention, the factory has achieved significant production optimization effects when dealing with complex parts processing tasks. The application of deep learning models makes the processing path optimization process more intelligent and efficient, solving the problems of inefficiency and lack of adaptability of traditional methods in complex and changeable processing tasks. The simulation verification and feedback adjustment mechanism ensures the reliability and stability of the processing path, and further improves the processing quality and efficiency. In specific applications, it significantly reduces processing time and energy consumption, reduces tool wear, and brings significant economic and environmental benefits.
[0248] The method of the present invention can significantly improve processing efficiency and path accuracy by automatically generating the optimal processing path through improving the deep learning model, and avoid the errors caused by rule setting and lack of experience in traditional methods. Compared with traditional methods, the deep learning model is more efficient in handling complex and changeable processing tasks, and can quickly generate the optimal path, reduce processing time, and improve processing efficiency.
[0249] The method of the present invention effectively reduces energy consumption and tool wear during the machining process by optimizing the machining path. By generating the optimal machining path, the optimal planning of the machining path is achieved, and unnecessary path duplication and excessive machining time are avoided.
[0250] The method of the present invention has adaptive optimization capabilities and can perform real-time adjustment and optimization according to different processing tasks and workpiece characteristics. By obtaining the input parameter set of the actual processing task, the deep learning model can adapt to different processing tasks and realize personalized and intelligent path optimization. When faced with different material types, hardnesses and processing requirements, it can flexibly adjust the optimization strategy to ensure the best effect of the processing path.
[0251] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A CNC machining path optimization method based on deep learning, characterized in that: The steps include: S1,automatically collect historical processing data sets from the operation of CNC machine tools; S2, preprocessing the historical processing data set, removing noise and invalid data, and performing standardization processing; S3. Based on the preprocessed historical processing data set, a deep learning algorithm is used to train a neural network model so that the deep learning model can learn and identify the optimal path mode under different processing conditions; S4, input the input parameters according to the material type and processing requirements of the actual processing task into the trained deep learning model; S5. Generate the optimal processing path through deep learning model; S6. Perform simulation verification on the generated processing path to ensure the effectiveness and reliability of the path; S7, monitor the processing status in real time during the processing and collect feedback data; S8. According to the feedback data from real-time monitoring, the deep learning model is dynamically adjusted and optimized, and the optimized path parameters are updated to the processing path in real time; S9, uploading the optimized processing path to the CNC machine tool and executing the processing task; The S1 comprises the following steps: S11, automatically collecting NC machining path data from the operation of the NC machine tool, wherein the NC machining path data includes the machine tool movement trajectory, feed speed and machining sequence, and recorded as P(t), where P i (t) represents the i-th path data at time t: Among them, x ij (t), y ij (t), z ij (t) represents the coordinates of the jth position of the ith path in three-dimensional space, v ij (t) represents the feed speed, s ij (t) indicates the processing sequence; S12, automatically collecting CNC machining time data from the operation of the CNC machine tool, wherein the CNC machining time data includes a start time, an end time and a machining cycle, and is recorded as T(t), where T i (t) represents the i-th time data at time t: Among them, δ start (t') and δ end (t') represents the indicator function of the time point of the start and end of processing, respectively, and α and β are time decay factors; S13, automatically collecting CNC tool wear data from the operation of the CNC machine tool, wherein the CNC tool wear data includes tool usage time, tool wear degree and replacement record, recorded as W(t), where W i (t) represents the i-th tool wear data at time t: Among them, ω k represents the tool wear weight factor, u ik (t) represents the usage status of the i-th tool at time t, τ ik (t) represents the tool usage time; S14, automatically collecting processing material property data from the operation of the CNC machine tool, wherein the processing material property data includes material type, hardness and surface finish, and recorded as M(t), where M i (t) represents the i-th material characteristic data at time t: Among them, μ l represents the material property weighting factor, K il (t) represents the material type, ρ il (t) represents the material hardness, σ il (t) indicates the surface finish of the material; S15, integrating the CNC machining path data P(t), CNC machining time data T(t), CNC tool wear data W(t) and machining material property data M(t) to construct a historical machining data set D(t): D(t)={(P i (t),T i (t),W i (t),M i (t))|i=1,2,...,N}; Where N is the total number of samples collected.
2. The method for optimizing a CNC machining path based on deep learning according to claim 1, characterized in that: The S3 comprises the following steps: S31, dividing the preprocessed historical processing data set D(t) into a training data set and a verification data set; S32. Construct an improved deep learning model, wherein the improved deep learning model includes an input layer, an adaptive convolution layer, a hybrid LSTM-GRU layer, a multi-head attention mechanism layer and an output layer. The structure of the improved deep learning model is as follows: InputLayer→AdaptiveConvolutionLayer→HybridLSTM-GRULayer→Multi-headAttentionLayer→OutputLayer; S33, in the input layer, the pre-processed NC machining path data P(t), NC machining time data T(t), NC tool wear data W(t) and machining material property data M(t) are input, and the input of the input layer is expressed as: X(t)={P i (t),T i (t),W i (t),M i (t)|i=1,2,...,N}; S34. In the adaptive convolution layer, the local features of the data are extracted through the adaptive convolution operation. The output of the adaptive convolution layer is expressed as: Among them, σ is the activation function, w k (t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term; S35, the output C of the adaptive convolution layer adapt (t) is input into the hybrid LSTM-GRU layer to capture the long-term and short-term dependencies of the time series. The output of the hybrid LSTM-GRU layer is expressed as: i t =σ(W i ·[C adapt (t),h t-1 ]+b i ); f t =σ(W f ·[C adapt (t),h t-1 ]+b f ); o t =σ(W o ·[C adapt (t),h t-1 ]+b o ); r t =σ(W r ·[C adapt (t),h t-1 ]+b r ); z t =σ(W z ·[C adapt (t),h t-1 ]+b z ); H mix (t)=[h t ,c t ]; Among them, r t is the reset gate, z t is the update gate, i t is the input gate, f t For the forget gate, t is the output gate, is the candidate memory state, c t For memory status; S36. After the hybrid LSTM-GRU layer, a multi-head attention mechanism is introduced to weight the output of the hybrid layer and calculate the weighted output A multi (t): Where H is the number of attention heads, is the attention score of the h-th head, and the other symbol definitions are the same as those of single-head attention; S37. Output A of the multi-head attention mechanism multi (t) Input to the output layer to generate the final optimal path mode prediction result Among them, W out is the weight matrix of the output layer, b out is the bias term of the output layer; S38. Define the loss function L(θ) to calculate the error between the model prediction result and the actual path data: in, is the i-th path data predicted by the model, Y i (t) is the actual i-th path data, θ is the model parameter; S39. Optimize the loss function L(θ) through the gradient descent algorithm, update the model parameter θ, and the iterative formula is expressed as: Where η is the learning rate, is the gradient of the loss function with respect to the model parameters; S310, training the improved deep learning model to make the improved deep learning model parameter θ converge, and obtain the final optimal deep learning model θ * .
3. The method for optimizing a CNC machining path based on deep learning according to claim 2, characterized in that: The S4 comprises the following steps: S41, according to the material type and processing requirements of the actual processing task, obtain an input parameter set Q(t), the input parameter set including the material type M type (t), material hardness M hard (t), processing accuracy P acc (t) and feed speed v(t); S42, combining the input parameter set Q(t) with the preprocessed historical processing data set D(t) to form a complete input data set I(t): I(t) = {Q(t), D(t)}; The historical processing data set D(t) includes NC processing path data P(t), NC processing time data T(t), NC tool wear data W(t) and processed material property data M(t), specifically: D(t)={P i (t),T i (t),W i (t),M i (t)|i=1,2,...,N}; S43, input the input data set I(t) into the trained optimal deep learning model θ * In the example, the input layer’s input is represented as: X(t)={I i (t)|i=1,2,...,N}; Among them, the input data I i (t) includes all parameters corresponding to time t: I i (t)={M type,i (t),M hard,i (t),P acc,i (t),v i (t),P i (t),T i (t),W i (t),M i (t)); S44. In the optimal deep learning model θ * In , the input data set I(t) is processed in sequence by the adaptive convolution layer, the hybrid LSTM-GRU layer, and the multi-head attention mechanism layer to generate the intermediate feature representation F(t), which is expressed as: F(t)=A multi (t); Among them, the intermediate feature representation F(t) is generated by the following steps: Among them, the output C of the adaptive convolution layer adapt (t) represents the extraction of local features of data through adaptive convolution operation, σ is the activation function, and w k (t) is the adaptive convolution kernel weight, x(t) is the input data, K is the convolution kernel size, and b(t) is the time-related bias term; {h t ,c t }=HybridLSTM-GRU(C adapt (t)); The output h of the hybrid LSTM-GRU layer t and c t It represents capturing the long-term and short-term dependencies of time series; S45, inputting the intermediate feature representation F(t) into the output layer to generate the final optimal path mode prediction result; S46. Obtain the prediction result of the optimal processing path through steps S41-S45 as the path optimization solution for the actual processing task.
4. The method for optimizing a CNC machining path based on deep learning according to claim 3, characterized in that: The optimal processing path is generated according to the optimal path mode prediction result. opt (t) is expressed as:
5. The method for optimizing a CNC machining path based on deep learning according to claim 4, characterized in that: The S6 comprises the following steps: S61, the generated optimal processing path P opt (t) is input into the CNC machining simulation system. The input of the simulation system is expressed as: P input (t)=P opt (t); S62, in the simulation system, simulate the processing path P opt (t), and record the simulation result data R(t), which includes the path accuracy E path (t), processing time T sim (t) and tool wear W sim (t), where: Path Accuracy E path (t) is expressed as: Among them, P sim,i (t) is the actual execution trajectory of the ith path in the simulation system, L i is the length of the i-th path; Processing time T sim (t) is expressed as: Among them, V sim,i (t) is the feed rate of the i-th path in the simulation system; Tool wear condition W sim (t) is expressed as: Among them, λ i is the tool wear coefficient, f sim,i (t) is the cutting force; S63, calculating the deviation between the simulation result data R(t) and the actual processing requirements, the deviation is expressed as: The path accuracy deviation ΔE(t) is expressed as: ΔE(t)=E path (t)-E req (t); Among them, E req (t) is the path accuracy required for actual processing; The processing time deviation ΔT(t) is expressed as: ΔT(t)=T sim (t)-T req (t); Among them, T req (t) is the processing time required for actual processing; The tool wear deviation ΔW(t) is expressed as: ΔW(t)=W sim (t)-W req (t); Among them, W req (t) is the tool wear condition required by actual processing; S64, the optimal machining path P generated according to the path accuracy deviation ΔE(t), the machining time deviation ΔT(t) and the tool wear deviation ΔW(t) opt-new (t) Adjustment and optimization: Among them, η is the learning rate, α and β are weight factors; S65, through iterative simulation verification and optimization, finally determine the optimal processing path P that meets the processing requirements opt-final (t): in, represents the optimization result of the kth iteration; S66, ensure the final optimal processing path P opt-final (t) meets all machining requirements, including path accuracy, machining time and tool wear. The final optimization formula is expressed as: P opt-final (t)=argmin P (ΔE(t)+αΔT(t)+βΔW(t))。
Citation Information
Patent Citations
Multi-target cutting data generation algorithm and cutting parameter optimization method of numerical control machine tool
CN107976956A
Tool path generation and optimization method based on reinforcement learning
CN109491320A