Feedback Control Based Active Cooling With Pre-estimated Reliability For Stabilizing The Thermal Error of a Precision Mechanical Spindle

Thermal error stability (STE) of the spindle determines the machining accuracy of a precision machine tool. Here we propose a thermal error feedback control based active cooling strategy for stabilizing the spindle thermal error in long-term. The strategy employs a cooling system as actuator and a thermal error regression model to output feedback. Structural temperature measurements are considerably interfered by the active cooling, so the regression models trained with experimental data might output inaccurate feedbacks in unseen work conditions. Such inaccurate feedbacks are the major cause for excessive fluctuations and failures of the thermal error control processes. Independence of the thermal data is analyzed, and a V-C (Vapnik-Chervonenkis) dimension based approach is presented to estimate the generalization error bound of the regression models. Then, the model which is most likely to give acceptable performance can be selected, the reliability of the feedbacks can be pre-estimated, pre-estimated, and the risk of unsatisfactory control effect will be largely reduced. Experiments under different work conditions are conducted to verify the proposed strategy, the thermal error is stabilized to be within a range smaller than 1.637μm, and thermal equilibrium time is advanced by more than 78.3%.


Introduction
Thermal error contributes to about 70% of the total machining error in precision machine tools [1][2][3][4]. Spindle is one core component of a precision machine tool, thermal error of the spindle is the major factor leads to the deterioration of machining accuracy for machine tools [5][6][7]. Precision machine tools usually preheats for long period to achieve thermal equilibrium before machining. Then, the relative position between the workpiece coordinate system and the machine coordinate system will be adjusted by tool setting, so that the stable part of the thermal error will be eliminated. We can conclude that the fluctuation range or stability of the spindle thermal error is a dominant factor that affects the machining accuracy.
Active cooling is an effective way to suppress the thermal deformation of a precision spindle. Liu et al. developed a closed-loop bath recirculation system for temperature control of a motorized spindle, the coolant supply power is adjusted to control the temperature rise between the outlet and inlet of the cooling channel, that is the spindle heat dissipation from cooling [8]. A power matching based heat dissipation strategy is then proposed, the coolant temperature varies with the estimated heat generation of the component under cooling [9]. Grama et al. proposed the Cooler Trigger Model strategy for temperature control of a spindle, which dynamically controls the switching frequency of the cooler compressor so that the heat extraction is in accordance with the estimated heat generation rate [10]. Ge et al. presented an external cooling equipment for a spindle, which includes a cooling unit, CFRP (Carbon Fiber Reinforced Polymer) bars, and thermoelectric modules [11]. The external cooling largely reduced the thermal deformation of the spindle. According to the heat generation estimation of the spindle components, constant coolant temperature cooling experiment for a precision spindle is carried out by our research team [12], the spindle thermal error is significantly reduced, but still not stabilized.
Aforementioned active cooling strategies aim at minimizing the overall deformation of the spindle structure, so that the thermal error can be reduced to minimum. But such strategies are generally performed based on constant coolant temperature or offline empirical and theoretical heat generation models, hence the heat dissipation rate cannot accurately adapt to the rapidly-changing dynamic thermal characteristics of the spindle and the thermal error can hardly be kept stable in longterm. Moreover, strategies aim at dissipating all generated heat and minimize overall structural deformation usually consume large amount of energy and bring extra costs such as complex cooling-channels structure and a multiple-loops cooling system.
Here we propose a thermal error feedback control based active cooling strategy for the mechanical spindle in a precision boring machine. This strategy regards the "spindle-thermal error-active cooling" system as a feedback control system, which employs temperature online measuring and a thermal error model to output feedback in real-time, and uses the cooler as actuator. The thermal error feedback control strategy does not seek to minimize the thermal deformation of the overall spindle structure, but to maintain the long-term stability so the thermal-induced error in machining can be minimized (by tool-setting). As a result, this strategy consumes low energy in the active cooling, and it can be put into practice without raising extra costs of multi-loops cooling system, modifying flow channel structure or additional cooling devices.
Much effort has been made to study high-quality data-driven regression modeling methods for the spindle thermal error, and the modeling methods are widely used in the thermal error compensation for various spindles [6,[13][14][15]. It seems such regression modeling methods can also be used for the thermal error feedback control, the onlinetemperature measurements can be used as the inputs for the spindle thermal error regression model, and the model can output feedback in real-time for the thermal error feedback control. Then, the coolant temperature will be adjusted according to the difference between the estimated thermal error and the RITE (Reference Input of Thermal Error).
However, as we have observed in experiments, the recirculation of the temperature-varying coolant exerts serious influences on the online structural temperature measurements of the spindle, which significantly affects the regression model's input. So that the estimations of the regression model can be inaccurate, and the actual thermal error will deviate from the input reference. Normally, the effect of systematic error of the feedback (model outputted thermal error) is equivalent to that of a different RITE, it usually affects the thermal error magnitude but not the STE. Few inaccurate estimations with large residuals mainly cause the thermal error to continuously deviate from the input reference, which leads to the accumulated deviations of thermal error. This is the major reason leads to occasional excessive thermal error fluctuations, even failure of the feedback control processes.
The long-term output accuracy of the thermal error model, namely the feedback accuracy, is vital for the thermal error control effect. As a matter of experimental fact, the thermal error can be stabilized for any normal speed conditions if the real-time thermal error measurement is used as feedback. However, the performance of a thermal error model cannot be ensured or reasonably estimated when facing unseen data from various work conditions, hence the thermal error stabilization level and its duration time in the feedback control processes are uncertain and instable.
We seek to address the issue of pre-estimating the reliability of feedbacks for the not-yet-in progress thermal error control process, so that we can prejudge that whether an acceptable model(regressor) can be trained with existing data and regression algorithms, or further data diversifying and cleansing, and algorithm modification are still need. A V-C (Vapnik-Chervonenkis) dimension [16] based generalization error bound [17] for the regression model is presented, by performing which the generalization error bound of feedbacks can be estimated for the not-yet-in progress thermal error control processes with high confidence.
In this study, the spindle thermal error feedback control method is first presented.
Then, independence of the experimental thermal error training data is analyzed, the V-C dimension for several thermal error models are calculated, and the generalization error bounds are estimated for the model with the confidence of 0.95. In this way the model which is most likely to give acceptable performance for unseen work conditions can be employed, the unqualified models which might output inaccurate feedbacks can be excluded, thus the risks of excessive fluctuations and failures for the thermal error feedback control processes will be largely reduced. Finally, experiments are conducted under different work conditions to verify the thermal error feedback control strategy for the mechanical spindle.

Thermal error feedback control based active cooling strategy
for the precision spindle

The active cooling system for the spindle
The mechanical spindle of a precision boring machine is taken as the study object.
The mechanical spindle isolates majority of the motor's heat generation, but the bearings still generate significant amount of heat, so that the thermal error is nonnegligible. Moreover, the mechanical spindle possesses no internal cooling channels, so an extra cooler of the mechanical spindle is needed for the experimental investigation.

The schematic diagram of the spindle active cooling system
The schematic diagram of the spindle active cooling system is presented in this paper is shown in Fig. 1. A Siemens S7-200 PLC is used as the controller of the system. Configuration software (Force Control) is adopted to control and monitor the cooling devices, which is run on a host computer. The coolant temperature is adjusted according to the control instruction; then, the coolant is pressurized with a recycle pump, and stabilized with a turbine flowmeter and flow control valve during the circulation. The coolant flows in the helical cooler, and finally circulates back to the coolant temperature controller. is developed by the secondary development of Force Control configuration software, and the data exchange between the active cooling system and the host computer through the SQL Server database. Same for the data exchange between the acquisition software in host computer and the synchronous measurement system. The control module uses SQL query operation to write the latest acquired data in a table of the database and execute the feedback control algorithm. The instructions for coolant temperature (uk) are written to another table in the database, and data in the table is then transferred to a real-time database by using ODBC router. Finally, uk are sent to PLC of the coolant temperature controller by an I/O driver.

Cooler design for the mechanical spindle
Due to that the mechanical spindle of the precision boring machine possesses no inner cooling channel, an external cooling scheme is proposed. Thermal simulation for the spindle under cooling is conducted to pre-validate the external cooling scheme before developing it. The boundary condition calculation and thermal simulation method for the spindle is referring to [12,18]. The calculated boundary conditions and the material properties of the thermal simulation are listed in Table 1   Thermal simulation results (Fig. 2) show that the external cooling largely reduces the thermal error, the thermal error of the spindle with external cooling can easily reach stable state and has significantly superior stability than that without cooling, thus proved the effectiveness of the external cooling scheme. Then, the external helical cooler which can take effect is installed on the spindle to dissipate heat from the internal components and restrict the housing thermal deformation [11], thus suppressing the thermal error of the spindle without substantially changing the dynamic characteristics of the spindle. The helical cooler is installed and adjusted to fit the actual size and shape of the spindle, as shown in Fig. 3(a), and an insulation cover can prevent unnecessary convection heat transfer between the helical cooler and the ambient air ( Fig. 3(b), (c)).
Silicone-based thermal grease is fully applied on the joint surfaces to fill gaps and improve the cooling efficiency. Fig. 3(d) shows the coolant temperature controller and the recirculation loop.

The online synchronous thermal data testing system
The thermal behavior of the mechanical spindle can be investigated experimentally based on our previous works [19]. Synchronous temperature and displacement data are gathered by online-measurement with an acquisition card (NI SCXI-1600 series) The sampling interval in the measurement is 1 second, the precision of temperature sensor is ≤ ±0.1 °C, and the non-linearity in the displacement sensor is ≤ ±1%.
Photographs of the sensors setup and synchronous acquisition system is shown in The structural thermal sensitivity points for the spindle are analyzed by using Fuzzy Clustering [19], and the selected positions for temperature measuring are relatively distant from the cooler so they can be less affected. Finally, the temperature variables for thermal error modeling are optimized to be {TS1, TS2, TS3, TS4} (Fig. 4) plus coolant temperature TC, they are considerably strongly associated with the thermal error and relatively independent from each other. The original sampling frequency is 1Hz. In the thermal error feedback control processes, the feedback renews in every 3 minutes, and the temperature signals for every 3 minutes are processed to mean moving average for model input.
The thermal equilibrium of the spindle refers to the stable-state of its temperature field and thermal deformation field. The stability of the most concerned variable, thermal error E, can be used to determine whether the spindle is in thermal equilibrium.

Thermal error feedback control strategy
The thermal error feedback control system adopts the Proportional-Integral-Derivative (PID) algorithm. The PID-based thermal error feedback control scheme for the spindle thermal error is shown in Fig. 5.
The PID controller is given as follows, where uk is the instruction for coolant temperature (TC is the actual value of the coolant temperature), uk0 is the bias and also the initial uk value when the controlling starts, and e1(t) is the control error which equals that of RITE (Reference Input of Thermal Error) minus the estimated thermal error E. The controller parameters are the proportional gain kp, integral gain ki, and derivative gain kd.

Thermal data pre-processing and independence testing
On the basis of thermal testing experiments for the mechanical spindle, experimental thermal data including structural and coolant temperature are presented in this Section. The thermal data are cleansed by detecting and removing the outliers, and independence of the observations (data points) are tested.

Descriptive analysis of the experimental thermal data
The summing ΔE:

Boosting based outliers detection for the thermal data
The Boosting based Outliers Detection approach is employed for cleansing the outliers for dataset D [19]. The training dataset D and a robust SVR weak learner are The model f I would be evaluated by using an overall error measure, which is calculated on the basis of regression error rates e 1 I , e 2 I ,…, e n I at each iteration I. Error rate e i I , i∈{1, 2 ,…, n}, I∈{1,2,…,M} is defined as： The regression error rates are given by dividing the absolute residuals by the data point value, such that the error rate e i I of every data point is obtained and lies in the Then the error rate of every data point is compared with the preset error rate threshold τ , and the data points whose error rates exceed the threshold τ are considered as the poorly estimated. Finally, the overall error measure ε I at iteration I is calculated as: where i∈{1,2,…,n}, and e i I is the absolute residual of the ith data point. The After the probability weights of data points for iteration I+1 are updated, the updated probability weight distribution of iteration I+1 would be normalize so the sum is 1, and the probability weights of the poorly data points would be in fact increased.
Iterations would stop when overall error rate ε I is low enough, or after the algorithm has iterated M times.
Finally, three data points are suspected as outliers because they are associated with prominent large normalized probability weights: 0.1722, 0.1638 and 0.2414, while the largest normalized weight for the other training data points is 0.0511. The dataset D is cleansed by removing these data points of suspected outliers.

Independence testing for the spindle thermal data
The lagged autocorrelation and portmanteau statistic are adopted to characterize the independence of the multidimensional spindle thermal dataset, in order to determine whether the independence hypothesis based algorithms are appropriate to be applied.

The multivariate portmanteau statistic
The measured and preprocessed spindle thermal data matrix D can be denoted as a multivariate vector(T×S): where S is the total number of variates, T is the total number of total observations, s and Then, the portmanteau statistic Q is defined [20,21]:

Independence testing for the spindle thermal data
The For each lag l, the null hypothesis of independence is supported if Q<g(l). Q>g (l) means that the null hypothesis is rejected, the larger Q means the stronger violation for the independence hypothesis of the tested data. Q against different lag l (l=1:150) is calculated for the thermal data of the spindle under active cooling (Dataset I). Thermal data of the precision spindle without cooling (Dataset II), which is repeatedly adopted in thermal error modeling and proved high-quality [13,22,23], their Q against same lags (l=1:150) are also calculated for comparison. Finally, in order to test the data independence, Q of the above datasets are compared with that of the inversed cumulative distribution function which is standard γ distribution (Fig. 7).  (Fig. 7). The violation for independence assumption of the Dataset I is much weaker than that of the Dataset II (spindle without cooling). In view of the fine modeling effect with Dataset II using independence-based algorithms, we conclude that the independent violation is weak enough to be ignored for Dataset I.

Thermal error modeling and reliability pre-estimation of the feedback
As is analyzed in Section 3.3, the independence assumption based algorithms are appropriate to be applied on the dataset D (Dataset I). The regression modeling algorithms are performed to established thermal error models, then the generalization bounds of the models are estimated. Finally, the model which is most likely to give acceptable performance for unseen work conditions is employed, and the maximum TC deviation (from the ideal TC) for the upcoming thermal error feedback control processes is pre-estimated.

Support vector machine for regression theorem
In the regression context of SVM, the training dataset is (Xi, Yi), i=1,2,…,n, where X is a S-dimensional input, and X∈R S . The Y is a one-dimensional output and Y∈R.
In SVR, the input X is mapped onto a high dimension feature space using a kernel function at first, then a model is established in this high dimension feature space [24][25][26]. The multi-variates linear model f(X i ,Ω) is given by: where the parameter ε defines the width of insensitive margin. The empirical risk is: In the minimization problem (1), ε defines the width of the insensitive margin (tolerance margin), and ξ is called "slack variable" which determines the deviation distances from the insensitive margin. C is the penalty that characterizes the amount of tolerance for the data points lying outside the insensitive margin [27]. The function f is as follows, (12) where K(Xi, Xj) is the kernel function which is the inner product of the high-

dimensionally mapped input feature vectors, K(Xi, Xj)=Φ(Xi) T Φ(Xj). Kernel function
makes the dot product calculation practical, and it can be considered as a measure of similarity among the training data. Many kernel forms are commonly used in SVR, and the radial basis function (RBF) kernel function is adopted for SVR: (13) where is the (Gaussian) kernel width parameter.
Moreover, the ε-insensitive zone width parameter ε is already empirically set to 0.01, and the SVR model is established with two parameters, the penalty parameter C and the RBF kernel width parameter γ. The GA method is adopted to optimize the parameters of penalty parameter C and RBF kernel width parameter γ [19]. The GA is based on the mechanics of natural selection and genetics. Procedures of GA in this paper are carried out using references [28], which involves three stages, (1) population initialization, (2) operators and (3) chromosome evaluation.

Random Forrest Regression Theorem
A random forest regression (RFR) model [29,30] consists a collection of classification and regression trees (CART) [31]. Two random sampling procedures are adopted in RFR to alleviate over-fitting: 1. Bootstrap aggregating. For each CART a different sub-dataset is used for training and one-third of the training data (out-of-bag data, OOB) are used for estimating the general error. By sampling with replacement, some observations may be repeated in each subset. Finally, the CARTs are ensembled by averaging the output.
2. Feature projection. At first, certain number of input variables are randomly selected for the tree training process, and the data subset of the randomly selected input variables are then used to split each node, which results in less correlation among trees and a lower error rate.
Above procedures can largely reduce the variance error of RFR, but the bias can still be significant. Application of the bias-correction procedure can alleviate this problem [30,32] by estimating the systematic residuals and subtract them from the estimation: 1. Fit the training dataset using RFR. Compute the estimated values and residuals r=y-y*, where r is the residual, y is the test value and y* is the RFR models' estimation with input X.
2. Fit a RFR model regarding r as the response variable (explanatory variables are also X), output of the model is r*, and the final estimation output yo is: yo= y*+r* (14)

Estimating the V-C dimension
Let Let α1, α2∈Λ, and v be the empirical loss function, so the empirical functions on the first and the second half of the training data (D1 and D2) are: Based on formula (15), we introduce the empirical counts of the data points whose , which can be written as:   (22) and the empirical loss in the jth discretized subinterval is:  (24) Referring to, with the ε≥0, m  ¥ and j=0,1, …, m-1 and the V-C dimension dVC{L(·, α): α∈Λ} is finite, the expected maximum difference between the empirical losses Δ is: where c is a constant empirically chosen to 8.
We design a series of data length nt (t=1, 2, …, T) for randomly sampling sub- The bootstrapping method is used to iteratively resample a dataset with replacement, and estimate the statistics. In the bootstrapping, an observation for δ d VC is introduced, which is denoted as δ d VC * . The δ d VC * for each bootstrap sample D can be obtained by taking the mean and sum across all subintervals.
Finally, the V-C dimension dVC can be obtained by minimizing the squared distance (f n t ) between the observation δ d VC * (nt) and the true upper bound δ d VC (nt),

Loss estimation for the regression function
Let Qemp(αk) be the empirical risk at αk. For any p∈(0, 1), with probability at least 1-p the inequality [17,33] is: where the empirical risk Qemp(αk) is defined as the sum squared error of the fitting MSE of the function f(αk) on the training dataset: where y * is the prediction, and y is the measured data for the response variable Y.
Besides, the Vapnik-Chervonenkis (V-C) dimension dVC needs to be calculated for estimating the upper bound of Q(αk). The best model is the one which minimizes Q(αk).
The GA-SVR and RFR regression algorithms are employed to establish the thermal error models with the experimental data presented in Section 3.1. Then the generalization error bound estimating approach is applied on the established models.
With p=0.05 (probability 1-p equals 0.95), the bounded loss function is discretized into 10 disjoint intervals, and the dVC, Qemp and Q are calculated and listed in Table 3.

Reliability pre-estimation for the thermal error feedback control
Generalization error bound of the RFR model is the smallest among the three models, thus the feedback accuracy with the RFR model is expected to be the highest for unseen conditions.
Normal systematic residual of the feedback (E) is equivalent to a different RITE, so it usually affects the thermal error magnitude but not the STE. Few inaccurate variations (ΔE) estimations with large residuals at certain time-points are the major cause for the TC deviations (from the ideal TC) and excessive thermal error fluctuations.
But, if the estimation residual of ΔE is bounded to a small range, only small fluctuations and slight sustained increment/decrement tendencies will occur, even if the estimation residual accumulates for a period. The experimentally tuned proportional gain kp is 1.5, so the maximum TC deviation is expected to be 0.93℃ with the RFR model. We can assume that the thermal error will be stabilized to be within an acceptable range in the thermal error feedback control processes.

Pre-determination of RITE
Adjusting and maintaining coolant temperature consumes major energy in the active cooling for spindle. The magnitude of RITE mainly affects the total energy consumption of the thermal error controlling process and will slightly affect STE.
Maintaining STE at a relatively high thermal error value can reduce the amount of heat that needs to be dissipated by coolant circulations, thus decreasing the energy consumption of adjusting TC in the coolant temperature controller.
In the constant temperature cooling, the ambient temperature and the initial rpm, RITE is set to 12μm where the coolant temperature also varies around 16℃.

Evaluation method of STE
In order to quantitatively evaluate the STE using discrete derivative, the fluctuation in the measured thermal error curves should be avoided such that only the major variation trend of the thermal error will be reflected [12]. The spindle thermal error which varies non-linearly with time is fitted to a smooth curve: The least square method is used to fit the 4-order polynomial regression model.
STE is the discrete derivative of fitted thermal error f(t) to time t: In practical applications, a precision machine tool is normally pre-heated before machining. The spindle thermal deformation induced error in machining is ignorable when the thermal error is stable, because most of the spindle thermal error will be compensated by tool-setting. The thermal error can be regarded as stable when STE becomes less than a threshold value.

Experimental results of the thermal error feedback control
In the active cooling experiments, the thermal error feedback control strategy is The E curves with constant temperature cooling (TC=16 ℃) rose steadily in the entire experiment process (Fig. 8), while the E curve with thermal error feedback control stabilized around the pre-set RITE (17μm) after preheating of 30~50 minutes.
For the experiments in Fig. 12, the temperature data (sampling frequency is 1Hz) of every 3 minutes are characterized to a single mean moving average value, so the model outputted feedback value renews in every 3 minutes. The thermal errors measurements are fitted to smooth curves using five-order polynomial regression method, so the STE which reflect the major variation trend can be obtained (Fig. 9). The fitted E polynomials are presented in Table 4. (e)

Model performance analysis
Five experiments are conducted with the RFR model, for which the maximum TC deviation at any time point is pre-estimated to be 0.93℃. For the five cases of feedback control based active cooling experiments, the online thermal error estimations are compared with the actual thermal error measurements (Fig. 10). Time interval for the model to output an estimation is 180 seconds, which equals the time interval that the online temperature measurements are processed to mean moving average.  in the thermal equilibrium state, but are within the expected variation range all the time.
If we exclude the observations of the pre-heating stage and consider only those in the equilibrium-state, the goodness of fit of the model will reflect whether reliable feedback is outputted for the thermal error feedback control, so that the thermal error will be stabilized in long-term. Three evaluation criterions, the MSE, the determination coefficient R, and the accuracy η are introduced to assess the model performance in the thermal error feedback control process:  Table 5. The MSE value are smaller than 0.5159; the predicting accuracies (η) are all more than 9.494%; the determination parameters (R) are more than 0.9640.

Conclusion
A novel thermal error feedback control based active cooling strategy is proposed for stabilizing the thermal error of a precision mechanical spindle in long term.
Independence of the spindle thermal data is tested, and a V-C dimension based approach is presented to estimate the generalization error bound of the model for outputting feedbacks, so reliability of the thermal error feedback control processes can be preestimated. Core conclusions of this study are as follows: (1) Spindle thermal data which include temperature and thermal error are obviously dependent. The multivariate portmanteau statistic based independent testing is performed on the thermal variation data and indicated that only slight violation to the independent hypothesis. As a result, it is reasonable to perform independence hypothesis based algorithms on the spindle thermal variation data.
(2) Feedback inaccuracy is due to the insufficient generalization performance of the spindle thermal error model. A V-C dimension based approach is proposed to estimate the generalization error bounds of the thermal error regression models. Thus, the model which is most likely to give acceptable performance can be selected, and the feedback inaccuracy can be bounded. It can be estimated that the maximum deviation of TC is no more than 0.93℃ at any timepoint if the RFR model is employed, so the thermal error fluctuation range is assumed to be acceptable.
(3) STE are quantitatively evaluated using discrete derivative of the fitted smooth curves, and the spindle is regarded as equilibrium-state when STE keeps smaller than a threshold. In the five cases of thermal feedback control, the STE curves becomes under 0.25×10 -3 μm/s in less than 51 minutes, cooling with constant coolant temperature cannot achieve such stability. For the relaxed thermal equilibrium-state criteria of the STE value of 0.5×10 -3 μm/s, compared with the constant TC cooling, the thermal error feedback control based active cooling method advances the time for reaching the equilibrium-state by 78.3%~87.8% in the five cases. Moreover, in the equilibrium-state of the thermal error feedback control processes, the thermal error variation range are kept to 1.482~1.637μm for more than 150 minutes.
For further research, this method should be extended for various kinds of spindles in precision machine tools under diverse work conditions, and the pre-heating time should be shortened.