Tool bit error prediction method of five-axis numerical control machine tool
By collecting geometric and thermal deformation quantities in five-axis CNC machine tools, building a BP neural network model, and solving them in combination with WPSO algorithm, the problems of low error prediction accuracy and large calculation amount of five-axis CNC machine tools are solved, and error prediction effect with high precision and low calculation amount is achieved.
Patent Information
- Application Number
- CN202510324299.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-13
AI Technical Summary
The error prediction methods of existing five-axis CNC machine tools have problems of low accuracy and large calculation amount, especially in multi-axis combined motion, where error prediction is inaccurate.
A tool head error prediction method for five-axis CNC machine tools is designed. By collecting geometric deformation and thermal deformation, building a BP neural network model, and solving it in combination with WPSO algorithm (a combination of whale algorithm and particle swarm algorithm) to improve the accuracy of error prediction and reduce the calculation amount.
It realizes high accuracy and low calculation volume for error prediction of five-axis CNC machine tools, avoids the problem of falling into local optimal solutions, lays the foundation for subsequent tool head error compensation, and has also been applied in three-axis and four-axis CNC machine tools.
Smart Images

Figure CN120143740A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mechanical technology, and more specifically, the present invention relates to a method for predicting the tool head error of a five-axis numerically controlled machine tool. Background Art
[0002] As an important manufacturing tool in today's manufacturing industry, compared with traditional three-axis numerically controlled machine tools, five-axis numerically controlled machine tools have higher machining accuracy and production efficiency. The machining accuracy of machine tools directly affects a country's manufacturing capacity and scientific and technological level. Therefore, reducing the machining error of five-axis numerically controlled machine tools has become the core issue in the manufacturing field.
[0003] The key element for determining the error of a numerically controlled machine tool is the basis for establishing an error prediction method. Currently, researchers at home and abroad have classified it into direct measurement methods and indirect measurement methods according to different error measurement methods. The direct measurement method measures various error elements of the machine tool through various measuring instruments to obtain the error situation of the machine tool. However, most measuring instruments are greatly affected by the external environment, and there are also problems with insufficient response of sensors, affecting the measurement accuracy; the indirect measurement method indirectly evaluates or measures the accuracy of the machine tool through spatial position error or volume positioning error. However, in the multi-axis combined motion composed of the three moving axes and two rotating axes of a five-axis numerically controlled machine tool, there will be a problem of coupling and superposition, resulting in inaccurate error prediction.
[0004] Existing error predictions mostly build models through error elements. The prediction accuracy of separate geometric error or thermal error modeling is not high, and the calculation amount of modeling is large and cannot respond quickly. Summary of the Invention
[0005] The purpose of the present invention is to design and develop a method for predicting the tool head error of a five-axis numerically controlled machine tool, which predicts the error separately for different axes, and through the combination of two solution optimization methods, improves the prediction accuracy and greatly reduces the calculation amount.
[0006] The technical solution provided by the present invention is as follows:
[0007] A method for predicting the tool head error of a five-axis numerically controlled machine tool, comprising the following steps:
[0008] Step 1: Collect the geometric deformation and thermal deformation of the moving axis, rotating axis and spindle of the five-axis numerically controlled machine tool;
[0009] Step 2: Construct an error prediction model;
[0010] Among them, the error prediction model includes an input layer, a hidden layer, and an output layer. The input layer contains 2 nodes, which respectively input the geometric deformation amounts and corresponding thermal deformation amounts of different axes of the five-axis CNC machine tool. The hidden layer contains 5 nodes, and the output layer is 1 node, which outputs the prediction errors of different axes of the five-axis CNC machine tool.
[0011] Step 3: Solve the error prediction model through the WPSO algorithm to obtain the prediction errors of the moving axis, rotating axis, and spindle of the five-axis CNC machine tool.
[0012] Preferably, the geometric error includes the axial deformation amount, rotational error amount, and perpendicularity deformation amount.
[0013] Preferably, the output of the hidden layer of the error prediction model satisfies:
[0014]
[0015] In the formula, g is the activation function, ω pq is the hidden layer weight, a q is the input variable, b p is the hidden layer threshold.
[0016] Preferably, the output of the output layer of the error prediction model satisfies:
[0017]
[0018] In the formula, ω pk is the output layer weight, b k is the output layer threshold.
[0019] Preferably, the specific steps of Step 3 include:
[0020] Step 1: Create an initial population with the hidden layer weight, hidden layer threshold, output layer weight, and output layer threshold, and evenly divide the initial population into the first sub-population and the second sub-population;
[0021] Step 2: Iteratively update the first sub-population through the whale algorithm, and iteratively update the second sub-population through the particle swarm algorithm;
[0022] Step 3: In each iteration process, compare the fitness values of the first sub-population and the second sub-population, and select the parameters corresponding to the smaller fitness value to be passed to the other population until the iteration times are reached. The parameters corresponding to the minimum fitness value are the prediction errors of the moving axis, rotating axis, and spindle of the five-axis CNC machine tool.
[0023] Preferably, the whale algorithm specifically includes the following steps:
[0024] Step 1): Initialize the whale population:
[0025]
[0026] Wherein, X is the overall matrix of the whale positions, and X i is the i-th whale, is the value of the j-th dimension of the i-th whale, where i = 1, 2, …, N, and N is the number of whales;
[0027] The value of the j-th dimension of the i-th whale satisfies:
[0028]
[0029] Wherein, d j is the lower bound of the search space, rand is a random number in the interval [0, 1], and w j is the upper bound of the search space;
[0030] The fitness function is:
[0031]
[0032] Step 2), update the positions of the whales according to the probability parameters:
[0033] If P < 0.5 and |A| < 1, then the whale surrounds the prey. In the stage of surrounding the prey, the position update of the whale satisfies:
[0034]
[0035] Wherein, is the best candidate solution, ω is the update weight, A is the first coefficient, C is the second coefficient, is the position of the whale after surrounding the prey;
[0036] If P < 0.5 and |A| ≥ 1, then the whale performs bubble-net predation on the prey. In the stage of hunting the prey, the position update of the whale satisfies:
[0037]
[0038] Wherein, b is the spiral parameter, and l is a random number between [-1, 1];
[0039] If P ≥ 0.5, then the whale conducts random search for the prey. In the stage of searching for the prey, the position update of the whale satisfies:
[0040]
[0041] Wherein, X r is the position of the current random individual;
[0042] Perform random differential mutation on the whale individuals:
[0043]
[0044] Step 3): When the iteration times are reached, the global optimal solution is obtained.
[0045] Preferably, the first coefficient and the second coefficient satisfy:
[0046] A = 2ar 1 -a;
[0047] C = 2r 2 ;
[0048] where a is the balance number linearly decreasing from 2 to 0, r 1 is a random number between [0, 1], r 2 is a random number between [0, 1].
[0049] Preferably, the particle swarm algorithm specifically includes the following steps:
[0050] Step I: Randomly update the initial position and initial velocity of the particles;
[0051] Step II: Update the position and velocity of the particles:
[0052] Y′ uj = Y uj + v uj ;
[0053] v′ uj = δv uj + c 1 ·rand·(Y pb - Y uj ) + c 2 ·rand·(Y gb - Y uj );
[0054] where Y′ uj is the updated particle position, Y uj is the current position of the particle, v uj is the current velocity of the particle, v′ uj is the updated velocity, δ is the inertia weight, c 1 is the first learning factor, c 2 is the second learning factor, Y pb is the individual optimal position of the particle, Y gb is the global optimal position of the particle swarm;
[0055] Step III: Randomly mutate the particle position:
[0056] If the current random number rand > Pt , the particle position is updated as follows:
[0057]
[0058] And the mutation probability satisfies:
[0059]
[0060] In the formula, P max is the maximum probability, and P min is the minimum probability;
[0061] Step IV. Update the individual optimal solution and the global optimal solution of each particle until the maximum number of iterations is reached to obtain the optimal solution.
[0062] Preferably, the inertia weight satisfies:
[0063]
[0064] In the formula, δ max is the maximum weight, and δ min is the minimum weight.
[0065] Preferably, the first learning factor and the second learning factor satisfy:
[0066]
[0067] In the formula, c 1-max is the maximum value of the first learning factor, c 1-min is the minimum value of the first learning factor, c 2-max is the maximum value of the second learning factor, and c 2-min is the minimum value of the second learning factor.
[0068] Advantages of the present invention:
[0069] A tool head error prediction method for a five-axis CNC machine tool designed and developed by the present invention solves the BP neural network through the combination of the particle swarm optimization algorithm and the whale algorithm, which not only ensures the prediction accuracy, but also greatly reduces the calculation amount, and can prevent falling into the local optimal solution, laying a research foundation for the subsequent error compensation of the tool head, and can also be applied in three-axis and four-axis CNC machine tools, improving the applicability. Description of the Drawings
[0070] Figure 1 It is a schematic diagram of the mean square error of the embodiment described in the present invention. Detailed Embodiment
[0071] The following further describes the present invention in detail so that those skilled in the art can implement it according to the description in the specification.
[0072] A method for predicting the tool head error of a five-axis numerical control machine tool provided by the present invention includes:
[0073] Step 1: Collect the geometric deformation and thermal deformation of the moving axis, rotating axis, and spindle of the five-axis numerical control machine tool;
[0074] Among them, the geometric error includes the axial deformation, rotational error, and perpendicularity deformation;
[0075] Step 2: Construct an error prediction model;
[0076] The error prediction model includes an input layer, a hidden layer, and an output layer. The input layer contains 2 nodes, and the geometric deformation and corresponding thermal deformation of different axes of the five-axis numerical control machine tool are respectively input. The hidden layer contains 5 nodes, and the output layer is 1 node, which is used to output the predicted error of different axes of the five-axis numerical control machine tool;
[0077] The training steps of the error prediction model can be summarized as follows:
[0078] The first step: Set the initial values of the thresholds and weights of all nodes;
[0079] The second step: Make the following calculations for each input sample:
[0080] The output of the hidden layer satisfies:
[0081]
[0082] In the formula, g is the activation function, ω pq is the weight of the hidden layer, a q is the input variable, b p is the threshold of the hidden layer;
[0083] The output of the output layer satisfies:
[0084]
[0085] In the formula, ω pk is the weight of the output layer, b k is the threshold of the output layer;
[0086] The loss function is:
[0087]
[0088] In the formula, R k is the actual value;
[0089] The third step: Input new samples or samples of a new cycle until the network converges. During training, the input order of samples in each cycle should be randomly reordered.
[0090] Step 3: Solve the error prediction model through the WPSO algorithm to obtain the prediction errors of the moving axes, rotating axes, and spindle of the five-axis CNC machine tool;
[0091] Among them, the WPSO algorithm includes the following steps:
[0092] Step 1: Create an initial population with the hidden layer weights, hidden layer thresholds, output layer weights, and output layer thresholds, and evenly divide the initial population into a first sub-population and a second sub-population;
[0093] Step 2: Iteratively update the first sub-population through the whale algorithm and the second sub-population through the particle swarm algorithm;
[0094] The whale algorithm includes the following steps:
[0095] 1). Initialization of the whale population:
[0096]
[0097] In the formula, X is the overall matrix of the whale positions, X i is the i-th whale, is the value of the i-th whale in the j-th dimension, i = 1, 2,..., N, and N is the number of whales;
[0098] The value of the i-th whale in the j-th dimension satisfies:
[0099]
[0100] In the formula, d j is the lower bound of the search space, rand is a random number in the interval [0, 1], and w j is the upper bound of the search space;
[0101] The fitness function is:
[0102]
[0103] 2). Update the positions of the whales according to the probability parameters:
[0104] If P < 0.5 and |A| < 1, then the whale surrounds the prey. In the stage of surrounding the prey, the position update of the whale satisfies:
[0105]
[0106] In the formula, is the best candidate solution, ω is the update weight, A is the first coefficient, C is the second coefficient, is the position of the whale after surrounding the prey;
[0107] If P < 0.5 and |A| ≥ 1, then the whale performs bubble-net feeding on the prey. During the prey hunting stage, the position update of the whale satisfies:
[0108]
[0109] where b is the helix parameter and l is a random number between [-1, 1];
[0110] If P ≥ 0.5, then the whale performs random search for prey. During the prey search stage, the position update of the whale satisfies:
[0111]
[0112] where X r is the position of the current random individual;
[0113] Perform random differential mutation on the whale individuals:
[0114]
[0115] where the first coefficient and the second coefficient satisfy:
[0116] A = 2ar 1 - a;
[0117] C = 2r 2 ;
[0118] where a is the balance number linearly decreasing from 2 to 0, r 1 is a random number between [0, 1], r 2 is a random number between [0, 1];
[0119] The updated weight satisfies:
[0120]
[0121] where t is the current iteration number, t max is the maximum iteration number;
[0122] 3) Obtain the global optimal solution when the iteration number is reached.
[0123] The particle swarm optimization algorithm includes the following steps:
[0124] Step I: Randomly update the initial position and initial velocity of the particles;
[0125] Step II: Update the position and velocity of the particles:
[0126] Y′ uj = Y uj + v uj ;
[0127] v′ uj = δv uj + c 1 ·rand·(Y pb - Y uj ) + c 2 ·rand·(Y gb - Y uj );
[0128] In the formula, Y′ uj is the updated particle position, Y uj is the current position of the particle, v uj is the current velocity of the particle, v′ uj is the updated velocity, δ is the inertia weight, c 1 is the first learning factor, c 2 is the second learning factor, Y pb is the individual optimal position of the particle, Y gb is the global optimal position of the particle swarm;
[0129] Among them, the inertia weight satisfies:
[0130]
[0131] In the formula, δ max is the maximum weight, δ min is the minimum weight;
[0132] The first learning factor and the second learning factor satisfy:
[0133]
[0134] In the formula, c 1-max is the maximum value of the first learning factor, c 1-min is the minimum value of the first learning factor, c 2-max is the maximum value of the second learning factor, c 2-min is the minimum value of the second learning factor;
[0135] Step III, randomly mutate the particle position:
[0136] If the current random number rand > P t , then the particle position is updated to:
[0137]
[0138] And the mutation probability satisfies:
[0139]
[0140] In the formula, Pmax is the maximum probability, P min is the minimum probability;
[0141] Step IV: Update the individual optimal solution and the global optimal solution of each particle until the maximum number of iterations is reached, and obtain the optimal solution.
[0142] Step 3: In each iteration process, compare the fitness values of the first sub-population and the second sub-population, and select the parameters corresponding to the smaller fitness value to be passed to the other population until the number of iterations is reached. The parameters corresponding to the minimum fitness value are the prediction errors of the moving axis, rotating axis, and spindle of the five-axis CNC machine tool.
[0143] In this embodiment, a LU-400 type five-axis CNC machine tool is used to predict the tool tip error. The number of iterations is 200, the maximum weight is 0.9, the minimum weight is 0.2, the maximum value of the first learning factor is 2, the minimum value of the first learning factor is 1.3, the maximum value of the second learning factor is 1.7, the minimum value of the first learning factor is 0.6, the helix parameter is 1, the maximum probability is 0.45, the minimum probability is 0.05, and the learning rate is 0 to 0.25. The prediction performance according to the tool tip error prediction method of the present invention is as Figure 1 shown. It can be seen that the tool tip error prediction result of the present invention is basically the same as the actual observed value.
[0144] A tool tip error prediction method for a five-axis CNC machine tool designed and developed by the present invention solves the BP neural network through the combination of the particle swarm optimization algorithm and the whale algorithm, which not only ensures the prediction accuracy, but also greatly reduces the calculation amount, and can prevent falling into the local optimal solution, laying a research foundation for the subsequent error compensation of the tool tip, and can also be applied in three-axis and four-axis CNC machine tools, improving the applicability.
[0145] Although the embodiments of the present invention have been disclosed above, it is not limited to the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the field, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details and the embodiments shown and described here.
Claims
1. A tool head error prediction method for a five-axis CNC machine tool, characterized in that: The steps include: Step 1: Collect the geometric deformation and thermal deformation of the moving axis, rotating axis and main axis of the five-axis CNC machine tool; Step 2: Construct an error prediction model; The error prediction model includes an input layer, a hidden layer and an output layer, and the input layer includes 2 nodes, which respectively input the geometric deformation and corresponding thermal deformation of different axes of the five-axis CNC machine tool, the hidden layer includes 5 nodes, and the output layer is 1 node, which outputs the prediction errors of different axes of the five-axis CNC machine tool; Step 3: Solve the error prediction model through the WPSO algorithm to obtain the prediction errors of the moving axis, rotating axis and spindle of the five-axis CNC machine tool.
2. The tool head error prediction method for a five-axis CNC machine tool according to claim 1, characterized in that: The geometric error includes axial deformation, rotation error and vertical deformation.
3. The tool head error prediction method for a five-axis CNC machine tool according to claim 2, characterized in that: The hidden layer output of the error prediction model satisfies: In the formula, g is the activation function, ω pq is the hidden layer weight, a q is the input variable, b p is the hidden layer threshold.
4. The tool head error prediction method for a five-axis CNC machine tool as claimed in claim 3, characterized in that: The output layer output of the error prediction model satisfies: In the formula, ω pk is the output layer weight, b k is the output layer threshold.
5. The tool head error prediction method for a five-axis CNC machine tool according to claim 4, characterized in that: The step three specifically includes: Step 1, create an initial population with hidden layer weights, hidden layer thresholds, output layer weights and output layer thresholds, and divide the initial population into a first sub-population and a second sub-population; Step 2: Iteratively update the first sub-population by using the whale algorithm, and iteratively update the second sub-population by using the particle swarm algorithm; Step 3. In each iteration process, compare the fitness values of the first sub-population and the second sub-population, select the parameters corresponding to the smaller fitness value and pass them to the other population until the number of iterations is reached. The parameters corresponding to the minimum fitness value are the prediction errors of the moving axis, rotating axis and spindle of the five-axis CNC machine tool.
6. The control method of the tool head error prediction method of the five-axis CNC machine tool according to claim 5, characterized in that: The whale algorithm specifically includes the following steps: Step 1), whale population initialization: Where X is the overall matrix of whale positions, X i is the i-th whale, is the value of the jth dimension of the ith whale, i = 1, 2, ..., N, N is the number of whales; The value of the jth dimension of the ith whale satisfies: Where, d j is the lower bound of the search space, rand is a random number in the interval [0,1], and w j is the upper bound of the search space; The fitness function is: Step 2) Update the whale's position based on the probability parameter: If P < 0.5, and |A| < 1, the whale surrounds the prey. In the stage of surrounding the prey, the position update of the whale satisfies: In the formula, is the best candidate solution, ω is the update weight, A is the first coefficient, C is the second coefficient, for the position of the whale after encircling its prey; If P < 0.5 and |A| ≥ 1, the whale performs bubble net hunting on the prey. During the hunting phase, the position update of the whale satisfies: Where b is the spiral parameter, l is a random number between [-1,1]; If P ≥ 0.5, the whale will randomly search for prey. During the prey search phase, the whale's position update satisfies: Where, X r is the position of the current random individual; Perform random differential mutation on individual whales: Step 3) When the number of iterations is reached, the global optimal solution is obtained.
7. The control method of the tool head error prediction method of the five-axis CNC machine tool according to claim 6, characterized in that: The first coefficient and the second coefficient satisfy: A = 2ar1-a; C=2r2; Where a is the equilibrium number that decreases linearly from 2 to 0, r1 is a random number between [0,1], and r2 is a random number between [0,1].
8. The control method of the tool head error prediction method of the five-axis CNC machine tool according to claim 7, characterized in that: The particle swarm algorithm specifically includes the following steps: Step Ⅰ: Randomly update the initial position and initial velocity of the particle; Step II: Update the position and velocity of the particle: AND u ′ j =And uj +v uj ; v u ′ j =δv uj +c1 rand (Y pb -AND uj )+c2·rand·(Y gb -AND uj ); Where Y u ' j is the updated particle position, Y uj is the current position of the particle, v uj is the current velocity of the particle, v u ' j is the updated speed, δ is the inertia weight, c1 is the first learning factor, c2 is the second learning factor, Y pb is the optimal position of the individual particle, Y gb is the global optimal position of the particle swarm; Step III: Randomly mutate the particle positions: If the current random number rand>P t , then the particle position is updated as: And the mutation probability satisfies: Where P max is the maximum probability, P min is the minimum probability; Step IV: Update the individual optimal solution and the global optimal solution of each particle until the maximum number of iterations is reached and the optimal solution is obtained.
9. The control method of the tool head error prediction method of the five-axis CNC machine tool according to claim 8, characterized in that: The inertia weight satisfies: In the formula, δ max is the maximum weight, δ min is the minimum weight.
10. The control method of the tool head error prediction method of the five-axis CNC machine tool according to claim 9, characterized in that: The first learning factor and the second learning factor satisfy: In the formula, c 1-max is the maximum value of the first learning factor, c 1-min is the minimum value of the first learning factor, c 2-max is the maximum value of the second learning factor, c 2-min is the minimum value of the second learning factor.