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

Authors: Yanlei Li; Youmin Hu; Bo Wu; Jikai Fan
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

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 neurofuzzy modeling 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.


---

## Body

## 1. 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], 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–17], and Jin has explored the heat generation modeling of bearings [18–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. Section2 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.


## 2. 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 illustrates that the ANFIS architecture used in this paper employs the first-order Sugeno fuzzy model. It contains two inputs associated with two membership functions, four rules, and one output, and the nodes of the same layer have similar functions.Figure 1
ANFIS architecture using the first-order Sugeno fuzzy model.Using the first-order Sugeno fuzzy model for the output of each rule, the rule set with four fuzzy if-then rules is as follows:Rule 1: ifx is A1, y is B1, then f11=p11x+q11y+r11;Rule 2: ifx is A1, y is B2, then f12=p12x+q12y+r12;Rule 3: ifx is A2, y is B1, then f21=p21x+q21y+r21;Rule 4: ifx is A2, y is B2, then f22=p22x+q22y+r22;where A1 (or A2) and B1 (or B2) are the linguistic labels for the input variables x and y in the antecedent, respectively. fij=pijx+qijy+rij (i,j=1,2) are crisp functions in the consequent, and pij, qij, and rij are the consequent parameters.ANFIS consists of five layers that perform different actions. We define the output of the layerl node as Okl, where k (k=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 x (or y) that can be expressed as (1)Ok1=μAix,fori=1,2,k=1,2,Ok1=μBjy,forj=1,2,k=3,4,where x (or y) is the crisp input to the nodes and Ai (or Bj) 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 (2)μAix=bellx;ai,bi,ci=11+x-ci/ai2bi,fori=1,2,μBjx=bellx;aj,bj,cj=11+x-cj/aj2bj,forj=1,2,where (ai,bi,ci) and (aj,bj,cj) 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: (3)Ok2=wij=μAixμBjy,fori,j=1,2.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 N. 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 (4)Ok3=w¯ij=wij∑i,jwij,fori,j=1,2which 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 w¯ij and a first-order polynomial based on the first-order Sugeno model. Thus, the outputs of this layer are obtained by (5)Ok4=w¯ijfij=w¯ijpijx+qijy+rij,fori,j=1,2.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 (6)Ok5=∑i=12∑j=12w¯ijfij=∑i=12∑j=12w¯ijpijx+qiy+rij.Figure1 shows that the ANFIS has two adaptive layers with square nodes, namely, Layers 1 and 4, which have fitting parameters {ai,bi,ci}, {aj,bj,cj}, and {pij,qij,rij}, respectively. The number of fitting parameters is 24, including 12 premise parameters {ai,bi,ci}, {aj,bj,cj} and 12 consequent parameters {pij,qij,rij}. 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.


## 3. Experimental Setup and Measurement Results

### 3.1. Experiment Setup

As illustrated in Figure2, 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 z-axis.Figure 2
Schematic illustration of experimental equipment.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 Figure2, 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.


### 3.2. Data Process System

As illustrated in Figure3, 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.Figure 3
Schematic illustration of data process system.


### 3.3. 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 Figure6(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 Figure6(b). As shown in Figure 6(c), the blue curve is the actual deformation of the spindle and the pink curve is the predictive deformation of the spindle.


## 3.1. Experiment Setup

As illustrated in Figure2, 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 z-axis.Figure 2
Schematic illustration of experimental equipment.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 Figure2, 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.


## 3.2. Data Process System

As illustrated in Figure3, 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.Figure 3
Schematic illustration of data process system.


## 3.3. 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 Figure6(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 Figure6(b). As shown in Figure 6(c), the blue curve is the actual deformation of the spindle and the pink curve is the predictive deformation of the spindle.


## 4. 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 vectorvi=xi,yi′ and the output data zi, where i=1,…,n, n=4500.We calculate the average curve of the temperatures in Figure6(b) as the input vectors vi, and they are obtained by sampling the average temperature curves every second. The outputs zi are acquired by sampling the spindle deformation in Figure 6(c) every second.


### 4.2. Building the ANFIS Model

As can be seen from Figure4, the input vectors vi 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.Figure 4
Block diagram of the ANFIS model.Step 1.
Using the Gaussian kernels below, it maps the input vectorvi to the feature space. According to the kernel definition, it has(7)Kvi,vj=v-i,v-j=Φvi,Φvj=exp⁡⁡-vi-vj222σ2i,j=1,…,n,where Φ is a mapping from the input data vi to the feature space and v-i and v-j denote the images of vi and vj, respectively. Equation (7) can directly compute the inner product 〈v-i,v-j〉 based on vi, vj in the feature space.Step 2.
Discovering linear relations among the imagesv-i in the feature space, it can use the ridge regression method to solve the optimization for the loss function L:(8)min⁡w⁡Lλw,v-i,zi=min⁡w⁡λw2+∑i=1nzi-w,v-i2i=1,…,n,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:(9)∂Lλw,V,z∂w=2λw-2V′z+2V′Vw=0,where V denotes the matrix whose rows are the vectors v1′,…,vn′ and z denotes the vector (z1,…,zn). Equation (9) can be written in terms of w to obtain(10)w=V′λ-1z-Vw=V′α=∑i=1nαivi,where α=λ-1(v-Vw). Hence,(11)VV′+λIα=z,(12)α=G+λI-1z,where G=VV′ or Gij=〈v-i,v-j〉. 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 datasetS={x,y,z} in Cartesian coordinates (x,y,z), where (x,y)=Φvi,…,Φvn′. By rotating θ1 around the x-axis and θ2 around the y-axis, the geometrical transformation is implemented. Finally, the plane P1:z=w1x+w2y, which denotes the relations of the dataset S, coincides with plane yoz. θ1 equals the supplementary angle between plane yoz and the plane defined by the normal vector n1 of the plane P1 and the axial vector i=(1,0,0). It can be written as(13)θ1=π2-arccos⁡jn1-ijn1-i,where j=(0,1,0) is the normal vector of plane xoz. θ2 equals the angle between plane yoz and the plane P2 obtained by transforming P1. It can be expressed as(14)θ2=π2-arccos⁡n2ijn2-i,where n2 is the normal vector of plane P2. Therefore, the transformed dataset S-={x-,y-,z-}. It can be given by(15)T=10000cos⁡⁡θ1sin⁡θ100-sin⁡θ1cos⁡⁡θ100001cos⁡⁡θ20sin⁡θ200100-sin⁡θ20cos⁡⁡θ200001,x-y-z-1=xyz1T,where T 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 datasetS-. First, it evaluates the minimum x-min⁡ (or y-min⁡) and the range x-ran (or y-ran) of the vector x- (or y-) components. Then, vector x- (or y-) subtracts the minimum x-min⁡ (or y-min⁡) and is divided by the range x-ran (or y-ran). Finally, we obtain the new dataset S^={x^,y^,z^}.Step 4.
We train the ANFIS with two inputs, four rules, and one output. The inputsx^,y^ and output z^ are obtained from dataset S^. The input space (x^,y^) 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 z-axis.


## 4.1. Data Description

In this paper, 4500 training data pairs used in the proposed model contain the input vectorvi=xi,yi′ and the output data zi, where i=1,…,n, n=4500.We calculate the average curve of the temperatures in Figure6(b) as the input vectors vi, and they are obtained by sampling the average temperature curves every second. The outputs zi are acquired by sampling the spindle deformation in Figure 6(c) every second.


## 4.2. Building the ANFIS Model

As can be seen from Figure4, the input vectors vi 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.Figure 4
Block diagram of the ANFIS model.Step 1.
Using the Gaussian kernels below, it maps the input vectorvi to the feature space. According to the kernel definition, it has(7)Kvi,vj=v-i,v-j=Φvi,Φvj=exp⁡⁡-vi-vj222σ2i,j=1,…,n,where Φ is a mapping from the input data vi to the feature space and v-i and v-j denote the images of vi and vj, respectively. Equation (7) can directly compute the inner product 〈v-i,v-j〉 based on vi, vj in the feature space.Step 2.
Discovering linear relations among the imagesv-i in the feature space, it can use the ridge regression method to solve the optimization for the loss function L:(8)min⁡w⁡Lλw,v-i,zi=min⁡w⁡λw2+∑i=1nzi-w,v-i2i=1,…,n,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:(9)∂Lλw,V,z∂w=2λw-2V′z+2V′Vw=0,where V denotes the matrix whose rows are the vectors v1′,…,vn′ and z denotes the vector (z1,…,zn). Equation (9) can be written in terms of w to obtain(10)w=V′λ-1z-Vw=V′α=∑i=1nαivi,where α=λ-1(v-Vw). Hence,(11)VV′+λIα=z,(12)α=G+λI-1z,where G=VV′ or Gij=〈v-i,v-j〉. 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 datasetS={x,y,z} in Cartesian coordinates (x,y,z), where (x,y)=Φvi,…,Φvn′. By rotating θ1 around the x-axis and θ2 around the y-axis, the geometrical transformation is implemented. Finally, the plane P1:z=w1x+w2y, which denotes the relations of the dataset S, coincides with plane yoz. θ1 equals the supplementary angle between plane yoz and the plane defined by the normal vector n1 of the plane P1 and the axial vector i=(1,0,0). It can be written as(13)θ1=π2-arccos⁡jn1-ijn1-i,where j=(0,1,0) is the normal vector of plane xoz. θ2 equals the angle between plane yoz and the plane P2 obtained by transforming P1. It can be expressed as(14)θ2=π2-arccos⁡n2ijn2-i,where n2 is the normal vector of plane P2. Therefore, the transformed dataset S-={x-,y-,z-}. It can be given by(15)T=10000cos⁡⁡θ1sin⁡θ100-sin⁡θ1cos⁡⁡θ100001cos⁡⁡θ20sin⁡θ200100-sin⁡θ20cos⁡⁡θ200001,x-y-z-1=xyz1T,where T 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 datasetS-. First, it evaluates the minimum x-min⁡ (or y-min⁡) and the range x-ran (or y-ran) of the vector x- (or y-) components. Then, vector x- (or y-) subtracts the minimum x-min⁡ (or y-min⁡) and is divided by the range x-ran (or y-ran). Finally, we obtain the new dataset S^={x^,y^,z^}.Step 4.
We train the ANFIS with two inputs, four rules, and one output. The inputsx^,y^ and output z^ are obtained from dataset S^. The input space (x^,y^) 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 z-axis.


## 5. Results and Discussion

### 5.1. Training and Validating the ANFIS Model

Data transformation maps the training data pair to the square region[0,1]×[0,1] 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.Figure5 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 z-axis between the ANFIS output and the measured data is shown in Figure 6(c).Figure 5
((a), (b)) MFs before training; ((c), (d)) MFs after training.
(a)
Initial MFs onx
(b)
Initial MFs ony
(c)
Final MFs onx
(d)
Final MFs onyFigure 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.
(a)
(b)
(c)
(d)We obtain the testing dataset from a new cutting condition used for validating the ANFIS model, and the cutting condition is shown in Figure8(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 z-axis can be up to less than 6 μm. It shows that the ANFIS model can predict the spindle deformation along the z-axis well, even under new conditions.


### 5.2. 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 Figure7, 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 z-axis. We set the learning rate to μ=0.01 and the mean square error ε as 0.01.Figure 7
BP network architecture.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.
(a)
(b)
(c)
(d)To compare the performances of the ANFIS model and BP network, we employ the following evaluation criteria.Root mean squared error (RMSE):(16)RMSE=1N∑i=1NAi-Pi2,where Ai and Pi denote the actual and predicted deformations, respectively, and N denotes the number of datasets.Mean absolute percentage error (MAPE):(17)MAPE=1N∑i=1NAi-PiAi×100%.Correlation coefficient (R): (18)R=∑i=1NAi-A-Pi-P-∑i=1NAi-A-2∑i=1NPi-P-2,where A-=∑i=1N‍Ai/N and P-=∑i=1N‍Pi. From these evaluation criteria, we know that the smaller the RMSE and the MAPE and the larger R, the better the predicted performance. Table 1 presents the performances of the ANFIS model and BP network. We can see from Table 1 that the ANFIS model has a smaller RMSE and MAPE and a bigger R than the BP network.Table 1
Performances of the ANFIS model and BP network.
Model
RMSE
MAPE (%)
R
Training dataset
ANFIS model
0.56
0.29
0.9994
BP network
1.53
3.42
0.9983
Testing dataset
ANFIS model
0.89
0.67
0.9991
BP network
1.62
3.53
0.9974Using the BP network based on the training and testing datasets, we predict the spindle deformation along thez-axis, and the results are illustrated in Figures 6(d) and 8(d), respectively. We can see from Figures 6(d) 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 Figure 8(c). In the intervals above, we can deduce from Figures 8(c) and 8(d) that the ANFIS model can respond more quickly than the BP network; thus it can produce smaller prediction error.


## 5.1. Training and Validating the ANFIS Model

Data transformation maps the training data pair to the square region[0,1]×[0,1] 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.Figure5 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 z-axis between the ANFIS output and the measured data is shown in Figure 6(c).Figure 5
((a), (b)) MFs before training; ((c), (d)) MFs after training.
(a)
Initial MFs onx
(b)
Initial MFs ony
(c)
Final MFs onx
(d)
Final MFs onyFigure 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.
(a)
(b)
(c)
(d)We obtain the testing dataset from a new cutting condition used for validating the ANFIS model, and the cutting condition is shown in Figure8(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 z-axis can be up to less than 6 μm. It shows that the ANFIS model can predict the spindle deformation along the z-axis well, even under new conditions.


## 5.2. 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 Figure7, 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 z-axis. We set the learning rate to μ=0.01 and the mean square error ε as 0.01.Figure 7
BP network architecture.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.
(a)
(b)
(c)
(d)To compare the performances of the ANFIS model and BP network, we employ the following evaluation criteria.Root mean squared error (RMSE):(16)RMSE=1N∑i=1NAi-Pi2,where Ai and Pi denote the actual and predicted deformations, respectively, and N denotes the number of datasets.Mean absolute percentage error (MAPE):(17)MAPE=1N∑i=1NAi-PiAi×100%.Correlation coefficient (R): (18)R=∑i=1NAi-A-Pi-P-∑i=1NAi-A-2∑i=1NPi-P-2,where A-=∑i=1N‍Ai/N and P-=∑i=1N‍Pi. From these evaluation criteria, we know that the smaller the RMSE and the MAPE and the larger R, the better the predicted performance. Table 1 presents the performances of the ANFIS model and BP network. We can see from Table 1 that the ANFIS model has a smaller RMSE and MAPE and a bigger R than the BP network.Table 1
Performances of the ANFIS model and BP network.
Model
RMSE
MAPE (%)
R
Training dataset
ANFIS model
0.56
0.29
0.9994
BP network
1.53
3.42
0.9983
Testing dataset
ANFIS model
0.89
0.67
0.9991
BP network
1.62
3.53
0.9974Using the BP network based on the training and testing datasets, we predict the spindle deformation along thez-axis, and the results are illustrated in Figures 6(d) and 8(d), respectively. We can see from Figures 6(d) 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 Figure 8(c). In the intervals above, we can deduce from Figures 8(c) and 8(d) that the ANFIS model can respond more quickly than the BP network; thus it can produce smaller prediction error.


## 6. Conclusions

This paper proposes a new method for establishing the relationship between temperature data and spindle deformation along thez-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 thez-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 if-then 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 if-then 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.



---

*Source: 130253-2015-05-18.xml*