A texture classification and pose range determination method for geometric error compensation
Patent Information
- Application Number
- CN202611138210.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]针对现有技术中的上述不足,本发明提供了一种面向几何误差补偿的纹理分类及姿态范围确定方法,用于解决现有五轴铣削加工中几何误差补偿过程刀具姿态的调整缺乏合理约束,易导致姿态调整过程加工表面微观纹理形貌发生突变的问题,以及现有纹理形貌分类及姿态范围确定方法依赖大量不同姿态角下的纹理形貌建模、效率较低的问题
本发明所提出的一种面向几何误差补偿的纹理分类及姿态范围确定方法,通过构建小样本的不同组刀具姿态角作为训练集,并将各组刀具姿态角对应的曲面纹理形貌数字化模型作为标签,结合构建的曲面纹理形貌预测模型,实现了任意组刀具姿态角下曲面纹理形貌的预测;同时,还实现了曲面纹理形貌的分类及每类曲面纹理形貌对应的刀具姿态角范围的快速确定;最终以每类曲面纹理形貌对应的刀具姿态角范围为约束,实现了五轴铣削自由曲面的几何误差补偿,生成补偿后的加工路径,能够在提高加工精度的同时,保证刀具姿态调整下的加工曲面纹理形貌的完整性与均匀性。
Smart Images

Figure CN122820786A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of five-axis milling surface morphology technology, specifically to a method for texture classification and attitude range determination oriented towards geometric error compensation. Background Technology
[0002] Complex curved surface parts are widely used in aerospace, precision mold making, and high-end equipment manufacturing. The surface texture directly affects the part's fit, friction characteristics, and service reliability. Five-axis milling, with its high degree of spatial freedom, is widely used for machining complex free-form surfaces due to its high machining quality and efficiency. In actual machining, geometric error compensation is often performed to improve machining accuracy, a strategy that typically requires optimizing the tool orientation. Changes in tool orientation alter the contact relationship between the tool and the workpiece surface, thus affecting the geometric characteristics and distribution of the machined surface texture.
[0003] However, most existing geometric error compensation methods focus on optimizing geometric accuracy or machine tool motion performance, neglecting the impact of tool posture adjustment on surface texture morphology. During compensation, improper tool posture adjustment can easily lead to abrupt changes in the geometric features of the machined surface texture, reducing the quality of the machined surface morphology and the overall consistency of the texture morphology. On the other hand, existing texture morphology classification methods and their corresponding tool posture angle ranges can provide a basis for posture constraints, but they typically require establishing a large number of digital texture morphology models under different tool posture conditions, resulting in high computational costs and low efficiency, making it difficult to meet practical application needs. Summary of the Invention
[0004] To address the aforementioned shortcomings in existing technologies, this invention provides a texture classification and attitude range determination method for geometric error compensation. This method solves the problem that the adjustment of tool attitude during the geometric error compensation process in existing five-axis milling machining lacks reasonable constraints, which can easily lead to abrupt changes in the micro-texture morphology of the machined surface during the attitude adjustment process. It also addresses the problem that existing texture morphology classification and attitude range determination methods rely on a large number of texture morphology models under different attitude angles, resulting in low efficiency.
[0005] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A texture classification and pose range determination method for geometric error compensation includes the following steps: The range of tool attitude angle variation was determined. By dividing multiple tilt angle and rotation angle intervals, orthogonal experiments with stratified sampling were conducted to construct several sets of digital models of tool attitude angles and corresponding surface texture morphology. Construct the attitude input features for each set of tool attitude angles; Construct a surface texture topography prediction model to enhance texture details; Using pose input features as input and a digital model of surface texture as label, a surface texture prediction model is trained, and a numerical-structural composite loss function is constructed to adjust the model parameters to generate a trained surface texture prediction model. Construct a sample set of multiple tool attitude angles to be tested, and input it into a trained surface texture topography prediction model to predict the surface texture topography of each tool attitude angle, and use it as a sample to construct a surface texture topography dataset. Clustering methods are used to cluster the surface texture topography dataset to obtain surface texture topography classification results. The tool attitude angles corresponding to all surface texture topographys in each class are integrated to generate a continuous tool attitude angle range corresponding to each class of surface texture topography. By using the range of continuous tool attitude angles corresponding to each type of surface texture as a constraint, five-axis milling geometric error compensation based on texture constraints is achieved, and a compensated machining path is generated.
[0006] The present invention has the following beneficial effects: This invention proposes a texture classification and attitude range determination method for geometric error compensation. It constructs a small set of different tool attitude angles as a training set and uses the digital model of the surface texture corresponding to each set of tool attitude angles as a label. Combined with the constructed surface texture prediction model, it achieves the prediction of surface texture morphology under any set of tool attitude angles. Simultaneously, it also achieves the classification of surface texture morphology and the rapid determination of the tool attitude angle range corresponding to each type of surface texture morphology. Finally, using the tool attitude angle range corresponding to each type of surface texture morphology as a constraint, it realizes geometric error compensation for five-axis milling of free-form surfaces, generating a compensated machining path. This method can improve machining accuracy while ensuring the integrity and uniformity of the machined surface texture morphology under tool attitude adjustment. Attached Figure Description
[0007] Figure 1 This is a flowchart illustrating a texture classification and pose range determination method for geometric error compensation proposed in this invention. Figure 2 This is a schematic diagram of the bowl-shaped freeform surface in the embodiment; Figure 3 This is a schematic diagram of the structure of the digital model of the curved surface texture in the embodiment; Figure 4 This is a schematic diagram of the tool axis vector in the local tool contact point coordinate system of the embodiment; Figure 5 This is a schematic diagram of the surface texture prediction model in the embodiment; Figure 6 In the embodiment, the rotation angle is... Inclination angle is A schematic diagram comparing the surface texture shape predicted by the surface texture shape prediction model during training with the digital model of surface texture shape; Figure 7 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 1 in the embodiment; Figure 8 This is a schematic diagram of the overall surface texture and local texture in category 2 of the embodiment; Figure 9 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 3 in the embodiment; Figure 10 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 4 in the embodiment; Figure 11 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 5 in the embodiment; Figure 12 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 6 in the embodiment; Figure 13 This is a schematic diagram of the overall surface texture morphology and local texture morphology of category 7 in the embodiment; Figure 14 This is a schematic diagram of the overall surface texture and local texture of category 8 in the embodiment. Detailed Implementation
[0008] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0009] The specific embodiments of this invention are as follows: like Figure 1 As shown, a texture classification and pose range determination method for geometric error compensation includes the following steps: Step 1: Determine the range of tool attitude angle variation. By dividing multiple tilt angle and rotation angle intervals, conduct orthogonal experiments with stratified sampling to construct several sets of digital models of tool attitude angles and corresponding surface texture morphology.
[0010] The steps are as follows: Set cutting parameters to determine the range of tool attitude angles (tilt angle and rotation angle) in five-axis milling; and design stratified sampling orthogonal experiments using tilt angle and rotation angle as factors to construct a small-sample training dataset (each group of tool attitude angles is one sample) and labels (the label data for each sample is the digital model of the surface texture corresponding to each group of tool attitude angles). The specific implementation process is as follows: First, set the cutting parameters to determine the range of tool attitude angle variation in five-axis milling; the attitude angle includes rotation angle and tilt angle; the range of tilt angle variation is: , The angle of inclination. 、 These are the tool tilt angles. The maximum and minimum values; the range of the rotation angle is: , The rotation angle is... , These are the tool rotation angles. The maximum and minimum values.
[0011] In an optional embodiment of the invention, as follows Figure 2 Taking the bowl-shaped freeform surface shown as an example, the range of tool attitude angle variation is set according to the surface geometry: , ; , .
[0012] Secondly, the range of variation of the tool tilt angle is divided into: The range of tilt angles is divided into several intervals, and the range of tool rotation angle variation is further divided into... A rotation angle interval.
[0013] In one optional embodiment of the present invention The value is 6. The value is 5 Subsequently, using the tilt angle interval and rotation angle interval as the factor levels of the orthogonal experiment, each tilt angle interval and each rotation angle interval are matched to construct a stratified sampling orthogonal experimental table. For each experimental combination, angle values are randomly sampled from the corresponding tilt angle interval and rotation angle interval to generate a single set of tool attitude angles. Finally, all sets of tool attitude angles are summarized as the training dataset.
[0014] In this step, the orthogonal experimental setup for stratified sampling is shown in Table 1: Table 1. Orthogonal Experiment Table for Stratified Sampling
[0015] As shown in Table 1, there are 6 sets of tilt angle intervals and 5 sets of rotation angle intervals. Each tilt angle interval corresponds to each rotation angle interval, forming a test combination. Therefore, there are a total of 30 test combinations for stratified sampling. For each test combination, angle values are randomly selected from the corresponding tilt angle interval and rotation angle interval each time to obtain a single set of tool posture angles. Finally, 30 sets of tool posture angles are obtained, thus forming a small sample training dataset. Therefore, based on the orthogonal experimental table of stratified sampling in Table 1, the specific implementation process of stratified sampling is as follows: Step 1: Based on the orthogonal experimental table, determine the interval of the tool attitude angle for each group, expressed as:
[0016] In the formula, For the first The range of tool attitude angles; For the first The rotation angle range of the tool attitude angle; For the first The tilt angle range of the tool attitude angle; For the first The rotation angle interval number corresponding to the tool attitude angle; For the first The tilt angle interval number corresponding to the tool attitude angle of the group.
[0017] Step 2: Within the range of each set of tool attitude angles, randomly select the rotation angle and tilt angle to obtain the tool attitude angles for each set, represented as follows:
[0018] In the formula, For the first Tool attitude angle; For the first The rotation angle corresponding to the tool attitude angle; For the first The tilt angle corresponding to the tool attitude angle.
[0019] Repeat Step 1-Step 2 to obtain the tool attitude angles for all groups in the orthogonal experiment.
[0020] Then, a digital model of the surface texture morphology for each set of tool attitude angles is constructed, and this digital model of the surface texture morphology is used as the label for that set of tool attitude angles.
[0021] In this step, the process of constructing a digital model of the surface texture is as follows: Based on cutting parameters and tool attitude angles for each group, a digital model of surface texture morphology for five-axis milling can be directly established. That is, under the same cutting parameter settings, the tool attitude angles are set according to each group of tool attitude angles in the orthogonal experiment, and a digital model of surface texture morphology for five-axis milling of the tool attitude angles for that group is constructed as a label for the tool attitude angle samples of that group.
[0022] The construction process of the digital model of the curved surface texture is as follows: The workpiece surface is discretized, and a workpiece surface height value matrix is established based on the workpiece surface height values at each discrete point. The cutting edge trajectory during the machining process is obtained according to the set cutting parameters and tool attitude angle. A digital model of the surface texture is established through the interaction between the cutting edge trajectory and each discrete point of the workpiece surface.
[0023] In one optional embodiment of the present invention Figure 3 This paper presents a digital model of the surface texture morphology constructed from a set of tool attitude angles. Figure 3 In the diagram, X represents the horizontal position coordinate of the surface, Y represents the vertical position coordinate of the surface, and Z represents the height value coordinate of the surface.
[0024] Step 2: Construct the attitude input features for each set of tool attitude angles.
[0025] First, construct the local tool contact point coordinate system and tool axis vector for each set of tool attitude angles, expressed as:
[0026] In the formula, The tool axis vector; , , These are the coordinates of the tool axis vector in the local tool contact point coordinate system. , , Components in direction; , These are the cosine function and the sine function, respectively; among them, the tool axis vector is used to characterize the spatial orientation information of the tool.
[0027] In this step, Figure 4 This demonstrates the structure of the tool axis vector in the local tool contact point coordinate system. Figure 4 middle For the local tool contact point coordinate system, This refers to the tool feed direction at the tool contact point. The point of contact between the cutting tool and the workpiece surface. The direction of the surface normal vector at the point of contact with the blade is [missing information]. To align with the tool feed direction and surface normal direction Orthogonal directions.
[0028] Secondly, based on the variation range of the tool tilt angle and rotation angle, the tilt angle and rotation angle within each group of tool attitude angles are normalized using the minimum-maximum normalization method to generate the normalized tool tilt angle and rotation angle, expressed as:
[0029]
[0030] In the formula, This is the normalized tool rotation angle; This is the normalized tool tilt angle.
[0031] Based on the normalized tool rotation angle, tilt angle, and tool axis vector in the local tool contact point coordinate system, the attitude input features of each set of tool attitude angles are obtained, expressed as:
[0032] In the formula, The attitude input features are used for each set of tool attitude angles.
[0033] Step 3: Construct a surface texture shape prediction model with enhanced texture details.
[0034] In this step, the structure and connectivity of the surface texture prediction model are as follows: Figure 5 As shown, it includes a one-dimensional convolutional pose feature encoding module, a fully connected latent feature mapping module, a modulation parameter generation module, a FiLM pose conditional modulation module, a fully connected mapping and reshaping module, a local texture detail enhancement module, a local texture detail compensation generation module, and a residual overlay module.
[0035] The one-dimensional convolutional pose feature encoding module includes a first one-dimensional convolutional layer, a second one-dimensional convolutional layer, and a first fusion module.
[0036] The fully connected latent feature mapping module includes a flattening layer and a first fully connected layer.
[0037] The modulation parameter generation module is a multilayer perceptron, which includes a hidden mapping layer, a feature scaling parameter output layer, and a feature offset parameter output layer.
[0038] The fully connected mapping and reshaping module includes a second fully connected layer, a dimension expansion layer, and a matrix reshaping layer.
[0039] The local texture detail enhancement module includes a first two-dimensional convolutional layer, a non-linear activation layer, and several cascaded residual feature extraction units.
[0040] The local texture detail compensation generation module includes a feature compression layer, a second two-dimensional convolutional layer, and an output convolutional layer.
[0041] Step 4: Using pose input features as input and the surface texture morphology digitization model as output, train the surface texture morphology prediction model, and construct a numerical-structural composite loss function to adjust the model parameters to generate a trained surface texture morphology prediction model.
[0042] This step involves training a surface texture prediction model. The digital model of the surface texture is labeled data; once trained, the model can predict the surface texture of the target data. The specific implementation process is as follows: Input pose features The first one-dimensional convolutional layer of the one-dimensional convolutional pose feature encoding module is input to perform a convolution operation to extract shallow pose features. Then, the input is input to the second one-dimensional convolutional layer to perform a convolution operation to extract deep pose features. Finally, the deep pose features are input together with the shallow pose features into the first fusion module to generate pose fusion features.
[0043] In this step, the working principle of the one-dimensional convolutional pose feature encoding module is as follows: the pose input feature is... The first one-dimensional convolutional layer is input to perform convolution operations to generate shallow pose features. The shallow pose features are then input to the second one-dimensional convolutional layer for further convolution operations to extract deep pose features. Simultaneously, the shallow pose features are preserved through skip connections. The shallow pose features and deep pose features are then input to the first fusion module for fusion to obtain pose fusion features.
[0044] Input pose features After nonlinear mapping is performed by inputting the hidden mapping layer of the modulation parameter generation module in sequence, the feature scaling parameter output layer and the feature offset parameter output layer are input respectively to generate the feature scaling parameter and the feature offset parameter.
[0045] In this step, the modulation parameter generation module is a multilayer perceptron (MLP). The MLP includes a hidden mapping part and two output branches. The hidden mapping part is a hidden mapping layer, and the two output branches are the feature scaling parameter output layer and the feature offset parameter output layer, respectively. Based on this, the working principle of the modulation parameter generation module is as follows: First, the pose input feature is... The hidden mapping layer of the modulation parameter generation module is input to perform nonlinear mapping to generate hidden features. These hidden features are then input to the feature scaling parameter output layer and the feature offset parameter output layer to generate FiLM modulation parameters, including the feature scaling parameter. and feature offset parameters The calculation formula is as follows:
[0046]
[0047] in, Feature scaling parameters; Output the layer's weight matrix using feature scaling parameters; It is a non-linear activation function; The weight matrix of the hidden mapping layer; Input features for pose; The bias vector for the hidden mapping layer; The output layer's bias vector is determined by the feature scaling parameters; For feature offset parameters; The weight matrix of the output layer is the feature offset parameter; The bias vector of the output layer is the feature offset parameter.
[0048] The pose fusion features are sequentially input into the flattening layer and the first fully connected layer of the fully connected latent feature mapping module to perform flattening and fully connected mapping operations, thereby generating global latent features.
[0049] In this step, the fully connected latent feature mapping module works as follows: the pose fusion features are input into the fully connected latent feature mapping module, and the pose fusion features are sequentially flattened and fully mapped using a flattening layer and a first fully connected layer, thereby generating global latent features. .
[0050] The global latent features are input into the FiLM attitude conditional modulation module, and combined with feature scaling parameters and feature offset parameters, feature-level linear modulation is performed to generate the attitude-modulated latent features, represented as:
[0051] In the formula, These are latent features after attitude modulation; Input features for pose; Feature scaling parameters; This is an element-wise multiplication operation; For global latent features; This refers to the feature offset parameter.
[0052] In this step, FiLM is a feature-level linear modulation. Based on this, the working principle of the FiLM attitude conditional modulation module is: to convert global latent features... and feature scaling parameters and feature offset parameters The inputs are shared with the FiLM attitude conditional modulation module, which generates attitude-modulated latent features by performing feature-level linear modulation on the global latent features. .
[0053] The latent features after attitude modulation are sequentially input into the second fully connected layer, the dimension expansion layer, and the matrix reshaping layer of the fully connected mapping and reshaping module to perform fully connected mapping, dimension expansion, and matrix reshaping operations, thereby generating the initial predicted surface texture morphology.
[0054] In this step, the fully connected mapping and reshaping module works as follows: First, it maps the latent features after attitude modulation... The first layer is fed into a second fully connected layer, where a fully connected mapping operation is performed to generate a one-dimensional height feature vector whose length corresponds to the total number of elements in the surface texture. Next, this one-dimensional height feature vector is fed into a dimension expansion layer for dimension expansion, generating tensor features that meet the matrix reshaping requirements. Finally, the tensor features are fed into a matrix reshaping layer, where a matrix reshaping operation is performed according to the preset number of rows and columns of the surface texture, generating the initial predicted surface texture. .
[0055] The initial predicted surface texture shape is sequentially input into the first two-dimensional convolutional layer, nonlinear activation layer, and several cascaded residual feature extraction units of the local texture detail enhancement module to perform two-dimensional convolution operation, nonlinear activation, and local texture detail extraction to generate local texture enhancement features.
[0056] In this step, the local texture detail enhancement module includes a first two-dimensional convolutional layer with a large receptive field, a non-linear activation layer, and three sequentially connected residual feature extraction units. Each residual feature extraction unit includes two two-dimensional convolutional layers and a fusion module. Based on this, the working principle of the local texture detail enhancement module is as follows: First, the initial predicted surface texture shape is input into the first two-dimensional convolutional layer with a large receptive field, and a two-dimensional convolution operation is performed to extract the local texture structure and global shape trend, generating initial texture features. The initial texture features are then input into the non-linear activation layer for non-linear mapping, generating activated texture features. The activated texture features are then sequentially input into the three sequentially connected residual feature extraction units for local texture detail extraction, generating local texture enhancement features. The working principle of each residual feature extraction unit is as follows: The output features of the module connected to the residual feature extraction unit (if it is the first residual feature extraction unit, the input feature of the residual feature extraction unit is the activated texture feature; if it is the second or third residual feature extraction unit, the input feature of the residual feature extraction unit is the output feature of the previous residual feature extraction unit connected to it) are sequentially input into the two two-dimensional convolutional layers of the residual feature extraction unit to perform two-dimensional convolution operations, extract local texture features, and through skip connections, the local texture features are input to the fusion module for feature fusion to generate the output features of the residual feature extraction unit; finally, the output feature of the last residual feature extraction unit is the local texture enhancement feature.
[0057] The local texture enhancement features are sequentially input into the feature compression layer, the second two-dimensional convolutional layer, and the output convolutional layer of the local texture detail compensation generation module to perform feature compression, two-dimensional convolution operations, and feature mapping to generate the local texture detail compensation amount.
[0058] In this step, the local texture detail compensation generation module works as follows: Local texture enhancement features are input into a feature compression layer for channel dimension compression, generating compressed local texture features; the compressed local texture features are input into a second two-dimensional convolutional layer for two-dimensional convolution operations, further extracting local residual information; the extracted local residual information is input into an output convolutional layer for feature mapping, generating a single-channel local texture detail compensation amount consistent with the initial predicted surface texture shape size. .
[0059] The local texture detail compensation amount and the initial predicted surface texture shape are input into the residual overlay module, added point by point, and the predicted surface texture shape is output.
[0060] In this step, the residual overlay module works as follows: the initial predicted surface texture and local texture detail compensation are input into the residual overlay module, and the two are added point by point to generate the final predicted surface texture. ,Right now: .
[0061] We introduce mean absolute error loss, structural similarity loss, perceptual loss, and regularization loss, and based on the gradient norm, we perform adaptive weight determination to construct a numerical-structural composite loss function.
[0062] In this step, to evaluate the difference between the predicted results (i.e., predicted surface texture) output by the surface texture prediction model and the actual results (digital model of surface texture), and to use this as an optimization objective to guide model parameter updates during training, this invention proposes an adaptive weight determination method for a composite loss function based on gradient norm. This method dynamically allocates the weights of various sub-losses, including mean absolute error loss, structural similarity loss, perceptual loss, and regularization loss, thereby balancing the contributions of different loss terms during training. Based on this, the model parameters are iteratively updated using backpropagation to generate a trained surface texture prediction model. Therefore, the specific implementation process for constructing the numerical-structural composite loss function is as follows: First, considering numerical error, overall structural consistency, ability to construct local details, and generalization ability under small sample training, the sub-loss term of the numerical-structural composite loss function includes the mean absolute error loss. Structural similarity loss Perceived loss Regularization loss The calculation formulas for each sub-loss term are as follows:
[0063]
[0064]
[0065]
[0066] In the formula, For predicting the topography of a surface texture or predicting the total number of elements in a surface texture; The number of rows in the surface texture prediction model or the prediction of surface texture shape; The number of columns for predicting surface texture morphology or predicting surface texture morphology; To predict the first in the surface texture morphology Line 1 Predicted values for column elements; In the surface texture prediction model, the first Line 1 The actual values of the column elements; It is a structural similarity index; , These are, respectively, a prediction of surface texture morphology and a digital model of surface texture morphology; For the surface texture topography prediction model, the first Feature mapping of layers; These are the model parameters.
[0067] Secondly, an adaptive weight determination based on the composite loss function of gradient norm is established, specifically as follows: During each training iteration, the gradient of each sub-loss term with respect to the model parameters is calculated, and the corresponding gradient norm is further calculated. This is used to characterize the effect of the sub-loss term on the model parameters. The degree of impact of the update is expressed as:
[0068] In the formula, For the first Gradient norm of each sub-loss; For model parameters The gradient operator; For the first Individual loss functions; The gradient norm is L2. A larger gradient norm indicates a more significant impact of the loss term on model parameter updates.
[0069] Normalize the gradient norm of all sub-loss terms to obtain the weights corresponding to each sub-loss term. , represented as:
[0070] In the formula, For the first The weight of the individual loss, The total number of child losses is 4.
[0071] Based on the weights of each sub-loss, the sub-losses are weighted and summed to obtain the adaptively weighted composite loss function, which is the numerical-structural composite loss function, expressed as:
[0072] in, This is the numerical-structural composite loss function; The weights for the mean absolute error loss; The weights for structural similarity loss; Weights for perceived loss; The weights for the regularization loss.
[0073] The model parameters are updated by backpropagation using the numerical-structural composite loss function, and finally a trained surface texture prediction model is obtained.
[0074] in, Figure 6 It shows the rotation angle as Inclination angle is A comparison image of the predicted surface texture shape and the digital model of the surface texture shape during the training of the surface texture shape prediction model; and Figure 6 Figure (a) shows the predicted surface texture topography. Figure 6 Figure (b) shows a digital model of the surface texture morphology; Figure 6 Figure (c) shows a comparison between the local predicted surface texture at location 1 and the digital model of the surface texture. Figure 6 Figure (d) shows a comparison between the predicted local surface texture at location 2 and the digital model of the surface texture. Ultimately, from... Figure 6 It can be observed that the predicted surface texture morphology is highly consistent with the texture geometry features, overall texture morphology, and trend of the digital model of surface texture morphology.
[0075] Step 5: Construct multiple sets of tool attitude angle sample sets to be tested, and input them into the trained surface texture shape prediction model to predict the surface texture shape of each set of tool attitude angles, and use them as samples to construct a surface texture shape dataset.
[0076] This step involves constructing multiple sets of tool attitude angle samples to be tested, and inputting them into a trained surface texture prediction model to quickly predict the surface texture shape of each set of tool attitude angles. Each set of tool attitude angle surface texture shape is then used as a sample, thus constructing a surface texture shape dataset. The specific implementation process is as follows: First, set the discrete interval for the range of tilt angle variation. Discrete intervals of the rotation angle variation range Discretize the range of tilt angle variation and the range of rotation angle variation respectively, and establish , Based on discrete samples, and then based on the orthogonal experiment in step one above, a multi-set sample set of tool attitude angles to be tested is constructed, totaling [number missing]. A set of tool attitude angle samples. Among them, This represents the number of discrete intervals within the range of tilt angle variation. This represents the number of discrete intervals within the range of rotation angle variation.
[0077] In one optional embodiment of the present invention , , 181, .
[0078] Secondly, using the tool attitude angle information of each set of tool attitude angle samples in the test set as input, the corresponding surface texture shape is quickly predicted by the trained surface texture shape prediction model. Finally, all surface texture shapes constitute the surface texture shape dataset.
[0079] Step 6: Cluster the surface texture dataset using a clustering method to obtain the surface texture classification results. Integrate the tool attitude angles corresponding to all surface textures in each class to generate a continuous tool attitude angle range corresponding to each class of surface textures.
[0080] In this step, the process of using clustering methods to cluster the surface texture topography dataset and obtain the surface texture topography classification results is as follows: First, each surface texture shape is treated as a sample to form a surface texture shape dataset. Principal component analysis (PCA) is used to reduce the dimensionality of this dataset. Then, based on the dimensionality-reduced dataset, the silhouette coefficient method is used to determine the optimal number of classifications. Finally, using the optimal number of classifications as the target number of classifications, K-means clustering is applied to cluster the dimensionality-reduced dataset, obtaining the clustering results for each sample. Each sample corresponds to one surface texture shape, and the clustering result for each sample is the classification result for that surface texture shape.
[0081] Secondly, based on the surface texture classification results and the corresponding tool attitude angles for all surface textures in each category, the range of continuous tool attitude angles for each category of surface texture can be obtained. This range of continuous tool attitude angles for each category of surface texture provides a reasonable constraint for adjusting the tool attitude angles in subsequent geometric error compensation steps, ensuring the overall texture quality and integrity. Table 2 shows the range of continuous tool attitude angles for each category of surface texture. Figures 7-14 The overall surface texture and local texture are shown for each category. Figures 7-14 The left image shows the overall surface texture morphology for each category, while the right image shows the local texture morphology.
[0082] Table 2. Range of continuous tool attitude angles corresponding to various types of curved surface texture morphology.
[0083] Step 7: Using the range of continuous tool attitude angles corresponding to each type of surface texture as a constraint, realize five-axis milling geometric error compensation based on texture constraints and generate the compensated machining path.
[0084] Based on the set cutting parameters and tool attitude angles, a five-axis milling machining path is generated, and the command space coordinates of each tool position point in the machining path are obtained. ;in, Number the tool positions in the machining path; For the first The instruction space coordinates of each tool position point.
[0085] Command space coordinates based on each tool position point Calculate the actual spatial coordinates of each tool position. ,Right now:
[0086] In the formula, For the first The actual spatial coordinates of each tool position point; This is the mapping function between the machine tool kinematics and the error propagation model; For the first The tool attitude angle at each tool position point is expressed as: , For the first The tilt angle of each cutting point, For the first The rotation angle of each cutter point; This is a set of geometric error parameters for machine tools.
[0087] In this step, based on the machine tool kinematics and error propagation model, the spatial coordinates of each tool position point are used. And the set of machine tool set error parameters, to calculate the actual spatial coordinates of each tool position point. Among them, the machine tool kinematics and error propagation model is a coordinate transformation model established based on the five-axis machine tool kinematic chain, used to characterize the mapping relationship between the command tool position point, tool attitude angle, the positions of each motion axis of the machine tool, and geometric error parameters. Specifically, it involves establishing homogeneous coordinate transformation matrices for each linear and rotary axis based on the machine tool structure, and introducing corresponding geometric error parameters into each axis transformation matrix to form a machine tool kinematic chain transformation model containing errors. Through this model, the actual spatial coordinates of each tool position point can be calculated. Command space coordinates of each tool position The tool attitude angle and geometric error parameters are used to calculate the actual spatial coordinates of the tool position point under the influence of geometric errors.
[0088] Based on the continuous tool attitude angle range corresponding to each type of surface texture, tool attitude angle range constraints are constructed for each tool position point. , represented as:
[0089]
[0090] In the formula, Number the tool attitude angle range for the surface texture morphology; The first of the curved surface texture morphology The minimum tilt angle within a range of tool attitude angles; The first of the curved surface texture morphology The maximum tilt angle within the tool attitude angle range; The first of the curved surface texture morphology The minimum rotation angle within a range of tool attitude angles; The first of the curved surface texture morphology The maximum rotation angle within a range of tool attitude angles.
[0091] This step involves determining the tool attitude angle range corresponding to the texture shape for path planning, based on the surface texture morphology classified in step six and the continuous tool attitude angle range corresponding to each type of surface texture morphology. The tool attitude angle range constraint limits the range of tool attitude angle variation to ensure the consistency of the machined surface texture.
[0092] Construct a collaborative optimization model for tool posture at each tool position point in the machining path. , represented as:
[0093] In the formula, This represents the total number of tool points in the machining path. The weights of the first-order smoothness term; The weights are for the second-order smoothing terms; For the first Tool attitude angle at each tool position point; For the first The tool attitude angle at each tool position point.
[0094] In this step, The term is a geometric error compensation term, with the goal of minimizing the actual position error of the tool; The term is a first-order smoothing term, which ensures the continuity of tool posture changes; It is a second-order smoothing term, which suppresses abrupt changes in attitude and ensures the smoothness of tool attitude changes.
[0095] Numerical optimization methods are used to constrain the tool attitude angle range. The tool attitude collaborative optimization model is solved to obtain the compensated tool attitude at each tool position point.
[0096] The compensated tool attitude angles of each tool position point are converted into compensated tool axis vectors. The command space coordinates of each tool position point are combined with the compensated tool axis vectors to obtain the compensated tool position point data.
[0097] In this step, the compensated tool position data includes the command space coordinates of each tool position and the compensated tool axis vector.
[0098] Finally, based on the compensated tool position data, a compensated machining path is generated.
[0099] In this step, the compensated tool position data are combined into a compensated machining path according to the machining order of each tool position data in the original machining path.
[0100] In summary, the texture classification and attitude range determination method proposed in this invention for geometric error compensation constructs a small set of different tool attitude angles as a training set and uses the digital model of the surface texture morphology corresponding to each set of tool attitude angles as labels. Combined with the constructed surface texture morphology prediction model, it achieves the prediction of surface texture morphology under any set of tool attitude angles. Simultaneously, it also achieves the classification of surface texture morphology and the rapid determination of the tool attitude angle range corresponding to each type of surface texture morphology. Finally, using the tool attitude angle range corresponding to each type of surface texture morphology as a constraint, it realizes geometric error compensation for five-axis milling of free-form surfaces, generating a compensated machining path. This method can improve machining accuracy while ensuring the integrity and uniformity of the machined surface texture morphology under tool attitude adjustment. Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
[0101] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A method for texture classification and pose range determination oriented towards geometric error compensation, characterized in that, Includes the following steps: The range of tool attitude angle variation was determined. By dividing multiple tilt angle and rotation angle intervals, orthogonal experiments with stratified sampling were conducted to construct several sets of digital models of tool attitude angles and corresponding surface texture morphology. Construct the attitude input features for each set of tool attitude angles; Construct a surface texture topography prediction model to enhance texture details; Using pose input features as input and a digital model of surface texture as label, a surface texture prediction model is trained, and a numerical-structural composite loss function is constructed to adjust the model parameters to generate a trained surface texture prediction model. Construct a sample set of multiple tool attitude angles to be tested, and input it into a trained surface texture topography prediction model to predict the surface texture topography of each tool attitude angle, and use it as a sample to construct a surface texture topography dataset. Clustering methods are used to cluster the surface texture topography dataset to obtain surface texture topography classification results. The tool attitude angles corresponding to all surface texture topographys in each class are integrated to generate a continuous tool attitude angle range corresponding to each class of surface texture topography. By using the range of continuous tool attitude angles corresponding to each type of surface texture as a constraint, five-axis milling geometric error compensation based on texture constraints is achieved, and a compensated machining path is generated.
2. The texture classification and pose range determination method according to claim 1, characterized in that, The process of determining the range of tool attitude angle variation, dividing multiple tilt angle and rotation angle intervals, conducting stratified sampling orthogonal experiments, and constructing several sets of digital models of tool attitude angles and corresponding surface texture morphology is as follows: Set cutting parameters to determine the range of tool attitude angle variation in five-axis milling, including rotation angle and tilt angle; The range of tool tilt angle changes is divided into: The range of tilt angles is divided into several intervals, and the range of tool rotation angle variation is further divided into... One rotation angle interval; Using the tilt angle interval and rotation angle interval as the factor levels of the orthogonal experiment, each tilt angle interval and each rotation angle interval are matched with each other to construct a stratified sampling orthogonal experimental table. For each experimental combination, angle values are randomly sampled from the corresponding tilt angle interval and rotation angle interval to generate a single set of tool posture angles. Finally, all sets of tool posture angles are summarized as training dataset. Construct a digital model of the surface texture morphology for each set of tool attitude angles, and use this digital model of the surface texture morphology as a label for that set of tool attitude angles.
3. The texture classification and pose range determination method according to claim 1, characterized in that, The process of constructing the attitude input features for each set of tool attitude angles is as follows: Construct the local tool contact point coordinate system and tool axis vector for each set of tool attitude angles, i.e.: in, The tool axis vector; , , These are the coordinates of the tool axis vector in the local tool contact point coordinate system. , , Components in direction, This refers to the tool feed direction at the tool contact point. The direction of the surface normal vector at the point of contact with the blade is [missing information]. To align with the tool feed direction and surface normal direction Orthogonal directions; , These are the cosine function and the sine function, respectively. The rotation angle; The angle of inclination; Based on the variation range of the tool tilt angle and rotation angle, the tilt angle and rotation angle within each group of tool attitude angles are normalized using the minimum-maximum normalization method to generate the normalized tool tilt angle and rotation angle, i.e.: in, This is the normalized tool rotation angle; This is the normalized tool tilt angle; , These are the tool rotation angles. The maximum and minimum values; 、 These are the tool tilt angles. The maximum and minimum values; Based on the normalized tool rotation angle, tilt angle, and tool axis vector in the local tool contact point coordinate system, the attitude input features of each set of tool attitude angles are obtained, namely: in, Input features for pose.
4. The texture classification and pose range determination method according to claim 1, characterized in that, The surface texture prediction model includes a one-dimensional convolutional pose feature encoding module, a fully connected latent feature mapping module, a modulation parameter generation module, a FiLM pose conditional modulation module, a fully connected mapping and reshaping module, a local texture detail enhancement module, a local texture detail compensation generation module, and a residual overlay module. The one-dimensional convolutional pose feature encoding module includes a first one-dimensional convolutional layer, a second one-dimensional convolutional layer, and a first fusion module; The fully connected latent feature mapping module includes a flattening layer and a first fully connected layer; The modulation parameter generation module is a multilayer perceptron, which includes a hidden mapping layer, a feature scaling parameter output layer, and a feature offset parameter output layer. The fully connected mapping and reshaping module includes a second fully connected layer, a dimension expansion layer, and a matrix reshaping layer; The local texture detail enhancement module includes a first two-dimensional convolutional layer, a non-linear activation layer, and several cascaded residual feature extraction units; The local texture detail compensation generation module includes a feature compression layer, a second two-dimensional convolutional layer, and an output convolutional layer.
5. The texture classification and pose range determination method according to claim 4, characterized in that, The process of training a surface texture prediction model using pose input features and a digital model of surface texture as labels, and then adjusting the model parameters using a numerical-structural composite loss function to generate the trained surface texture prediction model is as follows: The pose input features are input into the first one-dimensional convolutional layer of the one-dimensional convolutional pose feature encoding module to perform convolution operations and extract shallow pose features. Then, they are input into the second one-dimensional convolutional layer to perform convolution operations and extract deep pose features. Finally, they are input together with the shallow pose features into the first fusion module to generate pose fusion features. After performing nonlinear mapping on the hidden mapping layer of the attitude input feature input modulation parameter generation module, the feature scaling parameter output layer and the feature offset parameter output layer are respectively input to generate the feature scaling parameter and the feature offset parameter. The pose fusion features are sequentially input into the flattening layer and the first fully connected layer of the fully connected latent feature mapping module to perform flattening and fully connected mapping operations, thereby generating global latent features. The global latent features are input into the FiLM attitude conditional modulation module, and combined with feature scaling parameters and feature offset parameters, feature-level linear modulation is performed to generate attitude-modulated latent features, i.e.: in, These are latent features after attitude modulation; Input features for pose; Features scaling parameters; This is an element-wise multiplication operation; For global latent features; For feature offset parameters; The pose-modulated latent features are sequentially input into the second fully connected layer, the dimension expansion layer, and the matrix reshaping layer of the fully connected mapping and reshaping module to perform fully connected mapping, dimension expansion, and matrix reshaping operations, generating the initial predicted surface texture morphology. The initial predicted surface texture shape is sequentially input into the first two-dimensional convolutional layer, nonlinear activation layer, and several cascaded residual feature extraction units of the local texture detail enhancement module to perform two-dimensional convolution operation, nonlinear activation, and local texture detail extraction to generate local texture enhancement features. The local texture enhancement features are sequentially input into the feature compression layer, the second two-dimensional convolutional layer, and the output convolutional layer of the local texture detail compensation generation module to perform feature compression, two-dimensional convolution operations, and feature mapping to generate the local texture detail compensation amount. The local texture detail compensation amount and the initial predicted surface texture shape are input into the residual overlay module, added point by point, and the predicted surface texture shape is output, i.e.: in, To predict the texture morphology of curved surfaces; This is the initial prediction of the surface texture morphology; This is the amount of compensation for local texture details; We introduce mean absolute error loss, structural similarity loss, perceptual loss, and regularization loss, and based on the gradient norm, we perform adaptive weight determination to construct a numerical-structural composite loss function. The model parameters are updated by backpropagation using the numerical-structural composite loss function, and finally a trained surface texture prediction model is obtained.
6. The texture classification and pose range determination method according to claim 5, characterized in that, The process of introducing mean absolute error loss, structural similarity loss, perceptual loss, and regularization loss, and then using gradient norm to adaptively determine weights to construct a numerical-structural composite loss function is as follows: Calculate the mean absolute error loss, structural similarity loss, perceptual loss, and regularization loss, i.e.: in, This is the average absolute error loss; For structural similarity loss; To perceive loss; This is the regularization loss; For predicting the topography of a surface texture or predicting the total number of elements in a surface texture; The number of rows in the surface texture prediction model or the prediction of surface texture shape; The number of columns for predicting surface texture morphology or predicting surface texture morphology; To predict the first in the surface texture morphology Line 1 Predicted values for column elements; In the surface texture prediction model, the first Line 1 The actual values of the column elements; It is a structural similarity index; , These are, respectively, a prediction of surface texture morphology and a digital model of surface texture morphology; For the surface texture topography prediction model, the first Feature mapping of layers; These are model parameters; Calculate the gradient norm of each sub-loss term, i.e.: in, For the first Gradient norm of each sub-loss; For model parameters The gradient operator; For the first Individual loss; It is an L2 norm; Based on the gradient norm of each sub-loss term, the gradient norm of each sub-loss is normalized to generate the weights of each sub-loss, i.e.: in, For the first The weight of the individual loss, This represents the total number of child losses; Based on the weights of each sub-loss, the sub-losses are weighted and summed to obtain the adaptively weighted composite loss function, which is the numerical-structural composite loss function, i.e.: in, This is the numerical-structural composite loss function; The weights for the mean absolute error loss; The weights for structural similarity loss; Weights for perceived loss; The weights for the regularization loss.
7. The texture classification and pose range determination method according to claim 1, characterized in that, The process of achieving five-axis milling geometric error compensation based on texture constraints, using the range of continuous tool attitude angles corresponding to each type of surface texture as a constraint, is as follows: Based on the set cutting parameters and tool attitude angles, a five-axis milling machining path is generated, and the spatial coordinates of each tool position point in the machining path are obtained. ;in, Number the tool positions in the machining path; For the first Spatial coordinates of each cutter point; Based on the spatial coordinates of each tool point Calculate the actual spatial coordinates of each tool position. ,Right now: in, For the first The actual spatial coordinates of each tool position point; This is the mapping function between the machine tool kinematics and the error propagation model; For the first The tool attitude angle at each tool position point is expressed as: , For the first The tilt angle of each cutting point, For the first The rotation angle of each cutter point; This is a set of machine tool geometric error parameters; Based on the continuous tool attitude angle range corresponding to each type of surface texture, tool attitude angle range constraints are constructed for each tool position point. , represented as: In the formula, Number the tool attitude angle range for the surface texture morphology; The first of the curved surface texture morphology The minimum tilt angle within a range of tool attitude angles; The first of the curved surface texture morphology The maximum tilt angle within the tool attitude angle range; The first of the curved surface texture morphology The minimum rotation angle within a range of tool attitude angles; The first of the curved surface texture morphology The maximum rotation angle within a range of tool attitude angles; Construct a collaborative optimization model for tool posture at each tool position point in the machining path. , represented as: in, This represents the total number of tool points in the machining path. The weights of the first-order smoothness term; The weights are for the second-order smoothing terms; For the first Tool attitude angle at each tool position point; For the first Tool attitude angle at each tool position point; Numerical optimization methods are used to constrain the tool attitude angle range. The tool attitude collaborative optimization model is then solved to obtain the compensated tool attitude at each tool position point; The compensated tool attitude angles of each tool position point are converted into compensated tool axis vectors. The command space coordinates of each tool position point are combined with the compensated tool axis vectors to obtain the compensated tool position point data. Finally, based on the compensated tool position data, a compensated machining path is generated.