Grinding wheel grinder error compensation method and device, computer equipment, readable storage medium and program product

By obtaining the process parameters of the grinding wheel, and using the error prediction model for error prediction and compensation, the problem of poor error compensation accuracy in the existing technology of grinding wheel is solved, and higher machining accuracy is achieved.

CN120055899BActive Publication Date: 2025-11-18CHINA NAT MASCH INST GRP YUNNAN BRANCH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411965045.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-11-18
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Existing error compensation methods for grinding wheels have poor accuracy after compensation and are difficult to control geometric and thermal errors simultaneously, resulting in low machining accuracy.

Method used

By acquiring the process parameters of the grinding wheel, error prediction is performed using an error prediction model. Error compensation is then performed by combining the predicted geometric and thermal errors. The error prediction model is generated through training on the actual geometric and thermal errors of the sample workpiece, taking into account both geometric and thermal error factors.

Benefits of technology

It significantly improves the machining accuracy of grinding wheels. By simultaneously considering geometric and thermal error factors for error compensation, the effect is more significant than that of single-factor compensation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120055899B_ABST
    Figure CN120055899B_ABST
Patent Text Reader

Abstract

The application relates to a grinding wheel grinder error compensation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a first process parameter of a grinding wheel grinder corresponding to a workpiece to be measured; inputting the process parameter into an error prediction model, and acquiring an error prediction result output by the error prediction model; the error prediction result is determined based on a predicted geometric error and a predicted thermal error; the error prediction model is generated after being trained by taking a second process parameter of a grinding wheel grinder corresponding to a sample workpiece, a real geometric error and a real thermal error of the sample workpiece as a sample set; and the relative position of the grinding wheel grinder is compensated according to the error prediction result, wherein the relative position represents the position of the grinding wheel grinder and the workpiece to be measured. The method can improve the accuracy of the grinding wheel grinder in grinding the workpiece.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of grinding machine error analysis technology, and in particular to a grinding wheel dust error compensation method, device, computer equipment, computer-readable storage medium and computer program product. Background Technology

[0002] With the development of machine learning technology, machine learning models have been applied in the field of machine tools.

[0003] If both geometric and thermal errors can be controlled simultaneously, machining accuracy can be significantly improved. However, the mapping relationship between the geometric accuracy and machine tool error of a grinding wheel is unclear, making precise error compensation difficult. When one is compensated while the other is uncontrolled, the error compensation effect is poor.

[0004] However, current error compensation methods still suffer from poor accuracy after compensation. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for error compensation of grinding wheels that can improve accuracy in addressing the aforementioned technical problems.

[0006] In a first aspect, this application provides a method for error compensation in a grinding wheel machine, the method comprising:

[0007] Obtain the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested;

[0008] The process parameters are input into the error prediction model, and the error prediction result output by the error prediction model is obtained; the error prediction result is determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric error and the actual thermal error of the sample workpiece as the sample set;

[0009] The relative position of the grinding wheel is compensated for based on the error prediction result, wherein the relative position represents the position of the grinding wheel and the workpiece to be tested.

[0010] In one embodiment, the error prediction model is trained in the following ways:

[0011] The input layer obtains the actual geometric error and the actual thermal error of each sample workpiece under different working conditions of the grinding wheel, as well as the second process parameters of each sample workpiece; wherein, the second process parameters include the grinding wheel speed, feed rate, and depth of cut;

[0012] The feature vector is obtained by extracting the feature values ​​of the second process parameters of each sample workpiece through the input layer;

[0013] The hidden layer determines a first output feature vector and a second output feature vector based on the target weight matrix, the target bias matrix, and the feature vector; wherein the first output feature vector indicates the vector of predicted geometric error; and the second output feature vector indicates the vector of predicted thermal error.

[0014] The first and second feature vectors to be output are transformed into error prediction results through the output layer;

[0015] The difference between the error prediction result and the actual error is calculated using a loss function; wherein the actual error includes the actual geometric error and the actual thermal error; and the error prediction model is obtained when the loss function satisfies a preset accuracy.

[0016] In one embodiment, the method for determining the target weight matrix and the target bias matrix includes:

[0017] Obtain the initial weight matrix and the initial bias matrix;

[0018] The initial weight matrix and the initial bias matrix are optimized using a genetic algorithm to obtain the target solution; wherein the target solution includes the target weight matrix and the target bias matrix.

[0019] In one embodiment, obtaining the initial weight matrix and the initial bias matrix includes:

[0020] Obtain the mean, standard deviation, and initial constant values ​​of the Gaussian distribution;

[0021] The first function is invoked to determine the initial weight matrix based on the mean of the Gaussian distribution and the standard of the Gaussian distribution;

[0022] The second function is called to determine the initial bias matrix based on the constant initialization value.

[0023] In one embodiment, optimizing the initial weight matrix and the initial bias matrix using a genetic algorithm to obtain the target solution includes:

[0024] The initial weight matrix is ​​encoded to obtain the initial weight code; the initial bias matrix is ​​encoded to obtain the initial bias code.

[0025] An initial solution set is randomly generated based on the initial weight encoding and the bias encoding. The initial solution set includes at least one initial solution, and each initial solution represents a set of weight matrices and bias matrices of the error prediction model.

[0026] The fitness function is used to perform adaptive calculations on each initial solution, and selection, crossover, and mutation processes are performed based on the calculation results to generate a new set of initial solutions; wherein, the fitness function represents the difference between the error prediction result output under the weight matrix and the bias matrix corresponding to each initial solution and the actual error.

[0027] Until the preset conditions are met, the new initial set of solutions that meet the preset conditions will be used as the candidate set of solutions.

[0028] The target solution is determined from the candidate solution set according to the selection rules.

[0029] In one embodiment, the target weight matrix is ​​updated in the following way:

[0030] Obtain the historical weight matrix, learning rate, and loss function;

[0031] The target weight matrix is ​​determined based on the historical weight matrix, the learning rate, and the loss function.

[0032] The update method for the target bias matrix includes:

[0033] Obtain the historical bias matrix, learning rate, and loss function;

[0034] The target bias matrix is ​​determined based on the bias matrix, the learning rate, and the loss function.

[0035] Secondly, this application also provides an error compensation device for a grinding wheel machine, the device comprising:

[0036] The acquisition module is used to acquire the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested;

[0037] The processing module is used to input the process parameters into the error prediction model and obtain the error prediction result output by the error prediction model; the error prediction result is determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric error and the actual thermal error of the sample workpiece as the sample set;

[0038] The compensation module is used to compensate for the relative position of the grinding wheel machine based on the error prediction result, wherein the relative position represents the position of the grinding wheel machine and the workpiece to be measured.

[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0042] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for error compensation of grinding wheels first obtain the first process parameters of the grinding wheel corresponding to the workpiece to be tested; second, input the process parameters into an error prediction model and obtain the error prediction results output by the error prediction model; the error prediction results are determined based on predicted geometric errors and predicted thermal errors; the error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric errors of the sample workpiece, and the actual thermal errors of the sample workpiece as the sample set; the error prediction model considers both geometric and thermal error factors simultaneously, and is generated after training with the actual geometric and thermal errors of the sample workpiece as the sample set; finally, error compensation is performed on the relative position of the grinding wheel based on the error prediction results. The error compensation is based on the simultaneous consideration of geometric and thermal error factors, and compared with considering only a single factor of geometric or thermal error, the compensation effect is significant, thereby improving the accuracy of grinding workpieces by the grinding wheel to a certain extent. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is an application environment diagram of the grinding wheel error compensation method in one embodiment;

[0045] Figure 2 This is a flowchart illustrating an error compensation method for a grinding wheel in one embodiment;

[0046] Figure 3 This is a flowchart illustrating the training method of an error prediction model in one embodiment;

[0047] Figure 4 This is a flowchart illustrating how the target weight matrix and target bias matrix are determined in one embodiment.

[0048] Figure 5This is a flowchart illustrating the process of obtaining the initial weight matrix and the initial bias matrix in one embodiment;

[0049] Figure 6 This is a schematic diagram illustrating the process of obtaining the target solution using a genetic algorithm in one embodiment;

[0050] Figure 7 This is a flowchart illustrating the update method of the target weight matrix and the target bias matrix in one embodiment;

[0051] Figure 8 This is a structural block diagram of the error compensation device for a grinding wheel machine in one embodiment;

[0052] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] The grinding wheel error compensation method provided in this application embodiment can be applied to, for example, grinding machines. Figure 1 In the application environment shown, the grinding wheel machine 102 communicates with the server 104 via a network. A data storage system can store the data that the server 104 needs to process. The data storage system can be integrated onto the server 104 or placed on a cloud or other network server. The server obtains the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested; inputs the process parameters into an error prediction model and obtains the error prediction result output by the error prediction model; the error prediction result is determined based on predicted geometric error and predicted thermal error; the error prediction model is generated after training with the second process parameters of the grinding wheel machine corresponding to the sample workpiece, the actual geometric error of the sample workpiece, and the actual thermal error as the sample set; error compensation is performed on the relative position of the grinding wheel machine according to the error prediction result, where the relative position represents the position of the grinding wheel machine relative to the workpiece to be tested. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The grinding wheel machine error compensation method involved in this application embodiment can be applied to a grinding wheel machine error compensation device, and the communication signal type identification device can be the aforementioned grinding wheel machine.

[0055] In one exemplary embodiment, such as Figure 2 As shown, an error compensation method for a grinding wheel machine is provided, which is applied to... Figure 1 Taking the server in the example, the explanation includes the following steps S202 to S206. Wherein:

[0056] Step S202: Obtain the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested.

[0057] The first process parameter is the process parameter for machining the workpiece to be tested, such as grinding wheel speed, feed rate, depth of cut, and coefficient of thermal expansion of the material.

[0058] Optionally, the server obtains the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested, as shown in Table 1.

[0059] Table 1 First process parameters of the workpiece to be tested

[0060]

[0061] Step S204: Input the first process parameter into the error prediction model and obtain the error prediction result output by the error prediction model; the error prediction result is determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameter of the grinding wheel corresponding to the sample workpiece, the actual geometric error of the sample workpiece, and the actual thermal error as the sample set.

[0062] The error prediction model can be a neural network model.

[0063] Optionally, before inputting the first process parameter into the error prediction model, the server trains the initial error prediction model using the second process parameter of the grinding wheel corresponding to the sample workpiece, the true geometric error of the sample workpiece, and the true thermal error of the sample workpiece as samples.

[0064] Optionally, the server inputs the first process parameters into the trained error prediction model and obtains the error prediction result output by the error prediction model. The error prediction model includes two output neurons: one neuron outputs the predicted geometric error, and the other neuron outputs the predicted thermal error. The error prediction result is determined based on the predicted geometric error and the predicted thermal error.

[0065] Step S206: Perform error compensation on the relative position of the grinding wheel machine based on the error prediction results.

[0066] The relative position represents the position of the grinding wheel and the workpiece being measured.

[0067] Optionally, the server can perform error compensation on the relative position of the grinding wheel machine based on the error prediction results, such as adjusting the controller parameters of the grinding wheel machine to complete the error compensation.

[0068] In the above-mentioned error compensation method for grinding wheels, firstly, the first process parameters of the grinding wheel corresponding to the workpiece to be tested are obtained; secondly, the process parameters are input into the error prediction model, and the error prediction results output by the error prediction model are obtained; the error prediction results are determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric error and the actual thermal error of the sample workpiece as the sample set; the error prediction model considers both geometric error and thermal error factors, and is generated after training with the actual geometric error and the actual thermal error of the sample workpiece as the sample set; finally, error compensation is performed on the relative position of the grinding wheel based on the error prediction results. The error compensation is based on the simultaneous consideration of geometric error and thermal error factors. Compared with considering only geometric error or thermal error as a single factor, the compensation effect is significant, thereby improving the accuracy of grinding wheels in polishing workpieces to a certain extent.

[0069] Following the above embodiments, such as Figure 3 As shown, the error prediction model training method includes steps S302 to S310. Wherein:

[0070] Step S302: Obtain the true geometric error and true thermal error of each sample workpiece under different working conditions of the grinding wheel machine through the input layer, as well as the second process parameters of each sample workpiece.

[0071] The second process parameter is the parameter corresponding to the sample workpiece, including grinding wheel speed, feed rate, depth of cut, material thermal expansion coefficient, etc.

[0072] The error prediction model consists of an input layer, a hidden layer, and an output layer.

[0073] Optionally, geometric and thermal error data of the grinding wheel machine under different operating conditions are collected, along with corresponding second process parameters (such as grinding wheel speed, feed rate, depth of cut, etc.) and temperature data. The server obtains the actual geometric and thermal errors of each sample workpiece under different operating conditions of the grinding wheel machine, as well as the second process parameters of each sample workpiece, as shown in Table 2. The obtained actual geometric and thermal errors of each sample workpiece under different operating conditions of the grinding wheel machine, as well as the second process parameters of each sample workpiece, are input to the input layer.

[0074] The measurement of true geometric errors involves using high-precision measuring equipment (such as laser rangefinders and coordinate measuring machines) to measure the geometric accuracy of the machine tool. Measurement items include: radial runout and axial runout of the grinding wheel spindle, parallelism between the grinding wheel and the worktable, and coaxiality between the headstock and tailstock. Measurement data are recorded, and the magnitude of each geometric error is calculated.

[0075] To measure the true thermal error, after the machine tool has been running for a period of time, the temperature of key parts of the machine tool is measured using temperature measuring equipment such as infrared thermometers or thermocouples. Measurement areas include: the grinding wheel area, spindle bearings, table guide rails, and coolant tank. Temperature data is recorded, and the temperature distribution and trends are analyzed.

[0076] Record the current settings of the grinding wheel, such as wheel speed, feed rate, and depth of cut. When recording measurements, consider external conditions such as ambient temperature and humidity to account for their impact on error during subsequent data analysis.

[0077] Table 2 Second process parameters of sample workpieces

[0078]

[0079] Step S304: Extract the feature values ​​of the second process parameters of each sample workpiece through the input layer to obtain the feature vector.

[0080] Optionally, the server extracts the feature values ​​of the second process parameters of each sample workpiece through the input layer to obtain a feature vector, so that the hidden layer can perform mathematical operations on the feature vector.

[0081] Step S306: The first and second feature vectors to be output are determined by the hidden layer based on the target weight matrix, the target bias matrix, and the feature vectors.

[0082] The first feature vector to be output indicates the vector of predicted geometric error; the second feature vector to be output indicates the vector of predicted thermal error.

[0083] In practical applications, hidden layers process feature vectors through a series of complex mathematical operations (such as weighted summation and activation functions) to extract useful features. These features may include various higher-level representations related to the process. The relationship between the second process parameter, the true geometric error, and the true thermal error, which are transformed into feature vectors, is reflected through the nonlinear transformations of the neural network's weights and biases, as well as the activation functions. These relationships are learned and optimized during the training of the neural network to better predict and explain various phenomena in the process.

[0084] Optionally, the server performs a linear transformation on the feature vectors of the input layer through the target weight matrix and target bias matrix of the hidden layer to obtain the input value of each neuron. The linearly transformed input value is then subjected to a non-linear transformation through an activation function to obtain the output value of each neuron, which is the first and second feature vectors to be output.

[0085] Step S308: The first and second feature vectors to be output are converted into error prediction results through the output layer.

[0086] Optionally, the server determines the error prediction result jointly by the output layer based on the first and second feature vectors to be output.

[0087] Step S310: Calculate the difference between the error prediction result and the actual error using the loss function; if the loss function meets the preset accuracy requirement, obtain the error prediction model.

[0088] The true error includes the true geometric error and the true thermal error.

[0089] Optionally, the difference between the predicted error and the actual error can be calculated using a loss function. A cross-entropy loss function can be used, as shown in equations (1) and (2). If the loss function satisfies the preset accuracy, the error prediction model is obtained. If the loss function does not satisfy the preset accuracy, the parameters are adjusted until they are satisfied.

[0090]

[0091] In the formula, N is the number of samples, y i This is the actual error. It is the prediction error.

[0092] In this embodiment, by training the error prediction model with the feature values ​​of the second process parameters of each sample workpiece and the actual error, a trained error prediction model can be obtained. Using the error prediction model to perform error prediction improves the accuracy of error prediction.

[0093] In one exemplary embodiment, such as Figure 4 As shown, the method for determining the target weight matrix and the target bias matrix includes steps S402 to S404. Wherein:

[0094] Step S402: Obtain the initial weight matrix and the initial bias matrix.

[0095] Optionally, the weight matrix and bias matrix are initialized before obtaining the initial weight matrix and initial bias matrix. The weight matrix can be initialized randomly, for example, using a Gaussian distribution (normal distribution): the weights are randomly sampled from a Gaussian distribution with a mean of zero and a standard deviation of σ. Commonly used distributions include the standard normal distribution (mean of 0, standard deviation of 1) and the scaled normal distribution (mean of 0, standard deviation of 1 / √n, where n is the number of input neurons). Alternatively, it can be initialized using a uniform distribution: the weights are randomly selected from a uniform distribution. For example, they can be uniformly distributed within the interval [-1, 1] or within the interval [-1 / √n, 1 / √n], where n is the number of input neurons.

[0096] The bias weight matrix can be initialized by setting it to 0 or by using small random values ​​to avoid inhibiting some neurons in the early stages of training.

[0097] Optionally, the server obtains the initialized weight matrix and bias matrix, that is, obtains the initial weight matrix and initial bias matrix.

[0098] Step S404: Optimize the initial weight matrix and initial bias matrix using a genetic algorithm to obtain the target solution; wherein the target solution includes the target weight matrix and the target bias matrix.

[0099] Optionally, the server can optimize the initial weight matrix and initial bias matrix using a single-objective genetic algorithm or a multi-objective genetic algorithm to obtain the objective solution; wherein the objective solution includes the objective weight matrix and the objective bias matrix.

[0100] In this embodiment, the target weight matrix and target bias matrix of the error prediction model can be gradually optimized through a genetic algorithm, thereby finding a set of parameters that can better map the relationship between the input features (second process parameters) and the output targets (true geometric error and true thermal error), thereby improving the accuracy of the error prediction model.

[0101] In practical applications, the initialization of the initial weight matrix and the initial bias matrix is ​​not fixed. Obtaining the initial weight matrix and the initial bias matrix may also include steps S502 to S506. Wherein:

[0102] Step S502: Obtain the mean, standard deviation, and constant initialization values ​​of the Gaussian distribution.

[0103] In practical applications, for example, a weight matrix of shape (X, Y) is initialized for an error prediction model, and it is desirable that the weights are drawn from a Gaussian distribution with a mean (μ) of 0 and a standard deviation (σ) of 0.01. This initialization method helps break symmetry at the start of training and helps the neural network learn better. Here, X and Y are natural numbers greater than 0.

[0104] Optionally, the server obtains the mean (μ) and standard deviation (σ) of the Gaussian distribution, constant initialization values, such as any natural number.

[0105] Step S504: Call the first function to determine the initial weight matrix based on the mean and standard of the Gaussian distribution.

[0106] Optionally, the server can call the first function np.random.normal to generate random numbers from a specified Gaussian distribution and return the initial weight matrix based on the mean (μ) and standard deviation (σ) of the Gaussian distribution.

[0107] Step S506: Call the second function to determine the initial bias matrix based on the constant initialization value.

[0108] Optionally, the server calls the second function bias_variable, which returns a bias matrix (or vector) whose elements are initialized to constant initialization values.

[0109] In this embodiment, initialization using a Gaussian distribution (normal distribution) and a small constant can accelerate the convergence speed of the gradient descent of the loss function and reduce training time.

[0110] In one exemplary embodiment, such as Figure 6 As shown, the initial weight matrix and initial bias matrix are optimized using a genetic algorithm to obtain the target solution, including steps S602 to S610. Wherein:

[0111] Step S602: Encode the initial weight matrix to obtain the initial weight code; encode the initial bias matrix to obtain the initial bias code.

[0112] Optionally, the server encodes the initial weight matrix to obtain the initial weight code; and encodes the initial bias matrix to obtain the initial bias code. For example, real-number encoding can be used to represent the initial weight matrix and initial bias moments as chromosomes (individuals) in a genetic algorithm.

[0113] Step S604: Randomly generate an initial solution set based on the initial weight encoding and bias encoding.

[0114] The initial solution set includes at least one initial solution. Each initial solution represents a set of weight matrices and bias matrices of the error prediction model. Each initial solution is a chromosome individual.

[0115] Optionally, the server determines the optimization objective and fitness function of the target genetic algorithm according to instructions. For example, the fitness function represents the difference between the predicted error and the actual error under the weight matrix and bias matrix corresponding to each initial solution. The target genetic algorithm initializes the population according to the scores corresponding to each performance index, randomly generates an initial solution set, and the server determines the gene encoding of each chromosome individual (initial solution), for example, using bit strings or real number encoding to represent different configuration parameters.

[0116] Step S606: Perform fitness calculation on each initial solution using the fitness function, and perform selection, crossover, and mutation processing based on the calculation results to generate a new set of initial solutions.

[0117] The fitness function represents the difference between the predicted error and the actual error under the weight and bias matrices corresponding to each initial solution. The mean squared error (MSE) serves as the metric for fitness. A smaller fitness function indicates a higher fitness level for the individual.

[0118] Optionally, the server scores all objectives for each chromosome individual (initial solution) according to a fitness function, calculating the Pareto rank and non-dominance level of each chromosome individual (initial solution). Based on the Pareto rank and non-dominance level of each chromosome individual (initial solution), as well as other selection pressures (such as crowding distance), superior chromosome individuals (initial solutions) are selected to enter the next generation. The selected superior chromosome individuals (initial solutions) are paired, and a crossover operation is applied to generate new offspring chromosome individuals (initial solutions). A mutation operation is applied to the new offspring chromosome individuals (initial solutions) to introduce new genetic diversity, generating a new set of initial solutions.

[0119] Step S608, until the preset conditions are met, the new initial solution set that meets the preset conditions is taken as the candidate solution set.

[0120] The preset conditions include a predetermined number of iterations or other termination conditions.

[0121] Optionally, the server performs adaptive computation on the new initial solution set using an adaptive function. The Pareto rank and non-dominated level of each chromosome individual (initial solution) are used for selection, crossover, and mutation based on the Pareto rank and non-dominated level to generate a new initial solution set. This process continues until preset conditions are met, such as whether a predetermined number of iterations has been reached or other termination conditions are met (e.g., the Pareto front change is less than a certain threshold). The new initial solution set that meets these preset conditions is then used as a candidate solution set. The candidate solution set includes at least one candidate solution.

[0122] Step S610: Determine the target solution from the candidate solution set according to the selection rules.

[0123] Optionally, the server determines a unique target solution from at least one candidate solution in the candidate solution set according to a selection rule. The selection rule is determined based on minimizing the error, such as minimizing the variance.

[0124] In practical applications, the process terminates and outputs the optimal solution or a set of excellent solutions when the preset number of iterations is reached or the population diversity decreases to a certain level. The individual with the highest fitness value is extracted from the final population and used as the combination of the target weight matrix and target bias matrix for the optimal error prediction model.

[0125] Assume an initial population size of 50 and 100 iterations. Randomly generate 50 sets of neural network weights and biases as the initial population, and calculate the fitness value of each individual using the training set data. Then, select the best individuals based on their fitness values ​​for crossover and mutation operations to generate a new population. After several generations of evolution, extract the individual with the highest fitness value as the optimal solution.

[0126] In this embodiment, the accuracy of the error prediction model can be improved by optimizing the weight matrix and bias matrix using a genetic algorithm.

[0127] In one embodiment, such as Figure 7 As shown, the update method for the target weight matrix includes steps S702 to S704. Wherein:

[0128] Step S702: Obtain the historical weight matrix, learning rate, and loss function.

[0129] Optionally, the server obtains the historical weight matrix W. old The learning rate (lr) and the loss function (Loss) are also considered.

[0130] Step S704: Determine the target weight matrix based on the historical weight matrix, learning rate, and loss function.

[0131] Optionally, the server uses the historical weight matrix W old The learning rate (lr) and loss function (Loss) are used to determine the target weight matrix W. new As shown in formula (3).

[0132]

[0133] The target bias matrix is ​​updated via steps S706 to S708. Wherein:

[0134] Step S706: Obtain the historical bias matrix, learning rate, and loss function.

[0135] Optionally, obtain the historical bias matrix B. old The learning rate (lr) and the loss function (Loss) are also considered.

[0136] Step S708: Determine the target bias matrix based on the bias matrix, learning rate, and loss function.

[0137] Optionally, the server uses the historical bias matrix B old The learning rate (lr) and loss function (Loss) are used to determine the target bias matrix B. new As shown in formula (4).

[0138]

[0139] It should be noted that each neuron in the hidden layer is connected to a neuron in the input layer through a target weight matrix, and each neuron has a target bias matrix.

[0140] In this embodiment, the target weight matrix and target bias matrix are determined based on the historical weight matrix, historical bias matrix, learning rate, and loss function, thereby improving the accuracy of the error prediction model.

[0141] In an exemplary embodiment, the server obtains the first process parameters of the grinding wheel corresponding to the workpiece under test, as shown in Table 1. Before inputting the first process parameters into the error prediction model, the server trains the initial error prediction model using the second process parameters of the grinding wheel corresponding to the sample workpiece, the true geometric error of the sample workpiece, and the true thermal error of the sample workpiece. The server inputs the first process parameters into the trained error prediction model and obtains the error prediction result output by the error prediction model. The error prediction model includes two output neurons: one neuron outputs the predicted geometric error, and the other neuron outputs the predicted thermal error. The error prediction result is determined based on the predicted geometric error and the predicted thermal error. The server performs error compensation on the relative position of the grinding wheel based on the error prediction result, such as adjusting the controller parameters of the grinding wheel to complete the error compensation.

[0142] Methods for training error prediction models include:

[0143] Collect geometric and thermal error data of the grinding wheel machine under different operating conditions, as well as the corresponding secondary process parameters (such as grinding wheel speed, feed rate, depth of cut, etc.) and temperature data. The server obtains the actual geometric and thermal errors of each sample workpiece under different operating conditions of the grinding wheel machine, as well as the secondary process parameters of each sample workpiece, as shown in Table 2. The obtained actual geometric and thermal errors of each sample workpiece under different operating conditions of the grinding wheel machine, as well as the secondary process parameters of each sample workpiece, are input to the input layer.

[0144] The measurement of true geometric errors involves using high-precision measuring equipment (such as laser rangefinders and coordinate measuring machines) to measure the geometric accuracy of the machine tool. Measurement items include: radial runout and axial runout of the grinding wheel spindle, parallelism between the grinding wheel and the worktable, and coaxiality between the headstock and tailstock. Measurement data are recorded, and the magnitude of each geometric error is calculated.

[0145] To measure the true thermal error, after the machine tool has been running for a period of time, the temperature of key parts of the machine tool is measured using temperature measuring equipment such as infrared thermometers or thermocouples. Measurement areas include: the grinding wheel area, spindle bearings, table guide rails, and coolant tank. Temperature data is recorded, and the temperature distribution and trends are analyzed.

[0146] The system records the current settings of the grinding wheel parameters, such as grinding wheel speed, feed rate, and depth of cut. Environmental conditions such as temperature and humidity can also be considered during measurement to account for their impact on error during subsequent data analysis. The server extracts the feature values ​​of the second process parameters for each sample workpiece through the input layer, obtaining a feature vector. This feature vector is then used by the hidden layer for mathematical operations. In practical applications, the hidden layer processes the feature vector through a series of complex mathematical operations (such as weighted summation and activation functions) to extract useful features. These features may include various higher-level representations related to the process. The relationship between the second process parameters, the true geometric error, and the true thermal error, transformed into feature vectors, is reflected through the weights and biases of the neural network and the nonlinear transformation of the activation function. These relationships are learned and optimized during the training of the neural network to better predict and explain various phenomena in the process. The server linearly transforms the feature vectors from the input layer through the target weight matrix and target bias matrix of the hidden layer to obtain the input value of each neuron. The linearly transformed input value is then nonlinearly transformed through the activation function to obtain the output value of each neuron, i.e., the first and second feature vectors to be output. The server determines the error prediction result through the output layer based on the first and second feature vectors to be output. The difference between the error prediction result and the actual error is calculated using a loss function. A cross-entropy loss function can be used, as shown in formulas (1) and (2). If the loss function meets the preset accuracy, the error prediction model is obtained. If the loss function does not meet the preset accuracy, the parameters are adjusted until they do.

[0147]

[0148] In the formula, N is the number of samples, y i This is the actual error. It is the prediction error.

[0149] In practical applications, for example, a weight matrix of shape (X, Y) might be initialized for an error prediction model, ideally with weights drawn from a Gaussian distribution with a mean (μ) of 0 and a standard deviation (σ) of 0.01. This initialization method helps break symmetry at the start of training and aids in better neural network learning. Here, X and Y are natural numbers greater than 0. The server obtains the mean (μ) and standard deviation (σ) of the Gaussian distribution, constant initialization values, such as any natural number. Random numbers can be generated from the specified Gaussian distribution by calling the first function `np.random.normal`. The server can also return the initial weight matrix based on the mean (μ) and standard deviation (σ) of the Gaussian distribution by calling the first function `np.random.normal`. The second function `bias_variable` returns a bias matrix (or vector) with all elements initialized to constant initialization values.

[0150] The server encodes the initial weight matrix to obtain the initial weight code; it also encodes the initial bias matrix to obtain the initial bias code. For example, real-number encoding can be used to represent the initial weight matrix and initial bias matrix as chromosomes (individuals) in a genetic algorithm. The server determines the optimization objective and fitness function of the target genetic algorithm according to instructions. The fitness function characterizes the difference between the predicted error and the actual error under the weight and bias matrices corresponding to each initial solution. The target genetic algorithm initializes the population based on the scores corresponding to each performance index, randomly generating an initial solution set. The server determines the gene encoding for each chromosome individual (initial solution), for example, using bit strings or real-number encoding to represent different configuration parameters. The fitness function characterizes the difference between the predicted error and the actual error under the weight and bias matrices corresponding to each initial solution, such as the mean squared error (MSE) as a measure of fitness. The smaller the fitness function, the higher the fitness of the individual. The server scores all objectives for each chromosome individual (initial solution) according to the fitness function, calculating the Pareto ranking and non-dominated level of each chromosome individual (initial solution). Based on the Pareto rank and non-dominated level of each chromosome individual (initial solution), and other selection pressures (such as crowding distance), superior chromosome individuals (initial solutions) are selected to enter the next generation. The selected superior chromosome individuals (initial solutions) are paired, and a crossover operation is applied to generate new offspring chromosome individuals (initial solutions). A mutation operation is applied to the new offspring chromosome individuals (initial solutions) to introduce new genetic diversity, generating a new set of initial solutions. The server performs adaptive computation on the new set of initial solutions using an fitness function. The Pareto rank and non-dominated level of each chromosome individual (initial solution) are used for selection, crossover, and mutation to generate a new set of initial solutions. This process continues until preset conditions are met, such as whether a predetermined number of iterations has been reached or whether other termination conditions are met (such as the Pareto front change being less than a certain threshold). The new set of initial solutions that meets the preset conditions is then used as a candidate solution set. The candidate solution set includes at least one candidate solution. The server determines a unique target solution from at least one candidate solution in the candidate solution set according to selection rules. These selection rules are determined based on minimizing errors, such as minimizing variance. Assume an initial population size of 50 and 100 iterations. Randomly generate 50 sets of neural network weights and biases as the initial population, and calculate the fitness value of each individual using the training set data. Then, select the best individuals based on their fitness values ​​for crossover and mutation operations to generate a new population. After several generations of evolution, extract the individual with the highest fitness value as the optimal solution.

[0151] The target weight matrix is ​​updated in the following ways: the server retrieves the historical weight matrix W. oldThe learning rate (lr) and loss function (Loss) are used by the server based on the historical weight matrix W. old The learning rate (lr) and loss function (Loss) are used to determine the target weight matrix W. new As shown in formula (3).

[0152]

[0153] The methods for updating the target bias matrix include: obtaining the historical bias matrix B. old The learning rate (lr) and loss function (Loss) are used by the server based on the historical bias matrix B. old The learning rate (lr) and loss function (Loss) are used to determine the target bias matrix B. new As shown in formula (4).

[0154]

[0155] It should be noted that each neuron in the hidden layer is connected to a neuron in the input layer through a target weight matrix, and each neuron has a target bias matrix.

[0156] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0157] Based on the same inventive concept, this application also provides a grinding wheel grinding machine error compensation device for implementing the above-mentioned grinding wheel grinding machine error compensation method. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more grinding wheel grinding machine error compensation device embodiments provided below can be found in the limitations of the grinding wheel grinding machine error compensation method above, and will not be repeated here.

[0158] In one exemplary embodiment, such as Figure 8 As shown, a grinding wheel machine error compensation device is provided, comprising: an acquisition module 801, a processing module 802, and a compensation module 803, wherein:

[0159] The acquisition module 801 is used to acquire the first process parameters of the grinding wheel corresponding to the workpiece to be tested.

[0160] The processing module 802 is used to input process parameters into the error prediction model and obtain the error prediction results output by the error prediction model. The error prediction results are determined based on the predicted geometric error and the predicted thermal error. The error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric error of the sample workpiece, and the actual thermal error of the sample workpiece as the sample set.

[0161] The compensation module 803 is used to compensate for the relative position of the grinding wheel machine based on the error prediction results, wherein the relative position represents the position of the grinding wheel machine and the workpiece to be measured.

[0162] In an exemplary embodiment, a grinding wheel machine error compensation device further includes: a training module, configured to acquire, through an input layer, the true geometric error and true thermal error of each sample workpiece under different working conditions of the grinding wheel machine, and second process parameters of each sample workpiece; wherein the second process parameters include grinding wheel speed, feed rate, and depth of cut; extract feature values ​​of the second process parameters of each sample workpiece through the input layer to obtain feature vectors; determine, through a hidden layer, a first feature vector to be output and a second feature vector to be output based on a target weight matrix, a target bias matrix, and the feature vectors; wherein the first feature vector to be output indicates the vector of predicted geometric error; the second feature vector to be output indicates the vector of predicted thermal error; convert the first feature vector to be output and the second feature vector to be output into error prediction results through an output layer; calculate the difference between the error prediction results and the true error through a loss function; wherein the true error includes true geometric error and true thermal error; and obtain an error prediction model when the loss function satisfies a preset accuracy.

[0163] In an exemplary embodiment, a grinding wheel error compensation device further includes: a matrix determination module, used to obtain an initial weight matrix and an initial bias matrix; and to optimize the initial weight matrix and the initial bias matrix using a genetic algorithm to obtain a target solution; wherein the target solution includes a target weight matrix and a target bias matrix.

[0164] In an exemplary embodiment, the matrix determination module includes: an acquisition and determination unit, configured to acquire the mean, standard deviation, and constant initialization value of a Gaussian distribution; call a first function to determine an initial weight matrix based on the mean and standard deviation of the Gaussian distribution; and call a second function to determine an initial bias matrix based on the constant initialization value.

[0165] In an exemplary embodiment, the matrix determination module includes: a matrix determination unit, configured to encode an initial weight matrix to obtain an initial weight code; encode an initial bias matrix to obtain an initial bias code; randomly generate an initial solution set based on the initial weight code and the bias code, the initial solution set including at least one initial solution, each initial solution representing a set of weight matrices and bias matrices of the error prediction model; perform adaptive calculation on each initial solution using a fitness function, and perform selection, crossover, and mutation processing based on the calculation results to generate a new initial solution set; wherein, the fitness function represents the difference between the output error prediction result and the actual error under the weight matrix and bias matrix corresponding to each initial solution; until a preset condition is met, the new initial solution set that meets the preset condition is taken as a candidate solution set; and determine the target solution from the candidate solution set according to the selection rules.

[0166] In an exemplary embodiment, a grinding wheel error compensation device further includes: an update module, configured to acquire a historical weight matrix, a learning rate, and a loss function; determine a target weight matrix based on the historical weight matrix, the learning rate, and the loss function; acquire a historical bias matrix, a learning rate, and a loss function; and determine a target bias matrix based on the bias matrix, the learning rate, and the loss function.

[0167] Each module in the aforementioned grinding wheel error compensation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0168] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores error data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements an error compensation method for a grinding wheel machine.

[0169] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0170] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0171] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0172] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0173] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0174] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0175] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for error compensation in a grinding wheel machine, characterized in that, The method includes: Obtain the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested. The first process parameters are the process parameters for machining the workpiece to be tested, including the grinding wheel speed, feed rate, depth of cut, and coefficient of thermal expansion of the material. The first process parameter is input into the error prediction model, and the error prediction result output by the error prediction model is obtained; the error prediction result is determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameter of the grinding wheel corresponding to the sample workpiece, the actual geometric error and the actual thermal error of the sample workpiece as the sample set; The relative position of the grinding wheel is compensated for based on the error prediction result, wherein the relative position represents the position of the grinding wheel and the workpiece to be measured; The error prediction model is trained in the following ways: The input layer obtains the actual geometric error and the actual thermal error of each sample workpiece under different working conditions of the grinding wheel, as well as the second process parameters of each sample workpiece; wherein, the second process parameters include the grinding wheel speed, feed rate, and depth of cut; The feature vector is obtained by extracting the feature values ​​of the second process parameters of each sample workpiece through the input layer; The hidden layer determines a first output feature vector and a second output feature vector based on the target weight matrix, the target bias matrix, and the feature vector; wherein the first output feature vector indicates the vector of predicted geometric error; and the second output feature vector indicates the vector of predicted thermal error. The first and second feature vectors to be output are transformed into error prediction results through the output layer; The difference between the error prediction result and the actual error is calculated using a loss function; wherein the actual error includes the actual geometric error and the actual thermal error; and the error prediction model is obtained when the loss function satisfies a preset accuracy.

2. The method according to claim 1, characterized in that, The methods for determining the target weight matrix and the target bias matrix include: Obtain the initial weight matrix and the initial bias matrix; The initial weight matrix and the initial bias matrix are optimized using a genetic algorithm to obtain the target solution; wherein the target solution includes the target weight matrix and the target bias matrix.

3. The method according to claim 1, characterized in that, The process of obtaining the initial weight matrix and the initial bias matrix includes: Obtain the mean, standard deviation, and initial constant values ​​of the Gaussian distribution; The first function is invoked to determine the initial weight matrix based on the mean of the Gaussian distribution and the standard of the Gaussian distribution; The second function is called to determine the initial bias matrix based on the constant initialization value.

4. The method according to claim 2, characterized in that, The optimization of the initial weight matrix and the initial bias matrix using a genetic algorithm to obtain the target solution includes: The initial weight matrix is ​​encoded to obtain the initial weight code; the initial bias matrix is ​​encoded to obtain the initial bias code. An initial solution set is randomly generated based on the initial weight encoding and the initial bias encoding. The initial solution set includes at least one initial solution, and each initial solution represents a set of weight matrices and bias matrices of the error prediction model. The fitness function is used to perform adaptive calculations on each initial solution, and selection, crossover, and mutation processes are performed based on the calculation results to generate a new set of initial solutions; wherein, the fitness function represents the difference between the error prediction result output under the weight matrix and the bias matrix corresponding to each initial solution and the actual error. Until the preset conditions are met, the new initial set of solutions that meet the preset conditions will be used as the candidate set of solutions. The target solution is determined from the candidate solution set according to the selection rules.

5. The method according to any one of claims 1-4, characterized in that, The update methods for the target weight matrix include: Obtain the historical weight matrix, learning rate, and loss function; The target weight matrix is ​​determined based on the historical weight matrix, the learning rate, and the loss function. The update method for the target bias matrix includes: Obtain the historical bias matrix, learning rate, and loss function; The target bias matrix is ​​determined based on the historical bias matrix, the learning rate, and the loss function.

6. A grinding wheel grinding machine error compensation device utilizing the grinding wheel grinding machine error compensation method according to claim 1, characterized in that, The device includes: The acquisition module is used to acquire the first process parameters of the grinding wheel machine corresponding to the workpiece to be tested; The processing module is used to input the first process parameters into the error prediction model and obtain the error prediction result output by the error prediction model; the error prediction result is determined based on the predicted geometric error and the predicted thermal error; the error prediction model is generated after training with the second process parameters of the grinding wheel corresponding to the sample workpiece, the actual geometric error and the actual thermal error of the sample workpiece as the sample set; The compensation module is used to compensate for the relative position of the grinding wheel machine based on the error prediction result, wherein the relative position represents the position of the grinding wheel machine and the workpiece to be measured.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Gear grinding accuracy prediction modeling method considering influence of geometric error of machine tool

    CN110297462A

  • Machine tool dynamic error compensation method and system based on instruction sequence analysis

    CN117170308A