WJET  Vol.4 No.1 , February 2016
CNC Thermal Compensation Based on Mind Evolutionary Algorithm Optimized BP Neural Network
Abstract: Thermal deformation error is one of the most important factors affecting the CNCs’ accuracy, so research is conducted on the temperature errors affecting CNCs’ machining accuracy; on the basis of analyzing the unpredictability and pre-maturing of the results of the genetic algorithm, as well as the slow speed of the training speed of the particle algorithm, a kind of Mind Evolutionary Algorithm optimized BP neural network featuring extremely strong global search capacity was proposed; type KVC850MA/2 five-axis CNC of Changzheng Lathe Factory was used as the research subject, and the Mind Evolutionary Algorithm optimized BP neural network algorithm was used for the establishment of the compensation model between temperature changes and the CNCs’ thermal deformation errors, as well as the realization method on hardware. The simulation results indicated that this method featured extremely high practical value.

Received 18 January 2015; accepted 30 January 2016; published 5 February 2016

1. Introduction

Generally, CNCs’ errors include the following several aspects: the inaccurate geometric dimensions of the CNCs’ spare parts and structures; thermal deformation errors; cutting force deformation; and other error sources, such as servo errors of the CNCs’ hafting system (following errors, etc.), CNCs’ interpolation errors, etc. [1] . Large amounts of studies indicated that the errors due to the uneven heat conduction, etc. were the most important sources of such precision processing machinery as CNCs, accounting to about 40% - 70% of the total errors [2] . As pointed out by literature [3] , due to the highly complex relations between CNCs’ thermal deformation and the errors, the generation of the thermal errors is a complex dynamic process, and it also features non-li- nearity, and generally, such value computation methods adopting empirical formula, FEM, experiment method and the regression method not only feature poor real-time capability,and poor accuracy for implementation. Since the neural network can ideally approach any continuous functions, this paper adopted the neural network method for conducting compensations on the CNC errors caused by the uneven heat conduction.

Currently, the BP neural network’s thermal error compensation method is generally adopted for the CNCs’ thermal compensations, and BP neural network is a kind of multi-layer forward neural network, which can approach arbitrary curves, feature simple algorithm and strong plasticity; however, at the BP initiating network, the weighted values and threshold values are random, and in practical applications, it is difficult to determine the ideal weighted values and the threshold values; in addition, since it is based on algorithm of gradient declines, BP features such drawbacks as rather slow learning rate, long convergence time and can easily fall into the local optimization of the algorithm. Therefore, the searching of the initial weighted values and the determination of the adequate number of trainings are the important issues currently faced. As pointed out by literature [4] , based on the law of natural survival people proposed a series of evolutionary algorithms; in contrast to the conventional algorithms, the most striking feature of the evolutionary algorithms is the population searching; and although it can overcome BP’s drawback of easily falling into the local optimization, it also features severe problems and flaws, for example, such shortcomings as pre-maturing and long training time still have not been overcome. Mind Evolutionary Algorithm overcomes the above drawbacks. Mind Evolutionary Algorithm divides the populations into winning populations and temporary populations, and the conducting of explorations on such a thought will benefit the enhancement of the global search capability. Mind Evolutionary Algorithm memorizes much multi-generational evolutions and drives evolution towards the beneficial direction. It adopts parallel structures which features fast speeds. The cross-variations of the conventional genetic algorithms feature duplicity and can generate good genes, but can also damage the originally good genes; however, Mind Evolutionary Algorithm can avoid such a problem.

This paper introduces the process of the experimental data acquisition, the principle of the Mind Evolutionary Algorithm, the process of optimizing the BP and how to realize the compensation model of the MEA-BP. The simulation results show that the algorithm has better fitting performance.

2. MEA Optimize the BP Neural Network

2.1. Description of the MEA Algorithm

Proposed by Sun Yizhi, et al. in 1998 [5] , Mind Evolutionary Algorithm, MEA is a kind of algorithm that simulates the evolution process of human thinking; by referring to the thoughts of genetic algorithm’s “population” and “evolution”, it explored the operational thought of “convergence ”and “alienation”. It can elevate the efficiency of global search to a great extent. Mind Evolutionary Algorithm features very strong extension, portability and very strong capacity of global optimization [6] .

2.2. Process of MEA Algorithm

1) Individuals of certain number were generated randomly in the designated space, and based on the scores, several winning individuals and temporary individuals with the highest scores were searched out.

2) Centering on the winning individuals, some new individuals were generated surrounding each individual to form the winning populations, and the temporary populations were obtained using the same method.

3) Survival of the fittest among the various sub-populations. This continued until it is impossible to generate the new winners (i.e. the maturing of the sub-populations), and the scoring of the sub-populations maturing was taken as its ultimate score, and the highest score was publicized on the global bulletin board, until all the sub-populations were unable to generate new scores, and the convergence was wrapped up.

4) The mature sub-populations also have constant competitions and constantly explored the new values; and the global bulletin board indicated the levels of scores of the winning populations and the temporary populations, and it also completed such operations as the exchanges and the discarding of the most suitable sub-populations and the intermediate sub-populations, and the eliminations of the individuals in the sub-populations, thus deriving at the global optimum individuals and their scores.

5) Upon completion of (4), the released individuals were again substituted by the temporary populations, and (3) and (4) were repeated until there were no elevations in the scores of the optimized individuals, and then the training was considered wrapped up.

2.3. MEA Optimized BP Neural Network

The adoption of MEA algorithm optimized BP neural network can iterate the initial weighted values and initial threshold values with higher efficiency more rapidly. Firstly, based on BP’s structures, the weighted values and the threshold values were mapped into the encoding space of the Mind Evolutionary Algorithm, and the solutions to which the encoding corresponds also correspond to the weighted values or the threshold values, and the encoding length is the sum of the BP weighted values and threshold values; this Paper adopted the BP neural network structure of 4-9-1, with an encoding length of 45, and the reciprocal of MSE of the training values was adopted as the scoring function of the individual populations, and Mind Evolutionary Algorithm was used for cyclic computations, and after the convergence of the scores, conducted the output of the initial weighted values and threshold values of the highest scores, and then they were substituted into the BP neural network for conducting trainings, and with the shortening of the BP training time, the network could mature more rapidly.

The algorithm process of MEA-BP neural network is indicated in Figure 1. Firstly, generated training individual according to the collected experimental data, determined the structure of neural network based on the training individual s, mind evolutionary algorithm parameters are determined by the structure of individual training and BP neural network, generations of the initial population, survival of the sub populations, the convergence of population operation, sub populations of different operation, judging the convergence of the score, if it does not converge to sub populations of similartaxis and dissimilation, else the convergence will be trained by the best individuals as the optimal weights and threshold of the neural network training, simulation and prediction.

3. Concrete Realization of Thermal Error Compensation

3.1. Thermal Error Compensation System Based on UCOS II

The modified structure block diagram of the BP thermal error compensation system is indicated in Figure 2, and this system adopted the microchips as the processors, which were produced with Italian and French semiconductors and feature high stability, high interference resistance and low energy consumption and was based on

Figure 1. Algorithm flow of MEA―BP neural networks.

Figure 2. MEA-BP’s framework diagram of the compensation system.

Cortex-M3 inner cores, constructs a platform of compensation hardware, used the UCOS ii with strong real-time capacity was the platform of the operation system, development interface and the application programs. The model constructed with MEA-BP was converted into C language and, through translation and linking, they were generated into executable codes which were written into the program memory. The differentiations of the temperature data collected real-time and the data of the ambient temperature were conducted, as well as the displacement data of the CNCs, which were put into the compensation program for calculation, and then they were converted to the values that could be identified by the CNCs and were conveyed into the CNCs’ system through the corresponding interfaces, thus realizing the error compensation.

3.2. Acquisition Process of the Experimental Data

The establishment of the neural network models needs a large amount of samples for conducting trainings, and first of all, we needed to collect the sample data; and this Paper conducted relevant data acquisition with the axis X of type KVC850MA/2 five-axis CNC as the research subject. Through the display of the CNC, the temperatures of the generator shell, the upper bearing block and the right of the cross slide were read, and through the laser interferometer, the errors data and ambient temperatures of the corresponding moments were collected. After a CNC was turned on, first preheated it for 30 min, and then the zero point of the lathe was stipulated to enter the testing program that had been previously debugged. Firstly, run the CNC at zero point, and axis X travels at a speed of 10 m/min, and the data were recorded at an interval of 54 mm, and for each testing, the record of a full length back and forth travel was completed. The time of temperature rise was an interval of 20 min. The laser interferometer was adopted for collecting the errors data of the preset points of the CNC programs, with a pause of 5 s, an effective stroke 810 mm, and an allowance of 5 mm was reserved at both the frontal and rear ends, totaling 820 mm; the temperatures of the CNC’s various testing points were recorded, and the CNC’s dry run data were not collected. Four hours after the CNC’s temperature rise, then the cooling down test was conducted, and the cooling down test continued for a total of 2 h, among which at an interval of 20 min of the CNC; s stop, the testing program was run once, the data of the whole travel were recorded, and a total of data of 16 groups were collected.

4. Modeling of Thermal Compensation Based on MEA-BP Neural Network and Performance Analysis

4.1. MEA-BP Neural Network Thermal Errors Modeling

To establish the MEA-BP neural networks, first of all, it is necessary to define the BP structure, and this Paper adopted the variations of the CNC’s current displacement from the displacement of the CNC zero point determined by G54, as well as variation values of the temperatures of the motor housing, the upper bearing block and the right of the cross slide as the inputs of BP, and the thermal errors measured by the laser interferometer as BP’s ideal output, and based on the factors affecting the CNCs’ thermal errors, it was determined there were 4 inputs, and 1 output; and through the formula in [4] literature, among which l is implied number of layer nodes that needs to be determined, m is the number of the output layer nodes, n is the number of input layer nodes, and a is an integer between 0 - 10, and the cut-and-try method was adopted to determine the several integer, and then, through simulation the optimal number of nodal point number of the implied layer is 9. Eventually, the structure of BP neural network was determined as a structure of 4-9-1, as indicated in Figure 3, after the data measured in the text 2.2 were analyzed and processed, some were used for training the neural networks, while parts of them were used for measuring the projected performances upon completion of the trainings. The parameter settings of BP neural network are: the learning rate 0.1, the maximum number of the circulation iterations was 1000, and the learning goal was 0.00001; Mind Evolutionary Algorithm parameter settings are: the population size is 200, the winning population size is 5, the temporary population size is 5, the number of sub-population is 20, the length of the individual encoding is 45, and the iterative step 10.

4.2. Analysis of Simulation Results

The BP neural network and MEA-BP neural network were transformed into the MATLAB codes, the data collected in the experiments were sorted and out into the input MATLAB simulation, and the projected errors and the percentages of projected errors are indicated in Figure 4 and Figure 5: the maximum error of the input data was 137 μ), and through the compensations of the two kinds of neural networks, the errors were reduced to below 4 μ. From Figure 4 we can be see that the BP-MEA residuals are smaller, the residuals are closer to 0, and from Figure 5 we can see that the error percentage of MEA-BP is significantly lower than that of BP, in conclusion MEA-BP featured better fitting performance, the errors percentages were more steady, the error rate lower, and it was possible to produce the compensation data more accurately, thus reducing the CNCs’ errors to a lower level. In the future, the author will attempt to improve the machining accuracy of CNC machine tools by using the actual compensator to verify and implement the CNC machine tools.

5. Concluding Remarks

Based on the five axis CNC machine tool model for KVC850MA/2 X axis as the research object, in view of the thermal error of machine tool, it proposed a kind of algorithm that was based on Mind Evolutionary Algorithm optimized BP neural network for conducting compensations on the CNCs; MATLAB simulation was conducted by combining the measured data and the algorithm so as to verify the algorithm effects. The simulation results indicated that the established network models featured excellent compensation effects, and the BP nerve restraining optimized by Mind Evolutionary Algorithm was faster, the projected errors percentages was lower, thus producing the compensation data more accurately.

Figure 3. Topology structure of BP neural network.

Figure 4. Two kinds of residual constras.

Figure 5. Two kinds of error percentage comparison


Sichuan province key laboratory of artificial intelligence projects (2012 rzy22).

Sichuan institute of technology innovation fund (y2014008).

Intelligent signal and information processing in Sichuan youth science and technology innovation team project (2015 td0022).


*Corresponding author.

Cite this paper: Zhao, Y. , Ren, X. , Hu, Y. , Wang, J. and Bao, X. (2016) CNC Thermal Compensation Based on Mind Evolutionary Algorithm Optimized BP Neural Network. World Journal of Engineering and Technology, 4, 38-44. doi: 10.4236/wjet.2016.41004.

[1]   Ni, J. (1997) Review and Outlooks of the CNC Error Compensation. China Mechanical Engineering, 8, 29.

[2]   Fu, J.Z., Yao, X.h., He, Y., et al. (2010) The Developmental Status of CNC Thermal Error Compensation Technology. Aeronautical Manufacturing Technology, 4, 64-66.

[3]   Sun, Y. and Zeng, H.L. (2010) A Kind of New CNC Thermal errors Real-Time Compensation Method. Machinery Design & Manufacture, 1, 244.

[4]   Wang, X.C., Shi, F., Yu, L., et al. (20123) Analyses of 43 Cases of MATLAB Neural Network. Beihang University Press, Beijing.

[5]   Cheng, Y.S. and Yan, S. (1998) Mind-Evolution-Based Machine Learning: Framework and the Implementation of Optimization. Proceedings of IEEE International Conference on Intelligent Engineering Systems, Vienna, 17-19 September 1998, 355-359.

[6]   Liu, J. (2015) Application Research of Mind Evolutionary Algorithm in BP Neural Network Nonlinear Fitting Function. Journal of Mianyang Normal University, 32, 79.

[7]   Ren, B., Ren, X.H. and Li, G.Z. (2013) The Lathes and Hydraulic Pressure of CNC Thermal Compensation Based on PSO Algorithm Optimized BP Neural Network. Machine Tool & Hydraulics, 41, 61.

[8]   Hong, X.H. (2014) Technical Research of CNC Thermal Compensation Based on Embedment. Manufacturing Automation, 36, 39.

[9]   Ren, X.H., Xu, W.D., Liu, L.X., et al. (2010) CNC Thermal Error Compensation Based on Genetic Algorithm Optimized BP Neural Networks. Manufacturing Automation, 33, 41.

[10]   He, X.J. (2004) Optimizations of the Weighted Values and Structures of the Neural Networks Based on Mind Evolutionary Algorithm. Computer Engineering & Science, 26, 38-39.