Method for calculating five-axis finish machining tool path approximation error through multi-task neural network

By applying a multi-task neural network based on attention mechanism and cross-connection method in five-axis machining, the problem of low approximation error calculation efficiency in five-axis machining is solved, and more efficient and accurate calculations are achieved, improving the efficiency of tool track generation.

CN120143739APending Publication Date: 2025-06-13SUZHOU UNIV OF SCI & TECH

Patent Information

Application Number
CN202510291500.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In five-axis machining, it is difficult for the prior art to efficiently calculate the approximation error, especially when generating high-quality tool tracks, the calculation time is too long, limiting the efficiency of tool track application.

Method used

A multi-task neural network based on attention mechanism and cross-connection method is adopted to optimize the approximation error calculation model by dynamically allocating feature weights and sharing between tasks, and improving calculation efficiency and accuracy.

Benefits of technology

It significantly improves the efficiency and accuracy of the approximate error calculation of five-axis machining tool tracks, reduces calculation time, and improves the generalization ability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143739A_ABST
    Figure CN120143739A_ABST
Patent Text Reader

Abstract

The invention discloses a method for calculating a five-axis finish machining tool path approximation error through a multi-task neural network. The method comprises the following steps: firstly, acquiring core parameters required by calculation of a neural network model, and mapping the parameters to the same scale by applying mean variance normalization; then, according to PCA (Principal Component Analysis) dimension reduction, screening is carried out on the data characteristics; regularization processing is added to optimize a network structure, and a part of neurons are hidden in each iteration process, so that interference of non-core knife contacts on approximation error value calculation is reduced, and model overfitting is avoided; an attention mechanism is introduced, feature weights are dynamically distributed, key features are highlighted, a higher weight ratio is given, the learning ability of the model is enhanced, and the training precision is improved; and finally, dynamically adjusting the feature sharing proportion among the tasks by using a cross connection method, ensuring that the unique features of each task are reserved while sharing information, reducing interference among the tasks, refining feature sharing among the tasks and enhancing the generalization ability of the model, thereby improving the calculation precision of the approximation error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAM (Computer Aided Manufacturing), and particularly to a method for solving the approximation error in five-axis finish machining. Background Art

[0002] The approximation error in numerical control machining refers to the error between the tool envelope surface formed during the cutting process and the cutter contact point trajectory line. In three-axis machining, the approximation error appears as the chord length error (also known as the arc height error), which is a linear error. However, in five-axis machining, the approximation error includes not only linear errors but also non-linear errors. This non-linear error is caused by the coupling of the rotating axes, resulting in the spatial trajectory of the linear interpolation motion of each axis deviating from the original programmed trajectory.

[0003] Currently, the commonly used method for calculating the five-axis approximation error is to select discrete points on the cutter contact point trajectory and iteratively calculate the distance from these points to the line connecting the cutter contact points or cutter location points, with the maximum value taken as the approximation error. This iterative calculation method based on geometric data cannot reuse the previous data when calculating the approximation error each time, making it difficult to balance accuracy and efficiency. Especially when generating high-quality tool paths such as equal-error tool paths with maximized step sizes, a large amount of calculation is required, resulting in excessive time consumption, which becomes the key bottleneck restricting the application of high-quality tool paths. Therefore, it is of great significance to improve the calculation efficiency of the approximation error while ensuring the calculation accuracy.

[0004] The disclosed invention patent (Application No.: ZL202110004876.3) proposes an equal-error tool path generation method for five-axis machining with a flat-bottom cutter. This method first calculates the cutter location points and cutter axis vectors for five-axis machining with a flat-bottom cutter for the cutter contact points on the cutter contact point trajectory, and further calculates the approximation error. Then, the step size is adjusted to meet the equal-error requirement, and finally, the equal-error tool path for five-axis machining with a flat-bottom cutter is generated.

[0005] The paper "Tool Path Generation Method for Five-Axis Variable Step Numerical Control Machining of Free Surfaces" (published in the journal "Modern Manufacturing Engineering" in 2021, Issue 2, pp. 76-80) proposes a tool path generation method for five-axis variable step numerical control machining of free surfaces. The core of this method is to calculate the approximation error through the adaptive discretization method, and by iteratively increasing or decreasing the cutter contact point step size through parameters, the approximation error is distributed within an ideal numerical range, thereby achieving maximized step size and minimized number of redundant tool paths.

[0006] The paper "Method for Generating Tool Paths for Five-Axis NC Machining with Adaptive Row Spacing for Free-Form Surfaces" (published in the journal Modern Manufacturing Engineering in 2022, issue 5, pages 61 - 67) proposed a method for generating tool paths for five-axis NC machining of free-form surfaces. The core of this method lies in calculating the approximation error through the equal scallop height method. The row spacing is optimized by the equal scallop height method to reduce the number of tool path rows and the total length, and the cutting profile of the tool is simulated using an ellipse. By iteratively calculating the equal scallop height points and adjusting the position of the cutting profile, a tool path that meets the scallop height requirements is generated, and the row spacing is adaptively planned with the minimum parameter difference.

[0007] The algorithms proposed in the above-mentioned paper and patent are both based on the geometric method, and the approximation error value is obtained through iterative calculation. This type of method requires a clear mathematical expression, and the calculation time increases with the increase in precision and is related to the CPU performance. At the same time, the calculation process of each surface is independent and cannot learn from each other's "calculation experience". When generating high-quality tool paths that require a large number of approximation error calculations (such as equal-error tool paths with maximized step size), the time consumption remains high.

[0008] The essence of calculating the approximation error is a process of solving unknown data (approximation error) using known data (such as tool radius, tool contact point trajectory line, etc.), and there is a complex functional relationship between the two. If this functional relationship can be mined based on the "calculation experience" of the approximation error, it is expected to significantly improve the calculation efficiency of the approximation error. Using multi-task learning combined with the attention mechanism (Attention) to optimize feature extraction makes the model more accurately focus on the important parts of the data. Considering that there must be similar tool entry / exit contact point trajectories between different surfaces but there must also be differences, the cross-stitch learning method is incorporated. By learning the mixed weights of multiple task features, it ensures the mutual flow of information between tasks, effectively shares information between different tasks, and avoids overfitting or underfitting problems caused by each task learning independently, greatly improving the generalization ability and prediction accuracy of the model. Therefore, applying a multi-task neural network combined with the attention mechanism and cross-stitch learning method to the calculation of the approximation error has strong practical significance.

[0009] The disclosed background technology section is only used to increase the overall understanding of the present invention and should not be regarded as the prior art known to those skilled in the art. Summary of the Invention

[0010] The purpose of the present invention is to provide a method for calculating the approximation error of five-axis finish machining tool paths using a multi-task neural network, which can efficiently calculate the approximation error of five-axis NC machining tool paths.

[0011] To achieve the above object, an embodiment of the present invention provides a method for calculating the approximation error of a multi-task neural network based on an attention mechanism cross-connection method, which is characterized by including the following steps:

[0012] Step 1: Import the surface model and plan the isoparametric tool path, etc.;

[0013] Step 2: Divide the data set and perform data preprocessing;

[0014] Step 3: Establish a neural network model;

[0015] Step 4: Optimize the neural network framework;

[0016] Step 5: Calculate the approximation error value.

[0017] In one or more embodiments of the present invention, in the above-mentioned step 1, the surface model and the isoparametric tool path planning include: using the isoparametric method to plan the row spacing and step length to generate the tool path.

[0018] In one or more embodiments of the present invention, in the above-mentioned step 2, the data preparation and preprocessing process includes:

[0019] Step 2.1: Select the core parameters for calculating the approximation error from step 1. Each sample includes the following parameters: the point set coordinates {p j} of the cutter contact points on the tool path line, the tool position points P i CL of two adjacent circle centers, the tool position points P i ' CL of two adjacent tool axes, the tool radius R, the tool length L, the tool tip ring radius r, the tool rake angle α, the theoretical value e i of the approximation error;

[0020] Step 2.2: Use mean-variance normalization to map the data to the same scale;

[0021] Step 2.3: Use PCA dimensionality reduction processing to reduce the dimensionality of the dataset features;

[0022] Step 2.4: In order to verify the fitting accuracy of the model, the dataset needs to be divided into a training set and a test set. The training set is responsible for training samples, and the test set is used to verify the accuracy and generalization ability of the model.

[0023] In one or more embodiments of the present invention, in the above-mentioned step 3, the process of establishing a neural network includes:

[0024] Step 3.1: Set the parameters required for the neural network, including the feature dimension of the hard-sharing layer, the number of hidden units in the task-specific layer, the model learning rate η, the number of training iterator times n, and the initial weight w of the neuronshj , the initial bias b of the neuron ij , activation function (ReLU function), regularization, and Adam optimizer.

[0025] Step 3.2 Establish a multi-task neural network model with the above parameters.

[0026] In one or more embodiments of the present invention, in step 4, optimizing the neural network framework includes:

[0027] Step 4.1 Set the optimization framework of the multi-task neural network, including an attention mechanism layer, the influence coefficient matrix p of the cross-connection layer, adding regularization between the hard-sharing layer and the task-specific layer, and the BN layer. In the hard-sharing layer and the specific layer of each task separately, set the corresponding Dropout probability according to the model fitting degree.

[0028] Step 4.2 Through the above optimization layer settings, establish a multi-task neural network optimization framework based on the attention mechanism cross-connection method.

[0029] In one or more embodiments of the present invention, in step 5, the process of calculating the approximation error value includes:

[0030] Step 5.1 Import the parameters after normalization and PCA dimensionality reduction into the input layer of the network, and save the theoretical value in the output layer to start the forward propagation of the model;

[0031] Step 5.2 During the forward propagation process, after the input features are extracted by the shared layer, generate task-specific features through attention mechanism weighting, and achieve feature sharing between tasks in the cross-connection layer, and finally transmit to the output layer to complete the prediction, taking into account both shared and specific feature expressions;

[0032] Step 5.3 Use the MSE loss function to judge the error between the theoretical value e i and the calculated value y j ;

[0033] Step 5.4 If the error is large, it is necessary to perform backpropagation on the error, assign weights and biases to the key features using the attention mechanism, adjust the weights and bias values of the neurons using the gradient descent algorithm, and adjust the influence coefficient matrix using the cross-connection method;

[0034] Step 5.5 If the accuracy still cannot meet the requirements after backpropagation, repeatedly adjust the model hyperparameters such as the learning rate η and the influence coefficient matrix p of the cross-connection layer until the error between the calculated value and the theoretical value is minimized.

[0035] Compared with the prior art, according to the present invention, in step 2, the feature weights are dynamically allocated through the Attention mechanism to highlight the key task features, thereby reducing the interference of secondary features on multi-task learning; in step 3, a cross-connection layer is adopted to achieve feature sharing and adjustment between tasks, and the multi-task model structure is optimized by combining task-specific features to enhance the collaborative learning ability between tasks; regularization processing is introduced into the model to sparsify the feature network, effectively suppressing the overfitting phenomenon and improving the generalization ability of the model; at the same time, the Adam optimizer is used to accelerate and optimize the training process, helping the model to converge faster and enhancing the global search ability, thereby significantly improving the accuracy and robustness of task prediction.

[0036] In step 4, according to R 2 The numerical value judges the fitting degree between the theoretical value and the actual value, and the MSE loss function value judges the error size between the theoretical value and the calculated value. The weights and bias values are adjusted through backpropagation, and the hyperparameters of the neural network model are adjusted to make the calculation result reach the optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 are four free-form surface schematic diagrams according to an embodiment of the present invention;

[0038] Figure 2 is a schematic diagram of a multi-task neural network according to an embodiment of the present invention;

[0039] Figure 3 is a schematic diagram of an optimized network structure of the Attention mechanism according to an embodiment of the present invention;

[0040] Figure 4 is a schematic diagram of an optimized network structure of the cross-linking method according to an embodiment of the present invention;

[0041] Figure 5 is a comparison diagram of the expected value and the model calculated value of surface 1 according to an embodiment of the present invention;

[0042] Figure 6 is a comparison diagram of the expected value and the model calculated value of surface 2 according to an embodiment of the present invention;

[0043] Figure 7 is a comparison diagram of the expected value and the model calculated value of surface 3 according to an embodiment of the present invention;

[0044] Figure 8 is a comparison diagram of the expected value and the model calculated value of surface 4 according to an embodiment of the present invention.

[0045] Figure 9 is a flowchart of a method for calculating the approximation error of the five-axis finish machining tool path by a multi-task neural network according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] The following will describe in detail the specific embodiments of the present invention in conjunction with the accompanying drawings. It should be understood that the protection scope of the present invention is not limited by the specific embodiments.

[0047] Unless otherwise clearly stated, in the whole specification and claims, the term "comprising" or its variations such as "including" or "having" etc. will be understood to include the stated elements or components, without excluding other elements or other components.

[0048] As Figures 1 to 9 shown, a method for calculating the approximation error of the five-axis finish machining tool path by a multi-task neural network according to a preferred embodiment of the present invention. The specific embodiments are as follows:

[0049] Step 1: Import the surface model and plan the isoparametric tool path

[0050] Import the surface model and obtain the data of 4 free-form surface models. Use the isoparametric method to calculate the tool path for surfaces 1, 2, 3, and 4 and obtain the sample data, where the tool radius is 5 mm. The schematic diagrams of the 4 free-form surfaces are as Figure 1 shown.

[0051] (1) For surface model 1 (the bounding box size is 120 mm × 140 mm × 38 mm), plan the sample surface into one copy of 199 and 100 rows of tool paths respectively. Each row of the tool path has a sample data set of 150 tool points. Among them, T199×150 (the number of tool path rows × the number of tool points) is used as the training sample, with a total of 29,561, and T100×150 is used as the test set sample, with a total of 14,900. The approximation error distribution range is [-6.5 μm, 0.5 μm].

[0052] (2) For surface model 2 (the bounding box size is 135 mm × 175 mm × 68.28 mm), plan the sample surface into one copy of 199 and 100 rows of tool paths respectively. Each row of the tool path has a sample data set of 150 tool points. Among them, T199×150 is used as the training sample, with a total of 29,561, and T100×150 is used as the test set sample, with a total of 14,900. The approximation error distribution range is [-6.5 μm, 1 μm].

[0053] (3) For surface model 3 (the bounding box size is 120 mm × 120 mm × 44.67 mm), plan the sample surface into one copy of 199 and 100 rows of tool paths respectively. Each row of the tool path has a sample data set of 150 tool points. Among them, T199×150 is used as the training sample, with a total of 29,561, and T100×150 is used as the test set sample, with a total of 14,900. The approximation error distribution range is, the approximation error distribution range is [-21.8 μm, 2 μm].

[0054] (4) For the surface model 4 (with a bounding box size of 150 mm × 150 mm × 54.02 mm), the sample surface is planned into a sample data set with 199 and 100 tool paths, each with 150 tool contact points on each tool path. Among them, T199×150 is used as the training sample, with a total of 29,561, and T100×150 is used as the test set sample, with a total of 14,900. The approximation error distribution range is [0.26 μm, 0.5 μm].

[0055] Step 2 Data Preparation and Preprocessing

[0056] The approximation error is the maximum distance between the tool contact point trajectory line and the tool envelope surface between two adjacent tool contact points. The tool contact point trajectory line is usually replaced by discrete points on it, which is more convenient in practical applications. The approximation error value is calculated from the discrete tool contact points, two adjacent tool location points, and tool information.

[0057] The input data includes: tool radius R, tool rake angle α, tool length L, and 10 discrete points on the tool contact point trajectory line Three coordinates {(x i , y i , z i ), (x i+1 , y i+1 , z i+1 )…(x i+9 , y i+9 , z i+9 )}, tool location point P i CL 、 Three coordinates Tool axis point P i ' CL 、 Three coordinates

[0058] Table 1 Approximation Error Calculation Data Set

[0059]

[0060] To eliminate the influence of the dimension between samples, normalization processing is used to map the data to the same scale. Assume that the data set contains n samples and m parameters, that is, D = {(x i , y i )}(|D| = n, x i ∈R m , y i ∈R). The normalized data is shown in Equation (1):

[0061]

[0062] where x i,scale is the normalized value, and x i is the parameter to be normalized, and μ and Std represent the average error and standard deviation of the parameter.

[0063] Step 3: Establish a neural network model

[0064] Step 3.1: Create a multi-task neural network model

[0065] There are two mechanisms of hard sharing and soft sharing of parameters in the multi-task learning structure. The neurons in the hard and soft sharing layers are used to learn the common features of different tasks and improve the robustness of the model through regularization. As Figure 2 shown, establish a multi-task learning model that includes hard and soft constraint mechanisms. When there are g tasks, each task has n samples and m parameters, the size of the neuron matrix in the input layer is [b i n×gm where b i is the bias of each neuron. t 1 , t 2 is the dimension of the neuron to be set, which is used to control the number of neurons in the hidden layer.

[0066] Step 4: Optimize the neural network framework

[0067] Step 4.1: Set the attention mechanism optimization layer

[0068] The input layer stacks the feature data related to each task horizontally as the input of the model and passes it to the hard-shared feature learning network; the hard-shared layer is responsible for learning and extracting the features t with high correlation among tasks i , and after dimensionality reduction processing by PCA, weights W i are assigned to the characteristics of each task, and the features with higher correlation with the current task are evaluated. The feature is represented as β i . Suppose there are i tasks. Suppose there are T tasks. The attention weight W i of Attention for task i can be calculated by Equation (2), where e i is the scoring function of task i, which can be calculated by Equation (3), where α i is the learnable weight matrix of task i, which determines the importance of features in a specific task, and β i is the relevant input feature of task i, and b i is the feature-related bias term of task i.

[0069]

[0070] e i = tanh(α i ·β​i +b i ) (3)

[0071] Subsequently, the features within each task are weighted again with w i,j , w i,j represents the weight of feature j that affects the prediction accuracy of the i-th task. The feature after being reassigned the weight is denoted as η i , assuming there are T tasks, Attention weights the features within each task w i,j can be calculated by Equation (4), and f i,j is the function score of feature j within task i, which can be calculated by Equation (5). Among them, v i is the learnable weight of the feature for task i, representing the importance of the feature, x g,j represents the j-th feature of task i, and d i is the bias term of the features within task i.

[0072]

[0073] f i,j =tanh(v i ·x i,j +d i ) (5)

[0074] Finally, the feature η i with the weight assignment completed is output to the task-specific layer for the next step of training. During the training process, the model will continuously adjust and adapt to the feature weights between tasks through iteration until the set number of iterations is completed or the loss (error value) of the model itself no longer decreases, and then the weight assignment ends. Its detailed process is as Figure 3 shown.

[0075] Step 4.2 Set the cross-connection method to optimize the layer

[0076] Set different weights in matrix α. Each task can share the features of other tasks and adjust the feature contributions as needed, as Figure 4 shown. This linear combination enables each task to not only rely on its own features but also learn with the help of the information of other tasks, thereby enhancing the generalization ability of the model and the cooperation between tasks. Assume that T tasks are trained, and the input feature of each task is h n (where n ranges from 1 to T). The cross-connection matrix α[i,j] can be calculated by Equation (6), where α[n,j] is the contribution ratio of task j to the features of task n. Each element in it determines the degree of feature fusion between tasks.

[0077]

[0078] The output features of each task after classification by the Attention layer are h n , which can be calculated by Equation (7) and used as the cross-connection layer to output the feature h' n can be calculated by Equation (8), where h n is the input feature of task n, h' n is the output feature of task n, n - 1 is the current task proportion, and j - 1 is the last task proportion.

[0079]

[0080] The features of each task not only come from its own features but also obtain a part of the information from the features of other tasks. The features of multiple tasks are fused with each other to better realize information sharing between tasks.

[0081] Step 5 Calculate the approximation error value

[0082] After obtaining the approximation error value from the output layer in Step 5.1, use Equation (9) to calculate the theoretical value e i and the error size MSE between the calculated value y j . The smaller the MSE, the higher the calculation accuracy of the model.

[0083]

[0084] If the error of the result predicted by the model is difficult to meet the requirements in Step 5.2, then perform backpropagation. Through the optimization of the Attention weight and bias, the Attention weight matrix w ij is adjusted according to the gradient using Equation (10) after backpropagation to reallocate the task-specific attention points and obtain a new weight matrix

[0085]

[0086] Since the MTL (Multi-Task Learning) neural network has the defects of overfitting and being easily trapped in local optimal solutions when using the SGDM (Stochastic Gradient Descent with Momentum) optimizer, it is necessary to change it to the Adam optimizer to adjust the weights and biases, as shown in Equation (11). Among them, β 1 , β 2 are the first-order and second-order momentum decay coefficients respectively, used to control the weights of historical information, v t and m t are momentum terms, used to control the learning step size, and represents the corrected momentum term, η is the learning rate of the network, t - 1 is the number of the current iteration, and it is the first iteration when t = 1.

[0087]

[0088] Step 5.3 Each round of iteration includes a forward propagation and a backward propagation process. In each iteration t, the Attention bias vector b ij is adjusted according to the feedback error in Equation (12). After multiple iterations, if the calculation accuracy of the model reaches the expectation, the training is stopped and the calculated values, weights, and bias values of the model are saved. If it still does not reach the expectation, the model is adjusted by adjusting hyperparameters such as the learning rate η and the momentum hyperparameter β, and then retrained until the calculation accuracy reaches the highest. Then the weights, biases, and calculated values when the loss function is minimized are saved.

[0089]

[0090] Step 5.4 To further verify the test accuracy and speed of the model, the test sample sets of Surfaces 1, 2, 3, and 4 are put into the test set for accuracy testing and compared with other neural networks. Among them, CAMTL (Cross - Stitch Learning Attention Multi - Task Learning) is the model used in the present invention. The verification and comparison results of Surface 1 are as Figure 5 shown in Table 2; the verification and comparison results of Surface 2 are shown in Table 3; the verification and comparison results of Surface 3 are shown in Table 4; the verification and comparison results of Surface 4 are shown in Table 5.

[0091] Table 2 Error Comparison Table of Surface N1

[0092]

[0093] Table 3 Error Comparison Table of Surface N2

[0094]

[0095] Table 4 Error Comparison Table of Surface N3

[0096]

[0097] Table 5 Error Comparison Table of Surface N4

[0098]

[0099] A typical implementation example of the present invention is as follows:

[0100] The isoparametric method is used to generate tool paths for Surface Models 1, 2, 3, and 4, and the tool radius is 5 mm. The specific information is as follows:

[0101] (1) For the surface model 1 (with a bounding box size of 120 mm × 140 mm × 38 mm), the sample surface is planned into one set of 199 tool paths and one set of 100 tool paths, each with 150 tool positions on each tool path. Among them, T199×150 (number of tool path rows × number of tool positions) is used as the training sample, a total of 29,561, and T100×150 is used as the test set sample, a total of 14,900. The approximation error distribution range is [-6.5 μm, 0.5 μm]. As Figure 5 shown, the error between the predicted result and the average value of the actual approximation error is only 0.326 μm.

[0102] (2) For the surface model 2 (with a bounding box size of 135 mm × 175 mm × 68.28 mm), the sample surface is planned into one set of 199 tool paths and one set of 100 tool paths, each with 150 tool positions on each tool path. Among them, T199×150 is used as the training sample, a total of 29,561, and T100×150 is used as the test set sample, a total of 14,900. The approximation error distribution range is [-6.5 μm, 1 μm]. As Figure 6 shown, the error between the predicted result and the average value of the actual approximation error is only 0.284 μm.

[0103] (3) For the surface model 3 (with a bounding box size of 120 mm × 120 mm × 44.67 mm), the sample surface is planned into one set of 199 tool paths and one set of 100 tool paths, each with 150 tool positions on each tool path. Among them, T199×150 is used as the training sample, a total of 29,561, and T100×150 is used as the test set sample, a total of 14,900. The approximation error distribution range is [-21.8 μm, 2 μm]. As Figure 7 shown, the error between the predicted result and the average value of the actual approximation error is only 0.73 μm.

[0104] (4) For the surface model 4 (with a bounding box size of 150 mm × 150 mm × 54.02 mm), the sample surface is planned into one set of 199 tool paths and one set of 100 tool paths, each with 150 tool positions on each tool path. Among them, T199×150 is used as the training sample, a total of 29,561, and T100×150 is used as the test set sample, a total of 14,900. The approximation error distribution range is [0.26 μm, 0.5 μm]. As Figure 8 shown, the error between the predicted result and the average value of the actual approximation error is only 0.000048 μm.

[0105] The multi-task neural network used in this patent, after combining the attention mechanism and the cross-connection method, while retaining the efficient training of the original multi-task neural network, improves the prediction accuracy. The hardware environment for running the algorithm in this example is a PC with an Intel i7-12700K, an NVIDIA RTX4060, and 32G of RAM. The CAMTL used in this invention enables information sharing between tasks by introducing a cross-connection layer, and at the same time combines the attention mechanism to effectively distinguish the specific features of each task, thereby optimizing the multi-task learning ability, reducing information redundancy, and improving the collaborative effect between tasks. This model also performs excellently in terms of generalization. By means of the cross-connection layer and the attention mechanism, overfitting is avoided, and the performance on new data is improved, showing stronger adaptability. In addition, the CAMTL model enhances the robustness in dealing with different tasks by balancing the learning of shared and task-specific features, can more robustly handle noisy or abnormal data, reduce the fluctuation of prediction errors, and demonstrates better anti-interference ability and generalization performance.

[0106] The foregoing description of specific exemplary embodiments of the invention has been presented for purposes of illustration and example. These descriptions are not intended to limit the invention to the precise forms disclosed, and obviously, many modifications and variations are possible in light of the above teaching. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the invention and its practical applications, so that those skilled in the art can implement and utilize various different exemplary embodiments of the invention, as well as various different selections and modifications. The scope of the invention is intended to be defined by the claims and their equivalents.

Claims

1. A method for calculating the tool path approximation error of five-axis finishing machining using a multi-task neural network, characterized in that: The following steps are involved: Step 1: Import the surface model and plan the tool path with equal parameters; Step 2: divide the data set and preprocess the data; Step 3: Establish a neural network model; Step 4: Optimize the neural network framework; Step 5 calculates the approximation error value.

2. The method for calculating the five-axis finishing tool path approximation error using a multi-task neural network as claimed in claim 1, characterized in that: Import the surface model, plan the isoparametric tool path, use the isoparametric method to plan the line spacing and step length for the surface model, generate the tool path, and obtain each tool contact point, tool position point and its local tool contact point curve and approximation error information.

3. The method for calculating the five-axis finishing tool path approximation error using a multi-task neural network as claimed in claim 1, characterized in that: Step 2: Dataset division and preprocessing include: A sample is constructed for each tool position point, and the parameters included are: tool radius R, tool length L, tool head ring radius r, tool front inclination angle α, three coordinates of the tool head circle center of two adjacent tool position points, three coordinates of the tool axis circle center of two adjacent tool position points, three coordinates of the discrete point set on the local tool contact curve between two adjacent tool contact points, and the theoretical value of the approximation error e i ; Use mean-variance normalization (Z-score Normalization) to map the parameters in the sample to the same scale; Use PCA dimensionality reduction to reduce the dimension of the feature parameters in the sample; All samples constitute the sample data set.

4. The method for calculating the five-axis finishing tool path approximation error using a multi-task neural network as claimed in claim 1, characterized in that: The step 3 of establishing a neural network model includes: Set the parameters required to create a neural network: hard shared layer feature dimension, number of hidden units in the task-specific layer, model learning rate η, number of training iterators n, initial neuron weight w hj , neuron initial bias b ij , activation function (ReLU function), regularization processing, Adam (Adaptive moment estimation) optimizer, to complete the creation of the multi-task neural network model.

5. The method for calculating the five-axis finishing tool path approximation error using a multi-task neural network as claimed in claim 1, characterized in that: The step 4 of optimizing the neural network framework includes: Set the attention mechanism layer, the cross-connection layer influence coefficient matrix p, add regularization processing and BN layer between the hard shared layer and the task-specific layer, and set the corresponding Dropout (random inactivation) probability in the hard shared layer and the specific layer of each task according to the degree of model fitting to complete the multi-task neural network optimization framework based on the attention mechanism cross-connection method.

6. The method for calculating the five-axis finishing tool path approximation error using a multi-task neural network as claimed in claim 1, characterized in that: The step 5 of calculating the approximation error value comprises: The samples in multiple sample data sets are stacked horizontally and imported into the neural network. The sample data is forward propagated in the network. When it propagates to the output layer, the output data is the approximation error calculation value y of the network model. j ; Using R 2 Indicates the theoretical value d j and the calculated value y j The degree of fit between them is calculated using the MSE (Mean Squared Error) loss function to calculate the theoretical value e i and the calculated value y j The error between them is used to measure the calculation accuracy of the model’s approximation error value; If the accuracy does not meet expectations, back propagation will begin, using the attention mechanism to assign key feature weights and biases, using the gradient descent algorithm to adjust the weights and bias values ​​of neurons, and using the cross-connection method to adjust the influence coefficient matrix to minimize the MSE loss function value; If the accuracy still does not meet expectations, adjust the hyperparameters of the network model and restart the calculation until the calculation accuracy of the model reaches the highest level; Save the model's approximation error calculation value and the weights and bias values ​​of the neural network model.

Citation Information

Patent Citations

  • Method for Generating Equal Error Toolpaths in Parametric Surface Flat End Machining (5-Axis)

    CN112987647B

Cited By

  • Intelligent decision-making system for small tool polishing processing technology applied to CAM (computer-aided manufacturing) industrial software

    CN121328298A