Thermal Error Modelling of the Spindle Using Data Transformation and Adaptive Neurofuzzy Inference System

This paper proposes a new method for predicting spindle deformation based on temperature data. The method introduces the adaptive neurofuzzy inference system (ANFIS), which is a neurofuzzymodeling approach that integrates the kernel and geometrical transformations. By utilizing data transformation, the number of ANFIS rules can be effectively reduced and the predictive model structure can be simplified. To build the predictive model, we first map the original temperature data to a feature space with Gaussian kernels. We then process the mapped data with the geometrical transformation and make the data gather in the square region. Finally, the transformed data are used as input to train the ANFIS. A verification experiment is conducted to evaluate the performance of the proposed method. Six Pt100 thermal resistances are used to monitor the spindle temperature, and a laser displacement sensor is used to detect the spindle deformation. Experimental results show that the proposed method can precisely predict the spindle deformation and greatly improve the thermal performance of the spindle. Compared with back propagation (BP) networks, the proposed method is more suitable for complex working conditions in practical applications.


Introduction
Manufacturers should promote the performance of the components of machine tools to improve the quality and accuracy of their workpieces.Among all of the components of machine tools, the spindle plays the most crucial role in machining operations because it provides the cutting speed of the tool and is a part of the force chain between the machine tool structure and the tool or the workpiece [1].The spindle and its bearings greatly affect the total heat generation and the resulting deformations [2].However, heat causes thermoelastic deformations to the spindle, which ultimately lead to geometric inaccuracies of the workpieces.
Thermal deformations are the main sources of errors in machine tools and of geometrical errors of machined workpieces [3].Thermal deformations are responsible for more than 50% of the overall error [2].The error induced by heat is a nonlinear and time-varying procedure caused by the nonuniform temperature variation in machine structures.A complex thermal behavior is produced by the interaction among heat sources, the thermal expansion of components, and the heat conduction between components.In establishing accurate thermal error compensation models, key temperature points that directly influence the model are difficult to identify.Therefore, many modeling approaches have been proposed to overcome the difficulty.
Weck et al. [2] have published a keynote paper on the error reduction and compensation of machine tools.For the deformation induced by heat, error compensation techniques are categorized into direct and indirect compensations [2].Direct compensation approaches periodically measure the thermal displacements of the tool relative to the workpiece.However, such measurements are often difficult because measuring the deflections is not always possible during machining.Sensors can be exposed to hot chips and the lubricant.Therefore, indirect compensation is more convenient and easier than direct compensation.Indirect compensation procedures based on auxiliary values such as temperature measurements build physical or mathematical models that reveal the relationship between temperature variables and thermal deformation.Various methods, such as finite element analysis [4,5], regression analysis [6,7], 2 Mathematical Problems in Engineering neural networks [8,9], and grey system theory [10,11], or the combination of two or three of these methods [12,13], have been applied to build error compensation models.Thermal deformations are calculated using representative temperature measurement points in the machine structure.The calculated deformations are compensated by the CNC control system [14].Our team has conducted substantial research on this field.For example, Junyong and Xuexiang have investigated the thermal dynamics characteristics of the feed system [15][16][17], and Jin has explored the heat generation modeling of bearings [18][19][20].
The majority of existing studies have focused on using artificial neural networks (ANNs) to build thermal error compensation models based on discrete temperature data.Unlike other mathematics models, ANNs have the advantages of information distribution saving, parallel processing, and self-learning ability.In recent years, different kinds of ANNs have been developed for thermal error compensation models, including back propagation (BP) [21], radial basis function (RBF) [8,22], Elman [23], grey neural [12], cerebellar model articulation controller (CMAC) neural [24], and integrated recurrent neural networks [25].However, these neural-modeling approaches have a high probability of being affected by external noise and poor generalization capability.In addition, the learning process may be trapped in the local minima for random initialized weights, and some neurons may be pushed into saturation [26].Thus, traditional ANNs are not suitable for modeling the nonlinear and time-varying procedure of thermal error.
In this paper, we propose a new thermal error predictive model for spindle deformation.The model integrates the kernel and geometrical transformation and the adaptive neurofuzzy inference system (ANFIS).The kernel and geometrical transformation is used for transforming temperature variables into the input space of ANFIS.The ANFIS model is trained by using two transformed temperature variables as input and the spindle deformation as output.After the training, the output of the model is used for predicting spindle deformation.A thermal error experiment for the spindle is implemented to evaluate the performance of the model.The results show that the model has high prediction accuracy and robustness, and it has a better machining performance than BP networks in practical applications.
ANFIS combines neural network adaptive capabilities and fuzzy logic qualitative characteristics.Therefore, it is more flexible in terms of network structure and it can approximate a highly nonlinear surface more effectively than traditional ANNs.As a neurofuzzy modeling approach, it has been widely applied for different purposes, including prediction [27,28], pattern recognition [29], control system [30,31], and knowledge discovery [32].
The remaining of this paper is organized as follows.Section 2 briefly provides the ANFIS description.Section 3 describes the experimental setup and measurement results.Section 4 presents the new thermal error predictive model that combines the kernel and geometrical transformation with ANFIS.Section 5 describes the training and validation results of the proposed model and compares the model and the BP network.Finally, Section 6 presents our conclusions.

Adaptive Neurofuzzy Inference System (ANFIS)
ANFIS [33], which uses fuzzy reasoning and neural network learning algorithms to map inputs into an output, is a multilayer feed-forward network.It is a fuzzy inference system (FIS) implemented in the framework of adaptive neural networks.Figure 1  where  1 (or  2 ) and  1 (or  2 ) are the linguistic labels for the input variables  and  in the antecedent, respectively.  =    +    +   (,  = 1, 2) are crisp functions in the consequent, and   ,   , and   are the consequent parameters.
ANFIS consists of five layers that perform different actions.We define the output of the layer  node as    , where  ( = 1, . . ., 4) denotes the node position along the downward vertical direction.ANFIS is detailed below.
Layer 1.This layer is the input layer, which uses square nodes to represent adaptive nodes.The outputs of this layer are the membership grades of the input variable  (or ) that can be expressed as where  (or ) is the crisp input to the nodes and   (or   ) are the linguistic labels (such as small and large) represented by appropriate member functions (MFs), which can be triangular MFs, trapezoidal MFs, Gaussian MFs, generalized bell MFs, and so on.In this paper, we employ generalized bell MFs defined by where (  ,   ,   ) and (  ,   ,   ) are the membership functions' parameter sets, which are referred to as premise parameters.
Layer 2. This layer is the rule layer, which uses circle nodes to represent fixed nodes.Each node in this layer is labeled as ∏, whose output is the product of the incoming signals: The output of each node represents the firing strength of a rule, which is the weight degree of the if-then rules in the antecedent.
Layer 3.This layer is the normalized layer, which uses fixed circle nodes labelled .Each node normalizes the firing strengths by calculating the ratio of the rule's firing strength to the sum of all rules' firing strengths.Therefore, the outputs of this layer are represented as which are called normalized firing strengths.
Layer 4. This layer is the consequent layer, which uses square adaptive nodes with a node function.The output of each node is the product of the normalized firing strength   and a firstorder polynomial based on the first-order Sugeno model.Thus, the outputs of this layer are obtained by The parameters in this layer are referred to as consequent parameters.
Layer 5.This layer is the output layer, which uses circle fixed nodes labelled ∑ and computes the summation of all incoming signals as the overall ANFIS output.It can be given by Figure 1 shows that the ANFIS has two adaptive layers with square nodes, namely, Layers 1 and 4, which have fitting parameters {  ,   ,   }, {  ,   ,   }, and {  ,   ,   }, respectively.The number of fitting parameters is 24, including 12 premise parameters {  ,   ,   }, {  ,   ,   } and 12 consequent parameters {  ,   ,   }.The task of the learning algorithm for the ANFIS is to tune the membership function shape and the first-order polynomials of the first-order Sugeno model to achieve the desired input-output mapping.
ANFIS training employs the hybrid learning algorithm combining the least-square and gradient descent methods, which consist of the forward and backward passes.In the forward pass, the least-squares method is used to optimize consequent parameters with premise parameters fixed.When the optimal consequent parameters are obtained, the backward pass begins immediately.In the backward pass, the gradient descent method is employed to optimize premise parameters with consequent parameters fixed.When the output error is less than a specified value or the maximum number of iterations is reached, the iteration stops.

Experimental Setup and Measurement Results
3.1.Experiment Setup.As illustrated in Figure 2, the experiment equipment consists of the spindle system, sensing units, and data process system.In the spindle system, the spindle is driven by a servomotor and uses a V-type belt to transmit power, and the maximum spindle speed is 8000 rpm.The sensing units include six Pt100 thermal resistances and a laser displacement sensor.Pt100 thermal resistances, with the advantages of high accuracy and fine calibration, were used as thermal sensors to monitor the temperature variations of the spindle.The laser displacement sensor was used for detecting the spindle deformation along the -axis.
In the spindle, because of the friction between the rolling elements and the inner and outer raceways, the bearings generate a large amount of heat and it is the main thermal error source of the spindle.The heat is dependent on the speed, preload, and lubrication.Faster speeds lead to higher contact forces, hence, higher friction and more heat.
A spindle has two groups of bearings to support the mandrel.They are arranged as follows: face-to-face angular contact bearing at the spindle nose and double row roller bearing at the rear of the spindle.As shown in Figure 2, six Pt100 thermal resistances were embedded in the holes near the two groups of bearings in the spindle housing.Each group has three Pt100 thermal resistances uniformly arranged along the circumference.They are separated by 120 degrees in the circumferential directions, and the sensors between the groups are aligned.The laser displacement sensor is mounted on the work table.

Data Process System.
As illustrated in Figure 3, the data process system consists of a high-precision data acquisition card PXI-4351, a data acquisition system PXI-1024, and a personal computer (PC).The data from the sensing units are acquired using the PXI-4351.Using the commercial software Labview, we wrote the data process program that runs on a PXI-1024.The data are analyzed by the data process program and PXI-1024 outputs the results to the PC monitor.The entire process is controlled by the PC.

Experiment Conditions.
To investigate the spindle's thermal behavior, the experiment was performed throughout the entire machining process.The spindle speed used for training the proposed ANFIS model is shown in Figure 6(a).The spindle speed has an important influence on heat generation.
According to the installed position of the Pt100 thermal resistances, the six measurement points were divided into two groups: the front and the rear.The temperatures for each group are illustrated in Figure 6 the blue curve is the actual deformation of the spindle and the pink curve is the predictive deformation of the spindle.

Building the Thermal Error Predictive Model
4.1.Data Description.In this paper, 4500 training data pairs used in the proposed model contain the input vector k  = (  ,   )  and the output data   , where  = 1, . . ., ,  = 4500.We calculate the average curve of the temperatures in Figure 6(b) as the input vectors k  , and they are obtained by sampling the average temperature curves every second.The outputs   are acquired by sampling the spindle deformation in Figure 6(c) every second.

Building the ANFIS Model.
As can be seen from Figure 4, the input vectors k  are mapped into a feature space with Gaussian kernels, and a learning algorithm is designed to discover the linear relations in the feature space.Then, the mapped vectors are processed by the geometrical transformation and gathered in the square region [0, 1] × [0, 1].The transformed vectors are used as the inputs to the ANFIS and the square region is used as the rule input space partition of ANFIS.The ANFIS model is described in detail as follows.
Step 1.Using the Gaussian kernels below, it maps the input vector k  to the feature space.According to the kernel definition, it has where Φ is a mapping from the input data k  to the feature space and k  and k  denote the images of k  and k  , respectively.Equation ( 7) can directly compute the inner product ⟨k  , k  ⟩ based on k  , k  in the feature space.Step 2. Discovering linear relations among the images k  in the feature space, it can use the ridge regression method to solve the optimization for the loss function : where , which defines the relative trade-off between loss and norm, controls the degree of regularization and w is the coefficient of the linear equation in the feature space.We can determine the optimal value of w by taking the derivatives of the loss function in terms of w and setting them to the zero vector.It is obtained as follows: where V denotes the matrix whose rows are the vectors k  1 , . . ., k   and z denotes the vector ( 1 , . . .,   ).Equation ( 9) can be written in terms of w to obtain where  =  −1 (k − Vw).Hence, where G = VV  or G  = ⟨k  , k  ⟩.Combining ( 12) with ( 7),  can be obtained and w can be calculated by (10).
Step 3. Transforming the original data to the input space of the ANFIS model performs the geometrical transformation and interval normalization for the dataset  = {x, y, z} in Cartesian coordinates (, , ), where (x, y) = (Φ(k  ), . . ., Φ(k  ))  .By rotating  1 around the -axis and  2 around the -axis, the geometrical transformation is implemented.Finally, the plane  1 :  =  1  +  2 , which denotes the relations of the dataset , coincides with plane . 1 equals the supplementary angle between plane  and the plane defined by the normal vector n 1 of the plane  1 and the axial vector i = (1, 0, 0).It can be written as where j = (0, 1, 0) is the normal vector of plane . 2 equals the angle between plane  and the plane  2 obtained by transforming  1 .It can be expressed as where n 2 is the normal vector of plane  2 .Therefore, the transformed dataset  = {x, y, z}.It can be given by where  is a geometrical transformation matrix from the original data space into the input space of the ANFIS model.Interval normalization includes the translation and scaling operations for dataset .First, it evaluates the minimum  min (or  min ) and the range  ran (or  ran ) of the vector  (or ) components.Then, vector x (or y) subtracts the minimum  min (or  min ) and is divided by the range  ran (or  ran ).Finally, we obtain the new dataset Ŝ = {x, ŷ, ẑ}.
Step 4. We train the ANFIS with two inputs, four rules, and one output.The inputs x, ŷ and output ẑ are obtained from dataset Ŝ.The input space (x, ŷ) is partitioned into 2 × 2 grids, and each fuzzy region corresponds to a rule.After the training process, we can use the model to predict the spindle deformation along the -axis.

Training and Validating the ANFIS Model. Data transformation maps the training data pair to the square region
where the dataset is gathered.Then, the transformed dataset is used as the training dataset of ANFIS with two inputs, four rules, and one output.Using the learning algorithm, we can obtain the optimal parameters for the transformation of the training dataset.For the training process of the ANFIS model, we set the initial step size  as 0.01 and the error of the convergent criterion  as 0.02 m.
Figure 5 illustrates the initial and final MFs before and after training.The obvious changes are encountered in the initial MFs after 300 steps.The comparison of the spindle deformation along the -axis between the ANFIS output and the measured data is shown in Figure 6(c).
We obtain the testing dataset from a new cutting condition used for validating the ANFIS model, and the cutting condition is shown in Figure 8(a).The comparison between the ANFIS output and the measured data is shown in Figure 8(c).The prediction error of the spindle deformation along the -axis can be up to less than 6 m.It shows that the ANFIS model can predict the spindle deformation along the -axis well, even under new conditions.

Comparisons with BP Network.
For the comparison between different models, we construct the BP network with the 2-5-1 topology structure.As shown in Figure 7, it consists of the input, hidden, and output layers, where two input neurons receive the average of the two groups of temperature variations from the Pt100 thermal resistances, five hidden neurons process the data with Sigmoid functions, and one output neuron predicts the spindle deformation along the axis.We set the learning rate to  = 0.01 and the mean square error  as 0.01.To compare the performances of the ANFIS model and BP network, we employ the following evaluation criteria.
Root mean squared error (RMSE): where   and   denote the actual and predicted deformations, respectively, and  denotes the number of datasets.Mean absolute percentage error (MAPE): Correlation coefficient (): where  = ∑  =1   / and  = ∑  =1   .From these evaluation criteria, we know that the smaller the RMSE and the MAPE and the larger , the better the predicted performance.Using the BP network based on the training and testing datasets, we predict the spindle deformation along the axis, and the results are illustrated in Figures 6(d) and 8(d), respectively.We can see from Figures 6(d

Conclusions
This paper proposes a new method for establishing the relationship between temperature data and spindle deformation along the -axis.In the proposed method, the original temperature data is first preprocessed using data transformation.Then the ANFIS model is trained with the transformed data, and then the trained ANFIS model outputs the prediction results.The following conclusions are obtained: (1) With the use of data transformation, the temperature data is gathered in the square region.The ANFIS model can conveniently partition the input space and effectively reduce the number of rules.In addition, the transformation procedure can reduce the randomness of the temperature data and the influence of unpredictable noises.
(2) Experimental validation was implemented.The experimental results indicate that the proposed method could precisely predict the spindle deformation and greatly improve the thermal performance of the spindle.Under the new condition, the prediction error of the spindle deformation along the -axis can be up to less than 6 m.
(3) According to the evaluation criteria, the ANFIS model outperforms the BP network.Under the new cutting condition, the MAPE of the ANFIS model is less than 0.7%, whereas the MAPE of the BP network is greater than 3.5%.The ANFIS model can respond more quickly than the BP network, and it can produce smaller prediction error.Unlike the BP network, ANFIS is transparent rather than a black box.Its ifthen rules are easy to understand and interpret.
(4) By nature, BP network is a black box, and the relationships between its inputs and outputs are difficult to interpret.By contrast, ANFIS is transparent, and its ifthen rules are very easy to understand and interpret.However, the ANFIS model has the imperfection of only modelling a single output, whereas the BP network can have several outputs.Overall, the ANFIS model has better performances than the BP network, and it is more suitable for modelling the spindle deformation caused by heat.

Figure 1 :
Figure 1: ANFIS architecture using the first-order Sugeno fuzzy model.

Figure 3 :
Figure 3: Schematic illustration of data process system.

Figure 4 :
Figure 4: Block diagram of the ANFIS model.
Final MFs on

Figure 6 :OutputFigure 7 :
Figure 6: Training dataset: (a) the cutting condition; (b) the temperature of front bearings and the rear bearing; (c) the prediction of the ANFIS model; (d) the prediction of BP network.

Figure 8 :
Figure 8: Testing dataset: (a) the cutting condition; (b) the temperature of front bearings and the rear bearing; (c) the prediction of the ANFIS model; (d) the prediction of BP network.
) and 8(d) that the output of the BP network tends to have a larger deviation from the actual spindle deformation during the warming-up stage.Only when the temperature increases smoothly, and the heat equilibrium of the spindle reaches a stable state, does the prediction accuracy of the BP network improve.Because of the change in working conditions, the measured values of the spindle deformation in intervals [35, 50], [60, 75], [100, 115], and [130, 145] are much bigger, and the curves in these intervals are more steep in comparison with the other sampling points, as shown in Figure8(c).In the intervals above, we can deduce from Figures8(c) and 8(d) that the ANFIS model can respond more quickly than the BP network; thus it can produce smaller prediction error.

Table 1
presents the performances of the ANFIS model and BP network.We can see from Table1that the ANFIS model

Table 1 :
Performances of the ANFIS model and BP network.