Part plane topography error prediction method based on multilayer perceptron
By combining a multilayer perceptron model with non-uniform point cloud acquisition and structured dataset modeling, the efficiency and accuracy problems of part machining error modeling in existing technologies are solved, and efficient and accurate part machining accuracy prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2025-07-23
- Publication Date
- 2026-07-24
AI Technical Summary
Existing machining error modeling methods struggle to establish manufacturing error models for the machining plane of parts while ensuring efficiency, and also suffer from cumbersome data processing and insufficient real-time prediction capabilities.
A multilayer perceptron-based approach is adopted, which involves non-uniform point cloud acquisition, intelligent data cleaning, Z-Score normalization, and structured dataset modeling. The neural network structure is then optimized using a particle swarm optimization algorithm to achieve high-precision prediction of the machining plane of parts.
It improves data quality and measurement accuracy, simplifies data processing procedures, enables efficient prediction of part machining accuracy, provides a more reliable data foundation, and provides technical support for intelligent manufacturing.
Smart Images

Figure CN121009593B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machining, specifically relating to a method for predicting the planar topography error of parts based on a multilayer perceptron. Background Technology
[0002] Modeling and prediction of surface errors in machining is an important research direction in the field of precision manufacturing. Its goal is to evaluate the surface accuracy of workpieces during machining through theoretical modeling, data analysis, and simulation, thereby optimizing process parameters, reducing machining costs, improving machining quality, and achieving intelligent production. The main modeling methods are physical mechanism-based modeling and data-driven modeling. However, due to the coupling of multiple factors in the machining process and the cost of data acquisition, the prediction accuracy and efficiency still need further improvement. In recent years, a large amount of research has been conducted on machining error modeling both domestically and internationally. Existing technology discloses a surface roughness prediction method based on an improved Deep Residual Shrinking Network (IDRSN) and Bidirectional Long Short-Term Memory Network (BiLSTM) using the Inception module. This method uses the Deep Residual Shrinking Network to denoise the input signal, introduces the Inception module to achieve adaptive multi-scale feature extraction, and finally constructs a prediction network to model and predict the surface accuracy of the workpiece. Experiments have verified that this method has high accuracy, laying a methodological foundation for the prediction of surface roughness in machining. However, this method has high algorithm complexity and shortcomings in the real-time performance of model prediction. Existing technologies also disclose models relating system source errors to part machining quality. These models analyze errors from a physical mechanism perspective, mapping the source errors of the final execution component to the workpiece machining quality. Based on the way the error source affects the workpiece, they are divided into direct error models and indirect error models. Depending on different analytical needs, these two sub-models can be used individually or in combination to improve analysis efficiency. However, they are limited by the difficulty in completely decoupling the coupled and interactive effects of multiple factors such as vibration, thermal deformation, and tool wear. The aforementioned methods use deep learning to adaptively extract signal features, effectively preserving important information, but require manual data preprocessing, making the process cumbersome. Summary of the Invention
[0003] The purpose of this invention is to address the difficulty of establishing a manufacturing error model of the machining plane of a part while ensuring efficiency in existing machining error modeling methods based on milling processes. This invention proposes a part manufacturing error modeling method based on a multilayer perceptron.
[0004] To achieve the aforementioned objectives, the technical solution of the present invention is as follows: A method for modeling manufacturing errors of parts based on a multilayer perceptron, comprising the following steps:
[0005] Step 1: Delineate the sampling area based on the ideal geometric contour of the processing plane, discretize it using sampling parameters, and obtain the index matrix based on the shape of the plane to be processed.
[0006] Step 2: Obtain the geometric parameters of the part plane, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, the machining process parameters, and the discrete single-point surface morphology feature values.
[0007] Step 3: Preprocess the initial data: including data cleaning, feature extraction, and normalization.
[0008] Step 4: Construct a dataset using the geometric parameters of the pre-processed machining plane, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, and the machining process parameters as input parameters, and the discrete single-point surface morphology feature values as output parameters.
[0009] Step 5: Construct a multilayer perceptron model and train the multilayer perceptron on the dataset to predict surface morphology feature values.
[0010] Step 6: When faced with a new accuracy prediction task, the machining accuracy is predicted by a trained neural network based on the geometric parameters of the plane to be machined, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, and the machining process parameters.
[0011] The specific implementation process of step 1 is as follows:
[0012] To discretize the geometric contour of the machined surface of the part into an index matrix, its minimum bounding rectangle is first determined as the envelope region, and a two-dimensional coordinate system is established with the upper left corner of the rectangle as the origin. A given sampling parameter λ (unit: m) is used. -1 The rectangle is uniformly discretized, and the dimension (m×n) of its index matrix is determined by the product of the rectangle's actual length a and width b with λ, i.e.:
[0013]
[0014] Where [] denotes the floor function, and m and n represent the number of rows and columns of the discrete matrix. A smaller value for the sampling parameter indicates a more precise grid division of the index matrix, resulting in a larger data volume for the same processed surface. Conversely, a larger value indicates a less precise grid division and a smaller data volume.
[0015] The label value of each element is determined based on whether its position is inside the plane to be processed. If the point is inside the plane, the element is labeled as 1; otherwise, it is labeled as 0. The index matrix is determined through the above steps. The process of determining the index matrix is shown in the appendix. Figure 2 As shown.
[0016] The specific implementation process of step 2 is as follows:
[0017] Geometric parameter P g and single-point surface morphology feature value h ij The method for acquiring point cloud data involves scanning the machined surface of the part using an articulated arm measuring instrument. It's important to note that data acquisition doesn't necessarily require sampling at the grid points. In fact, due to limitations in the articulated arm measuring instrument's operational precision, it's impossible to measure at a specific location. When collecting data, the points should be distributed as evenly as possible across the machined plane, with the total number of points being close to the number of elements 1 in the index matrix. This ensures sufficient data coverage of the entire plane. Using this method, the (x, y) coordinates of the points in the geometric parameters and the corresponding z-coordinates can be obtained. Based on the distribution of elements in the index matrix, the centroid position (x0, y0) of the machined plane can be calculated. Furthermore, the distance from the sampling point to the edge can be calculated. The calculation method is as follows: first, find the ray l from the centroid to the sampling point; denote the intersection point of ray l and the contour of the plane to be machined as D; the distance from the measurement point D to the sampling point is the distance from the sampling point to the edge. Material thermodynamic parameter P m Parameters such as elastic modulus (E), Poisson's ratio (v), density (ρ), coefficient of linear expansion (α), and thermal conductivity (K) can be obtained from relevant handbooks based on the material of the blank; the geometric parameters P of the milling cutter... t Including the tool's principal cutting edge angle (K) r Secondary deflection angle (K') r The rake angle (y), clearance angle (β), and tool tip radius (D) can be obtained by consulting the manual of the selected tool; machining process parameters P p Including cutting speed (V) c ), feed rate (F), depth of cut (a) p ), feed per tooth (f) z These parameters can be obtained from the process card;
[0018] The improvements in Step 2 are mainly reflected in three aspects: First, non-uniform point cloud acquisition is adopted, which only requires ensuring that the measurement points uniformly cover the machined surface. This significantly reduces the requirements for equipment operation accuracy and improves the feasibility and efficiency of data acquisition. Second, an innovative edge distance measurement method based on dynamic centroid calculation is proposed. By establishing the intersection of the centroid ray and the contour, the distance from the sampling point to the edge is determined, overcoming the measurement error of traditional fixed mesh division at the edges of complex contours. Third, multi-source data such as geometric parameters, material parameters, tool parameters, and process parameters are integrated, and various parameters are obtained through a standardized process, providing a more comprehensive and accurate data foundation for subsequent analysis. These improvements make the method more practical and accurate.
[0019] The specific implementation process of step 3 is as follows:
[0020] (1) Data cleaning: First, the original measured point cloud data is cleaned to remove outliers and noise points caused by measurement errors, environmental interference, or equipment malfunctions. In addition, missing sample points are appropriately interpolated or deleted.
[0021] (2) Feature extraction: The enhanced data is registered to determine the nominal position of the processing plane, and then the deviation of each sampling point from the processing plane is determined, which is the single-point surface morphology feature value h. ij ,
[0022] (3) Normalization: Since the dimensions and ranges of the input features vary greatly, all input parameters are normalized using Z-Score standardization to ensure that all features are distributed in similar numerical ranges.
[0023]
[0024] In the above formula, x represents the original sample value, μ represents the mean of the feature, σ represents the standard deviation of the feature, and z represents the normalized value.
[0025] The main improvements and advantages of step 3 compared to existing technologies are as follows: First, through an intelligent data cleaning process, measurement noise and outliers are effectively eliminated, while an adaptive interpolation algorithm is used to process missing data, significantly improving data quality. Second, the innovative combination of nominal plane registration and morphological feature extraction techniques enables accurate quantification of surface morphological features. Finally, the use of a Z-Score-based multi-parameter normalization method solves the analytical bias problem caused by dimensional differences in traditional methods. These improvements make data processing more robust and improve the accuracy of subsequent analyses.
[0026] The specific implementation process of step 4 is as follows: In step 4, the material thermodynamic parameters, milling cutter geometric parameters, and machining process parameters of the machined plane are used as input parameters, and the discrete single-point surface morphology feature values are used as output parameters to construct dataset D.
[0027] (1) Arrange the geometric parameters, material parameters, equipment parameters and processing parameters involved in a determined order into a row vector as the input vector, and use the collected discrete single-point surface morphology feature values as the output values.
[0028] (2) It should be noted that since multiple sampling points for single-point surface morphology feature values can be obtained after discretizing the plane in one machining operation, the number of sampling points varies with the degree of discretization and the size of the machined parts. To ensure the consistency of the output data format, single-point feature values are used as the output. If the discretization result contains N points, then N data points in the dataset can be obtained.
[0029] (3) The structure of the dataset is as follows:
[0030]
[0031] Wherein, dataset D consists of [D1, D2, ..., D k ] T Composition, in which each unit D i This represents data collected from the machined surface in a single machining operation. For the same machined surface, the material properties, tool shape parameters, and machining process parameters are identical. Therefore, for each data point... i The parameters of these three parts remain constant, but the geometric parameters and surface topography error of each sampling point change with the sampling point. For each data point... i Within a single unit, these data also differ.
[0032] A dataset is constructed using the pre-processed geometric parameters of the machined plane, material thermodynamic parameters, milling cutter geometry parameters, and machining process parameters as input vectors, and the discretized single-point surface topography features as output parameters. The data format of each input vector in the dataset is as follows:
[0033] data i =[x,y,x0,y0,s,l,E,v,ρ,α,K,K r ,K′ r ,y,β,D,V c ,F,a p ,f z (6)
[0034] Step 4 achieves a significant breakthrough in data modeling, with its core improvement lying in the establishment of a structured, multi-parameter coupled dataset. This method innovatively integrates geometric parameters, material thermodynamic parameters, tool geometric parameters, and machining process parameters into a standardized input vector, and uses single-point surface morphology feature values h... ij As output, a complete parameter mapping relationship is constructed. Compared with traditional methods, this structured processing has the following advantages: First, by maintaining the consistency of fixed parameters in the same processing cycle while preserving the independent geometric features of each sampling point, it ensures both the rigor of the data logic and the complete preservation of spatial distribution information; second, the flexible data structure of the single-point correspondence mode (one data record generated by one sampling point) effectively solves the problem of inconsistent data dimensions caused by variations in discreteness and part size; finally, the standardized data organization provides high-quality training samples for subsequent machine learning modeling, significantly improving the efficiency and accuracy of model training. This systematic parameter integration method provides a more comprehensive and reliable data foundation for predicting the surface morphology of processed parts.
[0035] The specific implementation process of step 5 is as follows:
[0036] A multilayer perceptron was constructed, with 20 neurons in the input layer, corresponding to the input geometric parameters, material parameters, tool parameters, and processing parameters. The output layer has one neuron, directly outputting the predicted surface topography error value. The hidden layer structure of the network was adaptively optimized using a particle swarm optimization algorithm. The optimal number of hidden layers and neurons per layer were determined through intelligent search, thus achieving a balance between model complexity and prediction performance.
[0037] During optimization, the Particle Swarm Optimization (PSO) algorithm encodes network structure configurations as particles, each representing a potential network structure. By initializing the population, evaluating fitness, and updating velocity and position, the PSO searches for the optimal structure in the solution space. Fitness evaluation uses a validation set loss function to ensure that the selected structure not only performs well on the training data but also possesses excellent generalization ability. After multiple iterations, the network structure with the minimum validation loss is finally selected as the final configuration of the multilayer perceptron model.
[0038] During the model training phase, the mean squared error loss function (MSE) is used as the optimization objective. This function is sensitive to outliers and can effectively measure the overall prediction error, guiding the model to focus on improving global accuracy. After determining the optimal hidden layer configuration, the network parameters are fully trained using the training set data, and the model's generalization performance is evaluated using the test set. The final constructed multilayer perceptron prediction model fully integrates process parameters, spatial features, and intelligent optimization algorithms, enabling high-fidelity prediction of part surface morphology errors and providing strong support for high-precision assembly scenarios.
[0039] The specific implementation process of step 6 is as follows:
[0040] When facing a new machining accuracy prediction task, the process begins by dividing the data into a mesh to obtain the coordinates of each prediction point. Then, geometric parameters such as the centroid position, prediction point coordinates, centroid distance, and edge distance are calculated. Material property parameters are obtained from relevant literature based on the material type, tool geometry parameters are determined based on the selected tool, and machining process parameters are determined based on the machining process card. After preprocessing, these parameters are combined into an input vector, which is then used to predict the surface accuracy of the machining result through a multilayer perceptron model.
[0041] By processing geometric parameters, machining parameters, and material parameters using a multilayer perceptron, the discrete point matrix of the machining plane can be obtained, thus enabling the prediction of machining accuracy based on machining parameters.
[0042] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned method for predicting part planar topography errors based on a multilayer perceptron.
[0043] A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the aforementioned method for predicting part planar topography errors based on a multilayer perceptron.
[0044] Compared with the prior art, the advantages of the present invention are as follows:
[0045] Based on a multilayer perceptron, machining accuracy was predicted. In the data acquisition stage, an innovative non-uniform point cloud acquisition strategy was adopted, breaking through the limitations of traditional gridded sampling. This enabled more flexible data acquisition that better met actual engineering needs through an articulated arm measuring instrument. In the data processing stage, a systematic cleaning process combined with intelligent interpolation algorithms significantly improved data quality. Dynamic centroid calculation methods and Z-score normalization effectively solved the challenges of complex contour measurement and dimensional uniformity. The most groundbreaking aspect was the structured data modeling method, which organically integrated geometric parameters, material properties, tool parameters, and process parameters into a standardized dataset. A single-point correspondence pattern perfectly balanced data consistency and spatial distribution characteristics. This solution not only significantly improved measurement accuracy and analytical reliability, but its standardized output format also provided an ideal data foundation for subsequent machine learning modeling. It achieved high-precision prediction from machining parameters to surface morphology, providing strong technical support for intelligent manufacturing. A complete modeling process for predicting part machining errors was proposed, improving the efficiency of part machining accuracy prediction. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating the overall process flow of a part manufacturing error modeling method based on a neural network for process parameter information, implemented according to the present invention.
[0047] Figure 2 This is a schematic diagram for solving the index matrix.
[0048] Figure 3 A graph representing the composition of the training data.
[0049] Figure 4 Diagram showing how edge distance is calculated.
[0050] Figure 5 This is a schematic diagram of a multilayer perceptron. Detailed Implementation
[0051] The present invention will be further illustrated below with reference to the embodiments. The embodiments described below are illustrative and not limiting, and should not be used to limit the scope of protection of the present invention.
[0052] Example 1: See Figures 1-5 A method for predicting planar topography errors of parts based on multilayer perceptrons includes the following steps:
[0053] Step 1: Determine the index matrix.
[0054] The sampling area is defined based on the ideal geometric contour of the machining plane, discretized using sampling parameters, and an index matrix is obtained based on the shape of the plane to be machined.
[0055] Step 2: Obtain training data.
[0056] Obtain the geometric parameters of the part's plane, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, the machining process parameters, and the discrete values of the surface topography features at single points.
[0057] Step 3: Data preprocessing,
[0058] Data preprocessing includes data cleaning, feature extraction, and normalization. Step 4 involves preprocessing the initial data to construct the dataset.
[0059] A dataset is constructed using the geometric parameters of the pre-processed machining plane, material thermodynamic parameters, milling cutter geometry parameters, and machining process parameters as input parameters, and the discrete single-point surface topography feature values as output parameters.
[0060] Step 5: Construct and train a multilayer perceptron.
[0061] A multilayer perceptron model is constructed, and its structure is optimized using the example group algorithm. The multilayer perceptron is then trained on a dataset, enabling it to predict surface topography features. Step 6: Prediction of the plane to be processed.
[0062] The machining accuracy is predicted by using a multilayer perceptron and an index matrix obtained through training, based on the input vector composed of the geometric parameters of the plane to be machined, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, and the machining process parameters.
[0063] In step 1, the sampling area is defined based on the ideal geometric contour of the processing plane, discretized using sampling parameters, and an index matrix is obtained based on the shape of the plane to be processed.
[0064] (1) Using the smallest bounding rectangle to enclose the plane feature CAD geometry, let the length and width of the rectangle be a and b respectively. Establish a two-dimensional coordinate system with the upper left corner of the rectangle as the origin. Discretize the rectangle using the sampling parameter λ. The sampling parameter λ and the length and width of the rectangle determine the dimension of the discrete matrix, and have the following relationship:
[0065]
[0066] Where [] denotes the floor function, and m and n represent the number of rows and columns of the discrete matrix.
[0067] (2) In order to characterize the shape of the plane to be processed by a matrix, the numbers 1 and 0 are used to represent whether the position is within the plane to be processed. The geometric feature coverage area is set to 1, and the other areas are set to 0, forming a two-dimensional index matrix A of the discrete plane, and the index of the position with a value of 1 is a. ij As attached Figure 2 As shown in the figure. In step 2, the geometric parameters of the part plane, the material thermodynamic parameters, the milling cutter geometric parameters, the machining process parameters, and the discrete single-point surface morphology feature values are obtained. The input vector structure of the dataset is shown in the attached figure. Figure 3 As shown.
[0068] (1) Geometric parameter P g This includes: the coordinates (x, y) of the sampling point, the coordinates (x0, y0) of the centroid of the geometric shape, the distance l from the sampling point to the centroid of the plane, and the distance s from the sampling point to the edge. The method for determining the distance s from the sampling point to the edge is: determine the intersection point d of the ray formed by the centroid and the sampling point and the edge of the shape, and calculate the distance between point d and the sampling point. (See attached diagram.) Figure 4 As shown;
[0069] (2) Material thermodynamic parameter P m Including elastic modulus (E), Poisson's ratio (v), density (ρ), coefficient of linear expansion (α), and thermal conductivity (K);
[0070] (3) End mill geometry parameter P t Including the tool's principal cutting edge angle (K) r Secondary deflection angle (K') r ), rake angle (y), clearance angle (β), and tip radius (D);
[0071] (4) Processing parameters P p Including cutting speed (V) c ), feed rate (F), depth of cut (a) p ), feed per tooth (f) z );
[0072] (5) The discrete single-point surface morphology feature value is h ij This value represents the deviation of the sampling point from the ideal plane, with positive and negative signs indicating the direction.
[0073] Step 3 involves preprocessing the acquired data, which mainly includes:
[0074] (1) Data cleaning: First, the original measured point cloud data is cleaned to remove outliers and noise points caused by measurement errors, environmental interference, or equipment malfunctions. In addition, missing sample points are appropriately interpolated or deleted.
[0075] (2) Feature extraction: The enhanced data is registered to determine the nominal position of the processing plane, and then the deviation of each sampling point from the processing plane is determined, which is the single-point surface morphology feature value h. ij ,
[0076] (3) Normalization: Since the dimensions and ranges of the input features vary greatly, all input parameters are normalized using Z-Score standardization to ensure that all features are distributed in similar numerical ranges.
[0077]
[0078] In the above formula, x represents the original sample value, μ represents the mean of the feature, σ represents the standard deviation of the feature, and z represents the normalized value.
[0079] In step 4, the data set D is constructed using the material thermodynamic parameters, milling cutter geometry parameters, and machining process parameters of the machined plane as input parameters, and the discrete single-point surface morphology feature values as output parameters.
[0080] (1) Arrange the geometric parameters, material parameters, equipment parameters and processing parameters involved in a determined order into a row vector as the input vector, and use the collected discrete single-point surface morphology feature values as the output values.
[0081] (2) It should be noted that since multiple sampling points for single-point surface morphology feature values can be obtained after discretizing the plane in one machining operation, the number of sampling points varies with the degree of discretization and the size of the machined parts. To ensure the consistency of the output data format, single-point feature values are used as the output. If the discretization result contains N points, then N data points in the dataset can be obtained.
[0082] (3) The structure of the dataset is as follows:
[0083]
[0084] Wherein, dataset D consists of [D1, D2, ..., D k ] T Composition, in which each unit D i This represents data collected from the machined surface in a single machining operation. For the same machined surface, the material properties, tool shape parameters, and machining process parameters are identical. Therefore, for each data point... i The parameters of these three parts remain constant, but the geometric parameters and surface topography error of each sampling point change with the sampling point. For each data point... iWithin each unit, these data also differ. Specifically, in step 5, the surface accuracy is predicted using a multilayer perceptron model, and the neural network structure is adaptively optimized using a particle swarm optimization (PSO) algorithm. The structure of the multilayer perceptron is shown in the attached figure. Figure 5 As shown.
[0085] (1) Model structure design: The core of the shape error prediction model is a multilayer perceptron network structure. The input layer and output layer structure are designed based on the features of the dataset. The number of neurons in the input layer is 20 and the number of neurons in the output layer is 1. The number of hidden layers and the number of neurons in each layer are adaptively optimized by particle swarm optimization algorithm.
[0086]
[0087] In the above formula, n c m is the number of hidden layers. c The number of neurons in each hidden layer,
[0088] (2) The optimization process of the Particle Swarm Optimization (PSO) algorithm for the multilayer perceptron structure is as follows:
[0089] Step 1: Particle encoding. Each particle represents a network structure configuration. The particle length is the set maximum number of hidden layers, Lmax. Each dimension of the particle represents the number of neurons in the corresponding hidden layer.
[0090] Step 2: Initialize the population by randomly generating several particles with different network structures, with parameters within a set range.
[0091] Step 3: Fitness evaluation. For each particle in the population, an MLP model is built based on its structure. After inputting the training data, the loss function of the validation set is used as the fitness.
[0092] Step 4: Position and velocity updates. Particles continuously adjust their structural parameters based on historical and global optima, avoiding getting trapped in local optima through swarm intelligence search.
[0093] Step 5: Output the optimal structure. After completing the iteration, select the network structure with the minimum validation loss as the final configuration of the MLP for subsequent training and testing on the dataset.
[0094] (3) Loss function selection: Considering the sensitivity to outliers and the model convergence characteristics, the mean squared error loss function (MSE) is adopted as the optimization objective for network training:
[0095]
[0096] In the above formula, y i This is due to the error in the actual shape. Here, M represents the model's predicted value, and M represents the number of samples.
[0097] (4) Model training and application: After completing the particle swarm algorithm, the network parameters are trained using the training set, and the generalization performance of the model is evaluated using the test set.
[0098] In step 6, the machining accuracy is predicted by a neural network obtained through training based on the geometric shape parameters of the plane to be machined, the thermodynamic parameters of the material, the geometric shape parameters of the milling cutter, and the machining process parameters. (1) The discrete matrix is divided according to the geometric contour of the plane to be machined and the sampling parameters. The value of each element of the matrix is determined according to whether each sampling point of the discrete matrix is within the contour of the set: if the point is inside the contour, the element is marked as 1, otherwise it is marked as 0.
[0099] (2) The geometric parameters, processing parameters, material parameters and processing equipment parameters of the prediction points are used as the input of the network according to the structural organization data proposed above, and the trained MLP model is called to calculate the output.
[0100] Example 2: The sources of error during part machining mainly include machine tool and cutting tool errors, workpiece material deformation, fixture and positioning errors, and the influence of environmental factors. Therefore, the accuracy of the plane in the milling process is related to the blank material constant, tool geometry parameters, and machining process parameters. Simultaneously, its surface morphology features have geometric correlation, i.e., they are related to its location. A multilayer perceptron can be used to establish the relationship between these parameters and the final machining result, realizing a method for modeling the plane manufacturing error of parts. This process is described in detail below with reference to milling machining details.
[0101] To obtain the data, the index matrix is first determined based on the geometric contour of the part. Then, its smallest bounding rectangle is used for discretization, discretized using sampling parameters. Assuming the length and width of the bounding rectangle are a and b respectively, then:
[0102]
[0103] Where [] denotes the floor function, and m and n represent the number of rows and columns of the discrete matrix. After discretization, the corresponding matrix is obtained. The row and column indices of the matrix elements correspond to their positions on the milling plane. Depending on whether the position is inside the plane to be machined, the value of the element at the corresponding position is set to 1 or 0. That is, if the corresponding position is inside the plane to be machined, the element is set to 1, and otherwise it is set to 0, so as to handle various shapes of the plane to be machined.
[0104] Obtain geometric parameters and output parameters, i.e., the surface topography feature values of discrete points. The surface point cloud of the machining result is acquired using an articulated arm measuring instrument. After preprocessing the point cloud (outlier removal, registration), the planar point cloud value of the machining result in the machine tool coordinate system is obtained. The xy coordinates of the point cloud value are the position coordinates of the corresponding point in the machine tool coordinate system. The z-value can be used to calculate the deviation of the point from the nominal plane, i.e., the surface topography feature value. The centroid position of the machining plane is calculated using a discrete matrix, and then the centroid distance and edge distance are calculated. The geometric parameter P is obtained. g Based on the material of the blank, the following thermodynamic parameters of the material were obtained by consulting relevant handbooks: elastic modulus (E), Poisson's ratio (v), density (ρ), coefficient of linear expansion (α), and thermal conductivity (K). m Obtain the milling cutter geometry parameter P by consulting the manual of the selected tool. t : Tool principal cutting edge angle (Kr), secondary cutting edge angle (K'r), rake angle (y), clearance angle (β), tool tip radius (D); obtain machining process parameters P by referring to the process card. p Cutting speed (Vc), feed rate (F), depth of cut (ap), feed per tooth (fz);
[0105] To construct a Multilayer Perceptron (MLP), we first need to build a dataset and use the above parameters to form the input vector for the MLP:
[0106] data i =[x,y,x0,y0,s,l,E,v,ρ,α,K,K r ,K′ r ,y,β,D,V c ,F,a p ,f z (6) The discrete surface topography features of the machining results are used as the output of the network. It should be noted that for a single machining operation, the material parameters, tool parameters, and machining process parameters are fixed, but the geometric parameters and surface topography feature values of each point are different. The amount of data is related to the number of sampling points. By processing multiple times and collecting the corresponding data, a dataset of a certain scale D = {data1, data2, ..., data...} can be obtained. n}, used for training multilayer perceptrons.
[0107] After obtaining dataset D, a multilayer perceptron is trained on dataset D. The hidden layer structure of the multilayer perceptron is optimized using the particle swarm optimization algorithm to achieve the optimal choice of network structure and performance. The trained multilayer perceptron yields a data model. This model takes the row vector of processing parameters as input and the single-point processing morphology as output, and can predict the single-point processing morphology result based on the processing parameters.
[0108] When faced with a new task of predicting machining accuracy, the first step is to divide the index matrix. (See attached image.) Figure 2 As shown, the feature plane is discretized using a sparse matrix, and an index matrix A is formed based on the geometric contour of the feature plane and the sampling parameters. Assume the shape parameters of the minimum envelope rectangle of the feature plane are a and b, both in meters, and the sampling parameter is t, also in meters. -1 The resulting index matrix A has dimensions (a·t, b·t). Elements in the regions to be processed have values of 1, while elements in other regions have values of 0.
[0109]
[0110] Here, U represents the portion of the index matrix A that overlaps with the area to be processed. All elements in index matrix A with a flag value of 1 are traversed. For each element, its spatial coordinates are calculated based on its row and column indices, and then the remaining geometric parameters are calculated. These geometric parameters, material parameters, tool parameters, and machining parameters are preprocessed to form an input vector, which is then input into a multilayer perceptron for processing. The corresponding output surface topography error is obtained, and the element values at the corresponding positions in the index matrix are replaced. This process constructs the surface topography matrix and models the surface topography error.
[0111] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting planar topography errors of parts based on multilayer perceptrons, characterized in that, Includes the following steps: Step 1: Determine the index matrix. The minimum envelope rectangle is obtained based on the geometry of the plane to be processed. The dimension of the index matrix is determined based on the length and width values of the minimum envelope rectangle and the sampling parameters. Then, the values of each element in the index matrix are determined based on the index coordinates of the matrix elements. Step 2: Obtain training data. Obtain the geometric parameters of the part's plane, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, the machining process parameters, and the discrete values of the surface topography features at single points. Step 3: Data preprocessing, Data preprocessing includes data cleaning, feature extraction, and normalization operations, which preprocess the initial data. Step 4: Build the dataset. A dataset is constructed using the geometric parameters of the pre-processed machining plane, material thermodynamic parameters, milling cutter geometry parameters, and machining process parameters as input parameters, and the discrete single-point surface topography feature values as output parameters. Step 5: Construct and train a multilayer perceptron. A multilayer perceptron model is constructed, and its structure is optimized using the example grouping algorithm. The multilayer perceptron is then trained on a dataset, enabling it to predict surface morphology features. Step 6: Prediction of the plane to be processed. The machining accuracy is predicted by using a multilayer perceptron and an index matrix trained on the input vector composed of the geometric parameters of the plane to be machined, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, and the machining process parameters. In step 1, the minimum envelope rectangle is obtained based on the geometry of the plane to be processed. The dimension of the index matrix is determined based on the length and width values of the minimum envelope rectangle and the sampling parameters. Then, the values of each element in the index matrix are determined based on the index coordinates of the matrix elements. (1) Find the minimum envelope rectangle of the machining surface of the part to be machined. Using the smallest circumscribed rectangle as the envelope plane feature CAD geometry, let the length and width of this rectangle be a and b, respectively. Establish a two-dimensional coordinate system within the machining plane with the top left corner of the rectangle as the origin, and then sample parameters... Discretize the rectangle; the dimension of the discrete matrix is determined by the sampling parameters. Given the rectangle's length and width dimensions, the relationship between these parameters can be expressed as: Where [] denotes the floor function, and m and n represent the number of rows and columns of the discrete matrix. (2) In order to characterize the shape of the plane to be processed by a matrix, the numbers 1 and 0 are used to represent whether the position is within the plane to be processed. The geometric feature coverage area is set to 1, and the other areas are set to 0, forming a two-dimensional index matrix A of the discrete plane. The index of the position with a value of 1 is a. ij; In step 2, the geometric parameters of the part plane, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, the machining process parameters, and the discrete single-point surface morphology feature values are obtained. (1) Geometric parameters Includes: the coordinates (x, y) of the sampling point, and the centroid coordinates of the geometric shape. Distance of sampling point from the centroid of the plane The distance s from the sampling point to the edge is determined by: finding the intersection point d of the ray formed by the centroid and the sampling point with the edge of the shape, and then calculating the distance d between point d and the sampling point. (2) Material thermodynamic parameters Including elastic modulus (E), Poisson's ratio (v), density (ρ), coefficient of linear expansion (α), thermal conductivity ( ); (3) End mill geometry parameters Including the tool's principal cutting edge angle (K) r Secondary deflection angle (K') r ), rake angle (y), clearance angle (β), and blade tip radius (D); (4) Processing parameters Including cutting speed (V) c ), feed rate (F), depth of cut (a) p ), feed per tooth (f) z ); (5) The discrete single-point surface morphology feature value is h ij This value represents the deviation of the sampling point from the ideal plane, with positive and negative signs indicating the direction. In step 3, the acquired data is preprocessed, mainly including: (1) Data cleaning: First, the original measured point cloud data is cleaned to remove outliers and noise points caused by measurement errors, environmental interference or equipment malfunctions. In addition, for missing sample points, reasonable interpolation or deletion is performed. (2) Feature extraction: The enhanced data is registered to determine the nominal position of the processing plane, and then the value of each sampling point deviating from the processing plane is determined, which is the single-point surface morphology feature value h. ij (3) Normalization: Since the dimensions and ranges of each input feature are quite different, all input parameters are normalized. By using Z-Score standardization, all features are distributed in similar numerical ranges. In the above formula, x represents the original sample value, μ represents the mean of the feature, σ represents the standard deviation of the feature, and z represents the normalized value. In step 4, a dataset is constructed using the material thermodynamic parameters, milling cutter geometry parameters, and machining process parameters of the machined plane as input parameters, and the discrete single-point surface morphology feature values as output parameters. , (1) Arrange the geometric parameters, material parameters, equipment parameters and processing parameters involved in a determined order into a row vector as the input vector, and use the collected discrete single-point surface morphology feature values as the output values. (2) To ensure the consistency of the output data format, single-point feature values are used as output. If the discrete result contains N points, then N data points in the dataset can be obtained. (3) The structure of the dataset is as follows: Wherein, dataset D is composed of Composition, in which each unit This represents data collected from the machined surface in a single machining operation. For the same machined surface, the material properties, tool shape parameters, and machining process parameters are identical. Therefore, for each... The parameters of these three parts remain constant, but the geometric parameters and surface topography error of each sampling point change with the sampling point. For each Within a single unit, these data also differ. In step 5, the surface accuracy is predicted using a multilayer perceptron model, and the neural network structure is adaptively optimized using a particle swarm optimization (PSO) algorithm. (1) Model structure design: The core of the shape error prediction model is a multilayer perceptron network structure. The input layer and output layer structure are designed according to the features of the dataset. The number of neurons in the input layer is 20 and the number of neurons in the output layer is 1. The number of hidden layers and the number of neurons in each layer are adaptively optimized by particle swarm optimization algorithm. In the above formula, The number of hidden layers. The number of neurons in each hidden layer (2) The optimization process of the particle swarm optimization algorithm for the multilayer perceptron structure based on PSO is as follows: Step 1: Particle encoding. Each particle represents a network structure configuration. The particle length is the set maximum number of hidden layers, Lmax. Each dimension of the particle represents the number of neurons in the corresponding hidden layer. Step 2: Initialize the population by randomly generating several particles with different network structures, with parameters within a set range. Step 3: Fitness evaluation. For each particle in the population, an MLP model is built based on its structure. After inputting the training data, the loss function of the validation set is used as the fitness. Step 4: Position and velocity updates. Particles continuously adjust their structural parameters based on historical and global optima, avoiding getting trapped in local optima through swarm intelligence search. Step 5: Output the optimal structure. After completing the iteration, select the network structure with the minimum validation loss as the final configuration of the MLP for subsequent training and testing on the dataset. (3) Loss function selection: Considering the sensitivity to outliers and the model convergence characteristics, the mean squared error loss function (MSE) is adopted as the optimization objective for network training: In the above formula, To account for the actual shape error, The value is the model prediction, and M is the number of samples. (4) Model training and application: After completing the particle swarm optimization algorithm, the network parameters are trained using the training set, and the generalization performance of the model is evaluated using the test set. In step 6, the machining accuracy is predicted by a neural network trained based on the geometric parameters of the plane to be machined, the thermodynamic parameters of the material, the geometric parameters of the milling cutter, and the machining process parameters. (1) The discrete matrix is divided according to the geometric contour of the plane to be machined and the sampling parameters. The value of each element of the matrix is determined according to whether each sampling point of the discrete matrix is within the contour of the set: if the point is inside the contour, the element is marked as 1, otherwise it is marked as 0. (2) The geometric parameters, machining process parameters, material parameters and machining equipment parameters of the predicted points are organized into data according to the structure proposed above as the input of the network, and the trained MLP model is called to calculate the output.
2. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the part planar topography error prediction method based on multilayer perceptron as described in claim 1.
3. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instruction is executed by the processor, it implements the part planar topography error prediction method based on a multilayer perceptron as described in claim 1.