# Thermal Error Modelling of the Spindle Using Neurofuzzy Systems

Authors: Jingan Feng; Xiaoqi Tang; Yanlei Li; Bao Song
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

This paper proposes a new combined model to predict the spindle deformation, which combines the grey models and the ANFIS (adaptive neurofuzzy inference system) model. The grey models are used to preprocess the original data, and the ANFIS model is used to adjust the combined model. The outputs of the grey models are used as the inputs of the ANFIS model to train the model. To evaluate the performance of the combined model, an experiment is implemented. Three Pt100 thermal resistances are used to monitor the spindle temperature and an inductive current sensor is used to obtain the spindle deformation. The experimental results display that the combined model can better predict the spindle deformation compared to BP network, and it can greatly improve the performance of the spindle.


---

## Body

## 1. Introduction

Accuracy of machined work pieces is one of the most critical considerations for any manufacturer. In all components of machine tools, the spindle is the most important component because it provides cutting power and is part of the force chain between the machine tool structure and the tool. It directly affects the accuracy of work pieces and is one of the main error sources in terms of its contribution to the total heat generation and the resulting deformations [1]. Hence, the performance of the spindles directly determines the machine tools entire performance [2].The accuracy of machine tools depends on positioning errors. In the overall position errors, thermal errors caused by internal heat sources and environment are up to 70% [3]. Thermal error is a time-varying and nonlinear procedure induced by nonuniform temperature variation. The interactions between the thermal expansion of components, heat sources, and heat conduction produce complex thermal behavior. For machine tools, constructing a precise structure model is extremely difficult, very costly, and time-consuming, and much easier methods are to use error compensation [4]. With effective compensation, using medium precise machine tools can manufacture work pieces with higher accuracy [5]. Thermal error compensation has become a cost-effective method to improve accuracy of machine tools, especially with the increasing demand for machining accuracy in recent years.Since the two keynote papers, the first about thermal effects from [6] and the second about error reduction and compensation of machine tools from [1], a lot of research in this area has been performed. For the error caused by the heat deformation, compensation methods are divided into direct and indirect compensation. Direct compensation directly measures the drift displacements between the tool and the work piece to compensate positioning errors. Indirect compensation uses mathematical or physical models to find the relationship between auxiliary values (such as temperature variables) and thermal deformation. The output of the models is used to compensate positioning errors. In many situations, direct compensation is often quite difficult because the measurement of the drift is not always possible during the machining process. Hence, indirect compensation is more convenient and easier. Researchers have developed many indirect compensation methods, such as finite element analysis [7–9], regression analysis [10–12], fuzzy logic [13, 14], neural networks [15–17], and the combination of two or three methods [18–20].Currently, most current research focuses on using ANNs (artificial neural networks) to build error compensation models based on temperature variables. Compared with other models, ANNs has the advantages of parallel processing, information distribution saving, and self-learning ability. In recent years, different types of ANNs have been developed, including radial basis function (RBF) network [15, 21], feed-forward neural networks [22], backpropagation (BP) network [23], grey neural network [19], Elman network [24], integrated recurrent neural network [25], and cerebellar model articulation controller (CMAC) neural network [26]. However, these neural-modelling methods have poor generalization capability and are sensitive for external noise. For the random initialized weights, the learning course may trap in local minima, and some neurons may give rise to saturation. So traditional ANNs is not fit for modelling the time-varying and nonlinear procedure of thermal error.Adaptive neurofuzzy inference system (ANFIS) used in this paper is a neurofuzzy approach. It combines the fuzzy logic qualitative characteristics and neural network adaptive capabilities. Therefore, it is more flexible on structure, and it can more effectively approximate a highly nonlinear surface than traditional ANNs. As a neurofuzzy modelling method, it has been widely used in different fields, such as prediction [27, 28], knowledge discovery [29], control system [30, 31], and spattern recognition [32].In this paper, we propose a new combined model to predict the spindle deformation, which combines the grey model and the ANFIS model. The grey models are used to preprocess the original data, and the ANFIS model is used to adjust the combined model. To evaluate the performance of the model, the experiment for the spindle is implemented. The results show that the combined model has high prediction accuracy, and it has better performance than BP networks.The paper is organized as follows. Section2 presents our proposed model combining the grey models and the ANFIS model. Section 3 describes the experimental setup. Section 4 describes the experimental results and performs comparisons of the combined model and BP network. Finally, conclusions are presented in Section 5.


## 2. Building the Predictive Model

### 2.1. Data Preprocessing

In order to reduce the randomness of the original data and the influence of unpredictable noises, we use the grey model to preprocess the original data, namely, the measured data of the spindle. Grey system theory is a kind of systematic and scientific theory developed originally by Deng [33] in the 1980s.Based on the original data of the spindle, we establish the grey model GM(
1
,
N
), which is a first-order grey model with N variables. The following steps are performed.Step 1.
Create the original data sequence containing the temperature and thermal deformation of the spindle and it is expressed as follows:(1)
x
i
0
=
x
i
0
1
,
x
i
0
2
,
…
,
x
i
0
n
,
i
=
1,2
,
…
,
N
,where x
1
(
0
) is the thermal deformation data sequence, x
i
(
0
) is the temperature data sequence, and n is the sample size of the data.Step 2.
Using the accumulated generating operation (AGO), we convert chaotic seriesx
i
(
0
) into monotonously increasing series x
i
(
1
), and it is given by(2)
x
i
1
=
x
i
1
1
,
x
i
1
2
,
…
,
x
i
1
n
,where x
i
(
1
)
(
k
) is calculated by(3)
x
i
1
k
=
∑
j
=
1
k
x
i
0
j
,
k
=
1,2
,
…
,
n
.Step 3.
With the following first-level mean generating operation (MGO), we create the background seriesz
1
(
1
) from x
1
(
1
), and it is expressed as follows:(4)
z
i
1
k
=
0.5
x
i
1
k
+
0.5
x
i
1
k
-
1
,
k
=
2,3
,
…
,
n
.Step 4.
Establish the grey differential equation of the grey model GM(
1
,
N
), and it is expressed as follows:(5)
x
1
0
k
+
b
1
z
1
1
k
=
∑
i
=
2
N
b
i
x
i
1
k
,where the parameters [
b
1
,
b
2
,
…
,
b
N
] can be obtained by using the least-square method as follows:(6)
P
=
b
1
,
b
2
,
…
,
b
N
=
B
T
B
-
1
B
T
Y
1
,where(7)
B
=
-
z
1
1
2
x
2
1
2
⋯
x
N
1
2
-
z
1
1
3
x
2
1
3
⋯
x
N
1
3
⋮
⋮
⋮
⋮
-
z
1
1
n
x
2
1
n
⋯
x
N
1
n
,
Y
1
=
x
1
0
2
,
x
1
0
3
,
…
,
x
1
0
n
T
.Step 5.
Set up the grey model GM(
1
,
N
) as follows:(8)
x
^
1
1
k
+
1
=
x
1
1
1
-
1
b
1
∑
i
=
2
N
b
i
x
i
1
k
+
1
e
-
b
1
k
+
1
b
1
∑
i
=
2
N
b
i
x
i
1
k
+
1
,where x
^
1
(
1
)
(
k
) is the prediction value at a time k. Using the first-level inverse accumulated generating operation (IAGO), we can obtain the output of the grey model GM(
1
,
N
):(9)
x
^
1
0
k
+
1
=
x
^
1
1
k
+
1
-
x
^
1
1
k
.In the data preprocessing, we use the data sequence where (
x
i
(
0
)
(
1
)
,
x
i
(
0
)
(
2
)
,
…
,
x
i
(
0
)
(
k
)
)
k
<
n, to predict x
^
1
(
0
)
(
k
+
1
), namely, the thermal deformation of the spindle. We employ three groups of grey models, which have different length k of the data sequence. The outputs of the grey models are used as the inputs of our proposed ANFIS model, together with the measured thermal deformation used as the output, to train the ANFIS model.


### 2.2. Model Adjustment Using ANFIS

For getting better predictive effect, we use ANFIS to perform the adjustment of the combined model. ANFIS is a fuzzy inference system (FIS) implemented as a neural network, firstly proposed by Jang [34] in 1993, and then has been widely used [35–37]. It is a five layered feed-forward neural network structure and uses fuzzy reasoning and neural network learning algorithms to map inputs into an output. The ANFIS architecture used in this paper is shown in Figure 1. It uses the first-order Sugeno fuzzy model and has three inputs linked with three membership functions (MFs), eight rules, and one output.Figure 1
Adaptive neurofuzzy inference system.For the first-order Sugeno fuzzy model, the rule set with eight fuzzy if-then rules can be expressed as follows:Rule  1:
Ifx is A
1, y is B
1, and z is C
1,
thenf
1,1
,
1
=
p
1,1
,
1
x
+
q
1,1
,
1
y
+
r
1,1
,
1
z
+
m
1,1
,
1.
Rule  2:
Ifx is A
1, y is B
1, and z is C
2,
thenf
1,1
,
2
=
p
1,1
,
2
x
+
q
1,1
,
2
y
+
r
1,1
,
2
z
+
m
1,1
,
2.
Rule  3:
Ifx is A
1, y is B
2, and z is C
1,
thenf
1,2
,
1
=
p
1,2
,
1
x
+
q
1,2
,
1
y
+
r
1,2
,
1
z
+
m
1,2
,
1.
Rule  4:
Ifx is A
1, y is B
2, and z is C
2,
thenf
1,2
,
2
=
p
1,2
,
2
x
+
q
1,2
,
2
y
+
r
1,2
,
2
z
+
m
1,2
,
2.
Rule  5:
Ifx is A
2, y is B
1, and z is C
1,
thenf
2,1
,
1
=
p
2,1
,
1
x
+
q
2,1
,
1
y
+
r
2,1
,
1
z
+
m
2,1
,
1.
Rule  6:
Ifx is A
2, y is B
1, and z is C
2,
thenf
2,1
,
2
=
p
2,1
,
2
x
+
q
2,1
,
2
y
+
r
2,1
,
2
z
+
m
2,1
,
2.
Rule  7:
Ifx is A
2, y is B
2, and z is C
1,
thenf
2,2
,
1
=
p
2,2
,
1
x
+
q
2,2
,
1
y
+
r
2,2
,
1
z
+
m
2,2
,
1.
Rule  8:
Ifx is A
2, y is B
2, and z is C
2,
thenf
2,2
,
2
=
p
2,2
,
2
x
+
q
2,2
,
2
y
+
r
2,2
,
2
z
+
m
2,2
,
2.where x, y, and z are the inputs, A
1 (or A
2), B
1 (or B
2), and C
1 (or C
2) are the fuzzy sets, f
i
,
j
,
k (i
,
j
,
k
=
1,2) are crisp functions in the consequent, and p
i
,
j
,
k, q
i
,
j
,
k, r
i
,
j
,
k, and m
i
,
j
,
k are consequent parameters determined during the training process.The ANFIS has five layers, where nodes of the same layer have the similar function. We define the output of the node of the layerl as O
n
l, where n
(
n
=
1
,
…
,
8
) denotes the node position in the vertical direction. It is detailed as follows.Layer 1.
In this layer, all nodes are adaptive nodes and use square nodes to represent the membership function. The outputsO
n
1 of this layer are the fuzzy membership grade of the input x (or y
,
z), which is defined by(10)
O
n
1
=
μ
A
i
x
,
for
i
=
1,2
,
n
=
1,2
,
O
n
1
=
μ
B
j
y
,
for
j
=
1,2
,
n
=
3,4
,
O
n
1
=
μ
C
k
z
,
for
j
=
1,2
,
n
=
5,6
,where x (or y, z) is the crisp input to nodes and A
i (or B
j, C
k) is a fuzzy set linked with this node, characterized by the shape of MFs, and MFs can be any continuous and piecewise differentiable functions, such as Gaussian, generalized bell shaped, trapezoidal shaped, and triangular shaped functions. We employ generalized bell functions as MFs, which are defined by(11)
μ
A
i
x
=
b
e
l
l
x
;
a
i
,
b
i
,
c
i
=
1
1
+
x
-
c
i
/
a
i
2
b
i
,
f
o
r
i
=
1,2
,
μ
B
j
x
=
b
e
l
l
x
;
a
j
,
b
j
,
c
j
=
1
1
+
x
-
c
j
/
a
j
2
b
j
,
f
o
r
j
=
1,2
,
μ
C
k
x
=
b
e
l
l
x
;
a
k
,
b
k
,
c
k
=
1
1
+
x
-
c
k
/
a
k
2
b
k
,
f
o
r
k
=
1,2
,where (a
i
,
b
i
,
c
i), (a
j
,
b
j
,
c
j), and (a
k
,
b
k
,
c
k) are premise parameters, governing generalized bell MFs accordingly.Layer 2.
This layer is the rule layer using circle nodes to represent fixed nodes. Each node in this layer is labelled as∏, indicating that they perform as a simple multiplier. The outputs of this layer are represented as follows:(12)
O
n
2
=
w
i
,
j
,
k
=
μ
A
i
x
μ
B
j
y
μ
C
k
z
,
f
o
r
i
,
j
,
k
=
1,2
.The outputs denote the firing strength of rules and is the weight degree of if-then rules in the antecedent.Layer 3.
The nodes are also fixed nodes labelledN, indicating that they play a normalization role to the firing strengths from the previous layer. The outputs of this layer are expressed as follows:(13)
O
n
3
=
w
-
i
,
j
,
k
=
w
i
,
j
,
k
∑
i
,
j
,
k
=
1,2
w
i
,
j
,
k
,
f
o
r
i
,
j
,
k
=
1,2which are the so-called normalized firing strengths.Layer 4.
This layer is the consequent layer using square adaptive nodes. The output of each node is simply the product of the normalized firing strengthw
-
i
,
j
,
k and a first-order polynomial based on the first-order Sugeno model. The outputs of this layer are given by(14)
O
n
4
=
w
-
i
,
j
,
k
f
i
,
j
,
k
=
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
,
f
o
r
i
,
j
,
k
=
1,2
.Parameters in this layer are referred to as consequent parameters.Layer 5.
This layer is only single fixed node labelled with∑. This node performs the summation of all incoming signals. Hence, the overall output of the model is given by(15)
O
n
5
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
f
i
,
j
,
k
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
.


### 2.3. Hybrid Algorithm

The task of the learning algorithm for the ANFIS model is to tune all the fitting parameters, namely, premise parameters and consequent parameters, and make the ANFIS model achieve a desired input/output mapping.As shown in Figure1, there are two adaptive layers in the ANFIS model, namely, Layers 1 and 4. They have fitting parameters {
a
i
,
b
i
,
c
i
}, {
a
j
,
b
j
,
c
j
}, {
a
k
,
b
k
,
c
k
}, and {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}. The number of fitting parameters is 50, including 18 premise parameters {
a
i
,
b
i
,
c
i
}, {
a
j
,
b
j
,
c
j
}, and {
a
k
,
b
k
,
c
k
} and 32 consequent parameters {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}.The learning algorithm for the ANFIS model is the hybrid algorithm combining the gradient descent and least-squares method, which contains the forward pass and backward pass. In the forward pass, fixing premise parameters, it uses the least-squares method to optimize consequent parameters. When the consequent optimal parameters are found, the backward pass begins. In the backward pass, fixing consequent parameters, it uses the gradient descent method to optimize premise parameters.Forward Pass. Fixing premise parameters, the output of the ANFIS model can be expressed as follows:(16)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
f
i
,
j
,
k
.Substituting the fuzzy if-then rules into (16), it becomes(17)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
.After rearrangement, the output can be written as follows:(18)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
x
p
i
,
j
,
k
+
w
-
i
,
j
,
k
y
q
i
,
j
,
k
+
w
-
i
,
j
,
k
z
r
i
,
j
,
k
+
w
-
i
,
j
,
k
m
i
,
j
,
kwhich is a linear combination of the fitting consequent parameters {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}. The least-squares method is used to identify the optimal parameters. Once the consequent optimal parameters are found, the backward pass starts immediately.Backward Pass. Fixing consequent parameters, it uses the gradient descent method to optimize the premise parameters corresponding to the fuzzy sets in the input domain. The output of the ANFIS model is calculated by using the consequent parameters found in the forward pass. The output error is controlled to optimize the premise parameters by means of a standard backpropagation algorithm. It has been proven that the algorithm is highly efficient in the training process [34].


## 2.1. Data Preprocessing

In order to reduce the randomness of the original data and the influence of unpredictable noises, we use the grey model to preprocess the original data, namely, the measured data of the spindle. Grey system theory is a kind of systematic and scientific theory developed originally by Deng [33] in the 1980s.Based on the original data of the spindle, we establish the grey model GM(
1
,
N
), which is a first-order grey model with N variables. The following steps are performed.Step 1.
Create the original data sequence containing the temperature and thermal deformation of the spindle and it is expressed as follows:(1)
x
i
0
=
x
i
0
1
,
x
i
0
2
,
…
,
x
i
0
n
,
i
=
1,2
,
…
,
N
,where x
1
(
0
) is the thermal deformation data sequence, x
i
(
0
) is the temperature data sequence, and n is the sample size of the data.Step 2.
Using the accumulated generating operation (AGO), we convert chaotic seriesx
i
(
0
) into monotonously increasing series x
i
(
1
), and it is given by(2)
x
i
1
=
x
i
1
1
,
x
i
1
2
,
…
,
x
i
1
n
,where x
i
(
1
)
(
k
) is calculated by(3)
x
i
1
k
=
∑
j
=
1
k
x
i
0
j
,
k
=
1,2
,
…
,
n
.Step 3.
With the following first-level mean generating operation (MGO), we create the background seriesz
1
(
1
) from x
1
(
1
), and it is expressed as follows:(4)
z
i
1
k
=
0.5
x
i
1
k
+
0.5
x
i
1
k
-
1
,
k
=
2,3
,
…
,
n
.Step 4.
Establish the grey differential equation of the grey model GM(
1
,
N
), and it is expressed as follows:(5)
x
1
0
k
+
b
1
z
1
1
k
=
∑
i
=
2
N
b
i
x
i
1
k
,where the parameters [
b
1
,
b
2
,
…
,
b
N
] can be obtained by using the least-square method as follows:(6)
P
=
b
1
,
b
2
,
…
,
b
N
=
B
T
B
-
1
B
T
Y
1
,where(7)
B
=
-
z
1
1
2
x
2
1
2
⋯
x
N
1
2
-
z
1
1
3
x
2
1
3
⋯
x
N
1
3
⋮
⋮
⋮
⋮
-
z
1
1
n
x
2
1
n
⋯
x
N
1
n
,
Y
1
=
x
1
0
2
,
x
1
0
3
,
…
,
x
1
0
n
T
.Step 5.
Set up the grey model GM(
1
,
N
) as follows:(8)
x
^
1
1
k
+
1
=
x
1
1
1
-
1
b
1
∑
i
=
2
N
b
i
x
i
1
k
+
1
e
-
b
1
k
+
1
b
1
∑
i
=
2
N
b
i
x
i
1
k
+
1
,where x
^
1
(
1
)
(
k
) is the prediction value at a time k. Using the first-level inverse accumulated generating operation (IAGO), we can obtain the output of the grey model GM(
1
,
N
):(9)
x
^
1
0
k
+
1
=
x
^
1
1
k
+
1
-
x
^
1
1
k
.In the data preprocessing, we use the data sequence where (
x
i
(
0
)
(
1
)
,
x
i
(
0
)
(
2
)
,
…
,
x
i
(
0
)
(
k
)
)
k
<
n, to predict x
^
1
(
0
)
(
k
+
1
), namely, the thermal deformation of the spindle. We employ three groups of grey models, which have different length k of the data sequence. The outputs of the grey models are used as the inputs of our proposed ANFIS model, together with the measured thermal deformation used as the output, to train the ANFIS model.


## 2.2. Model Adjustment Using ANFIS

For getting better predictive effect, we use ANFIS to perform the adjustment of the combined model. ANFIS is a fuzzy inference system (FIS) implemented as a neural network, firstly proposed by Jang [34] in 1993, and then has been widely used [35–37]. It is a five layered feed-forward neural network structure and uses fuzzy reasoning and neural network learning algorithms to map inputs into an output. The ANFIS architecture used in this paper is shown in Figure 1. It uses the first-order Sugeno fuzzy model and has three inputs linked with three membership functions (MFs), eight rules, and one output.Figure 1
Adaptive neurofuzzy inference system.For the first-order Sugeno fuzzy model, the rule set with eight fuzzy if-then rules can be expressed as follows:Rule  1:
Ifx is A
1, y is B
1, and z is C
1,
thenf
1,1
,
1
=
p
1,1
,
1
x
+
q
1,1
,
1
y
+
r
1,1
,
1
z
+
m
1,1
,
1.
Rule  2:
Ifx is A
1, y is B
1, and z is C
2,
thenf
1,1
,
2
=
p
1,1
,
2
x
+
q
1,1
,
2
y
+
r
1,1
,
2
z
+
m
1,1
,
2.
Rule  3:
Ifx is A
1, y is B
2, and z is C
1,
thenf
1,2
,
1
=
p
1,2
,
1
x
+
q
1,2
,
1
y
+
r
1,2
,
1
z
+
m
1,2
,
1.
Rule  4:
Ifx is A
1, y is B
2, and z is C
2,
thenf
1,2
,
2
=
p
1,2
,
2
x
+
q
1,2
,
2
y
+
r
1,2
,
2
z
+
m
1,2
,
2.
Rule  5:
Ifx is A
2, y is B
1, and z is C
1,
thenf
2,1
,
1
=
p
2,1
,
1
x
+
q
2,1
,
1
y
+
r
2,1
,
1
z
+
m
2,1
,
1.
Rule  6:
Ifx is A
2, y is B
1, and z is C
2,
thenf
2,1
,
2
=
p
2,1
,
2
x
+
q
2,1
,
2
y
+
r
2,1
,
2
z
+
m
2,1
,
2.
Rule  7:
Ifx is A
2, y is B
2, and z is C
1,
thenf
2,2
,
1
=
p
2,2
,
1
x
+
q
2,2
,
1
y
+
r
2,2
,
1
z
+
m
2,2
,
1.
Rule  8:
Ifx is A
2, y is B
2, and z is C
2,
thenf
2,2
,
2
=
p
2,2
,
2
x
+
q
2,2
,
2
y
+
r
2,2
,
2
z
+
m
2,2
,
2.where x, y, and z are the inputs, A
1 (or A
2), B
1 (or B
2), and C
1 (or C
2) are the fuzzy sets, f
i
,
j
,
k (i
,
j
,
k
=
1,2) are crisp functions in the consequent, and p
i
,
j
,
k, q
i
,
j
,
k, r
i
,
j
,
k, and m
i
,
j
,
k are consequent parameters determined during the training process.The ANFIS has five layers, where nodes of the same layer have the similar function. We define the output of the node of the layerl as O
n
l, where n
(
n
=
1
,
…
,
8
) denotes the node position in the vertical direction. It is detailed as follows.Layer 1.
In this layer, all nodes are adaptive nodes and use square nodes to represent the membership function. The outputsO
n
1 of this layer are the fuzzy membership grade of the input x (or y
,
z), which is defined by(10)
O
n
1
=
μ
A
i
x
,
for
i
=
1,2
,
n
=
1,2
,
O
n
1
=
μ
B
j
y
,
for
j
=
1,2
,
n
=
3,4
,
O
n
1
=
μ
C
k
z
,
for
j
=
1,2
,
n
=
5,6
,where x (or y, z) is the crisp input to nodes and A
i (or B
j, C
k) is a fuzzy set linked with this node, characterized by the shape of MFs, and MFs can be any continuous and piecewise differentiable functions, such as Gaussian, generalized bell shaped, trapezoidal shaped, and triangular shaped functions. We employ generalized bell functions as MFs, which are defined by(11)
μ
A
i
x
=
b
e
l
l
x
;
a
i
,
b
i
,
c
i
=
1
1
+
x
-
c
i
/
a
i
2
b
i
,
f
o
r
i
=
1,2
,
μ
B
j
x
=
b
e
l
l
x
;
a
j
,
b
j
,
c
j
=
1
1
+
x
-
c
j
/
a
j
2
b
j
,
f
o
r
j
=
1,2
,
μ
C
k
x
=
b
e
l
l
x
;
a
k
,
b
k
,
c
k
=
1
1
+
x
-
c
k
/
a
k
2
b
k
,
f
o
r
k
=
1,2
,where (a
i
,
b
i
,
c
i), (a
j
,
b
j
,
c
j), and (a
k
,
b
k
,
c
k) are premise parameters, governing generalized bell MFs accordingly.Layer 2.
This layer is the rule layer using circle nodes to represent fixed nodes. Each node in this layer is labelled as∏, indicating that they perform as a simple multiplier. The outputs of this layer are represented as follows:(12)
O
n
2
=
w
i
,
j
,
k
=
μ
A
i
x
μ
B
j
y
μ
C
k
z
,
f
o
r
i
,
j
,
k
=
1,2
.The outputs denote the firing strength of rules and is the weight degree of if-then rules in the antecedent.Layer 3.
The nodes are also fixed nodes labelledN, indicating that they play a normalization role to the firing strengths from the previous layer. The outputs of this layer are expressed as follows:(13)
O
n
3
=
w
-
i
,
j
,
k
=
w
i
,
j
,
k
∑
i
,
j
,
k
=
1,2
w
i
,
j
,
k
,
f
o
r
i
,
j
,
k
=
1,2which are the so-called normalized firing strengths.Layer 4.
This layer is the consequent layer using square adaptive nodes. The output of each node is simply the product of the normalized firing strengthw
-
i
,
j
,
k and a first-order polynomial based on the first-order Sugeno model. The outputs of this layer are given by(14)
O
n
4
=
w
-
i
,
j
,
k
f
i
,
j
,
k
=
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
,
f
o
r
i
,
j
,
k
=
1,2
.Parameters in this layer are referred to as consequent parameters.Layer 5.
This layer is only single fixed node labelled with∑. This node performs the summation of all incoming signals. Hence, the overall output of the model is given by(15)
O
n
5
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
f
i
,
j
,
k
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
.


## 2.3. Hybrid Algorithm

The task of the learning algorithm for the ANFIS model is to tune all the fitting parameters, namely, premise parameters and consequent parameters, and make the ANFIS model achieve a desired input/output mapping.As shown in Figure1, there are two adaptive layers in the ANFIS model, namely, Layers 1 and 4. They have fitting parameters {
a
i
,
b
i
,
c
i
}, {
a
j
,
b
j
,
c
j
}, {
a
k
,
b
k
,
c
k
}, and {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}. The number of fitting parameters is 50, including 18 premise parameters {
a
i
,
b
i
,
c
i
}, {
a
j
,
b
j
,
c
j
}, and {
a
k
,
b
k
,
c
k
} and 32 consequent parameters {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}.The learning algorithm for the ANFIS model is the hybrid algorithm combining the gradient descent and least-squares method, which contains the forward pass and backward pass. In the forward pass, fixing premise parameters, it uses the least-squares method to optimize consequent parameters. When the consequent optimal parameters are found, the backward pass begins. In the backward pass, fixing consequent parameters, it uses the gradient descent method to optimize premise parameters.Forward Pass. Fixing premise parameters, the output of the ANFIS model can be expressed as follows:(16)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
f
i
,
j
,
k
.Substituting the fuzzy if-then rules into (16), it becomes(17)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
p
i
,
j
,
k
x
+
q
i
,
j
,
k
y
+
r
i
,
j
,
k
z
+
m
i
,
j
,
k
.After rearrangement, the output can be written as follows:(18)
f
=
∑
i
=
1
2
∑
j
=
1
2
∑
k
=
1
2
w
-
i
,
j
,
k
x
p
i
,
j
,
k
+
w
-
i
,
j
,
k
y
q
i
,
j
,
k
+
w
-
i
,
j
,
k
z
r
i
,
j
,
k
+
w
-
i
,
j
,
k
m
i
,
j
,
kwhich is a linear combination of the fitting consequent parameters {
p
i
,
j
,
k
,
q
i
,
j
,
k
,
r
i
,
j
,
k
,
m
i
,
j
,
k
}. The least-squares method is used to identify the optimal parameters. Once the consequent optimal parameters are found, the backward pass starts immediately.Backward Pass. Fixing consequent parameters, it uses the gradient descent method to optimize the premise parameters corresponding to the fuzzy sets in the input domain. The output of the ANFIS model is calculated by using the consequent parameters found in the forward pass. The output error is controlled to optimize the premise parameters by means of a standard backpropagation algorithm. It has been proven that the algorithm is highly efficient in the training process [34].


## 3. Experiment Setup

The experiment was implemented on a vertical machining center to verify the effectiveness of our proposed method. Figure2 shows that the experimental setup is equipped with a spindle driven by a built-in AC motor through a precision gear box, maximum spindle speed 6000 rpm, high-speed tool holders using standard HSK, and a standard ceramic ball is installed to the tool holder of the spindle. An inductive current sensor fixed on the worktable, together with an analog data acquisition system, was used to measure the spindle deformation along z-axis. Analyzing the spindle structure, we know that it has three heat sources directly affecting the effective length of the spindle: the first is the front bearing of the spindle, the second is the driving box located in the back of the spindle housing, and the third is the AC motor providing the power for the spindle. The sensor placement strategy is as close as possible to heat sources, and it facilitates to monitor the temperature fluctuation of heat sources. Therefore, three Pt100 thermal resistances T
1
,
T
2
,
T
3 are attached on the housing surface of the spindle close to heat sources.Figure 2
Schematic illustration of experimental setup.As shown in Figure2, the data process system was composed of data acquisition card PXI-4351, data acquisition system PXI-9230, and a personal computer (PC). The data from sensors were obtained by PXI-4351. Using software Labview, we wrote the data process program that runs on PXI-9230. The data were analyzed by the program, and the results are output on the PC monitor. The entire process was controlled by the PC.In order to enhance the robustness of our proposed model, the training dataset should spread throughout the entire running stage, including the warming-up stage, machine tool pause, and the thermal equilibrium stage. The thermal deformation and temperature data were recorded at a sampling interval of 1 min, and it had 300 groups covering 300 min. They were divided into two groups used for training and testing the model. The spindle speed, temperature profiles from three Pt100 thermal resistances, and the thermal deformation of the spindle are illustrated in Figures4 and 6.


## 4. Results and Discussion

### 4.1. Training and Validating the Combined Model

In training, we use the training dataset to train the combined model. Using the grey models, we preprocess the original data, namely, the temperature data and the thermal deformation of the spindle. The outputs of the grey models, together with the measured thermal deformation of the spindle, are used to train the ANFIS model. For the training process of the ANFIS model, we choose the initial step sizeκ as 0.01 and the error of the convergent criterion ε as 0.1 μm. Using the hybrid algorithm, we can obtain the optimal parameters for the ANFIS model. Figure 3 shows the initial and final MFs before and after training. We can see from the figure that it has big changes for initial MFs. The comparison between the output of the combined model and the measured data of the spindle deformation is illustrated in Figure 4(c).Figure 3
Membership functions before and after training.
(a)
Initial MFs onx
,
y
,
z
(b)
Final MFs onx
(c)
Final MFs ony
(d)
Final MFs onzFigure 4
Training dataset: (a) the spindle speed; (b) the temperature of the AC motor and the driving box and the spindle; (c) the prediction of the combined model; (d) the prediction of BP network.
(a)
(b)
(c)
(d)In testing, we use the testing dataset to validate the effectiveness of the combined model. The comparison between the output of the combined model and the measured data of the spindle deformation is shown in Figure6(c). We can see from the figure that the residual error of the spindle deformation along z-axis can be greatly reduced from 45 μm to less than 6 μm. It shows that the combined model has a good adaptability, even if under different conditions.


### 4.2. Comparisons with BP Network

For the comparisons between different models, we built the backpropagation (BP) network that has the topology structure of 3-7-1. As illustrated in Figure5, it is composed of input layer, hidden layer, and output layer. Three input neurons receive temperature data from three Pt100 thermal resistances, seven hidden neurons deal with the data by Sigmoid functions, and one output neuron predicts the spindle deformation along z-axis.Figure 5
BP network architecture.Figure 6
Testing dataset: (a) the spindle speed; (b) the temperature of the AC motor and the driving box and the spindle; (c) the prediction of the combined model; (d) the prediction of BP network.
(a)
(b)
(c)
(d)In order to compare the performance of the combined model and BP network, we use the following evaluation standard.Root mean squared error (RMSE):(19)
R
M
S
E
=
1
N
∑
i
=
1
N
A
i
-
P
i
2
,where A
i denotes the actual deformation, P
i denotes the predicted deformation, and N denotes the number of the dataset.Mean absolute percentage error (MAPE):(20)
M
A
P
E
=
1
N
∑
i
=
1
N
A
i
-
P
i
A
i
×
100
%
.Correlation coefficient (R):(21)
R
=
∑
i
=
1
N
A
i
-
A
-
P
i
-
P
-
∑
i
=
1
N
A
i
-
A
-
2
∑
i
=
1
N
P
i
-
P
-
2
,where A
-
=
∑
i
=
1
N
A
i
/
N and P
-
=
∑
i
=
1
N
P
i. We can see from the three evaluation standards that when RMSE and MAPE are smaller, larger R have better performance.As shown in Table1, the performance of BP network and the combined model are listed. We can know from Table 1 that the combined model has smaller RMSE/MAPE and bigger R than BP network.Table 1
Comparisons of BP network and the combined model.
Model
Training dataset
RMSE
MAPE (%)
R
BP network
1.33
3.22
0.9973
Combined model
0.66
0.49
0.9992
Model
Testing dataset
RMSE
MAPE (%)
R
BP network
1.64
3.45
0.9964
Combined model
0.79
0.58
0.9989Using BP network to predict the spindle deformation alongz-axis, the results of training and testing are shown in Figures 4(d) and 6(d), respectively. We can see from these figures that BP network have larger deviation for the actual spindle deformation during the warming-up stage. Only when the temperature smoothly increases and the heat equilibrium of the spindle reaches a stable status, BP network has a good effect.Due to the change of the spindle speed, the fluctuation of the spindle deformation in these intervals[
20,40
], [
60,90
], and [
90,120
] is much bigger. In contrast with other intervals, the curve in the above intervals becomes more steep, as illustrated in Figure 6(c). In these intervals, we can see that the combined models have more quick response speed than BP network; thus, it has smaller residual error.


## 4.1. Training and Validating the Combined Model

In training, we use the training dataset to train the combined model. Using the grey models, we preprocess the original data, namely, the temperature data and the thermal deformation of the spindle. The outputs of the grey models, together with the measured thermal deformation of the spindle, are used to train the ANFIS model. For the training process of the ANFIS model, we choose the initial step sizeκ as 0.01 and the error of the convergent criterion ε as 0.1 μm. Using the hybrid algorithm, we can obtain the optimal parameters for the ANFIS model. Figure 3 shows the initial and final MFs before and after training. We can see from the figure that it has big changes for initial MFs. The comparison between the output of the combined model and the measured data of the spindle deformation is illustrated in Figure 4(c).Figure 3
Membership functions before and after training.
(a)
Initial MFs onx
,
y
,
z
(b)
Final MFs onx
(c)
Final MFs ony
(d)
Final MFs onzFigure 4
Training dataset: (a) the spindle speed; (b) the temperature of the AC motor and the driving box and the spindle; (c) the prediction of the combined model; (d) the prediction of BP network.
(a)
(b)
(c)
(d)In testing, we use the testing dataset to validate the effectiveness of the combined model. The comparison between the output of the combined model and the measured data of the spindle deformation is shown in Figure6(c). We can see from the figure that the residual error of the spindle deformation along z-axis can be greatly reduced from 45 μm to less than 6 μm. It shows that the combined model has a good adaptability, even if under different conditions.


## 4.2. Comparisons with BP Network

For the comparisons between different models, we built the backpropagation (BP) network that has the topology structure of 3-7-1. As illustrated in Figure5, it is composed of input layer, hidden layer, and output layer. Three input neurons receive temperature data from three Pt100 thermal resistances, seven hidden neurons deal with the data by Sigmoid functions, and one output neuron predicts the spindle deformation along z-axis.Figure 5
BP network architecture.Figure 6
Testing dataset: (a) the spindle speed; (b) the temperature of the AC motor and the driving box and the spindle; (c) the prediction of the combined model; (d) the prediction of BP network.
(a)
(b)
(c)
(d)In order to compare the performance of the combined model and BP network, we use the following evaluation standard.Root mean squared error (RMSE):(19)
R
M
S
E
=
1
N
∑
i
=
1
N
A
i
-
P
i
2
,where A
i denotes the actual deformation, P
i denotes the predicted deformation, and N denotes the number of the dataset.Mean absolute percentage error (MAPE):(20)
M
A
P
E
=
1
N
∑
i
=
1
N
A
i
-
P
i
A
i
×
100
%
.Correlation coefficient (R):(21)
R
=
∑
i
=
1
N
A
i
-
A
-
P
i
-
P
-
∑
i
=
1
N
A
i
-
A
-
2
∑
i
=
1
N
P
i
-
P
-
2
,where A
-
=
∑
i
=
1
N
A
i
/
N and P
-
=
∑
i
=
1
N
P
i. We can see from the three evaluation standards that when RMSE and MAPE are smaller, larger R have better performance.As shown in Table1, the performance of BP network and the combined model are listed. We can know from Table 1 that the combined model has smaller RMSE/MAPE and bigger R than BP network.Table 1
Comparisons of BP network and the combined model.
Model
Training dataset
RMSE
MAPE (%)
R
BP network
1.33
3.22
0.9973
Combined model
0.66
0.49
0.9992
Model
Testing dataset
RMSE
MAPE (%)
R
BP network
1.64
3.45
0.9964
Combined model
0.79
0.58
0.9989Using BP network to predict the spindle deformation alongz-axis, the results of training and testing are shown in Figures 4(d) and 6(d), respectively. We can see from these figures that BP network have larger deviation for the actual spindle deformation during the warming-up stage. Only when the temperature smoothly increases and the heat equilibrium of the spindle reaches a stable status, BP network has a good effect.Due to the change of the spindle speed, the fluctuation of the spindle deformation in these intervals[
20,40
], [
60,90
], and [
90,120
] is much bigger. In contrast with other intervals, the curve in the above intervals becomes more steep, as illustrated in Figure 6(c). In these intervals, we can see that the combined models have more quick response speed than BP network; thus, it has smaller residual error.


## 5. Conclusions

This paper presents a new combined model to predict the spindle deformation alongz-axis. In the combined model, the grey models are employed to preprocess the original data, and the ANFIS model is used to adjust the combined model. The following conclusions are drawn:(a)
Using the grey model to preprocess the original data, it can reduce the randomness of the original data and the influence of unpredictable noises.
(b)
Experimental validation was carried out. It can be known from the experimental results that the combined model could improve the thermal performance of the spindle and precisely predict the spindle deformation. Under the new spindle speed, the residual error of the spindle can be decreased from 45μm to less than 6 μm.
(c)
Comparing the results of the combined model and BP network, it shows the superiority of the combined model in the aspect of the prediction of the spindle deformation. Under the new spindle speed, MAPE of the combined model are less than 0.6%, and MAPE of BP network are greater than 3%, and the combined model can more quickly respond than BP network, and it can receive smaller residual error.
(d)
In nature, BP network is a black box, and the relationships between inputs and outputs are difficult to interpret, but ANFIS is transparent, and the if-then rules are easy to understand and interpret.



---

*Source: 8281490-2016-03-15.xml*