The purpose of this paper is to produce an intelligent technique for modelling machine tool errors caused by the thermal distortion of Computer Numerical Control (CNC) machine tools. A new metaheuristic method, the cuckoo search (CS) algorithm, based on the life of a bird family is proposed to optimize the GMC(1, N) coefficients. It is then used to predict thermal error on a small vertical milling centre based on selected sensors.
A Grey model with convolution integral GMC(1, N) is used to design a thermal prediction model. To enhance the accuracy of the proposed model, the generation coefficients of GMC(1, N) are optimized using a new metaheuristic method, called the CS algorithm.
The results demonstrate good agreement between the experimental and predicted thermal error. It can therefore be concluded that it is possible to optimize a Grey model using the CS algorithm, which can be used to predict the thermal error of a CNC machine tool.
An attempt has been made for the first time to apply CS algorithm for calibrating the GMC(1, N) model. The proposed CS-based Grey model has been validated and compared with particle swarm optimization (PSO) based Grey model. Simulations and comparison show that the CS algorithm outperforms PSO and can act as an alternative optmization algorithm for Grey models that can be used for thermal error compensation.
Abdulshahed, A.M., Longstaff, A.P. and Fletcher, S. (2017), "A cuckoo search optimisation-based Grey prediction model for thermal error compensation on CNC machine tools", Grey Systems: Theory and Application, Vol. 7 No. 2, pp. 146-155. https://doi.org/10.1108/GS-08-2016-0021
Emerald Publishing Limited
Copyright © 2017, Ali M. Abdulshahed, Andrew P. Longstaff and Simon Fletcher
Published by Emerald Publishing Limited. This article is published under the Creative Commons Attribution (CC BY 4.0) licence. Anyone may reproduce, distribute, translate and create derivative works of this article (for both commercial & non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this licence may be seen at http://creativecommons.org/licences/by/4.0/legalcode
Manufacturing industry demands a continual improvement in the positioning accuracy of machine tools. Increasingly, changes in the business requirements of manufacturing industries are driving machining systems to be more accurate and more productive. To produce high-quality parts with high accuracy and to tight tolerances, the Computer Numerical Control (CNC) machine tools must have greater accuracy than the tolerances of the manufactured parts. Special attention has been paid to the influence of temperature changes on the accuracy of the CNC machine tools (Mayr et al., 2012). Thermal response arises from changes in the size and shape of the structural elements of the machine tool, and of the workpiece, due to varying temperature gradients on the machine and workpiece during the machining process. Thermal fluctuations of the machine tool structure are caused by changes in environmental temperature and heat sources that exist within the structure of the machine tool itself.
Compensation is a process where the thermal error present at a particular time, and position is corrected by adjusting the position of a machine’s axes by an amount equal to the error at that position (Abdulshahed et al., 2015b). Many compensation techniques have been explored to reduce thermal responses in a direct or indirect way (Mayr et al., 2012). Artificial intelligence models have been shown to be efficient in thermal error modelling (Abdulshahed et al., 2015b, 2016) since those methods are able to learn complex nonlinear relations and to treat imprecise data. However, these models are based on the input-output data patterns of the system under consideration. The size of the input-output data set is crucial when the generation of data is a costly affair (machine downtime). For instance, the process of obtaining such data can take several hours for internal heating tests and many days or more for the environmental tests (Longstaff et al., 2003). This is unacceptable in many production environments. Therefore, success in obtaining a reliable and robust model depends heavily on the choice of system variables involved as well as the available data set and the domain used for training purposes.
The Grey systems theory, established by Deng (1982), is a methodology that focusses on solving problems involving incomplete information or small samples. The technique can be applied to uncertain systems with partially known information by generating, mining, and extracting useful information from available data so that system behaviours, and their hidden laws of evolution can be accurately described (Liu et al., 2010, 2011). It uses a black-grey-white colour to describe complex systems (Tien, 2012; Liu et al., 2010). GM(1, N) is one of the most widely used implementations in thermal error compensation, which can establish a first-order differential equation featured by comprehensive and dynamic analysis of the relationship between system parameters. Based on the existing GM(1, N) model, Tien (2012) proposed a GMC(1, N) model, which is an improved Grey prediction model. The modelling values by GM(1, N) are corrected by including a convolution integral. Traditionally, these models have been calibrated by the least square method. However, due to the nonlinearity of the problem, the least square solution may not provide a satisfactory solution. A new metaheuristic method, the cuckoo search (CS) algorithm (Yang and Deb, 2009), based on the life of a bird family is proposed in this work to optimize the GMC(1, N) coefficients. It is then used to predict thermal error on a small vertical milling centre (VMC) based on selected sensors.
CS is a metaheuristic algorithm, introduced in 2009 by Xin-She Yang (Yang and Deb, 2009). CS is a stochastic algorithm, inspired by natural behaviour of a family of birds called Cuckoos. CS in a combination with L’evy flights, based on the breeding strategy of some cuckoo species. The CS algorithm has been validated and compared with other algorithms such as genetic algorithm (GA) (Guerrero et al., 2015; Yang, 2014a). It has many advantages due to its simplicity and efficiency in solving highly nonlinear optimization problems (Yang, 2014a).
Some species of the cuckoo birds engage in an aggressive reproduction strategy; they lay their eggs in the nests of other host birds, which act as surrogate parents. The host bird may notice that the eggs are not its own so it either throws them away or abandons the nest and builds a new one elsewhere. Consequently, Cuckoo eggs have to be incredibly good mimics in order to be accepted into the nest. In brief, the CS algorithm for global optimization is based on three rules: each artificial cuckoo lays an egg in a randomly chosen nest in one generation; nests, which have the high-quality eggs (solutions) will be retained to the next generation; and the total number of nests is fixed, and a host species can discover an exotic egg with a probability pa∈[0, 1]. Thus, the host bird can either throw the egg away or abandon the nest, and then randomly build a completely new nest in somewhere else.
For simplicity in describing the CS algorithm, this last assumption can be estimated by the fraction of pa of the n nests that are replaced by new nests with new random solutions at new locations. The fitness function of the solution is defined in a similar way as in metaheuristics evolutionary methods. It is worth pointing out that in this simple algorithm, there is no distinction between a cuckoo, an egg, or a nest, since each nest has a single egg. The aim is to use the new and potentially better solutions to replace worse solutions that are in the nests. Based on these three rules, the basic steps of the CS are described in a pseudo code below:
Algorithm 1. Pseudo code of CS (Yang and Deb, 2009)
1: Objective function: f(B), B=(bi1, bi2, …, biD)T;
2: Generate an initial population of n host nests b; i=1, 2, …, M;
3: While (t<MaxGeneration) or (stop criterion);
4: Get a Cuckoo randomly (say, i);
5: Generate a new solution by performing Levy flights;
6: Evaluate its fitness fi;
7: Choose a nest among n (say, j) randomly;
8: If (fi>fj);
9: replace j by new solution;
10: end if;
11: A fraction (pa) of worse nests are abandoned and new ones are built;
12: Keep the best solutions/nests;
13: Rank the solutions/nests and find the current best;
14: Pass the current best solutions to the next generation;
15: end while;
16: post process results;
2.2 Development of the GMC (1, N) model
Conventionally, the Grey models have been solved by the least squares method. However, due to the nonlinearity of the thermal errors problem, the least squares solution may not provide a satisfactory result. Recently, researchers have also paid much attention to artificial intelligence techniques in order to improve the predictive accuracy of Grey models. Several optimization techniques, such as the GA (Hsu, 2009) and particle swarm optimization (PSO) (Liu et al., 2014; Abdulshahed et al., 2015a) have been proposed. In comparison to these metaheuristic optimization algorithms, the CS provide advantages of simplicity, faster convergence rate, strong global search, and few adjustable parameters (Valian et al., 2011). In order to avoid the tedious trial and error approach, which may not result in an optimal solution, the CS algorithm will be used in this study in order to improve the performance of the Grey model.
In this section, the main steps of GMC (1, N) modelling are illustrated and discussed. The model can reveal the long-term trend of data and, by driving the model by the accumulated generating operation (AGO), rather than raw data, can minimize the effect of some of the random occurrences. Therefore, the first step for building GMC (1, N) is to carry out first-order accumulated generating operation (1-AGO) to the data, to increase the linear characteristics and reduce the randomness from the measuring samples. GMC (1, N) model has been formulated as an optimization problem so that the probability of encountering the global optimum is maximized. CS algorithm, with capability to optimize complex numerical functions, is adopted to calibrate the GMC (1, N) model. Finally, an Inverse accumulated generating operation (IAGO) is performed to predict the thermal error and generate the final compensation values. Figure 1 shows a schematic diagram of CS-based Grey model. The modelling detail is described as follows:
Consider the original data series as following:where i=2, 3, …, N, r is the period of delay, n gives the length of the original data series and m denotes the number of entries to be predicted.
The above sequences of each variable are processed using 1-AGO to obtain the first-order AGO sequences as follows:
Since the details of GMC (1, N) can be found in (Tien, 2012), this work only briefly mentions the core equations of the model:
To calculate the coefficients b1, bi and u, the CS algorithm can be used to calibrate the Equation (2). Then, the Grey model is optimized until the performance is satisfactory. Finally, the optimal corresponding coefficients are used as the Grey model coefficients to predict the thermal error. The calibrating process of GMC (1, N) can be summarized as follows.
In CS algorithm, each egg in a nest represents a coefficient in the model, and a new cuckoo egg represents a new coefficient value to the model. The mathematical description of the CS algorithm is as follows:
The population of nests is represented as Bi=(bi1, bi2, …, biD)T for i=1, 2, …, M, where M is the population size, and D the number of coefficients in the model.
The initialization of host nests is generated randomly by using this equation:where Lbj and Ubj are lower and upper bounds, respectively. U(0,1) is a uniformly distributed random real number that can take any values between 0 and 1.
The new solution (of an artificial cuckoo) is obtained from its current solution and probability transition according to this equation:where α,(α>0) is the step size scaling factor, ⊗ is entry-wise multiplication as similar to PSO, and L(s, λ) corresponds to a random step size s, which is a random number drawn from the Lévy distribution with the exponent λ. It is worth mentioning that random walk via Lévy flight is more efficient in exploring the search space as its step length is much longer in the long run (Yang, 2014b). Values for size scaling factor α, and Lévy distribution parameter λ are constant, as suggested in (Yang, 2010).
The fitness function f(Bi) is measured using a fitness function that quantifies the quality of the eggs (solutions) as follows:
Select the jth nest via j=[U(0, M)]∧j≠i.
Replace the ith solution with the jth solution, if a better solution is found; i.e., if f(bj)<f(bi).
Keep the best solution, i.e., if .
If the value of the error meets the requirement of the model, or a pre-determined number of epochs are passed, then the model optimization will end.
Export the optimal solution B=(b1, b2, …, bD)T.
1-IAGO can be applied to obtain the predicted values. The mathematical expression is as the following:
3. Experimental work
The experimental data used for the development and validation of the proposed model were performed on a small VMC and utilized a Renishaw OMP40-2 spindle-mounted probe to monitor distortion, which is the output of the system being modelled. It has a stated unidirectional repeatability of 1.0 μm at 480 mm/min with a 50 mm stylus. The test is done through machining a number of parts, which are machined individually at a datum point on the table. When a part is finished the table moves to the next datum point to start machining the next part. Each part excites the X, Y and Z axes through simulated milling operations. This allows heat to be generated from spindle, motors, and axes movement. A probing routine is run before the first machining operation to create a datum baseline for the test on four corners of granite square (see Figure 2). Probing routines are run after the third part and sixth part to measure the response of the tool in the X, Y and Z axes. The system inputs are measured using nine temperature sensors placed on the carrier, spindle boss, axes motors, axes ballscrews nut, while other sensors were placed around the machine to pick up the ambient temperature. These representative temperature sensors for modelling were selected according to their influence coefficient value using a Grey model; more details about this model are given in Abdulshahed et al. (2015a) and similar models are given in Abdulshahed et al. (2016). A general overview of the experimental setup is shown in Figure 2.
To simulate the actual machining process, the machine was examined by running the spindle at a speed of 9,000 rpm (except for the periods of probing), and a feedrate of 5,000 mm/min for 200 min to excite the thermal behaviour. The high rotational speed brings a larger thermal displacement for the spindle carrier. Moreover, the ballscrew system will generate heat due to the friction during the machining process, which causes thermal errors. Temperature of measured points grows gradually until the equilibrium state is reached. The temperature sensors were measured simultaneously every 10 seconds. The maximum response of the X-axis is 20 μm, the Y-axis is 18 μm, and the Z-axis is 58 μm. In this paper, the thermal response of the Z-axis was investigated as an example for the modelling, and potential error compensation.
4 Results and discussion
In order to optimize the GMC(1, N) coefficients, the experimental data set was divided into two sets, one is being used for calibrating the model (approximately 10 per cent), and the rest for testing performance (approximately 90 per cent). Nine temperature sensors are used as inputs, and Z-axis response as output. The thermal compensation model is designed and simulated in the MATLAB environment. The proposed model was designed as follows:
Step 1: a 1-AGO is applied to the raw data to increase the linear characteristics and reduce the randomness from the measuring samples.
Step 2: the GMC(1, N) model is trained with a CS algorithm as discussed in Section 2.2.
Step 3: an IAGO is performed to calculate the thermal error and generate the final compensation value.
In the CS algorithm, the number of the population (nests) is set to be 25 whilst alien eggs discovering probability pa=0.25 as suggested by Yang (2010) (see Table II). After 100 iterations, the total error was at an acceptable level (2 μm for testing data set). Table I illustrates the final Grey model coefficients.
The Grey model obtained using CS algorithm is:
The final Grey model being optimized and validated in this work has been tested next by a new testing data set, not used during training stage. The individual variables are shown in Figure 3. Simulation results show that the thermal error in the Z direction can be significantly reduced from 58 μm to less than 3 μm using testing data set (see Figure 4).
Recent research indicates that PSO algorithm can outperform GA algorithms (Hassan et al., 2005) and other optimization algorithms for many real-word problems. Now we will compare the CS with PSO algorithm for the same thermal error problem discussed in our work (Abdulshahed et al., 2015a). After implementing both algorithms using MATLAB, we have carried out extensive simulations for the purpose of comparison using a variety of different parameters values.
In these algorithms, population size means swarm size for the PSO, and size of host nests for the CS algorithm. Predictive results using both models are presented in Table II, Figure 4, and Figure 5, where the two models are examined by the same testing data set. According to evaluation criteria values, it is clear that the CS-based Grey model has a smaller RMSE, residual value (±2 µm), higher efficiency E, and fewer parameters contrasting with the PSO-based Grey model. This is an advantage due to the fact that there are fewer parameters to be fine-tuned in CS algorithm than in PSO algorithm. This means that, apart from the population size (nests), there is essentially one parameter (pa) that needs to be tuned. Furthermore, another distinction of CS from PSO algorithm is the fine balance between exploration and exploitation, where the global search is interleaved with the local search through the local random walk (i.e. pa). Therefore, the CS-based Grey model is an excellent modelling choice for predicting the thermal error of the machine tools with the benefit of fewer parameters to be fine-tuned.
The main aim of this research work was to produce an intelligent technique for modelling machine tools caused by the thermal distortion of CNC machine tools. Accurate modelling of machine tools is becoming ever more important because of current industrial demands for higher productivity at increasing quality levels. In this work, an attempt has been made for the first time to apply CS algorithm for calibrating the GMC(1, N) model. The proposed CS-based Grey model has been validated and compared with PSO-based Grey model. Simulations and comparison show that the CS algorithm outperforms the PSO, which can act as an alternative optimization algorithm for Grey models that can be used for thermal error compensation.
It can therefore be concluded that it is possible to optimize a Grey model using the CS algorithm, which can be used to predict the thermal error of a CNC machine tool. Future studies will concentrate on applications in predicting the thermal errors under different operation conditions.
CS-based Grey model parameters
Performance calculation of the used models
|Models||PSO-based Grey model||CS-based Grey model|
|Population size||Swarm size (25)||Nests (25)|
|swarm confidence factor||2||–|
|Discovering rate of alien eggs||–||0.25|
|Residual||±4 μm||±2 μm|
Abdulshahed, A.M., Longstaff, A.P. and Fletcher, S. (2015a), “A particle swarm optimisation-based grey prediction model for thermal error compensation on CNC machine tools”, in Liam, B. (Ed.), Laser Metrology and Machine Performance XI, LAMDAMAP 2015, EUSPEN, Huddersfield, pp. 369-378.
Abdulshahed, A.M., Longstaff, A.P. and Fletcher, S. (2015b), “The application of ANFIS prediction models for thermal error compensation on CNC machine tools”, Applied Soft Computing, Vol. 27 No. 1, pp. 158-168.
Abdulshahed, A.M., Longstaff, A.P., Fletcher, S. and Potdar, A. (2016), “Thermal error modelling of a gantry-type 5-axis machine tool using a grey neural network model”, Journal of Manufacturing Systems, Vol. 41 No. 1, pp. 130-142.
Deng, J.-L. (1982), “Control problems of grey systems”, Systems & Control Letters, Vol. 1 No. 5, pp. 288-294.
Guerrero, M., Castillo, O. and García, M. (2015), “Cuckoo search via lévy flights and a comparison with genetic algorithms”, in Castillo, O. and Melin, P. (Eds), Fuzzy Logic Augmentation of Nature-Inspired Optimization Metaheuristics, Springer International Publishing, Cham, pp. 91-103.
Hassan, R., Cohanim, B., De Weck, O. and Venter, G. (2005), “A comparison of particle swarm optimization and the genetic algorithm”, Proceedings of the 1st AIAA Multidisciplinary Design Optimization Specialist Conference, pp. 18-21.
Hsu, L.-C. (2009), “Forecasting the output of integrated circuit industry using genetic algorithm based multivariable grey optimization models”, Expert Systems with Applications, Vol. 36 No. 4, pp. 7898-7903.
Liu, L., Wang, Q., Wang, J. and Liu, M. (2014), “A rolling grey model optimized by particle swarm optimization in economic prediction”, Computational Intelligence, Vol. 32 No. 3, pp. 391-419.
Liu, S., Lin, Y. and Forrest, J.Y.L. (2010), Grey Systems: Theory and Applications, Springer-Verlag Berlin Heidelberg, Berlin Heidelberg.
Liu, S., Forrest, J. and Yingjie, Y. (2011), “A brief introduction to grey systems theory”, Proceeding of IEEE International Conference on Grey Systems and Intelligent Services 2011, IEEE, Nanjing, pp. 1-9.
Longstaff, A.P., Fletcher, S. and Ford, D.G. (2003), “Year. Practical experience of thermal testing with reference to ISO 230 Part 3”, in Dg, F. (Ed.), Laser Metrology and Machine Performance VI, WIT Press, Southampton, pp. 473-483.
Mayr, J., Jedrzejewski, J., Uhlmann, E., Alkan Donmez, M., Knapp, W., Härtig, F., Wendt, K., Moriwaki, T., Shore, P., Schmitt, R., Brecher, C., Würz, T. and Wegener, K. (2012), “Thermal issues in machine tools”, CIRP Annals – Manufacturing Technology, Vol. 61 No. 2, pp. 771-791.
Tien, T.-L. (2012), “A research on the grey prediction model GM (1, n)”, Applied Mathematics and Computation, Vol. 218 No. 9, pp. 4903-4916.
Valian, E., Mohanna, S. and Tavakoli, S. (2011), “Improved cuckoo search algorithm for feedforward neural network training”, International Journal of Artificial Intelligence & Applications, Vol. 2 No. 3, pp. 36-43.
Yang, X.-S. (2010), Nature-Inspired Metaheuristic Algorithms, Luniver Press.
Yang, X.-S. (2014a), Cuckoo Search and Firefly Algorithm, Springer.
Yang, X.-S. (2014b), “Cuckoo search and firefly algorithm: overview and analysis”, in Yang, X.-S. (Ed.), Cuckoo Search and Firefly Algorithm, Springer, London, pp. 1-26.
Yang, X.-S. and Deb, S. (2009), “Cuckoo search via Lévy flights”, World Congress on Nature & Biologically Inspired Computing (NaBIC) 2009, IEEE, pp. 210-214.
The authors gratefully acknowledge the UK’s Engineering and Physical Sciences Research Council (EPSRC) funding of the EPSRC Centre for Innovative Manufacturing in Advanced Metrology (Grant Ref: EP/I033424/1). The authors also gratefully acknowledge the EASE-R3 Project (Integrated framework for a cost-effective and ease of repair, renovation and re-use of machine tools within modern factory).