Grey Systems : Theory and Application A cuckoo search optimisation-based Grey prediction model for thermal error compensation on CNC machine tools

Purpose – 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. Design/methodology/approach – 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. Findings – 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. Originality/value – 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.


Introduction
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(Abdulshahed et al., , 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(Liu et al., , 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.
2. Methodology 2.1 CS 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 147 CNC machine tools egg with a probability p a ∈ [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 p a 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) Generate an initial population of n host nests b; i ¼ 1, 2, …, M; 3: While (toMaxGeneration) or (stop criterion); 4: Get a Cuckoo randomly (say, i); 5: Generate a new solution by performing Levy flights; 6: Evaluate its fitness f i ; 7: Choose a nest among n (say, j) randomly; 8: If ( f i Wf j ); 9: replace j by new solution; 10: end if; 11: A fraction ( p a ) 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; 17: end 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: 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: . . .; n þm: Since the details of GMC (1, N ) can be found in (Tien, 2012), this work only briefly mentions the core equations of the model: where t ¼ 1, 2, …, n+m, b 1 is the development coefficient, b i , (i ¼ 2, 3, …, N ) the driving coefficient, and u the Grey control parameter. Therefore, time response sequences can be obtained, which is the solution of the differential Equation (1):

CNC machine tools
To calculate the coefficients b 1 , b i 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 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 Lb j and Ub j 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 α,(αW0) 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(B i ) is measured using a fitness function that quantifies the quality of the eggs (solutions) as follows: where f is the fitness value,x 0 ð Þ k ð Þ is the target output; and, x (0) (k) is the predicted output based on model parameters (nests) updating:

Replace the ith solution with the jth solution, if a better solution is found
• 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.
• 1-IAGO can be applied to obtain the predicted values. The mathematical expression is as the following:

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. Table   Column Surface sensors Ambient sensors

CNC machine tools 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 p a ¼ 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 ( p a ) 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. p a ). 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.

Conclusions
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

153
CNC machine tools 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.