1 Introduction

Ball screw feed drive system, as the key component of precision transmission and positioning of CNC machine tools, plays a vital role in the positioning accuracy of machine tools. However, in the working process, as each component of the feed system is very sensitive to temperature changes, the friction between the contact surfaces of the moving pairs leads to temperature rise, which causes thermal deformation of the structure and affects the positioning accuracy of the machine tools [1, 2]. Previous studies have shown that the processing errors caused by thermal deformation of feed system account for 50% to 80% of the total errors [3]. Therefore, this subject conducts in-depth research on the thermal error of the feed system, and the influence of thermal effect on machine tool processing accuracy was studied. The thermal error was predicted and modeled according to the temperature distribution mechanism of feed system.

In order to reduce the thermal error of machine tool feed system, scholars have done a lot of research work, including through the symmetrical design of structure, low temperature expansion materials, installation of cooling devices, etc. These studies mainly focus on the effectiveness of practice and replace the study of the thermal deformation mechanism of the screw shaft with cooling method [4, 5]. However, these methods tend to cost more in the processing, and they do not have strain capacity for the thermal error under complex environmental conditions. Therefore, most scholars focus on error prediction and compensation [6].

The thermal error of CNC machine tool feed system originates from the time-dependent nonlinear process caused by uneven temperature variation in mechanical structure. Accurate error prediction modeling is an important part of error compensation. Generally, various thermal error compensation methods are widely used to establish thermal error models, including multiple regression method [7,8,9], neural network method [10,11,12], gray theory [13, 14], support vector machine method, and so on [15,16,17]. However, the above error modeling methods need more sensors and are more expensive, and the research process requires lengthy and time-consuming experimental analysis. In practical applications, it is difficult to ensure the accuracy and robustness of the model. In order to solve the above problems, other scholars have tried to study from the thermal deformation mechanism, apply numerical analysis method, and widely use MATLAB and ANSYS software. Yang et al. [18] used the finite element method (FEM) that was used to simulate the thermal expansion process of the ball screw feed system and calculated the thermal deformation of the ball screw shaft and nut. Kim et al. [19] estimated the ball screw in real time based on lumped heat capacity model and completed the prediction of temperature field and thermal error of feed system. Chen et al. [20] analyzed the thermal characteristics of the screw nut in the servo system, simplified the modeling of the screw temperature field, and proposed to predict the temperature field of the screw by identifying the parameters of the model. Xia et al. [21] based on the theory of heat transfer studied the dynamic characteristics of ball screw system and proposed a dynamic model of ball screw pair thermal deformation based on least squares system identification theory. However, since the feed system has many heat sources and changes with the feed velocity and the environment, the heat generation rate and the temperature rise distribution of the system are time-varying. This makes it difficult to establish precise thermal boundary conditions for the ball screw drive system. Therefore, it is difficult for scholars to accurately predict the temperature rise and thermal error of the feed system.

Aiming at some problems in the above research, this paper proposed a real-time prediction model of axial thermal error based on experimental and simulation analysis. Based on the Monte Carlo (MC) finite element simulation identification method, the heat distribution ratio of each heat source in the feed system is determined, and then the torque current of the servo motor is used to identify the heat generation rate of each heat source in the feed system. Then, a new thermal error prediction model based on the torque current of servo motor is proposed, which provides a basis for real-time compensation of thermal error in the feed system of CNC machine tools.

2 Identification of heat generation rate distribution relationship by FEM integrated with Monte Carlo method

Because there are many heat sources in the feed system and the changes with the feed speed and environment, the heat generation rate of heat source and the temperature rise for the drive system have large time-varying. According to the traditional calculation method, its accuracy cannot be guaranteed. In the actual processing process, the sensor cannot directly measure the temperature of the heat source center. Therefore, this paper presents a finite element method based on experimental data combined with Monte Carlo algorithm to identify and calculate the heat generation rate of the feed system.

2.1 Finite element simulation calculation integrated with Monte Carlo optimization method

In this paper, the x-axis feed system was selected as the research object, and its finite element model was established by using ANSYS software. Due to the complexity of geometry shape for CNC machine feed system, in order to improve the calculation efficiency, the model needs to be simplified. Solid90 elements were chosen as the element type, while TARGE170 and CONTA174 contact elements were selected for each pair of contact areas. The feed system in ANSYS software is shown in Fig. 1.

Fig. 1
figure 1

Finite element model

Herein, the use of x1, x2, x3, and x4, respectively, indicates the heat generation rate of the nut, the fixed bearing, the support bearing, and the guide rail. The temperature field of ball screw feed system is obtained by substituting heat generation rate, and then the objective function is calculated. The objective function is established as follows:

$$ F\left({x}_1,{x}_2,{x}_3,{x}_4\right)=\sum \limits_i\sum \limits_j{\left({T}_{ij}^{\mathrm{E}}-{T}_{ij}^{\mathrm{M}}\right)}^2 $$
(1)

where \( {T}_{ij}^{\mathrm{E}} \) is the temperature of the given point i of the jth sampling time step, and the superscripts E and M represent the experimental measured values and the finite element simulation values, respectively. Section 4 will introduce the experiment part in detail.

Monte Carlo simulation was used to determine the heat flux xT of each heat source. If the lower and upper bounds of xT are xLT and xHT, respectively, the K-group heat flux sample values were generated using a random function.

$$ {\displaystyle \begin{array}{l}{x}_{ml}={x}_{LT}+ random\left(0,{\delta}_T\right)\ \\ {}{\delta}_T={x}_{HT}-{x}_{LT},m=1,2,3,4;l=1,2,\cdots, K\end{array}} $$
(2)

The heat flux values of each group were substituted into the finite element model to calculate and extract the temperature value \( {T}_{lij}^{\mathrm{M}} \) corresponding to the temperature detection point and the detection time. Substitute each group of simulated temperature \( {T}_{lij}^{\mathrm{M}} \) and experiment result \( {T}_{ij}^{\mathrm{E}} \)x into Eq. (1) to calculate the objective function Fl. Find the heat flux corresponding to the minimum objective function of K times simulation, denoted as \( {x}_1^{\hbox{'}} \), \( {x}_2^{\hbox{'}} \), \( {x}_3^{\hbox{'}} \), and \( {x}_4^{\hbox{'}} \). If the results meet the accuracy min(Fl) ≤ ε, the simulation results are output, and the simulation calculation is ended. Otherwise, the upper and lower limits are changed by the dichotomy, that is, if \( {x}_m^{\hbox{'}}-{x}_{LT}<0.5{\delta}_l \), then xHT = xHT − 0.5δl; otherwise xLT = xLT + 0.5δl, l = 1, 2, 3, 4. Then, the above simulation process is repeated. The method obtains the temperature field which satisfies the experiment data and obtains the real heat generation rate. The flow chart of the whole simulation process implementation is shown in Fig. 2.

Fig. 2
figure 2

Flow chart of FEM combined with MC optimization

2.2 Identification and distribution ratio of heat generation rate of each contact surfaces

The Monte Carlo simulation is used to identify the heat generation rate of each heat source in the feed system. Among them, the number of samples k = 60, calculation accuracy ε = 0.01, the lower limit of heat flux of each heat source is 0, and the upper limit takes the total power QALL consumed by the feed system. Figure 3 is the calculation result of the heat generation rate of each heat source under the feed velocity of 5 m/min. It can be seen from Fig. 3 that the heat generation rate of each heat source decreases rapidly at the beginning and gradually reaches a steady-state value with the increase of system operation time. This change is similar to the system temperature heat balance process. The reason is that the temperature of each contact surface is low in the initial stage, the viscosity of lubricating oil film is high, and the frictional heat flux between the contact surfaces is also large. With the increase of the temperature of the contact surface, the viscosity of lubricating oil decreases, and the heat generation rate between the contact surfaces decreases. The Gompertz model is used to describe the variation of the heat generation rate of each heat source with the feed time.

Fig. 3
figure 3

Heat generation rate of each heat source

The influence of feed velocity on the temperature field of ball screw is analyzed in references [22]. It was proved that the heat generation rate of the heat source increases nonlinearly with time. The dynamic trend of heat generation rate is the same under different feed speed. Therefore, the experimental data can be used to identify the heat generation rate of each heat source, and the nonlinear regression analysis of the identification results is carried out to determine the relationship between the heat generation rate of each heat source and the time.

$$ {Q}_i={A}_i+{B}_i\cdotp {e}^{c_it} $$
(3)

where t is the working time and Ai, Bi, and ci are the nonlinear regression coefficients of each heat source.

The distribution ratio was calculated for the identification result Qi of heat source of heat generation rate at different feed velocity, which is the ratio of heat generation rate of each heat source to total heat generation rate.

$$ {P}_i=\frac{Q_i}{\sum \limits_{i=1}^4{Q}_i}=\frac{A_i+{B}_i\cdotp {e}^{c_it}}{\sum \limits_1^4{A}_i+{B}_i\cdotp {e}^{c_it}} $$
(4)

where Pi is the distribution ratio of each heat source.

By using Eq. (5), the trend of the distribution ratio for heat generation rate of each heat source with time can be obtained at different feed velocities. Although the heat generation rate of each heat source increases linearly with the feed velocity, its distribution ratio is not affected by the feed velocity, that is, the distribution relationship of heat generation rate does not change with the feed rate different feed rates, which is related to the determined correlation coefficient and processing time.

2.3 Identification of heat generation rate based on the torque current of the servo motor

The research object of this paper is the x-axis feed system of inclined machine tool. The process from friction power to thermal deformation is shown in Fig. 4. The heat power and deformation of temperature field satisfy the law of conservation of energy. Therefore, the heat generation rate of each heat source can be obtained by using the servo motor torque current captured by FOCAS function interface program in Section 4 and heat generation rate distribution ratio in Section 2.2. Calculate the output torque of servo motor as follows:

$$ {T}_m={K}_tI $$
(5)
Fig. 4
figure 4

The procedure of feed system from friction to deformation

In the formula, Tm is the torque of the servo motor, I is torque current of servo motor, and Kt is the torque coefficient of the servo motor.

The total friction power consumption of the ball screw feed system is as follows:

$$ {Q}_A=\left\{\begin{array}{l}\frac{T_{\mathrm{m}}n}{9550}-{m}_{\mathrm{t}}g\sin \left(\alpha \right)\kern1em \mathrm{Positive}\ \mathrm{stroke}\\ {}{m}_{\mathrm{t}}g\sin \left(\alpha \right)v+\frac{T_{\mathrm{m}}n}{9550}\kern0.75em \mathrm{Negative}\ \mathrm{stroke}\end{array}\right. $$
(6)

where QA is the total friction thermal power, n is the rotational speed, mt is the mass of the tool holder, gis the gravitational acceleration, α is the inclination angle of the ball screw drive system relative to the horizontal plane, and v is the feed velocity of the tool holder.

The total frictional heat power of the feed system is obtained by summing up the heat generation rate of each heat source identified by Monte Carlo simulation. Figure 5 shows the comparison between the FEM identification at the feed velocity of 5 m/min and the total heat power calculated by the torque current. The Monte Carlo (MC) identification results are in good agreement with the experimental results, and the error is within a reasonable range.

Fig. 5
figure 5

Comparison of heat generation rate

The heat generation rate of each heat source can be calculated by using the heat rate distribution relationship obtained by Eq. (5) and the torque current of the servo motor. In this way, the real-time heat generation rate of the heat source can be obtained.

$$ {Q}_i={Q}_A\cdotp {P}_i $$
(7)

3 Thermal error prediction model

The thermal error model is essentially the relationship between temperature and thermal error. The lower end of the ball screw is fixed, the upper end is free, and the radial deformation of the lead screw shaft is neglected. According to the theory of heat transfer, the ball screw can be simplified to a one-dimensional rod heat conductor [23]. As shown in Fig. 6, the spatial scale s is used to discretize the lead screw axis into N segments, that is, L = j · s. The timescale γ is used to divide the running time of the system into W segments, that is, t = i ⋅ γ. Discrete the area of the screw shaft and establish the node discrete equation.

Fig. 6
figure 6

Schematic diagram of discretization of ball screw

In the working process of the feed system, the heat source of the bearing at both ends injects heat to the screw shaft for heat conduction, and the friction heat is generated when the nut runs to a contact point of the screw shaft. In addition, the screw shaft and the air contact section Sj generate convective heat transfer, and heat conduction is performed adjacent to Sj − 1 and Sj + 1. The heat balance equation is expressed as follows.

$$ \varDelta {T}_j^i=\frac{Q_{1-1}^i+{Q}_{2-N}^i+{Q}_{3-j}^i-{Q}_{out-j}^i-{Q}_{L-j}^i}{cm} $$
(8)

where \( \varDelta {T}_j^i \) is the temperature change of the Sj segment during the ith period, \( {Q}_{1-1}^i \) is the total heat generated by the free end bearing, \( {Q}_{2-N}^i \) is the total heat generated by the motor end bearing during the ith period, \( {Q}_{3-j}^i \) is the total friction heat generated by the a moving nut during the ith period, \( {Q}_{L-j}^i \) is the thermal conductivity of the Sj segment along the axial direction, \( {Q}_{out-j}^i \) is the heat exchange between the Sj segment and the air, c is the specific heat capacity of lead screw material, and m is the mass of each segment.

\( {Q}_{1-1}^i \), \( {Q}_{2-N}^i \), and \( {Q}_{3-j}^i \) are the total heat generated in timescale. For one of the heat sources, the total heat generated per timescale is expressed as:

$$ {Q}^i={Q}_i\cdotp \gamma $$
(9)

where Qi is calculated by Eq. (7).

\( {Q}_{L-j}^i \)is the heat conduction in the γ timescale. The formulas are as follows:

$$ {Q}_{L-j}^i=\left(\lambda \cdotp {A}_{\mathrm{c}}\frac{\left({T}_j^i-{T}_{j-1}^i\right)}{s}+\lambda \cdotp {A}_{\mathrm{c}}\frac{\left({T}_j^i-{T}_{j+1}^i\right)}{s}\right)\times \gamma $$
(10)

where λ is thermal conductivity, Ac is the cross-sectional area of the lead screw, \( {T}_j^i \) is the temperature of jth segment at i time, \( {T}_{j-1}^i \) is the temperature of j-1 segment at i time, and \( {T}_{j+1}^i \) is the temperature of j + 1 segment at i time.

The heat exchange between the ball screw and the working environment is the way of heat dissipation. During the time γ, the heat transfer between the ball screw and the air is as follows:

$$ {Q}_{out-j}^i={h}_v\times A\times \left({T}_j^i-{T}_A\right)\times \gamma $$
(11)

where hv is the convective heat transfer coefficient between the screw and the air, A is the surface area of contact with air each segment, and TA is the working environment temperature.

Therefore, the major heat dissipation way is the coefficient of convective heat transfer between the ball screw feed system and the surrounding. According to Eqs. (12) and (13), the heat transfer coefficient (hv) can be obtained. The calculation of heat transfer coefficient should be updated in real time in the program.

$$ {h}_v=\frac{N_u{\lambda}_{fluid}}{l_d} $$
(12)
$$ \left\{\begin{array}{c}{N}_u=C{\left({G}_r\cdotp {P}_r\right)}^m\\ {}{P}_r=\frac{\mu_f{c}_f}{\lambda_{fluid}}\end{array}\right. $$
(13)

where Nu is Nusselt number, λfluid is the thermal conductivity of air, ld is the diameter of the lead screw, μf is the dynamic velocity, cf is specific heat capacitance of air, and Pr is 0.707 for air.

Cumulative calculation for \( \varDelta {T}_j^i \), \( \varDelta {T}_j=\sum \limits_{i=1}^l\varDelta {T}_j^i \) is the temperature change value of the jth segment during the working period of the drive system. ΔLj is the amount of thermal elongation.

$$ \varDelta {L}_j=\alpha \times \varDelta {T}_j\times s $$
(14)

where ΔTj is the temperature change of the jth segment of the screw shaft and α is the thermal expansion coefficient of the screw shaft.

During the working process of the feed system, the thermal error of the worktable running to position j is as follows:

$$ {L}_j=\sum \limits_{i=1}^j\varDelta {L}_i $$
(15)

4 Experimental setup and data processing

4.1 Experimental setup and procedure

In order to study the heat transfer and thermal deformation of the ball screw feed system under different working conditions, the experiment was established and placed as shown in Fig. 7. The experiment object is the x-axis ball screw feed system of HTC2050i CNC lathe, and the CNC system is FANUC 0I Mate-TD. The ball screw model is 3210, the nominal diameter is 32 mm, the pitch is 10 mm, and the stroke range is 220 mm. The lead screw is supported by two bearings, of which the bearing closed to the servo motor is fixed support and the other end is support bearing. The PC104 computer is connected to the numerical control system through a network cable interface. The FOCAS function interface program runs on the PC104 industrial control system to realize the reading and storage of the servo motor torque current signal and the feed axis position of the feed system [24].

Fig. 7
figure 7

Experimental setup for measuring x-axis thermal characteristics

In order to analyze the heating characteristics of the heat source for the feed system, the temperature and positioning error detection points should be reasonably selected. The temperature sensors were arranged as close as possible to the heat source to accurately reflect the temperature changes of each heat source. The measurement point distribution of the system temperature and positioning error is shown in Fig. 8.

  1. 1)

    Using magnetic adsorption thermocouple to detect temperature, the detection points are temperature T1 of motor end bearing, temperature T2 of lower bearing, temperature T3 of nut flange, and temperature T4 of guide slide. The sampling interval was set to 0.5 s.

  2. 2)

    The temperature of the surface points of the screw was recorded by infrared thermal imager for full stroke, and the temperature is measured once every 10 min of reciprocating motion. The data processing process of thermal imaging picked up the temperature point of the lead screw surface in equal intervals, as shown in Fig. 2, P1–P6, and the dot pitch was 44 mm.

  3. 3)

    According to ISO 230-3 standard and ISO 230-2 standard [25, 26], the positioning error was measured by using XL80 laser interferometer. The measuring point was still selected as P1–P6, and the worktable was tested every 10 min of reciprocating motion.

Fig. 8
figure 8

Distribution of measurement points

4.2 Data processing

When the experiment obtained the worktable position and torque current of the feed system, the sampling data are between 70 and 72 ms in the working process, and the position and the torque data were not synchronized. In order to obtain the corresponding relationship between the working position and the torque current, the original sampled data were interpolated by the cubic spline to obtain a continuous function of position and current as a function of time. If the feed position of the workbench starts from Z0 to Z1, the record data file is:

$$ {\displaystyle \begin{array}{cccc}{z}_1& {t}_{z1}& {i}_1& {t}_{i1}\\ {}{z}_2& {t}_{z2}& {i}_2& {t}_{i2}\\ {}\vdots & \vdots & \vdots & \vdots \\ {}{z}_j& {t}_{zj}& {i}_j& {t}_{ij}\\ {}\vdots & \vdots & \vdots & \vdots \end{array}} $$
(16)

where tzj is the time corresponding to the collection location data, ij is the torque current, and tij is the time corresponding to the collection torque current data.

Its data processing steps are as follows:

  1. Step 1:

    Read the data file and identifies the position change of the worktable.

  2. Step 2:

    Interpolates the feed axis data (position, time and torque current, time) of Step 1 with cubic spline respectively, obtains the function of position and current changing continuously with time, and then obtains the change of current with the position of the worktable.

The current data of the feed system collected at a constant speed over a period of time is shown in Fig. 9. When in the forward stroke (0–220 mm), the current is positive, and the motor pulls the worktable upward; when in the negative stroke (220–0 mm), the current fluctuates around 0. This shows that the current moves downward mainly by its own gravity, and there is a great sudden change when starting or stopping.

Fig. 9
figure 9

Torque current and position sampling data

The temperature and current sampling data were corresponded to the initial time, and the fluctuation of temperature in the feeding process was obtained. As shown in Fig. 10, the temperature change near the heat source measurement points under the condition of 5 m/min feed rate. It can be seen that the trend of temperature change is almost the same. At the initial temperature, the temperature rises extremely, and after a certain period of time, the temperature reaches near steady state, and the temperature of the heat source near the motor end bearing is significantly higher than other heat sources.

Fig. 10
figure 10

Experimental results of temperature under the feed velocity of 5 m/min

5 Results and discussion

In order to evaluate the prediction model, the temperature and torque current experimental data are used for modeling and simulation calculation. The prediction model is calculated using MATLAB 2014A. According to the predicted temperature field of ball screw, the real-time prediction of thermal error is realized at any position and time. As shown in Fig. 11, the temperature rise of ball screw calculated by the model is compared with that measured by infrared thermal imager. The predictions of the model are basically in agreement with the experimental results. Using the Eqs. (14) and (15), the thermal error of the worktable at the given position of the lead screw can be obtained. The results of the thermal error model calculation and the thermal error data measured of the experiment can be compared and verified. The comparison between the calculated results and the thermal error of the experiment is shown in Fig. 12. The growth trend of axial thermal deformation is similar, and the residual error between the calculation results of thermal error prediction model and the actual experiment results is within a reasonable range. It is proved that FEM combined with Monte Carlo method can identify the variation law of heat generation rate of ball screw feed system, and then the heat generation rate of each heat source is calculated by the torque current of the servo motor for the feed system. It provides a new idea for thermal error prediction and compensation. Real-time measurement of the torque current of the feed system realizes adaptive real-time prediction for thermal error of the feed system and has strong applicability.

Fig. 11
figure 11

Variations of screw temperature rise with time under

the feed velocity of 5 m/min.

Fig. 12
figure 12

Comparison of thermal error for predicting results and experimental results under the feed velocity of 5 m/min

6 Conclusions

Aiming at the thermal error of ball screw feed system, a new real-time prediction model for thermal error of ball screw feed system is proposed based on simulation, experimental analysis, and numerical calculation. The following conclusions can be drawn:

  1. 1.

    Based on the temperature measurement and current data of the drive system, the finite element (FEM) combined with Monte Carlo method is proposed to identify the dynamic characteristics of the feed system heat source under the actual working conditions. By comparing the heat generation rate of each heat source and the output power of the servo motor, the validity of the identification results was verified. This study provides a new method for heat source identification of ball screw feed system with multiple heat sources.

  2. 2.

    By identifying the functional relationship between the heat generation rate of each heat source in the feed system and the running time, the distribution ratio of each heat source in the working process of the system was deduced, and then a method of predicting the heat generation rate by using the torque current of the servo motor is proposed.

  3. 3.

    The prediction model for forecasting the temperature rise and thermal error distribution of the screw by using the heat generation rate of each heat source was proposed, and the accuracy of the prediction method was verified experimentally. It provides a new idea for heat source identification method and thermal error compensation and has a strong application value in practical engineering applications.