The application of ANFIS prediction models for thermal error compensation on CNC machine tools

Thermal errors can have significant effects on CNC machine tool accuracy. The errors come from thermal deformations of the machine elements caused by heat sources within the machine structure or from ambient temperature change. The effect of temperature can be reduced by error avoidance or numerical compensation. The performance of a thermal error compensation system essentially depends upon the accuracy and robustness of the thermal error model and its input measurements. This paper first reviews different methods of designing thermal error models, before concentrating on employing an adaptive neuro fuzzy inference system (ANFIS) to design two thermal prediction models: ANFIS by dividing the data space into rectangular sub-spaces (ANFIS-Grid model) and ANFIS by using the fuzzy c-means clustering method (ANFIS-FCM model). Grey system theory is used to obtain the influence ranking of all possible temperature sensors on the thermal response of the machine structure. All the influence weightings of the thermal sensors are clustered into groups using the fuzzy c-means (FCM) clustering method, the groups then being further reduced by correlation analysis. A study of a small CNC milling machine is used to provide training data for the proposed models and then to provide independent testing data sets. The results of the study show that the ANFIS-FCM model is superior in terms of the accuracy of its predictive ability with the benefit of fewer rules. The residual value of the proposed model is smaller than ±4 m. This combined methodology can provide improved accuracy and robustness of a thermal error compensation system. © 2014 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/3.0/).


Introduction
Thermal errors of machine tools, caused by internal and external heat sources, are one of the main factors affecting CNC machine tool accuracy. Internal heat sources comprise all heat sources that are directly caused by the machine tool and cutting process, such as spindle motors, friction in bearings, etc. External heat sources are attributed to the environment in which the machine is located, such as neighbouring machines, opening/closing of machine shop doors, cyclic variation of the environmental temperature during the day and night and differing behaviour between seasons. The complex thermal behaviour of a machine is created by interaction between these different heat sources. According to various publications [1][2][3], thermal errors represent up to 75% of the total positioning error of the CNC machine tool. The response to spindle Many compensation techniques have been explored to reduce thermal errors in a direct or indirect way. Direct compensation is simple yet efficient philosophy, making use of directly measured displacements between a tool and a workpiece, often using probing. However, direct measurement compensation has a number of disadvantages. For instance, it is likely that some of the most significant thermal problems are caused by rapid thermal changes. Tracking and correcting these rapid movements would require frequent measurements. When a tool-mounted probe is used, each measurement requires a break in machining, therefore introducing unacceptable time delays. In addition, probing measurements can be prone to errors caused by swarf or coolant on the surface of the workpiece [3]. This can be overcome by repeated measurements or other means, but incurs further cost in terms of hardware or production time. Realistically, direct thermal compensation is most applicable to fixed tooling, such as lathes [2], where a dedicated sensor can be conveniently located.

Thermal modelling methods
There are two general schools of thought related to indirect thermal error compensation. The first method uses principle-based models such as the finite element analysis (FEA) model [5] and finite difference element method (FDEM) [2]. Mian et al. [5] proposed a novel offline approach to modelling the environmental thermal error of machine tools in order to reduce the downtime required to calibrate the model. Based on an FEA model, the method was found to reduce the machine downtime from a fortnight to 12.5 h. Their modelling approach was tested and validated on a production machine tool over a one-year period and found to be very robust. However, building a numerical model can be a great challenge due to problems of establishing the boundary conditions and accurately obtaining the characteristics of heat transfer.
The second method is empirical modelling based on correlation between the measured temperature changes and the resultant displacement of the functional point of the machine tool, which is the change in relative location between the tool and workpiece. Linear regression is the simplest method to correlate measured temperatures with resulting displacement. A least squares approach is used to obtain the coefficients that determine the relationship between inputs and output without using any physical equation. Although this method can provide reasonable results for a given machine test regime, the thermal displacement usually changes with variation in the machining process and the environment, which introduces and error into the model [6]. The linear regression model is also time-consuming and labour intensive to design.
In recent years, it has been shown that thermal errors can be successfully predicted by artificial intelligence modelling techniques such as artificial neural networks ANNs [7,8], fuzzy logic [9], adaptive neuro-fuzzy inference systems [8] and a combination of several different modelling methods [10].
The adaptive neuro fuzzy inference system (ANFIS) has become an attractive, powerful, general modelling technique, combining well established learning laws of ANNs and the linguistic transparency of fuzzy logic theory [11]. By employing the ANN technique to update the parameters of the Takagi-Sugeno type inference model, the ANFIS is given the ability to learn from training data in the same way as an ANN. The solutions mapped out onto a fuzzy inference system (FIS) can therefore be described in linguistic labels (fuzzy sets) [12]. Thus, the nodes and the hidden layers are determined precisely by a FIS in the ANFIS network. This eliminates the well-known difficulty of determining the hidden layer of ANN models and at the same time improving its prediction capability. ANFIS is considered because it does not require complex mathematical model, it is fast and adaptive and the developed prediction tool can be implemented quickly, which is essential for thermal errors compensation. ANFIS techniques have already been applied to different engineering areas such as support to decision-making [13,14], modelling tool wear in turning process [15], and modelling thermal errors in machine tools [8,16]. Abdulshahed et al. [8] compared the ability of ANFIS and ANNs to predict thermal error compensation in CNC machine tools. The results indicated that although ANNs have a good level of prediction accuracy, the ANFIS models were superior in terms of forecasting ability. Wang [16] also proposed a thermal model using ANFIS. Experimental results indicated that the thermal error compensation model could reduce the thermal error to less than 9 m under cutting conditions. He used six inputs with three fuzzy sets per input, producing a complete rule set of 729 (3 6 ) rules in order to build an ANFIS model. Clearly, Wang's model is practically limited to low dimensional modelling. It is important to note that an effective partition of the input space can decrease the number of rules and thus increase the speed in both learning and application phases. However, a reliable and reproducible procedure to be applied in a practical manner in ordinary workshop conditions was not proposed. For example, the number of fuzzy rules increases exponentially when the number of variables rises. To overcome this limitation, fuzzy c-means algorithms could be used to determine clusters effectively, providing better clustered inputs to prediction model.

Reduction of model inputs
Intuitively, locating a large number of sensors on a machine tool structure should enhance the accuracy of the thermal error model since it increases the information input. However, many researchers aim to reduce the number of required temperature sensors. Too large a number of sensors might lead to an increase in the constraints and cost of the compensation system, as well as possibly leading to poor robustness of the thermal model because of increase in data noise. Several studies have used statistical approaches such as engineering judgement, thermal mode analysis, stepwise regression and correlation coefficients to select the temperature sensors for thermal error compensation models [17]. Yan and Yang [18] proposed an MRA model combing two methods, namely the direct criterion method and indirect grouping method; both methods are based on synthetic Grey correlation. Using this method, the number of temperature sensors was reduced from 16 to four and the residual range was reduced for 69.1%. Han et al. [19] proposed a correlation coefficient analysis and fuzzy c-means clustering for selecting temperature sensors both in their robust regression thermal error model and ANN model [20]; the number of thermal sensors was reduced from 32 to five. However, these methods suffer from the following drawbacks: a large amount of data is needed in order to select proper sensors; and the available data must satisfy a typical distribution such as normal (or Gaussian) distribution [21]. Therefore, a systematic approach is still needed to minimise the number of temperature sensors and select their locations so that the downtime and resources can be reduced while robustness is increased.
Grey system theory is a method introduced by Deng in early 1980s [22] with the intention to study the Grey systems by using mathematical methods with poor information and small data sets. In Grey system theory, GM (h, N) denotes a Grey model, where h is the order of difference equation and N is the number of variables. The GM (h, N) model can be used to describe the relationship between the influencing sequence factors and the major sequence factor of a system. Furthermore, weights of each factor represent their importance to the major sequence factor of the system. Its most significant advantage is that it needs only a small amount of experimental data for accurate prediction, and the requirement for the data distribution is also low [21]. In this paper, the GM (1, N) model and fuzzy c-means clustering are used to determine the major sensors influencing thermal errors of a small vertical milling machine (VMC), which is capable of simplifying the system prediction model. Then we used the ANFIS to build two thermal prediction models based on selected sensors: ANFIS by dividing the data space into rectangular subspaces (ANFIS-Grid) and ANFIS by using fuzzy c-means clustering method with ANFIS (ANFIS-FCM). This combined methodology can help to improve robustness of the proposed model, and reduce the effect of sensor uncertainty.

Adaptive neuro fuzzy inference system (ANFIS)
The adaptive neuro fuzzy inference system (ANFIS) was introduced by Jang [11]. According to Jang, the ANFIS is a neural network that is functionally the same as a Takagi-Sugeno type inference model. ANFIS has become an attractive, powerful modelling technique, combining well established learning laws of ANNs and the linguistic transparency of fuzzy logic theory within the framework of adaptive networks. Fuzzy inference systems (FIS) are one of the most well-known applications of fuzzy logic theory. In the fuzzy inference systems, the membership functions typically have to be manually adjusted by trial and error. The FIS model performs like a white box, meaning that the model designers can discover how the model achieved its goal. On the other hand, artificial neural networks (ANNs) can learn, but perform like a black box regarding how the goal is achieved. Applying the ANN technique to develop the parameters of a fuzzy model allows us to learn from a given set of training data, just like an ANN. At the same time, the solution mapped out into the fuzzy model can be explained in linguistic terms as a collection of "IF-THEN" rules.

ANFIS architecture
The architecture of ANFIS is shown in Fig. 1. Five layers are used to construct this model. Each layer contains several nodes described by the node function. Adaptive nodes, denoted by squares, represent the parameter sets that are adjustable in these nodes. Conversely, fixed nodes, denoted by circles, represent the parameter sets that are fixed in the model. Simple ANFIS architecture, which uses two variables (T 1 and T 2 ) as inputs and one output (F: thermal drift), will be described in this section in order to explain the concept of the ANFIS structure.
Layer 1: The first layer is the fuzzy layer that converts the inputs into a fuzzy set by means of membership functions (MFs). It contains adaptive nodes with node functions described as: where T 1 and T 2 are the input node i, A and B are the linguistic labels associated with this node, (T 1 ) and (T 2 ) are the membership functions (MFs), There are many types of MFs that can be used. However, a Gaussian shaped function with maximum and minimum equal to 1 and 0 is usually adapted. Parameters in this layer are defined as premise parameters. Layer 2: Every node in this layer is a fixed node, marked by a circle and labelled by , with the node function to be multiplied by input signals to serve as output signal.
where the O 2,i is the output of Layer 2. The output signal w i represents the firing strength of the rule. Layer 3: Every node in this layer is considered a fixed node, marked by a circle and labelled by N, with node function to normalise the firing strength by computing the ratio of the ith node firing strength to sum of all rules' firing strength.
where the O 3,i is the output of Layer 3. The quantityw is known as the normalised firing strength. Layer 4: Every node in this layer is an adjustable node, marked by a square, with node function as following: where f 1 and f 2 are the fuzzy if-then rules as follows: where p i , q i and r i are the parameters set, referred to as the consequent parameters.
Layer 5: Every node in this layer is a fixed node, marked also by a circle and labelled by , with node function to calculate the overall output by: The simplest learning rule of ANFIS is "back-propagation" which computes error signals recursively from the output layer (Layer 5) backward to the input nodes (Layer 1). This learning rule is exactly the same as the back-propagation learning rule used in the common feed-forward neural networks [8,23]. Although this method can be applied to identify the parameters in an ANFIS network, the method is generally slow and likely to become trapped in local minima [11]. Different learning techniques, such as a hybrid-learning algorithm [14] or genetic algorithm (GA) [24], can be adopted to solve this training problem. Better performance of ANFIS models has been shown by adopting a rapid hybrid learning method, which integrates the gradient descent method and the least-squares method to optimise parameters [23,25,26]. Thus in this paper, the hybrid learning method is used for constructing the proposed models.

Extraction of the initial fuzzy model
In order to start the modelling process, an initial fuzzy model has to be derived. This model is required to select the input variables, input space partitioning or clustering, choosing the number and type of membership functions for inputs, creating fuzzy rules, and their premise and conclusion parts. For a given dataset, different ANFIS models can be constructed using different identification methods such as grid partitioning, and fuzzy c-means clustering (FCM) [23].
A The ANFIS-Grid partition method is the combination of grid partition and ANFIS. The data space divides into rectangular subspaces using axis-paralleled partitions based on a pre-defined number of MFs and their types in each dimension [27]. The limitation of this method is that the number of rules rises rapidly as the number of inputs (sensors) increases. For example, if the number of input sensors is n and the partitioned fuzzy subset for each input sensor is m, then the number of possible fuzzy rules is m n . While the number of variables raises, the number of fuzzy rules increases exponentially, which requires a large computer memory. According to Jang [11], grid partition is only suitable for problems with a small number of input variables (e.g. fewer than 6). In this paper, the proposed thermal error model has five inputs. It is reasonable to apply the ANFIS-Grid partition method. B The ANFIS-fuzzy c-means clustering is the most common method of fuzzy clustering [25]. Essentially, it works with the principle of minimising an objective function that defines the distance from any given data point to a cluster centre. This distance is weighted by the value of MFs of the data point [25]. In the FCM method, which is proposed to improve ANFIS performance, the data are classified into pertinent groups based on their degrees of MFs. In this clustering method, it is assumed that the number of clusters, n c , is known or at least fixed. It divides a given dataset X = {x1, . . ., xn} into c clusters. More detail can be found in the next section.
In order to obtain a small number of fuzzy rules, a fuzzy rule generation technique that integrates ANFIS with FCM clustering can be used, where the FCM is used to systematically identify the fuzzy MFs and fuzzy rule base for ANFIS model. In this paper, to identify premise membership functions, the two aforementioned methods were used and compared.

Fuzzy c-means clustering
Fuzzy c-means (FCM) is a soft clustering method in which each data point belongs to a cluster, with a degree specified by a membership grade. Dunn introduced this algorithm in 1973 [28] and it was improved by Bezdek [29]. FCM algorithm is the fuzzy mode of K-means algorithm and it does not consider sharp boundaries between the clusters [30,31]. Thus, the significant advantage of FCM is the allowance of partial belongings of any object to different groups of the universal set instead of belonging to a single group totally.
FCM partitions a collection of n vectors x i , i = 1, 2, . . ., n into fuzzy groups, and determines a cluster centre for each group such that the objective function of dissimilarity measure is reduced. i = 1, 2, . . ., c are arbitrarily selected from the n points. The steps of the FCM method are now briefly explained: firstly, the centres of each cluster c i , i = 1, 2, . . ., c are randomly selected from the n data patterns {x 1 , x 2 , x 3 , . . ., x n }. Secondly, the membership matrix ( ) is computed with the following equation: where, ij : the degree of membership of object j in cluster i; M: the fuzziness index varying in the range [1, ∞]; and d ij = ||c i − x j ||: the Euclidean distance between c i and x j . Thirdly, the objective function is calculated with the following equation. The process is stopped if it falls below a certain threshold: Finally, the new c fuzzy cluster centres c i , i = 1, 2, . . ., c are calculated using the following equation: m ij x j n j=1 m ij (9) In this paper, the FCM algorithm will be used to separate whole training data pairs into several subsets (membership functions) with different centres. Each subset will be trained by the ANFIS, as proposed by Park et al. [32]. Furthermore, the FCM algorithm will be used to find the optimal temperature data clusters for thermal error compensation models [33].

Selection of input variables
A large number of thermal sensors may have a negative influence on predication accuracy and robustness of a thermal prediction model. One of the difficult issues in thermal error modelling is the selection of appropriate locations for the temperature sensors, which is a key factor in the accuracy of the thermal error model. This study adopts Grey system theory to identify the proper sensor positions for thermal error modelling.
The Grey systems theory is a methodology that focuses on studying the Grey systems by using mathematical methods with a only few data sets and poor information. The technique works on uncertain systems that have partial known and partial unknown information. Its most significant advantage is that it needs a small amount of experimental data for accurate prediction, and the requirement for the data distribution is also low [21]. There are many types of Grey models; the Grey GM (1, N) model will be used in this work.

The GM (1, N) model
The first-order Grey model, GM (1, N), is a multivariable Grey model for multi-factor forecasting. GM (1, N) means a Grey model that has N variables including one dependent variable and N − 1 independent variables. Assume that there are N variables, x i (i = 1, 2, . . ., N), and each variable has n initial sequences as: First, in order to reduce the randomness and increase the smoothness of the sequence, the accumulative generation operation (AGO) is applied to convert the sequences to be strictly monotonic increasing sequences. For simplification, let us define the first-order accumulative generation operation (1-AGO) sequence for x (0) i as: where, Then, the GM (1, N) model can be expressed by the following Grey differential equation [21]: In which, z 1 (K) is defined as: where the coefficients a and b j are called the system development parameter and the driving parameters, respectively. From Eq. (10), we can write: . .
Eq. (5) can be written in the matrix form as: .
The coefficients of the model can then be obtained using the least-square estimate method as: . .
Therefore, the influence ranking from the independent variables to the dependent variable can be known by comparing the model values of b 2 ∼b N .
To obtain robust models, all the influence weighting of thermal sensors is clustered into groups using FCM. Then, one sensor from each cluster is selected to represent the temperature sensors of the same category according to its influence coefficient with the thermal drift. Therefore, by selecting five sensors, the ANFIS models can be built easily to predict the thermal drift.
The whole block diagram of the proposed system is shown in Fig. 2, where variables T1 to TN represent the temperature data captured from the temperature sensors, and the thermal drift obtained from non-contact displacement transducers (NCDTs). Fig. 3 shows the block diagram of a three-axis vertical milling machine (VMC). The motors for the axes are directly coupled to a ballscrew that is supported by bearings at each end. The spindle is rotated by a DC motor mounted on the top of the spindle carrier. The spindle speed can be controlled from 60 rpm to 8000 rpm. In order to obtain the temperature data of this machine tool, a total of 76 thermal sensors are placed on the machine. The sensors can be classified into different categories according to their positions as illustrated in Table 1.

Setup of measurement system
The machine tool is subjected to continuously changing operation conditions. It is rarely maintained at steady state and the heat generated internally will vary significantly as the spindle rotation speed is changed. When this is combined with the effect of ambient changes, the result is the complex thermal behaviour of the machine. Five non-contact displacement transducers (NCDTs) are used to measure the displacement of a precision test bar,    Carrier air 70 Table  71 Base air 72 Spindle air 73-75 Inside the column 76 Tool air representing the tool, in the X, Y and Z axes. The configuration is shown in Fig. 3.
In this work, a variety of heating and cooling tests are carried out in different ambient conditions and different spindle speeds of the VMC (see Table 2). Brief appraisal of the methodology shows the variation considered in this study. Comparing Test I and Test VI shows that a higher spindle rotation speed causes a larger thermal error for the same time duration. Whereas comparing Test II with Test III and Test V with Test VI, it can be seen that the same spindle rotation speed, and the same time duration, gave rise to different thermal error. This was due to change of the ambient conditions and hysteresis effect. More detail of these differences can be observed by examining a selected temperature sensor on the spindle carrier (T11); Fig. 4(a) shows different initial conditions of the machine and Fig. 4(b) shows the different magnitude of temperature changes in different tests.An example of heating and cooling test is illustrated as follows: the vertical milling machine was examined by running at its highest spindle speed of 8000 rpm for 1 h to excite the largest thermal behaviour. The temperature sensors at the selected points on the machine tool and the thermal displacement of the spindle are measured simultaneously; the thermal displacement of the vertical milling machine is shown in Fig. 5. The maximum displacement of the X-axis is 3 m, the Y-axis is 79 m and the Z-axis is 22 m. The X-axis thermal displacement is much smaller than that of the Y-axis and the Z-axis due to the mechanical symmetry of the machine and therefore is not investigate further in this paper; only the Y-axis and Z-axis errors are considered.

Influence weighting of sensors at various critical points
The selection of temperature variables is a key factor to the accuracy of the thermal error model, which will be adversely affected  Table 3 The clustering result.
By applying the Grey model GM (1, N) on the experimental data from one of abovementioned tests (Test VI), the influence coefficients can be obtained as follows: Suppose that T1 ∼ T76 represents the major variables (inputs) x 1 . The influence coefficients can be obtained by Eq. (13), as b 2 ∼ b 76 . The greater the influence weight, the greater the impact on the thermal error, and the more likely it is that the temperature variable can be regarded as a possible modelling variable.
Next, the influence weightings are clustered to five clusters by using fuzzy c-means clustering analysis (see Table 3). Afterward, one sensor from each cluster is selected according to its influence weight with the thermal displacement to represent the temperature sensors of the same category. In this case they are T18, T55, T63, T68 and T71. These temperature sensors are located on the spindle carrier (Strip 1 and Strip 2), spindle boss, ambient near the column, and ambient near the base, respectively.
For the purpose of comparison, another test was carried out on the well-known k-means clustering. The soft clustering approach produces more reasonable results than the hard clustering. However, FCM requires more iterations than k-means, because of the fuzzy calculations.

ANFIS models design
One of the main concerns with designing a thermal error compensation model using ANFIS, or any other self-learning algorithm, is whether the training data that was measured at one particular operating condition of the CNC machine tool would be sufficient to train the model fully for other operational conditions. In other words, is the measured data sufficient for the model to be applicable for all operating conditions?
Ideally, an ANFIS model is trained by a training set that includes many training pairs collected from all likely conditions. However, there cost of machine downtime to capture the training data is a significant concern, because the impact on productivity can have a high penalty. For this reason, reducing the number of training pairs required is very attractive.
Test IV was considered to validate the method of reducing the number of training cycles. Measurements of thermal error and corresponding temperatures were recorded while the machine was run through a range of duty cycle as follows: It was allowed to run at spindle speed 4000 rpm for 120 min, and then paused for 60 min before running for another 120 min; and then stopped for 180 min. Hence, the data obtained from this test is divided into three parts which were training, checking, and testing dataset. The checking dataset was used for over-fitting model validation, while the testing dataset was used to verify the accuracy and the effectiveness of the trained model.
Five temperature sensors from Section 4.2 were used as input variables to the models and the thermal displacement in the Ydirection was chosen as a target variable. The Gaussian functions  Table 5 Linguistic rules.
After setting the initial parameter values in the ANFIS models, the input membership functions were adjusted using a hybrid learning scheme. Extensive simulations were conducted to determine the optimum structure of the FIS models through various experiments. The optimal number of MFs was determined by assigning different numbers of MFs for the ANFIS-Grid model, and different values to the number of clusters (n c ) for the ANFIS-FCM model, respectively. Too few MFs will not allow an ANFIS model to be mapped well. However, too many MFs will increase the difficulty of training and will lead to over-fitting or memorising undesirable inputs such as noise. The prediction errors were measured separately for each model using the root mean square error (RMSE) index with the testing dataset. An example of selecting the optimum structure for the ANFIS-FCM model is presented as follows: In this modelling method, the optimum size of the FIS model was determined, and the results are shown in Table 4. Different numbers of epochs were selected for each model because the training process only needs to be carried out until the errors converge. As can be seen in Table 4, it cannot simply be stated that better results will be obtained with more clusters. It was found that the FIS model with three (n c = 3) clusters exhibited the lowest RMSE value (1.7) for the testing dataset. Consequently, this FIS model with three rules was considered to be the optimal. The corresponding rules of the optimum model are provided in Table 5.
Similarly, the optimum FIS model for ANFIS-Grid model was determined by arbitrarily varying the number of MFs from 2 to 4. The FIS model with three MFs per input (243 rules) was found to be the optimum.

Results and discussion
In this section, the aim is to use the structure of the ANFIS models described in the previous section to derive a thermal error compensation system. With the purpose of evaluating the prediction performance of the models generated using dataset Test IV, the remaining datasets Test I, Test II, Test III, Test V, and Test VI were used to run the models. The experimental tests were carried out throughout different time durations, different ambient temperatures and different spindle rotation speeds in order to validate the robustness of the modelling method. The performance of the models used in this study was computed using three performance criteria, including root-mean-square error (RMSE), correlation coefficient (R 2 ) and also the residual value.

Same spindle speed under different operation conditions
The prediction models established using the dataset from Test IV are used to forecast the thermal error of Test I, Test II, and Test III, respectively. In all experiments, the machine was examined by running the spindle at a speed of 4000 rpm, but the duration and ambient temperature is different between each test and different from the training data, as illustrated in Table 2. This is representative of a machine that manufactures similar parts, but in varying factory conditions. The temperature sensors at the selected points on the machine tool and the thermal displacement of the test bar are measured simultaneously.    Predictive results for the three tests using ANFIS-Grid model and ANFIS-FCM model are shown in Figs. 6-8. Results show that these two models are competitive. The performance of each of the two thermal prediction models is presented in Table 6. They both can predict the new observations and reduce the residual value to less than ±5 m for each test. It is clear that the ANFIS-FCM model has a smaller RMSE, residual value and higher correlation coefficient than the ANFIS-Grid model.

Different spindle speed under different operation conditions
The prediction models established using the dataset from Test IV were further tested to represent a machine that has different manufacturing parameters, also in varying factory conditions. The machine was run at its highest spindle speed of 8000 rpm for one hour to excite more thermal response than during the training data, and then paused for another hour for cooling (see Test V and Test VI). Predictive results using the ANFIS-Grid model and ANFIS-FCM model are shown in Figs. 9 and 10. The evaluation criteria values are provided in Table 7. The residual error obtained using the ANFIS-FCM model was again better than the ANFIS-Grid model. In addition, the ANFIS-FCM model has a lower RMSE and slightly higher correlation coefficient than the ANFIS-Grid model. This indicates that the ANFIS-FCM model is a good modelling choice for predicting the thermal error of the machine tools.

Conclusions
This paper proposes a thermal error modelling method based on the adaptive neuro fuzzy inference system (ANFIS) in order to establish the relationship between the thermal errors and the temperature changes. The proposed methodology has the ability to provide a simple, transparent and robust thermal error compensation system. It has the advantages of fuzzy logic theory and the learning ability of the artificial neural network in a single system. The optimal locations for the temperature sensors were determined through the Grey model and fuzzy c-means clustering. After clustering into groups, one sensor from each group is selected according to its influence coefficient value with the thermal drift. By this method, the number of temperature sensors was reduced from 76 possible locations to five, which significantly minimised the computational time, cost and effect of sensor uncertainty.
Two types of ANFIS model have been discussed in this paper: using grid-partitioning and using fuzzy c-means clustering. Both models were constructed and tested on a CNC milling machine. The results from the two sets of validation tests show that both ANFISbased models, derived from a single heating-and-cooling cycle, can improve the accuracy of the machine tool by over 80% for varying ambient conditions, heating durations and spindle speeds. The ANFIC-FCM produced better results, achieving up to 94% improvement in error with a maximum residual error of ±4 m. This compares favourably with other compensation methods based upon parametric or self-learning techniques, such as similar tests by the authors using artificial neural networks [8], as discussed in Section 1.
In addition to the better absolute accuracy, the ANFIS-FCM has been shown to have the advantage of requiring fewer rules, in this case requiring only three rules as opposed to the 243 found to be optimal for the ANFIS-Grid model. This is a significant benefit, since the latter method is significantly more laborious to construct.
Therefore, it can be concluded that the ANFIS-FCM model is a valid and promising alternative for predicting thermal error of machine tools without increasing computation overheads.
Ali Mohmed Abdulshahed has completed his five year bachelor of science in electrical & electronic engineering at Sirt University, Brega-Libya. Later he completed his MSc in engineering control systems and instrumentation with distinction from the University of Huddersfield, UK. He is presently working in the field of artificial intelligence and expert systems. He is now a PhD student in the Centre for Precision Technologies (CPT) at the University of Huddersfield.
Andrew Peter Longstaff is a Principal Enterprise Fellow at the University of Huddersfield. His specialism is instrumentation, measurement data acquisition, data processing and uncertainty management related to machine tools, robots and coordinate measuring machines. In the past sixteen years he has played a pivotal role in both government and industrially sponsored research and outreach activities in the field of manufacturing accuracy and control.
Dr Simon Fletcher is a Principal Enterprise Fellow with over 15 years' experience of researching and teaching in the field of Machine Tool Technology with particular focus on metrology and advanced design techniques for precision machining. His expertise is in solid modelling, finite element analysis and mathematical simulation of machining errors. Recently he has worked primarily on a range of industrial consultancy projects on machine tool measurement, four large collaborative European funded projects and has over 60 publications.