Keywords

1 Introduction

Thermal errors of machine tools (MTs) are among the most significant issues in precision manufacturing and can be responsible for up to 75% of the overall geometric errors on a produced workpiece [1]. Different mitigation strategies are employed by both MT manufacturers and users [2]. For example, thermo-symmetrical design introduces symmetry planes to reduce the effect of thermal errors. This is typically only possible in the design phase of MTs and does not remove all thermal errors [3]. Another approach is improved cooling of the MT and its environment to prevent or reduce temperature gradients both spatially and temporally [4]. Geometrical on-machine measurements can also be used to recalibrate the MT while reducing productivity [5]. On top of this, companies typically utilize warm-up cycles and skilled operators who are able to reduce the effects of thermal errors based on their experience. However, these are all resource-intense approaches. Another approach to mitigate the thermal errors is to predict and compensate them, which is seen as an intelligence-based approach. The modelling is typically carried out on an edge device that feeds the compensation values to the MT [6, 7]. Significant improvements of model-based thermal compensation were achieved with newly developed data-driven models and utilization of artificial intelligence [8]. The modelling approach can be classified into white, grey and black box models [9]. White box models allow the relationship between temperature and deformation to be fully understood and typically utilize FEM simulations or idealized geometries for this [10]. Grey Box models allow the partial reconstruction of the relationship of individual inputs on the thermal errors, while black box models prevent simple analysis of the model behavior. The field of thermal error compensation has seen all these modelling approaches applied.

Blaser et al. [11] and Mayr et al. [12] developed the thermal adaptive learning control (TALC), a closed-loop thermal error compensation which was implemented using an autoregressive model with exogeneous inputs (ARX). Zimmermann et al. [13, 14] expanded this work by using adaptive input selection in the closed loop, utilizing, among other methods, k-means clustering to prevent collinear inputs. These compensation approaches can also be validated using thermal test pieces in various production scenarios such as with metal working fluid (MWF), demonstrating the validity and necessity of robust data-driven models [15, 16]. Other model types that are often applied in thermal error compensation are artificial neural networks (ANNs) [17]. Recurrent neural networks (RNNs) are ANNs that can feed information from previous timesteps back in the model, similar to ARX models which makes them suitable for the time dependent nature of thermal errors and are therefore different compared to the purely feedforward nature of other ANNs. Long short-term memory networks (LSTMs) are one of the most popular types of RNNs that have been implemented for thermal error compensation [18]. Ngoc et al. [19] used such an LSTM with only the rotary axes power as model inputs to predict some axis-specific errors.

Temperature sensors can be used as model inputs, as pointed out by Kizaki et al. [20] to directly model the deformation analytically from the measured temperature field. Adding temperature sensors is a significant change on the MT and introduces an additional risk of failure, which has to be considered as demonstrated by Fujishima et al. [21]. In order to reduce the complexity and risk of failure already available measures might be preferable. However, the suitability of specific model inputs for thermal compensation is often not known and many different scenarios for both measurement and modelling are in theory feasible. Using control values can be an option to measure internal MT behavior without requiring additional sensor hardware.

In order to answer the question what type of model inputs are suitable for thermal compensation, especially considering the power uptake and model structure, this work applies both grey box models in the form of ARX models as well as black box models in the form of two different neural network architectures, utilizing purely dense feedforward layers or two LSTM layers with hidden states with various sets of model inputs from power measurements to temperature measurements and combinations thereof. Section 2 describes the experimental set up while Sect. 3 describes the compensation approaches and the subsequent results of differing input sets consisting of either both temperature and power measurements or each of them individually or the environmental temperature and the power measurements in order to capture the external behavior of the MT.

2 Experimental Set up

The proposed compensation methods are exemplarily applied to compensate the thermal errors of a rotary axis of a 5-axis MT.

2.1 Analyzed Machine Tool

Basis for the experimental investigations is a Mori Seiki NMV 5000. The kinematic chain of the investigated MT can be described according to ISO 10791-2:2001 [22] as: V [w-C‘-B‘-b-[Y1, Y2] – X – [Z1, Z2] –(C)- t]. The MT is equipped with a turning option in the C-axis which allows a maximum speed of 1200 rpm. This high-powered drive requires a second coolant cycle, which is installed and dedicated only for the rotary table. Therefore, two dedicated heat pumps are used to temper the MT. In order to measure the thermal errors a discrete R-Test is carried out with a precision sphere mounted eccentrically on the table. This precision sphere is measured at varying C-positions using a Renishaw OMP 60 touch trigger probe. The first measurement is defined as the reference state. All deviations from the reference state are defined as thermal errors, allowing the time dependent motion of the tool center point (TCP) relative to the workpiece. The separated axis-specific thermal errors \(E_{X0C} , E_{Y0C} , E_{Z0T} , E_{R0T} , E_{A0C} , E_{B0C} , E_{C0C}\) can be observed with repeatabilities below 0.6 µm and 3 µm/m for k = 2 on this specific MT [11].

2.2 Power Intake Measurement

The power intake of the MT is significant for its thermal behavior and depicted in Fig. 1. All power taken in will be transformed into heat besides the process work, for example, in the form of electric losses in the motors or as friction in the guides. In the case of the analyzed air cuts all power is transformed into thermal loads.

The electrical power intake of the MT is measured in real-time by six Acuvim II sensors in order to avoid and validate the values from the control directly, as described by Zimmermann and Gontarz et al. [23, 24]. One measures the power uptake by the linear axes, B-axis as well as the spindle motor (E1). Another measures the power uptake of the C-motor that can perform turning operations (E2). The electrical power uptake of both coolant systems is measured (E3 & E4). Another component that is observed is the hydraulic pump which is used to clamp and release the tool in the spindle (E6). The total power consumption of the MT is also measured (E5). In turn, this allows the calculation of all other components lumped together by subtracting the five individual measurements from the total power uptake of the MT. This “other” component (E7) contains, for example, the chip conveyor, the automatic tool changer or valves for cutting fluid which are negligible during the idling state.

Fig. 1.
figure 1

Power measurement of the six main components of the 5-axis MT. The linear and rotary motors and their respective cooling systems as well as the hydraulic pump and total electrical power intake are measured.

2.3 Temperature Measurement

The temperature is measured at twelve positions located on and around the MT as depicted in Fig. 2.

Fig. 2.
figure 2

Temperature sensors located on and around the investigated 5-axis MT.

Beside the structural sensors two air temperature sensors are located within the working space of the MT and one environmental temperature sensor is located outside the MT. A virtual sensor is generated by calculating the delta between the inlet and outlet temperature of the cooling system for the C-axis.

2.4 Experimental Load Case

In total, six experiments are carried out on the MT. The first experiment has a duration of 96 h followed by another 24-h load case of the same type. Here a random speed profile is applied to the C-axis in 300 rpm steps between 0–1200 rpm for random time durations between one and three hours. This is followed by two experiments (72 and 24 h) in which the B-axis is indexed at varying angles between 0 and 90°, in this mode the turning mode is not activated, so the C-axis rotates around ten times slower between 0–120 rpm (proportional to the B-angle). After this, additional 96- and 24-h experiments are carried out with the initial turning load case. In between the experiments the machine is in varying states and the interruptions are not of constant duration (between 15 min and various days of other activity), thus no assumptions on the MTs initial state are possible.

Figure 3 shows the measurements of electrical power consumption of the main components. It is noted that the other components (E7) are almost always 0 and only becomes relevant when the metal working fluid is activated. During idling the MT consumes around 2.8 kW and during the turning load case around 4.2–4.5 kW at maximum speed. During the B-axis load case this is increased to approximately 4.75 kW in a much more stable distribution. This indicates that during the turning load case more thermally dynamic behavior is expected due to varying heat sources and sinks changing compared to the more stationary B-axis load case.

Fig. 3.
figure 3

Electrical power intake during the six experiments. The red lines indicate a change in the load case from the turning mode to positioning rotations of the C-axis at varying B-angles. (Color figure online)

3 ARX Compensation Model

In order to predict thermal errors of MT, ARX models are used. As thermal errors can be described by a linear time-invariant dynamic system, they can be represented as a weighted sum

$$\begin{gathered} y\left[ k \right] + a_{1} \cdot y\left[ {k - 1} \right] + \ldots + a_{{n_{a} }} \cdot y\left[ {k - n_{a} } \right] \hfill \\ = b_{0,1} \cdot u_{1} \left[ {\text{k}} \right] + b_{1,1} \cdot u_{1} \left[ {k - 1} \right] + \ldots + b_{{n_{b\left( 1 \right)} ,1}} \cdot u_{1} \left[ {k - n_{b\left( 1 \right)} } \right] + \ldots \hfill \\ + b_{{0,{\text{M}}}} \cdot u_{M} \left[ {\text{k}} \right] + \ldots + b_{{n_{b\left( M \right)} ,M}} \cdot u_{M} \left[ {k - n_{b\left( M \right)} } \right] \hfill \\ \end{gathered}$$
(1)

at the time step k, consisting current and past outputs y, the current and past values of an input u, of which M different ones can be used and the model parameter \(a_{i}\) and \(b_{j,m}\). The order \(n_{a}\) defines the number of past system outputs that influence the current time step and \(n_{b,m}\) represents the considered time steps of the model input. As model inputs both temperature measurements and power measurements are used. The parameters of ARX models can be calculated using weighted least squares as shown by Mayr et al. [12] and the orders (\(n_{a}\) and \(n_{b}\)) are optimized following the Akaike Information Criterion (AIC). Model Inputs are selected by K-means clustering, where the number of clusters is defined by the Calinski-Harabasz Criterion [25] and subsequent cross correlation analysis. In TALC, which is shown in Fig. 4, periodical on-machine measurements are used to verify whether the residual is within the set action control limit (ACL) of 5 µm for position or 15 µm/m for orientation errors deviation of the true measurement. In case a residual error exceeds the corresponding ACL a not-good (NG) mode is initialized in which 18 measurements are gathered and used to retrain the compensation model. Whenever experiments are joined together to one time series at the interconnection an NG mode is carried out to allow the previous memory to be filled, as otherwise no memory components are available at machine start.

Fig. 4.
figure 4

TALC schematic adapted from Blaser et al. [11] and Zimmermann et al. [14].

3.1 Temperatures and Power Intake as Model Inputs

The thermal error \(E_{Z0T}\) is shown in Fig. 5 with and without thermal compensation during the 320-h experiment. All recorded model inputs were used during the input selection. During the turning load cycle, the measured error shown in Fig. 5(a) is highly fluctuating with an amplitude of up to 25 µm. In case of the B-axis load case, which is conducted in the middle of the test series, the error behavior appears significantly different, less dynamical changes and overall, a reduced amplitude of about 10 µm with more plateaus compared to the more transient behavior in the C-axis load case. This is also apparent in the model inputs, for example the table suspension temperature sensor (S8) shows similar changes in behavior as the thermal error. Both power measurements as well as temperatures are used as model inputs, in this case for example the total power consumption or the C-axis motor power consumption are used to predict the thermal error besides the temperature measurements. The first 160 h of measurement are used for parameter identification of the model described in Eq. (1). The residual error, shown in Fig. 5(b) during this training is very close to 0 with an average of 1.4 µm and appears to be only noise as there are no significant remaining patterns. Which indicates that the model inputs contain no additional information and can compensate well, if the situation is known exactly. The subsequent 160 h are used to validate this compensation to ensure a robust model even in slightly varying conditions. ACL verification measurements are carried out hourly and indicated by the light blue dashed line. They are not fed back to the model. Once the control measurement indicated that the ACL of any thermal error is exceeded a NG mode is triggered, which is indicated by the red vertical solid line. The maximal peak-to-peak error is reduced from 24.75 µm to 11.75 µm (53% reduction) and the root mean square error (RMSE) from 3.76 µm to 1.87 µm (50% reduction).

Fig. 5.
figure 5

Uncompensated and compensated thermal error \(E_{Z0T}\) measured during the 320 h of experiments. The model inputs are selected from all available temperature sensors and power intake measurements and therefore either in K or kW relative to the reference state of the first measurement. The red shaded areas with a duration of 2 h are a not-true-to-scale representation of the MT interruption between measurements which are followed by a NG mode (vertical red line) for model initialization after the training phase.

3.2 Temperatures as Model Inputs

Figure 6 depicts the compensation model for \(E_{Z0T}\) in the case where only temperature sensors are used as model inputs. \(E_{X0C}\) is the least significant of all observed thermal errors as it represents the symmetry plane of the MT which only observed symmetric load excitation. As in the case with only power + env. Temp 2 NG modes are triggered compared to the single NG mode of the input set with all possible sensors. Again, the compensation quality is high qualitatively and the reduction of the peak-to-peak error is −19%, 75% and 56% for \(E_{X0C}\), \(E_{Y0C}\) and \(E_{Z0T}\) in line with the other shown results. To allow comparison to other errors.

Fig. 6.
figure 6

The model inputs are selected only from all available temperature sensors.

3.3 Power Intake and the Environmental Temperature as Model Inputs

Figure 7 shows the compensated and uncompensated thermal error \(E_{Z0T}\). As input set in this case only the power measurements and the environmental temperature sensor are used. All other modelling parameters are identical to the above model with all possible inputs, but a second NG mode was triggered in this case. The peak-to-peak error can be reduced from 32.75 µm to 9.5 µm which is a 70.1% reduction and the RMSE from 8.1 µm to 1.4 µm which is a 81.8% reduction indicating that the compensation fit is still good even if no structural temperature sensors are used.

Fig. 7.
figure 7

Model inputs are selected only from the power intake measurements as well as the environmental temperature sensor and therefore either in K or kW.

3.4 Power Intake as Model Inputs

Another case considers only the power intake in the MT as potential inputs and therefore not the environmental temperature or direct source of information about the external heat sources of the MT. Figure 8 shows this, as the amount of six NG modes is clearly significantly higher than one in the case of all inputs or two in the case of solely temperatures it can be concluded that the temperature is a more flexible input compared to the power intake as it can contain both external and internal heat sources as it represents the actual temperature of the measured position. However, adding just one environmental temperature sensor to the power measurements reduces the number of NG modes from six to two despite both having five input variables and a similar performance as the temperature sensors.

Fig. 8.
figure 8

The model inputs are selected only from the power intake measurements in kW.

3.5 Comparison of Input Sets Using the Volumetric Error

Table 1. Reduction for the peak-to-peak value (P2P) the RMSE of the volumetric error due to the differences in input set and model training, between TALC, a version with no model updates or all data as training.

Table 1 shows the volumetric error reductions at the sphere position, which is uncompensated a RMSE of 9.7 µm or 29.9 µm in the peak. The volumetric error is defined as the Euclidean length of the error vector in space at the sphere position. Typically, the differences between the different input sets appear small but are rather significant. It is to be noted that the number of required NG modes differs between six for the case with only power inputs and one for the case with both power and temperature inputs. Therefore, also the case without TALC or by using all available data for model training is showcased. It is clear that using all inputs for selection is ideal, but the compensation quality can be satisfactorily achieved either with solely the temperature sensors or the environmental temperature and the power intakes. This quality cannot be achieved with the power as the sole input without any environmental measurements as no external effects are represented in the model inputs. Furthermore, a LSTM network and a regular feedforward ANN are used to validate these results. For these models no input selection is carried out, so they are used end to end, and all potential model inputs are used. Therefore, the case with all possible inputs performs slightly worse compared to the input selection carried out, in the case of the ARX model. It can be noted that the significantly increased training effort ~10,000 trainable parameters compared to 20–50 parameters in the case of the ARX model is not beneficial, the time dependency of the model however clearly is beneficial as the feedforward ANN has none.

4 Conclusion and Outlook

Data-driven thermal error compensation can significantly reduce the thermally induced errors in MTs with a wide range of suitable input sets and models if they are set up well. Both power measurements and temperature measurements are suitable for this if the measurements of internal sources are extended for those of external sources such as the environment and achieve volumetric error reductions around 72%. This allowed the robust compensation of two significantly different types of load cases with varying forms of models or inputs. In general, the time dependency of the model is seen as highly beneficial. Simpler models such as ARX models are more suitable than LSTM models, which can also achieve acceptable accuracy requiring magnitudes more total parameters and therefore training effort. Inputs that do not consider any external effects such as the environmental temperature are not as suitable as a significant effect cannot be represented.

Future work should focus on increasing the training efficiency of these compensation models in order to learn even broader types of loads with reduced training time. Industrialization of the thermal compensation should be pursued in order to increase the energy efficiency of advanced manufacturing.