Next Article in Journal
Investigation of Low-Pressure Sn-Passivated Cu-to-Cu Direct Bonding in 3D-Integration
Previous Article in Journal
Phosphate-Trapping Liposomes for Long-Term Management of Hyperphosphatemia
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Thermal Behavior Modeling Based on BP Neural Network in Keras Framework for Motorized Machine Tool Spindles

1
Faculty of Mechanical Engineering, University of East Sarajevo, 71123 Istocno Sarajevo, Bosnia and Herzegovina
2
Faculty of Mechanical Engineering, VSB-Technical University of Ostrava, 70833 Ostrava, Czech Republic
3
Faculty of Technical Sciences, University of Novi Sad, 21000 Novi Sad, Serbia
*
Author to whom correspondence should be addressed.
Materials 2022, 15(21), 7782; https://doi.org/10.3390/ma15217782
Submission received: 25 September 2022 / Revised: 20 October 2022 / Accepted: 2 November 2022 / Published: 4 November 2022
(This article belongs to the Section Corrosion)

Abstract

:
This paper presents the development and evaluation of neural network models using a small input–output dataset to predict the thermal behavior of a high-speed motorized spindles. Different neural multi-output regression models were developed and evaluated using Keras, one of the most popular deep learning frameworks at the moment. ANN was developed and evaluated considering the following: the influence of the topology (number of hidden layers and neurons within), the learning parameter, and validation techniques. The neural network was simulated using a dataset that was completely unknown to the network. The ANN model was used for analyzing the effect of working conditions on the thermal behavior of the motorized grinder spindle. The prediction accuracy of the ANN model for the spindle thermal behavior ranged from 95% to 98%. The results show that the ANN model with small datasets can accurately predict the temperature of the spindle under different working conditions. In addition, the analysis showed a very strong effect of type coolant on spindle unit temperature, particularly for intensive cooling with water.

1. Introduction

The importance of machine tool manufacturing in the metal machining industry is evident today, and it has a twofold effect on the industry. First, machine tool manufacturing as a part of the industry affects the position and the importance of the industry through its level of development and manufacturing output. Second, machine tool manufacturing creates the means of the working process for the metal-cutting industry, which, in turn, increases its total efficiency. In today’s prosperity of industrial rise, the application of the high-speed motorized spindle has significantly increased machining productivity and reduced manufacturing cost. However, its high speed and compact structure impose some negative effects on spindle thermal behaviors. Heat generation from spindle motors and bearings generally influence the temperature rise of a motorized spindle unit in its operation, resulting in errors, which are the main reasons for the reduction in machine tools’ precision and accuracy. The thermal behavior, caused by the temperature rise, is one of the main causes of the inaccuracy of the machine tools. Thermal errors account for 60 to 70% of total machine tool errors [1]. On the other hand, approximately 75% of machined workpieces’ geometrical errors occur due to temperature influence [2]. The heat generation on the bearings and motor occurring during the operation of high-speed spindles is often considerably high, so active cooling is required. With the correct choice of coolant and coolant flow, it is possible to influence the temperature rise and thereby reduce errors due to heat load. For active cooling of the housing, water with anticorrosive additive or special oil is used. The application of cooling oil is particularly popular in warm and humid Asian areas. This is due to the oil’s lower susceptibility to microbial contamination. Air and oil are also used as cooling liquids for the bearings. A large number of cooling strategies and concepts are available in [3] to reduce undesired effects due to thermal loads. On the other hand, challenges due to heat in motorized spindle units are currently being addressed by the industry and in research to improve the thermal properties of the spindle unit. At present, research on the thermal behavior of machine tools is being developed in several directions: numerical modeling, experimental testing, and model development based on artificial neural networks (ANNs). Compared with experimental measurement, numerical methods (using commercial softwaresuch as Ansys 12.0, MATLAB R16b, Abaqus2020, etc.) and ANNs allow comprehensive knowledge of the thermal behavior of the machine tools, and they save the time and energy cost of the experimental tests.
Many researchers have applied the finite element method (FEM) [4,5,6,7,8,9,10,11,12], the finite difference method (FDM) [13,14], or the finite difference element method (FDEM) [15,16,17] to obtain the numerical solution of temperature field of the spindle or of the entire machine tool. On the other hand, the temperature field of the spindle can be obtained by using the thermal network [18,19,20,21] or bond graph method [22], whereby, thermal balance equations can be solved by the Newton–Raphson method.
The above methods are limited due to the problems of defining the boundary conditions and the determination of the characteristics of heat transfer. In the recent decade, it has been shown that thermal behavior can be predicted by empirical modeling techniques, such as regression analysis, ANN, Grey system theory, and a combination of different modeling methods, with satisfactory accuracy. However, the temperature and the thermal displacement usually change with the operating conditions and the environment; it is difficult to apply regression analysis to a multiple-output-variable model, such as the model in this paper. Different from the regression model, the spindle thermal behavior in multiple directions can be modeled with only one neural network, as it has multiple outputs.
However, defining ANN models is not simple and depends firstly on the problem complexity and the learning algorithm complexity. Many researchers have used the trial-and-error method to improve the performance of neural networks. Through this process, neural networks are tested and evaluated, and then the optimal structure is determined. A method to select the number of hidden layers and nodes within, based on the numbers of input and output variables, was proposed in [23]. Bebis et al. [24] reported that small feed-forward neural networks can predict more accurately than larger ones. In addition, Kosarac et al. [25] showed that ANNs can be successfully trained with small data and used to predict the arithmetic mean roughness. In cases where the experiment is well planned and carried out, and if there is a high correlation between input and output, it is possible to achieve good neural models with small datasets, as presented in [26,27,28].
The most commonly used neural network methods are backpropagation (BP) and radial basis function (RBF). They have good performance in mapping and predicting the spindle thermal behavior. However, they often take a long time to train, and the speed of the convergence is slow. To overcome these drawbacks, researchers used different algorithms to optimize the structure of the BP neural network and avoid unstable prediction performance. A model based on the five key temperature points for the prediction of thermal deformation in the turning center by using a genetic algorithm (GA)-based BP neural network was proposed by Hao et al. [29]. Additionally, Huang et al. [29] introduced a genetic algorithm (GA) to optimize the BP network’s initial weights and thresholds. To improve the prediction performance of the neural network, Feng et. all [30] integrated multiple BP neural network models. Li et al. [31] performed optimization of the weights and thresholds of the BP neural network using the variable inertia factor particle swarm algorithm. In their paper, the temperature measurement points were clustered by the self-organizing feature map neural network. The correlation analysis method was used to explore the correlation between the thermal sensitive points and the thermal error of the spindle. Li et al. [32] used a beetle antenna search algorithm (BAS) to optimize the weights and thresholds of the BP neural network. The authors showed that BAS-BP had higher prediction accuracy than the BP and GA-BP models at different speeds. The RBF neural network is also a feed-forward (FF) network that has good approximation and global optimal performance. Cui et al. [33] proposed a model based on the five-point method using the multiple linear regression (MLR) method, BP, and RBF neural network to establish the thermal error prediction of the motorized spindle. Lv et al. [34] improved the prediction accuracy and generalization ability of ANNs by using a generalized RBF neural network modeling method and applied it to the thermal error modeling of the spindle housing. Zhang and Fu [35,36] improved the accuracy of the RBF neural network, developing the thermal error prediction model. They applied the genetic algorithm, particle swarm algorithm, and chicken flock algorithm to optimize the important parameters (hidden layer and output layer weights) of the RBF neural network. Dynamic neuron network models have better robustness in modeling spindle thermal behavior although temperatures are changing and the thermal–elastic process is varying nonlinearly under different working conditions [37]. Kang et al. [38] proposed a modified method that combined a feed-forward neural network (FNN) and hybrid filters for the prediction of thermal deformation in a machine tool. The hybrid filter consists of linear regression (LR), moving average (MA), and autoregression (AR). Outputs from the filter serve as input of the FF network, which is estimated by the static and dynamic relationships between the temperature distributions and thermal deformations.
In addition to those widely used neural network models discussed above, other neural networks were studied and applied for analysis of the spindle thermal behavior. Yang et al. [39] proposed a modified Elam network (EN) for determining the thermal errors of the spindle based on the FEA simulation. Li et al. [40] optimized weights and thresholds of the Elman neural network by using the sparrow search algorithm to predict thermal errors in motorized spindles. Zhang [41] proposed serial grey neural network (SGNN) and parallel grey neural network (PGNN) to predict the thermal error. Abdulshahed et al. [42] proposed a methodology for thermal error compensation using a grey neural network model with convolution integral optimized by a particle swarm optimization. Consideration of limitations and challenges in applying ML techniques along with possible strategies to address them, including computational cost, large errors of extrapolation, data availability, and the iteration with experiments, was presented by Qian and Yang [43]. Raza et al. [44] presented an unsupervised machine learning algorithm (including random forest, least absolute shrinkage, selection operator regression, and feed-forward neural networks) that can automatically classify and rationalize chemical trends in PFAS structures.
Thermal errors occur primarily due to temperature rise and temperature differences, which are the consequences of heat sources in the machine tool and changes in environmental conditions. Usually, the temperature variables tested by multiple sensors are taken as the input, and the thermal errors of machine tools are the output of NN model. The thermal and mechanical behavior of the spindle is a function of the cooling system. Inadequate coolants and flow lead to an increase in temperature and thermal expansion on the spindle elements. This causes an increase in thermal deformations as well as a decrease in the energy efficiency of the machine tool.
This paper presents the BP neural networks with the Adam optimization algorithm for the prediction of the temperature of motorized spindle units under different input conditions. The Adam optimization algorithm is implemented instead of the commonly used stochastic gradient descent (SGD) algorithm. Several models of neural networks have been developed where the number of hidden layers and neurons within varies. Spindle speed, coolant type, coolant flow of motor, and bearings were used as input parameters. Temperatures measured in three different areas of the spindle unit were considered as the output parameters. After the network learning and training, the temperatures of the motorized spindle unit in different areas were accurately fitted and predicted. The dataset used for the ANN development was obtained experimentally under various operating conditions. The experiment was conducted on the basis of the Box–Wilson central composite design with levels and ranges for three numerical (quantitative) factors and one categorical (qualitative) factor.

2. Experimental Setup

This paper investigates the effects of four factors on the temperature of a motorized spindle unit: a number of revolutions (n), coolant flow of motor (Qm), bearing coolant flow (Qb), and the coolant type (H). Table 1 shows these factors and their levels.
Figure 1a shows the experimental setup for measuring temperatures. Collected data were used to train and simulate neural networks. The tests were performed on a high-speed motorized spindle GMN TSSV 100-90000 (Figure 1b) with a maximum number of revolutions n = 90,000 [rpm], power P = 3 [kW], 2-pole AC induction electric motor, maximum U = 220 [V] per phase at maximum frequency. Cooling and oil–air lubrication were performed by injecting oil Qb = 187.2–283.6 [mL/h] in all bearings simultaneously. Oil or water flowed through the groove around the stator with a flow rate of Qm = 4–6 [L/min]. The spindle was mounted with two pairs of high-precision angular contact bearings, the front bearing with EX 12 7C1 DUL SNFA and the rear bearing with EX 10 7C1 DUL SNFA, mounted in a “tandem” arrangement so that the entire bearing formed an “O” arrangement. Front bearings had lock-ring preload, while rear bearings had constant (spring) preload. During the experiment, the external ambient temperature was 21 °C.
The motorized spindle (2) was connected to the frequency regulator Nidec HS 72 (1), which allowed for the desired RPM. The Acrylic Flow Meters 6A01 (5) was mounted to measure the amount of oil mist on the bearings at all times. The measurement of the flow of the cooling fluid for the motor was carried out with an Integral Flowmeter AXF (7) according to the principle of the Coriolis effect. The temperature of the cooling fluid was kept constant at 22 °C by using a heat exchanger placed in the tank (6). To measure the temperature of the spindle unit, thermocouples, infrared thermometer, and thermal imager were used. Three K-type thermocouples (T1, T2, and T3) were placed on the housing near the front and rear bearings and near the stator of the motor (Figure 1a,b). The temperature obtained from these thermocouples was collected by an acquisition system NI USB 6281 and then sent back to a computer for processing and monitoring results every one second. The output from the acquisition system was continuously monitored and analyzed in Matlab R16b software. An infrared thermometer was used to record the temperature at the outlet coolant from the spindle unit. To record the distribution of temperature fields, monitor the temperatures of the entire experimental rig, as well as to control the thermocouples and infrared thermometer, the Thermo ProTP TP8S, Wuhan Guide Infrared Co., Ltd., Wuhan, China, thermal imager was used. Table 2 shows the characteristics used for equipment.

2.1. Experimental Plan

The goal of this experiment was to determine the temperature rise on the spindle unit for different operation conditions. Using the Box–Wilson central composite design, the experiments were reduced to 40 runs. The central composite matrix shown in Appendix A (Table A1) contains 40 rows, representing the number of experimental runs.
In this research, levels and ranges were applied for three numerical (quantitative) factors: RPM, coolant flow, and oil mist flow. In addition, a categorical (qualitative) factor was applied—it was a type of cooling where oil and water were used. For a centrally composite plan, the parameter α, the distance of the axial arrays from the projected center, was 1, so that each numerical factor had three levels. The experiment was divided into two blocks. The role of the blocks was to reduce or eliminate the variability caused by interference factors that may have affected the response but were not directly related to a design factor. For this experiment, six replications were conducted to the midpoint for each level of the categorical factor, that is, two replicates for each level of the categorical factor in each block. For the central point in the project, standard working conditions were applied. Columns 8, 9, and 10 in Appendix A (Table A1) show the results of the measured temperatures (responses) for the conducted experiments in all three points, i.e., near front bearing, stator, and near rear bearing.

2.2. Analysis of Experimental Data

Data analysis was performed using the Seaborn, Scikit-learn, NumPy, and Pandas machine learning libraries and Keras framework for Python. Various algorithms were used for data visualization, such as HeatMap or Scatterplot. Since string values in column H (Appendix A Table A1) are not appropriate for data analysis, values in the column were converted into Boolean using the replace method from the Pandas library. Linear relationships between variables could be shown and quantified with a correlation matrix. The correlation matrix is a square matrix that measures the linear dependence between pairs of attributes. The correlation coefficients range from −1 to 1, where two attributes have a perfect positive correlation if r = 1, no correlation if r = 0, and a perfect negative correlation if r = −1. On the basis of the above analysis, the comprehensive correlation between the temperature and input variables was obtained, as shown in Figure 2. Figure 2a shows a correlation matrix with a correlation coefficient for all input variables. The correlations between output variables and input variable “H” (coolant type) were 0.93, 0.888, and 0.91, indicating that they were strongly positively correlated (Figure 2a). The correlations between output variables and input variable n (spindle speed) were positive and had values 0.3, 0.4, and 0.34. That indicates that correlation existed but was not significant, as in the previous case. The correlations between output variables and input variables Qm and Qb (black highlighted cell in the correlation matrix) were negligible, indicating that this relationship was not noticeable. The correlations between output variables T1, T2, and T3 were positive and had values of 0.98 and 0.99. It can be seen from Figure 2a that the type of coolant had the biggest influence on motor-spindle temperatures. When water-cooling of the housing was used, a large amount of heat was transferred by water. Water-based cooling was generally more effective due to higher specific heat capacity (41.2 kJ/(kg·K) at 20 °C for water vs. 1.9 kJ/(kg·K) for special cooling oil).
If the correlation matrix is observed separately for the case of cooling with oils and cooling with water, the influence of certain input variables changes significantly. The correlation between input and output variables for oil cooling was positive and had a value of 0.93 (Figure 2b). The small correlation factor between oil flow and temperature indicates that the oil flow did not significantly affect the spindle unit temperature change.
For the case of water-cooling, correlations between output variables and input variable n (spindle speed) were positive and had values of 0.79, 0.82, and 0.71. Correlations between Qm flow, as an input variable, and output variables had values of 0.2, 0.24, and 0.098, which indicates that correlation was not high but existed (Figure 2c). Therefore, the water flow had an impact on the temperature change of the spindle unit.

3. BP Neural Network Modeling

This paper also considered the influence of the network topology and the learning parameter on the model performances. Several models of neural networks have been developed where the number of hidden layers and neurons within varies. Neural network models have one, two, or three hidden layers. The number of neurons in the hidden layer varies from 2 to 10.
The Adam optimization algorithm is used for updating network weights in training data instead of the commonly used SGD algorithm. Adam algorithm uses two components, momentum and adaptive learning rate, to converge faster and update network weights efficiently. Momentum update can be expressed mathematically:
ν t = γ · ν t 1 + η · · θ · J ( θ ) θ = θ ν t
In the above equation, θ is network parameter (weight, bias…), η is a learning rate, J is a function to optimize, γ is a constant, ν(t−1) is a past timestep, and νt is a current timestep.
Adaptive learning rates can be observed as adjustments, i.e., reducing the learning rate in the training phase. Mathematical expression is given in following equation:
E | g 2 | t = β E | g 2   | t 1 + ( 1 β ) g t 2 Θ t + 1 = Θ t η E | g 2   | t + ε · g t
where E | g 2 | t is an exponentially decaying average of squared gradients, β has the recommended setting of 0.9, θt+1 denotes the resulting (updated) parameters, and gt is the gradient at timestep t.

3.1. Impact of Network Architecture on Model Performance

The activation function for hidden layers is ReLU, and the linear activation function is used for the output layer. The number of epochs is set at 10,000, but the early stopping function interrupts training after model performance stop to improve on the validation dataset. First, for model selection and evaluation, the hold-out method is used. R-squared and RMSE are used to explain a quantitative measure of model performances for each output, and the average value is considered.
Table 3 shows that network performances are not improving significantly by increasing the number of hidden layers and neurons within. A smaller value of the learning parameter improves the performance of a neural network that has more than one hidden layer but slows down the training at the same time; however, it should certainly take into account that the difference in the results of individual networks is negligibly small. It is important to note that in this case, the dataset is divided randomly, which means that during the next training, the results will likely differ from the results shown in Table 3.

3.2. Impact of Cross-Validation Technique on Model Performance

Building the machine learning model requires two things: feeding the model with an initial dataset for training and then providing unseen data to the model to evaluate its performance. The stability and performances of the model highly depend on the data belonging to training and validation sets. Although a large number of evaluation techniques exist, this paper examines and compares the impact of two cross-validation techniques on model performance:
  • Holdout cross-validation technique
  • KFold cross-validation technique.
Holdout (Figure 3) is the simplest of all validation techniques widely used in machine learning. Holdout implies that the entire data set is divided, most often randomly, into two sets. Usually, data are divided in a ratio of 2/3 of the data to the training set and 1/3 of the data to the test set. If handling a large dataset, data can be divided into ratios of 60/40, 70/30, 80/20, or even 90/10. An advantage of this technique is that it is fast because training executes only once. As a drawback, randomly splitting the initial dataset can lead to high variance on repeated training. As a result, the model accuracy will not be consistent. The way to obtain a more robust model using the holdout method is by repeating training several times, using different random seeds. After k repetitions, average performance is computed.
KFold cross-validation (Figure 4) is another method for estimating the model performances. This method systematically creates and evaluates multiple models on different subsets. In most cases, cross-validation is used for the estimation and evaluation of the effectiveness of different hyperparameters. The KFold validation technique is not desirable in neural networks because it is more expensive compared with the holdout technique (i.e., it is time-consuming). When the dataset is large enough, one validation set is enough, and usually there is no need for the KFold.

3.3. Choosing the Number of Folds for Cross-Validation

This section of the research analyzes the influence of the fold size on the model performance. Fold sizes from k = 2 to k = n were used to assess and evaluate their effects on prediction errors. The last case is a leave-one-out-cross-validation technique or LOOCV. LOOCV represents the cross-validation case where there are several folds, which are equal to dataset size, and just one fold is held out for validation.
In this research, the dataset with n = 40 input/output sets was split into folds. The same random-state function values (42), provide the same division into a training and testing set in all runs. Five different network architectures, 4-2-3, 4-4-4, 4-4-4-3, 4-8-8-3, and 4-10-10-3, were assessed.
The most common measures of regression model fit, R-squared and RMSE were used to estimate model performances. Root mean squared error can be expressed by formula:
R M S E = 1 n i = 1 n ( y i y i ^ ) 2
where y ^ i is predicted values, and yi is a dependent regression variable. Since the training set has 40 samples, the 2-fold cross-validation estimates the model performance over a training set of 20, 4-fold cross-validation over a training set of 30, and so on, while LOOCV estimates the model performance over a training set of 39. Figure 5 and Figure 6 show the impact of KFold size on bias and variance for five tested network architectures.
Figure 5 shows that leave-one-out cross-validation does not lead to significantly lower bias than KFold. Increasing K slightly improves variance for almost all tested network architectures (except the 4-2-3 network architecture), as can be seen in Figure 6. This can be explained in the following way: for smaller K values, training samples become smaller. As a result, the model is less stable, which is indicated by the higher value of the variance.
Table 4 shows that the lowest average bias and variance has neural network topology 4-8-8-3 and it will be considered the most favorable. The topology of the adopted neural network for further analysis is shown in Figure 7.

4. Results and Discussion

Figure 8 (based on [25]) shows the procedure of neural network building and simulation using an experimentally obtained dataset. In total, 40 samples were used for neural network model building, of which 28 samples were used for training and 12 for validation of the network. Following that, the neural network was simulated using 14 sets which were completely unknown to the network.

4.1. Verification of ANN Model

Network characteristics have been estimated based on the value of the root mean square error (RMSE) related to the simulation dataset and correlation coefficient (R). After comparing the absolute error of the experimentally obtained output and simulation output, an assessment of the possibility of using neural networks trained with small data sets was produced (Table 5).
The relative error was calculated by the equation:
e r r . = T i N N T i e x p T i e x p × 100 %
The regression plot for simulation is shown in Figure 9. Figure 9a–c show that the neural network model provided R-squared values of R2 = 0.9843 (output T1—Figure 9a), R2 = 0.9747 (output T2—Figure 9b), and R2 = 0.9532 (output T3—Figure 9c), which can be considered good for all outputs.

4.2. Analysis of Working Conditions Effect on the Spindle Thermal Characteristics Obtained by the Proposed ANN Model

Figure 10 shows the change in temperature rise depending on the number of revolutions for different oil flows (Qm) through the housing. By increasing the number of revolutions by 25%, the temperatures of the spindle unit increased by 63% at an oil flow of Qm = 3 L/min, i.e., by 65% at an oil flow of 7 L/min. However, by increasing the flow from Qm = 3 L/min to Qm = 7 L/min, the temperatures of T1 and T3 decreased by 2% at n = 30,000 rpm, or by 1% at n = 70,000 rpm, while the temperature of T2 decreased by 1.7% at n = 30,000 rpm and 3% at n = 70,000 rpm.
The temperature change depending on the number of revolutions for the considered water flow (Qm) through the housing is shown in Figure 11. Increasing the number of revolutions from n = 30,000 rpm to n = 40,000 rpm (25%) increased the temperature difference (ΔT) at the considered points by 50% at a water flow of Qm = 3 L/min, i.e., by 55% at a water flow of Qm = 7 L/min. However, increasing the flow from 3 L/min to 7 L/min reduced the temperatures of T1 and T3 by 12% at n = 30,000 rpm, or by 13% at n = 70,000 rpm, while the temperature of T2 decreased by 10% at n = 30,000 rpm and 16% at n = 70,000 rpm.
When cooling the housing with oil, the maximum temperature increase ΔT2 was approximately 16 °C at a flow rate of Qm = 3 L/min. By increasing the flow to Qm = 7 L/min, ΔT2 decreased to 1 °C, while ΔT1 decreased from 14.5 °C to 13 °C, and ΔT3 decreased from 14.6 °C to 14 °C. On the other hand, when cooling the housing with water, by increasing the flow from 3 L/min to 7 L/min, the temperature ΔT1 decreased for 4 [°C], with a simultaneous decrease in the temperature ΔT2 from 3.8 °C to 1.2 °C and temperature ΔT3 from 3.9 to 1.3 °C. Therefore, the coolant flow had a greater effect on the temperatures of the spindle unit elements when cooling the housing (stator) with water, which is similar to the analysis of experimental test results presented in Section 2. With water cooling, the temperature ΔT2 was lower by approximately 12 °C than with oil cooling, while the temperatures ΔT1 and ΔT2 were lower by approximately 11 °C, which is also consistent with the experimental testing.

5. Conclusions

The major advantage of this approach is that it enables the results of ANN models to be easily integrated with FEM models or digital twins, especially for any further analyses of the influence of temperature on the spindle unit behavior.
Eighteen different neural network models were evaluated, whereby a hold-out method is used for model selection and evaluation. It can be seen that:
  • Network performances does not improve significantly by increasing the number of hidden layers and neurons within;
  • A smaller value of the learning parameter improves the performance of a neural network with more than one hidden layer but significantly slows down training;
  • All models have high variance since the dataset was split randomly.
Five different neural network models were estimated using the KFold cross-validation technique.
  • It can be seen that the model with the 4-8-8-3 network topology has the lowest RMSE value, which indicates that this model has the best performance.
  • Increasing fold number has no significant impact on the bias but slightly improves variance.
The hold-out method is preferred when the dataset is large and can be a good validator for building the initial model. This method takes less computational power and requires less time to run.
  • When handling small datasets, cross-validation is more desirable than the hold-out method since the model is trained on multiple folds. This provides a more reliable indicator of the model acting on unseen data. For datasets up to 40 input/output values, with multiple outputs, the LOOCV method provides the lowest bias and variance, and this model can be considered more reliable than models using lower Kfold values.
Through these findings, the history of temperature distribution on the spindle can be learned, and suitable coolant and flow for the motorized spindle unit can be chosen to minimize temperature rising and thermal expansion. The results of temperature obtained by means of the ANN model make it possible to indicate the best solution and to quantitatively assess the improvement in the high-speed motorized spindle thermal properties. By choosing the appropriate coolant and flow rate, the energy efficiency of the machine tool is increased, while temperature and errors due to heat load are reduced.

Author Contributions

Conceptualization, A.K. and A.Z.; methodology, A.K. and C.M.; software, M.K. and R.C.; validation, M.K. and M.T.; investigation, A.Z. and A.A.; resources, A.K. and A.Z.; writing—original draft preparation, A.K. and A.Z.; writing—review and editing, A.A. and M.K.; visualization, M.K. and C.M.; supervision, A.Z. All authors have read and agreed to the published version of the manuscript.

Funding

The paper presents part of the research results of the project “Collaborative systems in the digital industrial environment” No. 142-451-2671/2021-01/02, supported by the Provincial Secretariat for Higher Education and Scientific Research of the Autonomous Province of Vojvodina.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. Experimental plan.
Table A1. Experimental plan.
Randomized RowNo.Blockn
[rpm]
Qm
[L/min]
Qb
[mL/h]
HT1
[°C]
T2
[°C]
T3
[°C]
1255,0006235.2Oil31.332.031.7
272255,0004235.2Oil30.932.733.5
343270,0005235.2Water23.525.322.5
314255,0005235.2Oil31.931.331.8
395255,0005235.2Water21.822.420.9
376255,0005187.2Water21.722.520.8
267270,0005235.2Oil34.538.135.9
408255,0005235.2Water21.822.420.9
259240,0005235.2Oil29.828.829.0
3510255,0004235.2Water22.022.621.2
3211255,0005235.2Oil31.931.331.8
3812255,0005283.6Water21.222.020.4
3313240,0005235.2Water20.720.619.8
3614255,0006235.2Water21.922.521.2
3015255,0005283.6Oil31.932.433.1
2916255,0005187.2Oil29.430.130.2
317140,0006187.2Oil28.328.328.1
1618170,0006187.2Water25.827.624.9
1519140,0006187.2Water22.222.721.5
1920140,0006283.6Water21.821.921.2
521140,0004283.6Oil30.330.330.1
1722140,0004283.6Water21.421.221.6
423170,0006187.2Oil36.437.138.8
824170,0006283.6Oil35.836.638.3
2025170,0006283.6Water24.125.923.2
1026155,0005235.2Oil31.931.331.8
1327140,0004187.2Water21.321.720.5
128140,0004187.2Oil29.329.028.9
629170,0004283.6Oil35.837.238.5
2430155,0005235.2Water21.822.420.9
2331155,0005235.2Water21.822.420.9
1232155,0005235.2Oil31.931.331.8
1133155,0005235.2Oil31.931.331.8
2234155,0005235.2Water21.822.420.9
935155,0005235.2Oil31.931.331.8
736140,0006283.6Oil29.629.629.5
1837170,0004283.6Water23.523.325.5
238170,0004187.2Oil36.237.839.0
2139155,0005235.2Water21.822.420.9
1440170,0004187.2Water24.226.023.0

References

  1. Ramesh, R.; Mannan, M.A.; Poo, A.N. Error compensation in machine tools—A review: Part II: Thermal errors. Int. J. Mach. Tools Manuf. 2000, 40, 1257–1284. [Google Scholar] [CrossRef]
  2. Mayr, J.; Jedrzejewski, J.; Uhlmann, E.; Alkan Donmez, M.; Knapp, W.; Härtig, F.; Wendt, K.; Moriwaki, T.; Shore, P.; Schmitt, R.; et al. Thermal issues in machine tools. CIRP Ann.-Manuf. Technol. 2012, 61, 771–791. [Google Scholar] [CrossRef] [Green Version]
  3. Denkena, B.; Bergmann, B.; Klemme, H. Cooling of motor spindles—A review. Int. J. Adv. Manuf. Technol. 2020, 110, 3273–3294. [Google Scholar] [CrossRef]
  4. Holkup, T.; Cao, H.; Kolář, P.; Altintas, Y.; Zelený, J. Thermo-mechanical model of spindles. CIRP Ann. 2010, 59, 365–368. [Google Scholar] [CrossRef]
  5. Uhlmann, E.; Hu, J. Thermal Modelling of a High Speed Motor Spindle. Procedia CIRP 2012, 1, 313–318. [Google Scholar] [CrossRef]
  6. Zhang, P.; Chen, X. Thermal–mechanical coupling model-based dynamical properties analysis of a motorized spindle system. Proc. Inst. Mech. Eng. Part B J. Eng. Manuf. 2014, 230, 732–743. [Google Scholar] [CrossRef]
  7. Zivkovic, A.; Zeljkovic, M.; Tabakovic, S.; Milojevic, Z. Mathematical modeling and experimental testing of high-speed spindle behavior. Int. J. Adv. Manuf. Technol. 2015, 77, 1071–1086. [Google Scholar] [CrossRef]
  8. Fang, B.; Gu, T.; Ye, D.; Luo, T. An improved thermo-mechanical model for vertical machining center. Int. J. Adv. Manuf. Technol. 2016, 87, 2581–2592. [Google Scholar] [CrossRef]
  9. Zhang, L.; Li, J.; Wu, Y.; Zhang, K.; Wang, Y. Prediction model and experimental validation for the thermal deformation of motorized spindle. Heat Mass Transf. 2018, 54, 2691–2704. [Google Scholar] [CrossRef]
  10. Liu, J.; Ma, C.; Wang, S.; Wang, S.; Yang, B.; Shi, H. Thermal-structure interaction characteristics of a high-speed spindle- bearing system. Int. J. Mach. Tools Manuf. 2019, 137, 42–57. [Google Scholar] [CrossRef]
  11. Zivkovic, A.; Zeljkovic, M.; Mladjenovic, C.; Tabakovic, S.; Milojevic, Z.; Hadzistevic, M. A study of thermal behavior of the machine tool spindle. Therm. Sci. 2019, 23, 2117–2130. [Google Scholar] [CrossRef]
  12. Zhou, H.; Fan, K.; Gao, R. Fast heat conduction-based thermal error control technique for spindle system of machine tools. Int. J. Adv. Manuf. Technol. 2020, 107, 653–666. [Google Scholar] [CrossRef]
  13. Bossmanns, B.; Tu, J.F. A thermal model for high speed motorized spindles. Int. J. Mach. Tools Manuf. 1999, 39, 1345–1366. [Google Scholar] [CrossRef]
  14. Bossmanns, B.; Tu, J.F. A Power Flow Model for High Speed Motorized Spindles—Heat Generation Characterization. J. Manuf. Sci. Eng. 2000, 123, 494–505. [Google Scholar] [CrossRef]
  15. Jedrzejewski, J.; Kowal, Z.; Kwaśny, W.; Modrzycki, W. Hybrid model of high speed machining centre headstock. CIRP Ann. 2004, 53, 285–288. [Google Scholar] [CrossRef]
  16. Jędrzejewski, J.; Kowal, Z.; Kwaśny, W.; Modrzycki, W. High-speed precise machine tools spindle units improving. J. Mater. Process. Technol. 2005, 162, 615–621. [Google Scholar] [CrossRef]
  17. Mayrl, J. Comparing the thermo-mechanical behaviour of machine tool frame designs using a FDM-FEM simulation approach. In Proceedings of the ASPE Annual Meeting, Dallas, TX, USA, 14–19 October 2007; pp. 14–19. [Google Scholar]
  18. Liu, Z.; Pan, M.; Zhang, A.; Zhao, Y.; Yang, Y.; Ma, C. Thermal characteristic analysis of high-speed motorized spindle system based on thermal contact resistance and thermal-conduction resistance. Int. J. Adv. Manuf. Technol. 2015, 76, 1913–1926. [Google Scholar] [CrossRef]
  19. Yan, K.; Hong, J.; Zhang, J.; Mi, W.; Wu, W. Thermal-deformation coupling in thermal network for transient analysis of spindle-bearing system. Int. J. Therm. Sci. 2016, 104, 1–12. [Google Scholar] [CrossRef]
  20. Lo, Y.C.; Hu, Y.C.; Chang, P.Z. Parameter Estimation of the Thermal Network Model of a Machine Tool Spindle by Self-made Bluetooth Temperature Sensor Module. Sensors 2018, 18, 656. [Google Scholar] [CrossRef] [Green Version]
  21. Zhou, C.; Qu, Z.; Hu, B.; Li, S. Thermal network model and experimental validation for a motorized spindle including thermal-mechanical coupling effect. Int. J. Adv. Manuf. Technol. 2021, 115, 487–501. [Google Scholar] [CrossRef]
  22. Yang, Y.; Du, Z.; Feng, X.; Yang, J. Real-time thermal modelling approach of a machine tool spindle based on bond graph method. Int. J. Adv. Manuf. Technol. 2021, 113, 99–115. [Google Scholar] [CrossRef]
  23. Lippmann, R. An introduction to computing with neural nets. IEEE Assp Mag. 1987, 4, 4–22. [Google Scholar] [CrossRef]
  24. Bebis, G.; Georgiopoulos, M. Feed-forward neural networks. IEEE Potentials 1994, 13, 27–31. [Google Scholar] [CrossRef]
  25. Kosarac, A.; Mladjenovic, C.; Zeljkovic, M.; Tabakovic, S.; Knezev, M. Neural-Network-Based Approaches for Optimization of Machining Parameters Using Small Dataset. Materials 2022, 15, 700. [Google Scholar] [CrossRef]
  26. Al Hazza, M.H.; Adesta, E.Y. Investigation of the Effect of Cutting Speed on the Surface Roughness Parameters in CNC End Milling using Artificial Neural Network. In IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK, 2013; p. 012089. [Google Scholar]
  27. Karagiannis, S.; Stavropoulos, P.; Ziogas, C.; Kechagias, J. Prediction of surface roughness magnitude in computer numerical controlled end milling processes using neural networks, by considering a set of influence parameters: An aluminium alloy 5083 case study. Proc. Inst. Mech. Eng. Part B J. Eng. Manuf. 2014, 228, 233–244. [Google Scholar] [CrossRef]
  28. Eser, A.; Aşkar Ayyıldız, E.; Ayyıldız, M.; Kara, F. Artificial intelligence-based surface roughness estimation modelling for milling of AA6061 alloy. Adv. Mater. Sci. Eng. 2021, 2021, 5576600. [Google Scholar] [CrossRef]
  29. Hao, W.; Hongtao, Z.; Qianjian, G.; Xiushan, W.; Jianguo, Y. Thermal error optimization modeling and real-time compensation on a CNC turning center. J. Mater. Process. Technol. 2008, 207, 172–179. [Google Scholar] [CrossRef]
  30. Feng, T.; Ming, Y.; Ji, P.; Yabin, W.; Guofu, Y. CNC machine tool spindle thermal error modeling based on ensemble BP neural network. Comput. Integr. Manuf. Syst. 2018, 24, 1383–1390. [Google Scholar]
  31. Li, B.; Tian, X.; Zhang, M. Thermal error modeling of machine tool spindle based on the improved algorithm optimized BP neural network. Int. J. Adv. Manuf. Technol. 2019, 105, 1497–1505. [Google Scholar] [CrossRef]
  32. Li, Z.; Zhu, B.; Dai, Y.; Zhu, W.; Wang, Q.; Wang, B. Research on Thermal Error Modeling of Motorized Spindle Based on BP Neural Network Optimized by Beetle Antennae Search Algorithm. Machines 2021, 9, 286. [Google Scholar] [CrossRef]
  33. Cui, L.Y.; Zhang, D.W.; Gao, W.G.; Qi, X.Y.; Shen, Y. Thermal Errors Simulation and Modeling of Motorized Spindle; Trans Tech Publications: Stafa-Zurich, Switzerland, 2011; pp. 1305–1309. [Google Scholar]
  34. Lv, C.; Liu, Z.Y.; Liu, Z.J.; Yu, Z.M. Application of generalized radial basis function neural network to thermal error modeling. Opt. Precis. Eng. 2015, 23, 1705–1713. [Google Scholar]
  35. Zhang, H.N. Research on Modeling of Machining Center Spindle Thermal Error Based on Improved RBF Network. Tech. Autom. Appl. 2019, 38, 60–74. [Google Scholar]
  36. Fu, G.; Gong, H.; Gao, H.; Gu, T.; Cao, Z. Integrated thermal error modeling of machine tool spindle using a chicken swarm optimization algorithm-based radial basic function neural network. Int. J. Adv. Manuf. Technol. 2019, 105, 2039–2055. [Google Scholar] [CrossRef]
  37. Li, Y.; Zhao, W.; Lan, S.; Ni, J.; Wu, W.; Lu, B. A review on spindle thermal error compensation in machine tools. Int. J. Mach. Tools Manuf. 2015, 95, 20–38. [Google Scholar] [CrossRef]
  38. Kang, Y.; Chang, C.W.; Huang, Y.; Hsu, C.L.; Nieh, I.F. Modification of a neural network utilizing hybrid filters for the compensation of thermal deformation in machine tools. Int. J. Mach. Tools Manuf. 2007, 47, 376–387. [Google Scholar] [CrossRef]
  39. Yang, Z.; Sun, M.; Li, W.; Liang, W. Modified Elman network for thermal deformation compensation modeling in machine tools. Int. J. Adv. Manuf. Technol. 2011, 54, 669–676. [Google Scholar] [CrossRef]
  40. Li, Z.; Zhu, B.; Dai, Y.; Zhu, W.; Wang, Q.; Wang, B. Thermal error modeling of motorized spindle based on Elman neural network optimized by sparrow search algorithm. Int. J. Adv. Manuf. Technol. 2022, 121, 349–366. [Google Scholar] [CrossRef]
  41. Zhang, Y.; Yang, J.; Jiang, H. Machine tool thermal error modeling and prediction by grey neural network. Int. J. Adv. Manuf. Technol. 2012, 59, 1065–1072. [Google Scholar] [CrossRef]
  42. Abdulshahed, A.M.; Longstaff, A.P.; Fletcher, S.; Potdar, A. Thermal error modelling of a gantry-type 5-axis machine tool using a Grey Neural Network Model. J. Manuf. Syst. 2016, 41, 130–142. [Google Scholar] [CrossRef] [Green Version]
  43. Qian, X.; Yang, R. Machine learning for predicting thermal transport properties of solids. Mater. Sci. Eng. R: Rep. 2021, 146, 100642. [Google Scholar] [CrossRef]
  44. Raza, A.; Bardhan, S.; Xu, L.; Yamijala, S.S.R.K.C.; Lian, C.; Kwon, H.; Wong, B.M. A Machine Learning Approach for Predicting Defluorination of Per- and Polyfluoroalkyl Substances (PFAS) for Their Efficient Treatment and Removal. Environ. Sci. Technol. Lett. 2019, 6, 624–629. [Google Scholar] [CrossRef]
Figure 1. (a) A schematic of the experimental rig; (b) Spindle unit.
Figure 1. (a) A schematic of the experimental rig; (b) Spindle unit.
Materials 15 07782 g001
Figure 2. Correlation matrix; (a) four input variables; (b) coolant type oil; and (c) coolant type water.
Figure 2. Correlation matrix; (a) four input variables; (b) coolant type oil; and (c) coolant type water.
Materials 15 07782 g002
Figure 3. Holdout cross-validation.
Figure 3. Holdout cross-validation.
Materials 15 07782 g003
Figure 4. KFold cross-validation.
Figure 4. KFold cross-validation.
Materials 15 07782 g004
Figure 5. RMSE vs. KFold.
Figure 5. RMSE vs. KFold.
Materials 15 07782 g005
Figure 6. Standard deviation of RMSE vs. KFold.
Figure 6. Standard deviation of RMSE vs. KFold.
Materials 15 07782 g006
Figure 7. The adopted neural network topology 4-8-8-3.
Figure 7. The adopted neural network topology 4-8-8-3.
Materials 15 07782 g007
Figure 8. Simulation of the neural network using experimentally obtained dataset and developed NN model.
Figure 8. Simulation of the neural network using experimentally obtained dataset and developed NN model.
Materials 15 07782 g008
Figure 9. The plot of data regression for (a) temperature T1, (b) temperature T2, and (c) temperature T3.
Figure 9. The plot of data regression for (a) temperature T1, (b) temperature T2, and (c) temperature T3.
Materials 15 07782 g009aMaterials 15 07782 g009b
Figure 10. Temperature change depending on the number of revolutions for different oil flows through the housing: (a) Qm = 3 [L/min]; (b) Qm = 5 [L/min]; and (c) Qm = 7 [L/min].
Figure 10. Temperature change depending on the number of revolutions for different oil flows through the housing: (a) Qm = 3 [L/min]; (b) Qm = 5 [L/min]; and (c) Qm = 7 [L/min].
Materials 15 07782 g010
Figure 11. Temperature change depending on the number of revolutions for different water flows through the housing: (a) Qm = 3 [L/min]; (b) Qm = 5 [L/min]; and (c) Qm = 7 [L/min].
Figure 11. Temperature change depending on the number of revolutions for different water flows through the housing: (a) Qm = 3 [L/min]; (b) Qm = 5 [L/min]; and (c) Qm = 7 [L/min].
Materials 15 07782 g011
Table 1. Experimental factors and their levels.
Table 1. Experimental factors and their levels.
ConditionFactorUnitsLow LevelMiddle LevelHigh Level
−10+1
Number of revolutionsno/min40,00055,00070,000
Coolant flow of motorQmL/min456
Bearing coolant flowQbmL/h187.2235.2283.6
Coolant typeH-Oil Water
Table 2. Main characteristic used measurement equipment.
Table 2. Main characteristic used measurement equipment.
Thermocouples
Type K
Thermal ImagerAcrylic Flow MetersIntegral Flowmeter AXF ISO 9104Infrared Thermometer
Operation range−200 to 1200 °C−20 to 250 °Cto 7 barto 100 bar−40 to 500 °C
Accuracy±0.2 °C at 100 °C ±1%±5% from whole range±0.15% from flow velocity±0.2%
Table 3. Network topology and learning rate selected based on model performance.
Table 3. Network topology and learning rate selected based on model performance.
NN ArchitectureNo. of EpochsLoss of Training SetLoss of Evaluation SetR2 (T1)R2 (T2)R2 (T3)R2 (Aver.)Learning Rate
RMSERMSERMSERMSE (Aver.)
1.4-2-350591.7312.4040.8920.8350.9050.8770.01
1.4371.7231.4741.544
2.4-2-311,6891.7382.3990.8960.8260.9100.8770.001
1.4181.7671.4361.540
3.4-3-328371.6822.4140.8790.8320.9110.8740.01
1.5211.7051.4211.549
4.4-3-382161.8525.1050.7590.6430.8250.7420.001
2.1952.4792.0842.252
5.4-4-338011.7312.3810.8900.8160.9170.8740.01
1.4391.7841.3741.532
6.4-4-394731.7202.4460.8870.8160.9160.8370.001
1.4721.8011.3881.553
7.4-5-317541.7462.4330.8660.8280.9240.8720.01
1.6061.7221.3231.550
8.4-5-385061.6852.4590.8790.8160.9170.8700.001
1.5201.7771.3801.559
9.4-3-3-31187.97924.120.025−0.260.350.0410.01
5.1415.0454.5274.904
10.4-3-3-343201.6122.5350.8680.8030.9370.8690.001
1.6261.8791.1951.566
11.4-4-4-312413.99226.0110.146−0.060.3780.1540.01
5.1985.1964.8995.097
12.4-4-4-376511.78672.39450.8810.8270.9210.8760.001
1.5231.7521.3381.537
13.4-8-8-39313.725218.3580.46850.08930.52020.3590.01
4.0164.6924.1154.274
14.4-8-8-352141.72002.3910.8920.83120.90850.8770.001
1.4451.7281.4481.540
15.4-4-4-4-35901.0843.3810.8420.7570.9150.8380.01
1.9002.0731.4941.822
16.4-4-4-4-310,3701.7332.3920.8930.8340.9060.8770.001
1.4291.7231.4711.541
17.4-4-10-4-3495536.10119.72302.2200.740.01
4.354.164.7884.43
18.4-4-10-4-360171.81262.43410.8770.8090.9290.8710.001
1.5331.8281.2681.543
Table 4. Average values of RMSE and standard deviation for five network topologies.
Table 4. Average values of RMSE and standard deviation for five network topologies.
Network TopologyRMSEσ
4-2-31.95450.34766
4-4-31.71580.20772
4-4-4-31.60680.26232
4-8-8-31.38500.20518
4-10-10-31.40670.22730
Table 5. Comparison of experimentally obtained dataset and neural network predictions.
Table 5. Comparison of experimentally obtained dataset and neural network predictions.
nQmQbHT1 T2 T3
Pred.MeasuredErr %Pred.MeasuredErr %Pred.MeasuredErr %
60,0004235.2Oil33.24033.6−1.0734.04435.4−3.8334.24837.0−7.44
60,0005235.2Oil33.15633.6−1.3234.03232.83.7634.09334.2−0.31
60,0006235.2Oil33.07332.501.7634.02134.70−1.9633.93733.102.53
50,0004235.2Oil31.21031.7−1.5531.94932.6−2.0032.15733.4−3.72
50,0005235.2Oil31.12731.7−1.8131.93730.93.3632.00231.70.95
50,0006235.2Oil31.04431.30−0.8231.92632.00−0.2331.84631.700.46
60,0004235.2Water23.36522.44.3123.85623.70.6623.00421.57.00
60,0005235.2Water23.28222.603.0223.84523.800.19%22.84821.705.29
60,0006235.2Water23.19922.304.0323.83323.700.5622.69321.505.55
50,0004235.2Water21.33721.20.6521.76122.2−1.9820.91220.71.02
50,0005235.2Water21.25321.80−2.5121.75022.30−2.4720.75720.80−0.21
50,0006235.2Water21.17021.90−3.3321.73822.50−3.3920.60221.20−2.82
30,0004235.2Oil27.15326.52.4627.75926.64.3627.97526.17.18
30,0005235,2Oil27.06927.2−0.4827.74727.12.3927.81927.70.43
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Kosarac, A.; Cep, R.; Trochta, M.; Knezev, M.; Zivkovic, A.; Mladjenovic, C.; Antic, A. Thermal Behavior Modeling Based on BP Neural Network in Keras Framework for Motorized Machine Tool Spindles. Materials 2022, 15, 7782. https://doi.org/10.3390/ma15217782

AMA Style

Kosarac A, Cep R, Trochta M, Knezev M, Zivkovic A, Mladjenovic C, Antic A. Thermal Behavior Modeling Based on BP Neural Network in Keras Framework for Motorized Machine Tool Spindles. Materials. 2022; 15(21):7782. https://doi.org/10.3390/ma15217782

Chicago/Turabian Style

Kosarac, Aleksandar, Robert Cep, Miroslav Trochta, Milos Knezev, Aleksandar Zivkovic, Cvijetin Mladjenovic, and Aco Antic. 2022. "Thermal Behavior Modeling Based on BP Neural Network in Keras Framework for Motorized Machine Tool Spindles" Materials 15, no. 21: 7782. https://doi.org/10.3390/ma15217782

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop