## Abstract

Thermally induced errors are the dominant source of inaccuracy in machine tools today and are often the most difficult type of error to reduce. Software compensation of thermally induced displacements at the tool center point (TCP) is a widely employed error reduction technique due to its cost-effectiveness and ease of implementation. Transfer function (TF)-based compensation methods lead to promising results, as has been shown in previous studies. Furthermore, machine tool manufacturers frequently offer the same type of machine tool equipped with different spindle units. This leads to different thermal deformation behavior depending on the specific spindle unit mounted in the machine tool. To demonstrate this difference, experimental research is carried out on three five-axis computer numerical control (CNC) machining centers of the same type equipped with three different spindle units. The experimentally obtained thermal errors at the TCP of three machine tools with different mounted spindle units are compared, showing a significant variation in thermal errors in the Z-direction depending on the spindle unit. The research presented in this paper shows a dynamic approach to thermal error compensation of five-axis CNC machining centers considering different spindle units. System identification theory is applied to build dynamic thermal error models for three different spindle units based on calibration experiments. Subsequently, the evaluation of model performance through spindle spectrum tests shows that a reduction in thermal error of up to 85% was achieved in the Z-direction after compensation.

## 1 Introduction

Different types of software error compensation are becoming a crucial part of contemporary technological development in the manufacturing industry. Software error compensation includes techniques to reduce various types of machine tool errors (e.g., geometric, kinematic, dynamic, thermal) that are widely employed because of their cost-effectiveness and ease of implementation [1]. Moreover, software error compensation can be much more flexible than other compensation methods because the compensation parameters can be readjusted whenever necessary. It is a brilliant example of how original resource-based technologies can be transferred into knowledge-based technologies. Compensation requires a thorough understanding of machine behavior and its underlying causes. There are no additional hardware costs, especially for thermal compensation, which is a considerable advantage [2]. Therefore, the importance of error compensation continues to grow. Ramesh et al. presented a review of machine tool error compensation [3,4]. Geometric, cutting-force induced and fixture-dependent errors compensation are discussed [3], and the review [4] is focused on thermal errors in machine tools. Contemporary feasible compensations are summarized by Wegener et al. [2].

The general objective of software error compensation is to develop different strategies to improve the dimensional accuracy of products manufactured with numerically controlled machine tools. Bryan [5] declared that of the various sources of machine tool error, thermal errors account for 40–70% of total errors. However, the necessity of reducing thermally induced error has been already recognized in the early sixties as mentioned by Weck et al. [6]. Researchers have been investigating the influences of thermal errors on machine tool accuracy and seeking solutions to reduce and compensate for these errors for decades. Mayr et al. carried out an update of the related research topics [7] showing the persistent importance of compensation and reduction of thermal errors. It is stated that thermal effects on machine tools have become even more important and the manufacturing industry is going through significant changes regarding the management of thermally induced errors of machine tools. The increase in spindle speed and feed motions of machine tool assemblies entails higher, dynamically changing power losses. As a result, the generated heat and its accumulation in the machine tool structure (and its environment) and heat transmission affect the precision of machine tools and their operations. Moreover, machine tools placed on ordinary shop floors (without additional air conditioning) are exposed to a thermally varying surrounding environment. Continuously changing machine operating conditions and the thermally varying surrounding environment have a nonlinear and dynamically changing relationship with thermal errors at the tool center point (TCP).

In addition, the machining accuracy requirements have continuously increased in recent years. Therefore, it is important to control and reduce thermal errors to improve the accuracy of precision machine tools, and the manufacturing industry is going through significant changes regarding the management of thermally induced machine tool errors. Thermally induced displacements at the TCP cannot be sufficiently eliminated through proper machine tool structure design [8], temperature control [9], or direct compensation [10,11] without high additional costs and/or modeling efforts [12]. Thus, contrary to thermal error reduction techniques mentioned earlier, software thermal error compensation, as an important part of intelligent functions of modern machine tools, plays a key role, and this topic has been the focus of significant recent research.

The spindle is the core component of computer numerical control (CNC) machine tools. Of all heat sources that lead to thermal distortion, the spindle is a dominant contributor to total thermal errors due to the large amount of heat generated by its high-speed revolutions and quick response inducing thermal errors at the TCP. As such, studies on spindle thermal deformations are indispensable to total thermal error reduction [13]. There are various design solutions for the main machine tool spindle (belt-driven spindle units, direct coupling, and motorized spindle units). However, today, the vast majority of modern machine tools are equipped with motorized spindles (also called electro spindles) [14].

General trends in the machining industry are characterized by increasing globalization of the sector with the standardization of components and systems. For this reason, motorized spindles are often available as cartridge or block units, making it possible to equip machine tools with different spindle units without excessive structural modifications of the machine tools. Therefore, machine tool manufacturers are able to meet the requirements of various customers.

Horejš et al. [15] carried out experimental research on five-axis CNC machining centers equipped with three different spindle units. Experimentally obtained thermal errors at the TCP were compared from machining centers with three different mounted spindle units, showing a significant variation in thermal errors in the *Z*-direction depending on the specific spindle unit [15]. Thermal errors at the TCP in the *X* and *Y* directions of the tested gantry-type five-axis machining centers caused by spindle rotation were lower compared to thermally induced displacements at the TCP in the *Z*-direction. Therefore, thermal errors in the *X* and *Y* directions are neglected during the development of a thermal error compensation model. Furthermore, a thermal error compensation model of the five-axis CNC machining center thermal errors based on the transfer function (TF) is presented [15,16]. The proposed compensation approach employs temperatures as the system inputs. Brecher et al. [17] suggested to employ numerical control (NC) data such as rotational speed and motor current values as input of the estimated TF. The proposed method allows the abandonment of all additional sensors apart from one environmental temperature sensor. At the same time, the methods require a high modeling effort (large numbers of experiments). Mareš et al. [18] proposed a TF-based compensation model with the effective spindle power or tool temperature measured by an additional infrared temperature sensor as the input to the estimated TF. The developed compensation model attempts to extend the model validity by accounting for cutting process influences (e.g., heat generation in the cutting zone during the manufacturing process due to plastic deformation and friction between the tool and workpiece). This influence is in particular of great importance for dry machining. Therefore, the thermal error compensation model is calibrated on tests carried out under real machining conditions. These cutting tests differ from thermal tests based on displacement sensors for machine tools, which are ordinarily employed to calibrate thermal error compensation models. Thermal tests under load-free rotation of the main spindle (so-called air cutting tests) are applied [15,16].

The compensation model [15] was calibrated using experimental data from tests with only one motorized spindle unit (hereafter referred to as SP1). The developed compensation model was tested on data collected during spindle speed spectrum tests obtained from machine tools equipped with different spindle units (SP1, SP2, and SP3). The approximation quality of the compensation model calibrated using experimental data from tests with only one motorized spindle unit SP1 deteriorates if the model is applied to different spindle units (SP2 and SP3). Thus, the result [15] also revealed that the compensation model calibrated using experimental data from tests with only one spindle unit cannot be satisfactorily applied to different spindle units. Therefore, the developed thermal error compensation model based on TF was modified by multiplying the original compensation model for spindle SP1 [15] by a constant (gain *g*) [16] to improve the approximation quality of the thermal error model for spindle units SP2 and SP3. This approach enables rapid modification of a TF-based compensation model with minimum additional modeling effort and no need for additional experiments on machine tools equipped with other spindle units, leading to the easily feasible industrial applicability of the compensation model. However, a simple modification of the TF-based compensation model [16] predominantly influences the steady-state adjustment of thermal error prediction and has a lower effect on improving transient thermal errors at the TCP.

The research presented in this paper focuses on improving the approximation quality of the thermal error compensation model by developing separate thermal error compensation models for machining centers equipped with different motorized spindle units (unique TF for each spindle unit).

## 2 Experimental Research

### 2.1 Experimental Setup.

All experiments were carried out on gantry-type five-axis machining centers with a rotary table (diameter, 630 mm; Fig. 1) with three different motorized machining spindles from the Kessler Group. Spindle specifications are summarized in Table 1. Power and torque of the spindles are represented by the value of the “Power S6-40%” and “Torque S6-40%,” which defines duty cycles (duty-type S6—Continuous operation periodic duty) of three-phase asynchronous motors inside the motorized spindles according to international standard IEC 60034-1. The duty-type S6 is defined as a sequence of identical duty cycles, each cycle consisting of a time of operation at constant load and a time of operation at no-load. There is no time to de-energized and rest. The abbreviation S6 is followed by a cyclic duration factor, e.g., S6 40% (the percentage ratio between the period of loading and the total duration of the duty cycle is defined cyclic duration factor).

The machining centers were equipped with several temperature probes (Pt100, Class A, 3850 ppm/K) placed as close as possible to the heat sinks and sources. Herein, the bearings of the motorized spindle, the asynchronous alternating current (AC) motor inside the motorized spindles, and ambient surroundings (ambient temperature variations) are considered as the heat sources and heat sinks. Additionally, relevant temperatures were recorded from the machine tool control system in 0.1 °C resolution (e.g., temperatures of linear and rotary axes feed drives, machine bed temperature, column temperature, and headstock temperature).

Tests for thermal distortion caused by rotating spindles were carried out according to the ISO 230-3 international standard [19] (Fig. 2). Eddy current sensors (sensor type: PR6423, produced by Emerson [20]) firmly clutched in the measuring fixture were employed for noncontact sensing of relative displacements in directions *X*, *Y*, and *Z* between the TCP represented by a test mandrel (length, 125 mm; diameter, 40 mm) and the measuring fixture placed on the rotary table of the five-axis machining center. The measuring fixture is placed in the middle of the table representing the regular position of the workpiece. Displacements were sensed in micrometer resolution. The experimental setup on the gantry-type five-axis machining center per ISO 230-3 is shown in Fig. 2.

Data were acquired using a cRIO 9024 programmable automation controller (PAC) [21] with labview software (the sampling rate was 1 s). Today, almost every spindle is equipped with sensors to monitor the bearing temperature (*T*_{bearing}). This bearing temperature and other NC data such as effective power, electric current, torque, feed rate, and motor temperatures were also logged using Profibus decentralized periphery (DP) communication between the machine controller and the PAC cRIO 9024. A different test with constant spindle speed and spindle speed spectrum tests was designed to verify the validity of the compensation model for each of the motorized spindles (Table 1).

### 2.2 Experiment Results

#### 2.2.1 Constant Spindle Speed of 500 rpm.

The bearing temperature behavior of the measured spindles (Δ*T*_{bearing-SPi}, index *i* represents a specific type of the spindle unit SP1, SP2, or SP3, *i* = 1, 2, 3) during 500 rpm tests is shown in Fig. 3. Figure 4 depicts the spindle motor temperature for different spindles *T*_{mot-SPi} (*T*_{mot-SPi} represents the spindle motor winding temperature, which is built into the spindle motor by the manufacturer) and the behavior of the ambient temperature (*T*_{amb-SPi}) over time during 500 rpm tests with the three different spindle units shown in Table 1.

Thermally induced displacements in the *Z*-direction of five-axis CNC machining centers equipped with the three different spindle units during 500 rpm tests are shown in Fig. 5.

#### 2.2.2 Constant Spindle Speed of 9000 rpm.

The bearing temperature behavior of the measured spindles during the 9000 rpm tests is shown in Fig. 6. Figure 7 shows the motor temperature of the spindles and the behavior of the ambient temperature over time during the 9000 rpm tests with the three different spindle units shown in Table 1. Thermally induced displacements in the *Z*-direction of five-axis CNC machining centers equipped with the three different spindle units during 9000 rpm tests are shown in Fig. 8.

The SP3 spindle unit differs from other spindle units (SP1 and SP2) in thermal behavior. It has a lower bearing temperature for a high spindle speed than in the case of lower spindle speed (Figs. 3 and 6), contrary to expectations. However, it is not due to the higher heat production of the bearings at lower speed; it is probably caused by the higher heat production of the asynchronous AC motor at low speeds than at high speed of the spindle SP3. The efficiency of the asynchronous AC motor is lower at low speeds than at the rated one because the asynchronous AC motor is designed to nominal values. The heat generated in the asynchronous AC motor is consequently transferred through the motorized spindle, and it affects also the measured bearing temperature. This hypothesis is supported by the fact that the cooling system of the spindle units (SP1, SP2, and SP3) is identical (also identical flowrates). However, the motorized spindle producer has the highest requirement for the SP3 spindle unit. Apparently, the SP3 spindle unit is not sufficiently cooled at a lower speed. This thermal behavior of the SP3 is repeatable, as can be seen in the spindle speed spectra in Sec. 3.3.

## 3 Thermal Error Compensation

### 3.1 Model Calibration and Identification.

System identification theory is applied to build the dynamic thermal error model for spindle units (SP1, SP2, and SP3) based on a calibration experiment in Sec. 2.2 (specifically, models are identified based on tests with a constant spindle speed of 9000 rpm). The TF reflects the nature of heat transfer principles. Thus, the calibration of the empirical parameters is simple; in addition, the model is more reliable with untested inputs, and it can even be used reliably to extrapolate data since it forces the data to conform to the same mathematical form as the real process, [22].

The method used in the present research is based on the linearization of machine tool thermal problems, with the help of an equation system consisting of linear parametric models, which is contrary to models with nonlinear parts [23].

The applicability and robustness of TF-based software compensation have already been introduced for different machine tool structures (three-axis to five-axis machining centers, turning-machining centers) and machine tool sizes [1,16,18,23–25].

*ɛ*(a generally suitable form for modern machine tool control systems using their programming languages [23]) in the time domain is introduced by the following equation:

*y*is the TF output,

*u*is the TF input,

*a*are weight factors (the calibration coefficients) of the TF input,

_{n}*b*is the weight factors of the TF output,

_{m}*k*represents the examined time instant, and

*k-n*(

*k-m*) is the

*n*-multiple (

*m*-multiple) delay in the sampling frequency of the measured input vector (simulated output vector).

The linear parametric models of ARX (autoregressive with external input) or OE (output error) identifying structures were examined for an estimation of the TF coefficients. Specifically, the linear parametric model ARX is used as it represents optimal model structure as also discussed by Mayr et al. [26] in the case of multiple input single output (MISO) models handing with arbitrary TCP measurements. The order of the TF was selected based on the best *fit* value (Eq. (4)) through the estimation process. The stability of each TF and the relationship between the thermomechanical system input and output described by the TF are examined through a linear time-invariant (LTI) step response [27]. The LTI expresses a clear dependency between an excitation (1 °C sudden change in temperature input) and a response (predicted deformation in the *Z*-direction) of the thermomechanical system.

Excitations in TFs are temperatures measured close to considered heat sources/sinks (specifically bearing temperature *T*_{bearing} and ambient temperature *T*_{amb} (Fig. 1)), and the responses represent the deformations in the *Z*-direction (*δ _{Z}*). Data processing, TF identification, and modeling were performed in matlab software (version R2017b).

*Z*-direction (

*δ*) caused by spindle rotation and a varying ambient temperature. Thus, the compensation model consists of two TFs for each spindle unit

_{Z}*T*

_{bearing-SPi}is the spindle bearing temperature difference, Δ

*T*

_{amb-SPi}is the ambient temperature difference,

*ɛ*

_{SPi}represents the TFs approximating the thermal errors due to spindle rotation, and

*ɛ*

_{amb}represents the TF approximating thermal errors due to changes in ambient temperature obtained from an environmental temperature variation error test (ETVE) test per ISO 230–3 international standard [19].

The TF approximating thermal errors due to changes in ambient temperature *ɛ*_{amb} is identified using experiments with the five-axis CNC machining center equipped with the motorized spindle unit SP1. The same TF *ɛ*_{amb} is employed to predict thermal errors due to changes in ambient temperature for machining centers equipped with motorized spindles SP2 and SP3.

The coefficients of the identified TFs *ɛ*_{SPi} and *ɛ*_{amb} are calibrated using experimental data from tests with a constant spindle speed of 9000 rpm presented in Sec. 2.2.2.

The coefficients of the identified TFs *ɛ*_{SPi} and *ɛ*_{amb} are summarized in Table 2 [16]. The coefficients of identified TFs for different spindle units *ɛ*_{SP2} and *ɛ*_{SP3} are summarized in Table 3. LTI diagrams for the transfers used in Eq. (2) are shown in Fig. 9 (*ɛ*_{SP1} and *ɛ*_{amb}) and Fig. 10 (*ɛ*_{SP2} and *ɛ*_{SP3}).

*residue-SPi*(

*μ*m), which represents the fictive thermal displacements at the TCP in the

*Z*-direction (thermal error) obtained after the application of the compensation model offline

*δ*

_{Z}_{-EXP}represents the measured output (thermal displacement in the

*Z*-direction) and

*δ*

_{Z}_{-SIM}is the simulated (predicted) thermal displacement obtained by applying the thermal error compensation model.

*fit*value (normalized root mean squared error expressed as a percentage [27])

### 3.2 Simplified Compensation Model.

*g*(gain) to improve the approximation quality of the thermal error compensation model for the five-axis CNC machining centers equipped with spindle units SP2 and SP3 [16]

The main idea of the compensation model modification using the gain *g* is the simplicity of the proposed solution. Thus, the development of thermal error compensation models for different motorized spindle units does not require either additional experiments or a substantial additional modeling effort, which is time-consuming and expensive. It leads to an easily feasible industrial applicability of the TF-based compensation model.

### 3.3 Compensation Model Results and Comparison With Experimental Data.

Spindle speed spectra were performed to verify the identified thermal error models according to Eqs. (2) and (6). Different spindle speed spectra were selected to prove the applicability and robustness of the identified models for various working conditions of the spindle units SP1 to SP3. The spindle speed was changed every 30 min for the five-axis machining center equipped with SP1, every 60 min for the five-axis machining center equipped with SP2, and every 120 min for the five-axis machining center equipped with SP3 during the verification tests.

Figure 11 shows the behavior of bearing temperature Δ*T*_{bearing-SP1} and ambient temperature Δ*T*_{amb-SP1} behavior over time during the verification test (spindle speed spectrum) on the five-axis machining center equipped with the motorized spindle unit SP1. The light gray curve plotted in Fig. 11 represents the variable spindle speed during the verification test with the spindle unit SP1. The spindle speed was changed every 30 min, as mentioned above (500–10,000 rpm). An increase in the ambient temperature of about 0.5 °C is observed during the verification test with SP1 (Fig. 11). Thus, the minimal influence of ambient temperature on compensation results is expected (part of the model in Eq. (2), which predicts the ambient temperature influence (Δ*T*_{amb-SPi}*.ɛ*_{amb}) is negligible). The bearing temperature Δ*T*_{bearing-SP1} increased by a little more than 8 °C during the verification test on a five-axis machining center equipped with SP1. This bearing temperature rise is higher (approximately 2 °C) than during the test with a constant spindle speed of 9000 rpm (Fig. 6 in Sec. 2.2.2).

Figure 12 shows the thermal displacements measured at the TCP in the *Z*-direction (solid thick curve) and predicted (dashed curve) of the five-axis CNC machining center equipped with the SP1 motorized spindle unit SP1 obtained from the TF model by Eq. (2) for the same verification test with variable spindle speed (Fig. 11).

The thin solid curve corresponds to the residual error (*residue-SP1*) calculated by Eq. (3) of the compensation model based on the TF according to Eq. (2). It represents the thermal displacements at the TCP in the *Z*-direction that would be achieved by applying the compensation model calculated by Eq. (2). This residual error (*residue-SP1*) is in the range from −14 *µ*m to 5 *µ*m. As the simplified compensation model calculated by Eq. (6) was calibrated based on the experimental data with the spindle unit SP1, the results of the simplified compensation model would be identical to the results of the improved compensation model according to Eq. (2) in the case of the spindle unit SP1 (the gain *g* in Eq. (6) would be equal to 1 for the spindle unit SP1).

Analogically, Figs. 13 and 15 show the bearing temperature Δ*T*_{bearing-SPi}, ambient temperature Δ*T*_{amb-SPi} behavior over time, and variable spindle speed during the tests with spindle units SP2 and SP3. The spindle speed was changed every 60 min in the case of the five-axis machining center equipped with SP2 (Fig. 13), as mentioned above (0–18,000 rpm). The rise in ambient temperature Δ*T*_{amb-SP2} during the verification tests on machine center with SP2 is even lower than in the case of the verification tests on machine center with SP1 (approximately 0.2 °C; Fig. 11 compared to Fig. 13). Thus, a negligible influence of ambient temperature on compensation results is also expected, as in the previous case (the verification test with spindle unit SP1). The maximal rise in the bearing temperature Δ*T*_{bearing-SP2} is 5.2 °C.

In the case of the verification test on the five-axis machining center equipped with SP3 (Fig. 15), the spindle speed was changed every 120 min (1000–8000 rpm). The ambient temperature increased by about 1.4 °C. It is the highest observable change in ambient conditions during three verification tests performed with variable spindle speed. The maximal rise in the bearing temperature Δ*T*_{bearing-SP3} is 7.1 °C (Fig. 14). The SP3 spindle unit has a lower bearing temperature for a high spindle speed than in the case of lower spindle speed, as shown also in Sec. 2.2. The causes of this behavior are discussed in Sec. 2.2. First, the bearing temperature Δ*T*_{bearing-SP3} steeply increases at spindle speed 1000 rpm (0–2 h in Fig. 15). Then, it decreases at higher spindle speed 4000 rpm (2–4 h in Fig. 15). The higher bearing temperature of the SP3 Δ*T*_{bearing-SP3} correlates with the higher thermally induced displacements in the *Z* and contrary.

Measured thermally induced displacements *δ*_{ZSP2-EXP}, the prediction by compensation models *δ _{Z}*

_{SP2-SIM}according to Eq. (2) and

*δ*

_{ZSP2-SIM}given by Eq. (6) for the verification test with spindle unit SP2 is depicted in Fig. 14. The maximum measured thermally induced displacements in the

*Z δ*

_{ZSP2-EXP}of the five-axis machining center equipped with SP2 is 90

*µ*m. Figure 14 also includes the results of the compensation model built for the spindle unit SP1

*δ*

_{Z}_{-SP1-SIM}given by Eq. (2) to demonstrate the poor prediction of the compensation model if applied to a five-axis CNC machining center equipped with a different spindle unit (SP2). The maximum value of the thermally induced displacements in the

*Z*-direction predicted by the model built for the spindle unit SP1

*δ*

_{Z}_{-SP1-SIM}is only 50

*µ*m (Fig. 14).

A similar graph for the verification test on the five-axis machining center equipped with spindle unit SP3 is shown in Fig. 16. In the case of the verification test on the five-axis machining center equipped with SP3, the maximum measured thermally induced displacements in the *Z δ*_{ZSP3-EXP} is 83 *µ*m (Fig. 16). The maximum value of the thermally induced displacements in the *Z* predicted by the model built for the spindle unit SP1 *δ _{Z}*

_{-SP1-SIM}is only 61

*µ*m. The residual errors of the compensation models according to Eqs. (2) and (6) for verification tests on five-axis CNC machining centers equipped with the spindle unit SP2 and SP3 are shown in Figs. 17 and 18 in Sec. 4.

The constant *g* in Eq. (6) is obtained by fitting the measured data on five-axis CNC machining centers equipped with the spindle unit SP2 and SP3, respectively. The constant *g* is equal to 1.75 in the case of the spindle unit SP2 and *g* = 1.25 for the spindle unit SP3.

## 4 Discussion

The thermal error reduction in the *Z*-direction (expressed by the *fit* value) of the compensation model by the formula Eq. (2) is between 74% and 85% during verification tests with different spindle units (Table 4). The average *fit* value of the TF-based compensation model given by Eq. (2) for the verification tests is 80%. The average *fit* value increased by 13% compared to the average *fit* value obtained for the simplified compensation model according to Eq. (6) (Table 4). The thermal error reduction expressed by the *fit* using the simplified compensation model deteriorates if the model is applied to spindle units SP2 and SP3 (fall by 25% in the case of spindle unit SP2 and 15% in the case of spindle unit SP3; Table 4).

The simplified compensation model calculated by Eq. (6) predominantly improves steady-state errors. However, the simplified model has a lower prediction of thermal errors during the transient state. Nevertheless, it can be concluded that even the simplified thermal error compensation model led to a significant thermal error reduction in the *Z*-direction of gantry-type five-axis CNC machining centers. Generally, the thermal characteristics of the motorized spindles may be various for different motorized spindle units. Thus, it is justified that the thermal error compensation models using unique TF for each motorized spindle, given by Eq. (2), should achieve a higher prediction of thermal errors compared to the simplified compensation model according to Eq. (6). Although the simplified compensation model (Eq. (6)) has a lower thermal error approximation quality. On the other hand, it enables rapid modification of the compensation model with minimum additional modeling effort; e.g., it enables quick modification of the compensation model at the customer site by the machine tool manufacturer. Consequently, it leads to an easily feasible industrial applicability of the compensation model.

Thermal error minimization is also evident when the calculated *residue-SPi* of the compensation models formulated by Eqs. (2) and (6) are compared (also Table 4). Residual thermally induced displacements in the *Z*-direction (*residue-SPi*) of the five-axis CNC machining center equipped with different spindles over time during the verification tests (spindle speed spectra) are shown in Fig. 17 for the compensation model defined by Eq. (2) and Fig. 18 for the compensation model calculated by Eq. (6).

The proposed TF-based model according to Eq. (2) was shown to produce better results than the simplified model using only 1 TF (Eq. (6)), for a wide range of spindle speeds. The maximum residual error of the proposed compensation model according to Eq. (2) is only −14 *µ*m (verification tests on five-axis CNC machining centers equipped with the spindle unit SP1, see *residue-SP1* Eq. (2) in Fig. 17).

*pk*is the abbreviation for a peak-to-peak evaluation method.

The calculated Δ*pk* are summarized in Table 5. The average Δ*pk* of the TF-based compensation model according to Eq. (2) for the verification tests is 15 *µ*m. The average value of Δ*pk* decreased by 7 *µ*m (from 22 *µ*m to 15 *µ*m) in comparison with the average Δ*pk* value, which is obtained for the simplified compensation model given by Eq. (6) (Table 5).

## 5 Conclusions

In the age of Industry 4.0, thermal error software compensation is a fundamental part of the intelligent functions of modern machine tools. This paper provides new insight into the development of thermal error compensation in a five-axis CNC machining center considering different motorized spindles.

Experiments were carried out on gantry-type five-axis CNC machining centers of the same type equipped with three different spindle units (SP1, SP2, and SP3). The tests were realized under load-free rotation of the main spindle, saving for the cutting process (calibrated using a noncontact test setup, the so-called air cutting tests). The absence of the cutting process during the tests is typically used for the development of most software thermal error compensation models. These thermal error compensation models are sometimes called air cutting models.

Subsequently, system identification theory is applied to build the dynamic model to compensate for the thermal errors of five-axis CNC machining centers equipped with three different spindle units. The proposed TF-based compensation model consists of three individual submodels for each spindle unit (a unique TF for each motorized spindle).

Furthermore, spindle speed spectra tests were performed on the five-axis CNC machining center with different spindle units to verify the ability of the developed thermal error compensation model to reduce thermally induced errors at the TCP in the *Z*-direction. Up to 85% thermal error reduction was achieved in the *Z* direction of the machining center after the TF-based compensation model.

Finally, the results of the proposed TF-based model were compared with the results of the simplified thermal error compensation model. The simplified model exploits only 1 TF identified using tests with only spindle unit SP1, the application on different motorized spindles (SP2 and SP3) is realized via the multiplication of the spindle rotation part of the model by a constant *g* (gain). The proposed TF-based model was shown to produce better results than the simplified model using only 1 TF. The average *fit* value of the proposed model increased by 13% compared to the average *fit* value obtained for the simplified compensation model. The positive impact on local extremes of residual errors can also be observed. The average Δ*pk* value decreased by 7 *µ*m (from 22 *µ*m to 15 *µ*m) in comparison with the average Δ*pk* value obtained for the simplified compensation model. It can be concluded that the simple modification of the TF-based compensation model predominantly influences a steady-state adjustment of thermal error prediction and has a lower effect on the improvement of transient thermal errors at the TCP.

The concept of a TF-based compensation model lies in the partial linearization of the issue. It makes it possible to solve each heat source impact separately and to build an approximation model with their subsequent superposition. Thus, such an equation system consisting of linear parametric models has an open structure for easy integration of different thermal source impacts (e.g., spindle rotation, linear axis movements, rotary axis, and time-varying environmental influence) or its variability. In the case of different motorized spindles installed on the same type of machine tool, it is highly beneficial to minimize thermal errors using the TF-based compensation model. This approach allows modifying just the part of the compensation model aimed at the prediction of thermal errors caused by spindle rotation, and the rest of the model (other components) can be kept unchanged. Generally, the prediction accuracy of the compensation models calibrated based on tests carried out under load-free rotation of the main spindle (air cutting model) deteriorates in real cutting applications. The developed model for the five-axis CNC machining center equipped with spindle unit SP1 was tested under real machining conditions (dry machining) [18], showing a lower prediction accuracy of thermally induced errors in the *Z*-direction. However, the influence of the cutting process is in particular of great importance for dry machining. Thus, the application of the thermal error models for software compensation of machine tools is generally acceptable in finishing or low power processes (significantly improves machine tools accuracy).

To improve the accuracy of the model during cutting conditions, the TF-based compensation models can be extended [18]. This fundamental area needs to be explored further.

## Acknowledgment

The authors would like to acknowledge funding support from the Czech Ministry of Education, Youth and Sports under the project CZ.02.1.01/0.0/0.0/16_026/0008404 “Machine Tools and Precision Engineering” financed by the OP RDE (ERDF (Funder ID: 10.13039/501100008530)). The project is also cofinanced by the European Union.

## Conflict of Interest

There are no conflicts of interest.

## Data Availability Statement

The data sets generated and supporting the findings of this article are obtainable from the corresponding author upon reasonable request.

## Nomenclature

*g*=gain

*i*=type of spindle unit,

*i*= 1, 2, 3*k*=the examined time instant

*m*=order of the transfer function denominator

*n*=order of the transfer function numerator

*t*=time, s

*z*=complex number

*D*=outer diameter of spindle, m

*L*=spindle length, m

*a*=_{n}weight factors (the calibration coefficients) of the transfer function input,

*μ*m · K^{−1},*μ*m · s^{1}· K^{−1},*μ*m · s^{2}· K^{−1}*b*=_{m}weight factors (the calibration coefficients) of the transfer function output, s

^{−1}, s^{−2}, s^{−3}*T*_{amb}=ambient temperature, °C

*T*_{bearing}=bearing temperature, °C

*T*_{mot}=spindle motor winding temperature, °C

*e(t)*=disturbance value

*fit*=approximation quality of the identified models expressed by normalized root mean squared error expressed as a percentage, %

*residue-SPi*=residual approximation error at the TCP in the

*Z*-direction,*µ*m*u(t)*=transfer function output vector

*y(t)*=transfer function output vector

### Greek Symbols

### Subscripts or Superscripts

## References

^{™}User's Guide