A CPA-optimized BP neural network spindle thermal error modeling method
Through CPA optimization of the BP neural network, the slow convergence speed and overfitting problems of BP neural network in high-speed electrical spindle thermal error prediction are solved, achieving higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN202410944216.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prediction of high-speed electrical spindle thermal errors, BP neural networks have problems such as slow convergence speed, sensitive to initial weights and biases, requiring a large amount of training data, and prone to overfitting.
The method of thermal error modeling of the spindle of BP neural network is adopted to optimize the BP neural network spindle by building an experimental platform, acquiring and analyzing data, initializing the weights and thresholds of neural networks, and using carnivorous plant optimization algorithm to optimize the weights and thresholds, ultimately improving the prediction accuracy and robustness .
It improves the thermal error prediction accuracy, enhances the robustness of the model, and can be more effectively applied to the field of thermal error modeling of electric spindles.
Smart Images

Figure CN118965958B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of high-speed electric spindle thermal error prediction and analysis, and specifically relates to a CPA optimized BP neural network spindle thermal error modeling method. Background Art
[0002] Research shows that the core component of precision machine tools is the high-speed electric spindle. During long-term high-speed operation of the machine tool, the internal heat dissipation of the high-speed electric spindle is insufficient and slow, resulting in a rapid increase in the internal temperature, causing thermal deformation of the spindle, and affecting the machining accuracy of the machine tool. In the field of fine machining, the machining error caused by the heating of the machine tool spindle accounts for 40% to 70% of the total error of the machine tool. Therefore, the thermal error of the electric spindle caused by the thermal deformation of the high-speed electric spindle is the main reason affecting the machining accuracy of the machine tool. To ensure the machining accuracy of the machine tool, the thermal error of the electric spindle must be minimized. At this stage, there are three methods to reduce the thermal error of the high-speed electric spindle: thermal error prevention method, temperature control method and thermal error compensation method. The thermal error compensation method is to predict the thermal error deformation in advance and compensate it, which is the most widely used.
[0003] BP neural network is a common type of artificial neural network, which is widely used in pattern recognition, predictive analysis, control systems and other fields. Although BP neural network has many advantages, such as the ability to approximate any complex function, the ability to learn and adapt to various input data, it also has some disadvantages: slow convergence, easy to fall into local minima, sensitive to initial weights and biases, requiring a large amount of training data, requiring a carefully designed network structure, and prone to overfitting. Summary of the invention
[0004] In order to solve the problems of slow convergence speed, sensitivity to initial weights and biases, requirement of a large amount of training data, and easy overfitting in the prediction of thermal errors of high-speed electric spindles, the present invention provides a CPA optimized BP neural network spindle thermal error modeling method, which has the characteristics of high prediction accuracy and robustness.
[0005] The technical solution adopted by the present invention is:
[0006] A CPA optimized BP neural network spindle thermal error modeling method comprises the following steps:
[0007] S1. Build the experimental platform and arrange the temperature and displacement measurement points;
[0008] S2. Analyze the data obtained in S1 and select the measurement point information as the training set and the test set;
[0009] S3. Initialize the weights between the input layer and the hidden layer, the hidden layer and the output layer, and the built-in thresholds of the hidden layer and the output layer;
[0010] S4. Input training set data to BP neural network;
[0011] S5. The BP neural network is used to bring in the training set, and the error MSE between the actual output and the expected output is obtained after the calculation output, and then compared with the cost function E (i) In contrast, if MSE < E (i) Then predict the test set. If MSE>E (i) Then the back propagation process is started, and the carnivorous plant optimization algorithm is introduced to correct the weights and thresholds to obtain the optimal initialization weights and thresholds;
[0012] S6. Optimize BP neural network using carnivorous plant optimization algorithm;
[0013] S7. Substitute the optimal solution to train the BP neural network;
[0014] S8. The error, accuracy, determination coefficient, mean absolute error and root mean square error between the prediction result of the BP neural network model and the true value are used as prediction evaluation indicators;
[0015] S9. The performance and prediction accuracy of the optimized BP neural network model are evaluated by calculating the prediction evaluation index between the prediction result and the true value.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] 1. The CPA-BP thermal error prediction model proposed in the present invention has higher thermal error prediction accuracy than the original BP thermal error prediction model;
[0018] 2. The present invention proposes a new BP optimization scheme, which can be applied to the field of thermal error modeling of electric spindles;
[0019] 3. The CPA-BP thermal error prediction model proposed in the present invention has better robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a simplified diagram of the BP neural network structure process;
[0021] Figure 2 It is the BP neural network process diagram;
[0022] Figure 3 It is a diagram of the process of optimizing BP neural network by carnivorous plant optimization algorithm;
[0023] Figure 4 This is a schematic diagram of the distribution of temperature measurement points on the test bench, 1-T1 measurement point, 2-T2 measurement point, 3-T3 measurement point, 4-T4 measurement point, 5-T5 measurement point, 6-T6 measurement point, 7-T7 measurement point, 8-T8 measurement point, 9-T9 measurement point, 10-T10 measurement point;
[0024] Figure 5 It is the classification and grouping of CPA algorithms. DETAILED DESCRIPTION
[0025] In order to better understand the purpose, structure and function of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0026] Taking the electric spindle speed, temperature and spindle thermal elongation at 6000r / min as data, predicting the spindle thermal elongation at 4000r / min and 8000r / min as an example, the CPA optimized BP neural network spindle thermal error modeling method of the present invention includes the following steps:
[0027] S1. Build an experimental platform, arrange temperature measurement points and displacement measurement points, and obtain real-time temperature data and spindle thermal displacement data of the front end cover, front bearing chamber, front bearing bracket, spindle box, rear bearing chamber, and rear bearing bracket at different speeds;
[0028] The detailed locations are shown in Table 1 and Figure 4 As shown, the real-time temperature data and spindle thermal displacement data are obtained at rotation speeds of 4000 rpm, 6000 rpm, 8000 rpm, and 10000 rpm, respectively.
[0029] Table 1 Measurement point code and deployment location details
[0030]
[0031]
[0032] S2. Analyze the data obtained in S1 and select key measurement point information for use as training sets and test sets.
[0033] S3. Initialize the weights between the input layer and the hidden layer, the hidden layer and the output layer, and the built-in thresholds of the hidden layer and the output layer;
[0034] S4. Input training set data to BP neural network;
[0035] S5. Based on the forward propagation principle of BP neural network, the BP neural network is used to bring in the training set, and the error MSE between the actual output and the expected output is obtained after the calculation output, and then compared with the cost function E (i) In contrast, if MSE < E (i) Then predict the test set. If MSE>E (i) Then the back propagation process is started, and the carnivorous plant optimization algorithm is introduced to correct the weights and thresholds to obtain the optimal initialization weights and thresholds;
[0036] The calculation formula of the mean square error MSE is:
[0037]
[0038] Its cost function E (i) The expression is
[0039]
[0040] Where y (i) is the expected output value (true value), o (i) is the actual output value (predicted value), n L is the dimension of the output data.
[0041] S61. randomly generate N groups of carnivorous plant populations and classify and group them;
[0042] S62. Simulate the predation behavior of carnivorous plants;
[0043] Simulate the predation behavior of carnivorous plants to promote the search and optimization of solutions. This includes updating the position of the solution in the population, which may respond to the characteristics of the main axis thermal error model in a dynamic way. Each group of carnivorous plants selects random prey from the group for predation. If the predation is successful, a new plant is generated to join the population, otherwise a new prey is generated to join the population;
[0044] S63. Determine whether the maximum number of predation times has been reached, if yes, proceed to the next step, otherwise proceed to the previous step again;
[0045] S64. Entering the reproduction stage, the globally optimal carnivorous plant will reproduce a new plant to join the population;
[0046] S65. Determine whether the maximum number of reproduction times has been reached, if yes, proceed to the next step, otherwise proceed to the previous step again;
[0047] S66. Enter the renewal phase, after the predation and reproduction phases, the total number of new plants and new prey is generated. Calculate the fitness values of all individuals, and sort them from best to worst according to their fitness values, and retain the first N individuals with better fitness values.
[0048] S67. Determine whether the algorithm has reached the maximum number of iterations. If yes, output the global optimal carnivorous plant and obtain the optimal weight and threshold. Otherwise, repeat the classification and grouping stage of S61. By setting the maximum number of iterations, it is convenient to stop the operation of the algorithm, and the performance of different algorithms can be compared under the same maximum number of iterations.
[0049] S7. Substitute the optimal solution to train the BP neural network;
[0050] The training set and the test set are imported into the BP neural network model optimized by the carnivorous plant optimization algorithm, the BP neural network model optimized by the carnivorous plant optimization algorithm is trained using the training set, and the test set is predicted;
[0051] S8. The error, accuracy, determination coefficient, mean absolute error and root mean square error between the prediction result of the BP neural network model and the true value are used as prediction evaluation indicators;
[0052] S9. The performance and prediction accuracy of the optimized BP neural network model are evaluated by calculating the prediction evaluation index between the prediction result and the true value.
[0053] In the process of forward propagation, there is a link of "comparing with the expected result to see if it is satisfactory". In this link, an error will be generated between the actual output result and the expected output result. In order to reduce this error, it is converted into an optimization process. For any optimization problem, there is always an objective function, which is the loss function.
[0054]
[0055] In formula (3), LOSS is the loss function, n is the number of samples, and y i is the true value of the i-th sample, is the predicted value of the i-th sample, w is the weight, x i is the input node and b is the bias.
[0056] In order to minimize the error between the actual output result and the expected output result, we need to find the minimum value of this function. The iterative method to find the minimum value of the function is to find the numerical solution through gradient descent + iteration. The iterative method generally needs to be repeated many times, because the search for the minimum value of the function may require multiple iterations, and in each iteration, the weights between the nodes in each layer will also be continuously iterated and updated.
[0057]
[0058] In formula (4) Adjustment amount
[0059] α[W (t) -W (t-1) ]: Smoothing item
[0060] η>0, is the learning rate; α is the momentum factor, 0≤α<1;
[0061] In this way, each iteration will generate a weight update, and then the updated weights and training samples will be forward propagated. If the result is not satisfactory, back propagation will be performed and the iteration will continue. This process will be repeated until a satisfactory result is obtained.
[0062] The above content is the main calculation formula for the regression prediction of the BP neural network. After inputting the information of the thermal elongation at 6000r / min at a certain time point obtained from the experiment into the input layer of the BP neural network, the cell state is updated with the time, and then the output layer outputs the regression prediction data under the current state, so as to achieve the prediction of the thermal elongation at the same time under the working conditions of 4000r / min and 8000r / min.
[0063] like Figure 3 As shown, the optimization process of the carnivorous plant optimization algorithm (CPA) of the present invention is as follows:
[0064] Phase 1: Population initialization
[0065] In CPA, each individual represents a feasible solution, and the population size is the number of feasible solutions. First, each individual s is randomly initialized according to formula (5) i (i=1,2,…,N), forming a population S={s1,s2,…,s i ,...,s N}. Then calculate each individual s in the population S i The fitness value f(s i ). Finally, all individuals are sorted in ascending order according to the size of the relevant fitness values to form a new ordered population Y = {y1, y2, ..., y N}. Formula (5) is expressed as follows:
[0066] s i =Lb+(Ub-Lb)×rand1 (5)
[0067] In formula (5), s i is the i-th individual generated; Lb and Ub represent the lower and upper bounds of the search domain respectively; rand1 is a random number in the interval [0,1].
[0068] Stage 2: Classification and grouping
[0069] First, Figure 5 As shown, the individuals in population Y are classified, and the top-n strategy is adopted to select the first n individuals as carnivorous plants (i.e., p1, p2, ...), and the remaining m individuals as prey (i.e., q1, q2, ...), where n+m=N, and m=k×m, (k≥2 and k is an integer). Then the classified individuals are grouped again. Figure 5As shown in , the population is finally divided into n groups, each containing 1 plant and k prey. Figure 5 Take the rth group in the example, which consists of 1 plant p r and k prey q r ,q n+r ,...,q (k-1)×n+r Here, let this group be H r ={p r ,q r ,q n+r ,…}.
[0070] The specific method of grouping each carnivorous plant individual by relevant fitness value is as follows:
[0071] The carnivorous plant population can be represented by the following population matrix:
[0072]
[0073] In formula (6): P OP is the population matrix of carnivorous plants; N is the population size of carnivorous plants; d is the dimension of the problem to be solved;
[0074] The mathematical description of carnivorous plant population initialization is as follows:
[0075] s i,j =Lb j +(Ub j -Lb j )×rand (7)
[0076] In formula (7): s i,j is the position of the jth dimension of the i-th carnivorous plant; rand is a random number in the range [0,1]; Ub j and Lb j are the upper and lower boundaries of the jth dimension of the problem to be solved respectively; in the carnivorous plant algorithm, the objective function of the problem to be solved can be used to calculate the fitness value of the carnivorous plant; the fitness value of the carnivorous plant population can be expressed by the fitness value vector:
[0077]
[0078] In formula (8), Fit is the fitness value vector of the carnivorous plant population; f(s) i is the fitness value of the i-th carnivorous plant.
[0079] Sort each carnivorous plant individual in ascending order according to its fitness value (considering the minimization problem); select the first nCPlant candidate solutions in the population as carnivorous plants (CP), and the remaining nPrey candidate solutions in the population as prey (Prey). The fitness sorting matrix and the overall sorting matrix of the population can be expressed as:
[0080]
[0081]
[0082] In formula (9), Sorted_Fit is the fitness vector after sorting.
[0083] Formula (10) Sorted_Pop is the sorted population matrix;
[0084] The grouping process requires simulating the environment of each carnivorous plant and its prey. During the grouping process, the prey with the best fitness value is assigned to the first-ranked carnivorous plant. Similarly, the second and third-ranked prey are assigned to the second and third-ranked carnivorous plants respectively. This process is repeated until the prey ranked nCPlant is assigned to the nCPlant-ranked carnivorous plant. Then, the prey ranked nCPlant+1 is assigned to the first-ranked carnivorous plant, and so on. This grouping is crucial and can reduce the possibility of preying on many inferior prey, which will help the growth of carnivorous plants.
[0085] Stage 3: Predation
[0086] Each group H r Plant p in (r=1,2,...,n) r Randomly select a prey q from all prey in this group w When preying, the algorithm will generate a random number rand2 (here rand2 is a random number in the interval [0,1]). If rand2≤α (here α is a parameter, indicating the attraction rate), the predation is successful, and a new plant is generated using formula (11) Join population Y; otherwise, predation fails and a new prey is generated using formula (11) Join population Y.
[0087] Formula (11) and its related formulas are as follows:
[0088]
[0089] g′=β×rand3 (12)
[0090] In formula (11), q w For this group H r A prey is randomly selected from . g′ is the growth result.
[0091] In formula (12), β is a parameter representing the growth coefficient; rand3 represents a random number in the interval [0,1].
[0092] Formula (13) and its related formulas are as follows:
[0093]
[0094] q in formula (13) u and q v For this group H r Two different preys randomly selected from u ,q v ∈Hx and u≠v, g″ is the new growth result;
[0095] In formula (14), β is the same as in formula (12), which represents the growth coefficient; function f(x) is used to calculate the fitness value; rand4 represents a random number in the interval [0,1].
[0096] The CPA algorithm requires that each plant p in the n group in the predation stage r (r=1,2,...,n) will perform l predation, and in each predation, a new plant or new prey will be generated by equation (11) or equation (13), that is, in one iteration, a total of n×l new individuals (new plants and new prey) will be generated in the predation stage to join the population Y.
[0097] Stage 4: Reproduction
[0098] Carnivorous plants absorb nutrients from their prey and use them to grow and reproduce. For reproduction, only the top-ranked carnivorous plant, the best solution in the population, is allowed to reproduce. This is to ensure that only the best solution is focused on during the development phase of the CPA algorithm. Unnecessary use of other solutions can be avoided, saving computational costs.
[0099] Here, a breeding task is mainly to use the plant with the best fitness value p1 to breed, that is, to use formula (15) to generate a new plant Join population Y.
[0100] Formula (15) and its related formulas are as follows:
[0101]
[0102] In formula (15), γ is a parameter that reflects the plant's reproduction rate; rand5 is a random number in the interval [0,1]. i and p j They are taken from different groups H i and H j For plants in , i≠j and i, j≠1 are required; the function f(x) represents the fitness value.
[0103] In addition, the CPA stipulates that the reproductive stage needs to use p i A total of n reproductions are performed, that is, in one iteration, the reproduction stage produces a total of n new plants to join the population Y.
[0104] Phase 5: Update Phase
[0105] After the predation and reproduction stages, the total number of new plants and new prey produced is n×l+n, that is, the size of the current population Y is N+n×l+n. Calculate the fitness values of all individuals in Y and sort them from best to worst according to their fitness values. According to the top-n strategy, retain the first N individuals with better fitness values in Y and delete the n×l+n individuals at the back.
[0106] Stage 6: Algorithm ends judgment
[0107] Determine whether the algorithm has reached the set maximum number of iterations maxIt, if yes, stop the CPA algorithm and output the optimal solution, otherwise return to the classification and grouping stage. By setting the maximum number of iterations, you can easily stop the algorithm, and you can compare the performance of different algorithms under the same maximum number of iterations.
[0108] The carnivorous plant optimization algorithm optimizes the BP neural network process as follows Figure 3 As shown:
[0109] The training set and test set data are imported into the CPA-BP electric spindle thermal error prediction model. The CPA optimization algorithm will determine the initial values of each weight parameter, the initial value of the bias parameter and the initial value of the hidden state of the BP neural network through layer-by-layer iteration based on the training set and test set data, and output the optimal solution; finally, the training set and test set data are applied to the optimized BP neural network for regression prediction and the prediction results and evaluation indicators are output to complete the regression prediction task.
[0110] According to the experimental data, the thermal error model of the electric spindle optimized by the carnivorous plant optimization algorithm and the BP neural network was established. In order to verify that the accuracy of the prediction model of the carnivorous plant optimization algorithm and the BP neural network is better than that of the sparrow search optimization algorithm and the BP neural network prediction model, it was verified at different speeds. The results show that at 4000r / min and 8000r / min, the accuracy of the thermal error model predicted by the carnivorous plant optimization algorithm and the BP neural network, the sparrow search optimization algorithm and the BP neural network prediction model are 95.38%, 96.13% (carnivorous plant optimization algorithm and BP neural network), 93.17%, 93.75% (sparrow search optimization algorithm and BP neural network), 83.74%, 82.60% (BP neural network prediction model). Among them, the model accuracy of the carnivorous plant optimization algorithm and the BP neural network is about 97.411%. The carnivorous plant optimization algorithm and the BP neural network have greatly shortened the prediction time required by reducing the parameter setting than the sparrow search optimization algorithm and the BP neural network. The carnivorous plant optimization algorithm and the BP neural network have shown better prediction accuracy in the thermal error prediction model.
[0111] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A CPA optimized BP neural network spindle thermal error modeling method, characterized by: The following steps are involved: S1. Build the experimental platform and arrange the temperature and displacement measurement points; S2. Analyze the data obtained in S1 and select key measurement point information as training sets and test sets; S3. Initialize the weights between the input layer and the hidden layer, the hidden layer and the output layer, and the built-in thresholds of the hidden layer and the output layer; S4. Input training set data to BP neural network; S5. The BP neural network is used to bring in the training set, and the error MSE between the actual output and the expected output is obtained after the calculation output, and then compared with the cost function E (i) In contrast, if MSE < E (i) Then predict the test set. If MSE>E (i) Then the back propagation process is started, and the carnivorous plant optimization algorithm is introduced to correct the weights and thresholds to obtain the optimal initialization weights and thresholds; The specific steps of optimizing the BP neural network using the carnivorous plant optimization algorithm in S5 are: S51. randomly generate N groups of carnivorous plant populations and classify and group them; S52. Simulate the predation behavior of carnivorous plants; Each group of carnivorous plants selects random prey from the group to prey on. If the predation is successful, a new plant is generated to join the population; otherwise, a new prey is generated to join the population. S53. Determine whether the maximum number of predation is reached, if yes, proceed to the next step, otherwise proceed to the previous step again; S54. Entering the reproduction stage, the globally optimal carnivorous plant will reproduce a new plant to join the population; S55. Determine whether the maximum number of reproduction times has been reached, if yes, proceed to the next step, otherwise proceed to the previous step again; S56. Entering the renewal phase, after the predation and reproduction phases, the total number of new plants and new prey is generated, the fitness values of all individuals are calculated, and they are sorted from best to worst according to their fitness values, and the first N individuals with better fitness values are retained; S57. Determine whether the algorithm has reached the maximum number of iterations. If yes, output the global optimal carnivorous plant to obtain the optimal weight and threshold. Otherwise, repeat the classification and grouping stage of S51. The specific method of simulating the predatory behavior of carnivorous plants in S52 is: Each group H r Plant p in (r=1,2,...,n) r Randomly select a prey q from all prey in this group w When preying, the CPA algorithm will generate a random number rand2, which is a random number in the interval [0,1]. If rand2≤α, α is a parameter representing the attraction rate, the predation is successful, and a new plant is generated using formula (11): Join population Y; Otherwise, the predation fails and a new prey is generated using formula (11) Join population Y, Formula (11) and its related formulas are as follows: g′=β×rand3 (12) In formula (11), q w For this group H r A prey is randomly selected from, g′ is the growth result; In formula (12), β is a parameter, which represents the growth coefficient; rand3 represents a random number in the interval [0,1]; Formula (13) and its related formulas are as follows: In formula (13), q u and q v For this group H r Two different preys randomly selected from u ,q v ∈H r And u≠v, g″ is the new growth result; In formula (14), β is the same as in formula (10), which represents the growth coefficient; function f(x) is used to calculate the fitness value; rand4 represents a random number in the interval [0,1]; S6. Substitute the optimal solution to train the BP neural network; S7. The error, accuracy, determination coefficient, mean absolute error and root mean square error between the prediction result of the BP neural network model and the true value are used as prediction evaluation indicators; S8. The performance and prediction accuracy of the optimized BP neural network model are evaluated by calculating the prediction evaluation index between the prediction result and the true value.
2. A CPA optimized BP neural network spindle thermal error modeling method according to claim 1, characterized in that: In the S1, it is necessary to obtain the real-time temperature data and the thermal displacement data of the spindle of the front end cover, the front bearing chamber, the front bearing bracket, the main spindle box, the rear bearing chamber, and the rear bearing bracket at different speeds.
3. The CPA optimized BP neural network spindle thermal error modeling method according to claim 1, characterized in that: The calculation formula of the mean square error MSE in S5 is: Its cost function E (i) The expression is Where y (i) is the expected output value (true value), o (i) is the actual output value (predicted value), n L is the dimension of the output data.
4. A CPA optimized BP neural network spindle thermal error modeling method according to claim 2, characterized in that: The method for randomly generating N groups of carnivorous plant populations and classifying and grouping them in S51 is as follows: S511. Population initialization: First, each individual s is randomly initialized according to formula (5) i (i=1,2,…,N), forming a population of size N s={s1,s2,…,s i ,...,s N }, and then calculate each individual s in the population S i The fitness value f(s i ), finally, all individuals are arranged in ascending order according to the size of the relevant fitness values to form a new ordered population Y = {y1, y2, ..., y N }, formula (5) is expressed as follows: s i =Lb+(Ub-Lb)×rand1 (5) In formula (5), s i is the i-th individual generated; Lb and Ub represent the lower and upper bounds of the search domain respectively; rand1 is a random number in the interval [0,1]; S512. Classification and grouping: First, the individuals in population Y are classified, and the top-n strategy is adopted to select the first n individuals as carnivorous plants p and the remaining m individuals as prey q. Then the classified individuals are grouped again. Finally, the population is divided into n groups, each containing 1 plant p and k prey q.
5. A CPA optimized BP neural network spindle thermal error modeling method according to claim 4, characterized in that: The method for entering the breeding stage in S54 is: A breeding task uses the plant with the best fitness value p1 to breed, that is, a new plant is generated using formula (15) Join population Y, Formula (15) and its related formulas are as follows: In formula (15), γ is a parameter that reflects the plant's reproduction rate; rand5 is a random number in the interval [0,1]; p in formula (16) i and p j They are taken from different groups H i and H j For plants in the,i≠j,i,j≠1; Function f(x) represents the fitness value; The reproductive stage requires the use of p i A total of n reproductions are performed, that is, in one iteration, the reproduction stage produces a total of n new plants to join the population Y.
6. A CPA optimized BP neural network spindle thermal error modeling method according to claim 4, characterized in that: The specific method of entering the update phase in S56 is: After the predation stage in S52 and the reproduction stage in S54, the total number of new plants and new prey generated is n×l+n, that is, the size of the current population Y is N+n×l+n,,, calculate the fitness values of all individuals in Y, and sort them from best to worst according to their fitness values. According to the top-n strategy, retain the first N individuals with better fitness values in Y, and delete the n×l+n individuals at the back.
7. The CPA optimized BP neural network spindle thermal error modeling method according to claim 5, characterized in that: The specific method of grouping each carnivorous plant individual according to the relevant fitness value in S51 is as follows: The carnivorous plant population is represented by the following population matrix: In formula (6): P OP is the population matrix of carnivorous plants; N is the population size of carnivorous plants; d is the dimension of the problem to be solved; The mathematical description of carnivorous plant population initialization is as follows: s i,j =Lb j +(Ub j -Lb j )×rand (7) In formula (7): s i,j is the position of the jth dimension of the i-th carnivorous plant; rand is a random number in the range [0,1]; Ub j and Lb j are the upper and lower boundaries of the jth dimension of the problem to be solved respectively; the objective function of the problem to be solved is used to calculate the fitness value of the carnivorous plant; the fitness value of the carnivorous plant population is represented by the fitness value vector: In formula (8), Fit is the fitness value vector of the carnivorous plant population; f(s) i is the fitness value of the i-th carnivorous plant.
8. The CPA optimized BP neural network spindle thermal error modeling method according to claim 6, characterized in that: The classification grouping of the population is calculated as follows: Sort each carnivorous plant individual in ascending order according to its fitness value; select the first nCPlant candidate solutions in the population as carnivorous plants (CP), and the remaining nPrey candidate solutions in the population as prey (Prey). The fitness sorting matrix and the overall sorting matrix of the population are expressed as: In formula (9), Sorted_Fit is the fitness vector after sorting; In formula (10), Sorted_Pop is the sorted population matrix; The grouping process requires simulating the environment of each carnivorous plant and its prey. During the grouping process, the prey with the best fitness value is assigned to the first-ranked carnivorous plant. Similarly, the second and third-ranked prey are assigned to the second and third-ranked carnivorous plants respectively. This process is repeated until the prey ranked nCPlant is assigned to the nCPlant-ranked carnivorous plant, and then the prey ranked nCPlant+1 is assigned to the first-ranked carnivorous plant.
Citation Information
Patent Citations
AVOA optimization LSTM neural network main shaft thermal error modeling method
CN117113845A
Interval prediction method for hot rolling coiling temperature
WO2022105294A1