PREDICTIVE COMPENSATION OF THERMAL DEFORMATIONS OF BALL SCREWS IN CNC MACHINES USING NEURAL NETWORKS

Original scientific paper The need to improve the accuracy of positioning of a servo-drive was the stimulus for research on a new sensorless method for compensation of thermal deformations of ball screws, enabling predictive compensation of the elongation of such a screw based on historical data. Models have been developed for the predictive compensation of thermal deformations of ball screws in CNC machines, in the form of single-directional multi-layered neural networks with error back-propagation (MLP), radial basis function neural networks (RBF) and Kohonen networks. Neural networks were developed with different structures and learning parameters, and these networks were compared. Models were evaluated in terms of the effectiveness of operation of the networks. The models were tested on real data.


Introduction
Due to strong competition in the market for machine tools, manufacturers have recently had to devote attention to economical machines, in which they strive to combine high accuracy and productivity with relatively low costs.This trend necessitates the seeking of new solutions that are significantly cheaper, but are no worse in terms of accuracy and productivity.One of the chief factors increasing the cost of numerically controlled tools is a direct measurement system.Elimination of such a system leads to an increase in the positioning error resulting from errors in the kinematic chain of the servo-drive, as well as thermal deformations of the ball screw.It is estimated that errors resulting from the thermal expansion of mechanical components of machine tools account for 40-70% of all errors [1].A second defect is the system's high malfunction rate, linked to its location close to the machining space.
The need to improve the accuracy of positioning of a servo-drive equipped with a cheap indirect measurement system was the stimulus for research into a new, innovative, sensorless method for compensation of thermal deformations of ball screws, which will enable predictive compensation of the elongation of such a screw based on historical data obtained from the past operation of the drive.Such a solution can be expected to enable effective compensation of changes in the length of the screw without the need to measure either its elongation or the temperature.Previous research on sensorless methods for the compensation of thermal deformations of ball screws is reported in [2], and research relating to neural networks appears in [3][4][5].
A new approach to the subject is prediction ball screw elongation based on screw velocity and torque of servo motor by use neural networks.
The present work extends research on the use of MLP neural networks, and includes new research involving the development of models in the form of RBF and Kohonen neural networks, for predictive compensation of thermal deformations of ball screws in CNC machines.The best of the developed neural network models were selected on the basis of effectiveness of operation.

Literature review
Progress in the construction and technology of ball screw transmission systems means that they are able to operate with increasingly high speed and rigidity, providing an effective alternative to direct drive systems, particularly in machine tools with short travel paths.The elimination of a direct measurement system leads to an increase in the total error in positioning, which results chiefly from the errors of the drive kinematic chain and the error resulting from expansion of the screw [6][7][8][9].This is because the ball screw transmission plays an active part in measurement of the position of the support runners.Due to thermal expansion the pitch of the ball screw changes, leading to increase in the kinematic errors of the controlled axis.Fig. 1 shows the process of heating of a ball screw transmission during operation.It should be borne in mind that, taking account of the thermal expansion coefficient of steel, a temperature increase of 5 °C will cause a metre-long rod to increase in length by approximately 60 µm.In modern numerically controlled machines, such an error is unacceptable, and steps must be taken to minimise it.Many methods are known for minimising the unfavourable effects of this phenomenon.The literature describes methods based on design, manner of operation, thermal stabilisation and thermal compensation [10][11][12].The most common solutions are a direct measurement system, cooling of the ball screw transmission, or preheating of the machine tool [13,14].Most of these methods enable significant improvement in positioning accuracy in the case of medium and large machines.Unfortunately, in the case of small and cheaper machines, the use of a direct measurement system is unjustifiable in view of its excessive cost.Moreover, the low heat capacity of ball screws in machines of this type means that methods based on manner of operation are not sufficiently effective.The high rate of change in positioning errors makes it absolutely essential to implement effective methods for compensation of the elongation of ball screw transmissions.
In view of their great practical importance, these problems have aroused the interest of many research centres throughout the world, and are a significant issue for producers of new, more economical machine tools.The search continues for an effective, universal, simple and cheap method of compensating for the elongation of ball screw transmission systems [6][7][8][9][10][11][12][15][16][17][18][19].

Authors' research 3.1 Introduction to Neural Networks
More than 50% of applications of neural networks, including technical applications, use multi-layered singledirectional networks trained by a back-propagation method (MLP).Next most popular are self-organising Kohonen networks (SOFMs) trained by a competitionbased method, and RBF networks.Multi-layered networks are built from multiple layers of neurons.In a multi-layered network model the first layer is called the input layer, the last the output layer, and the remainder hidden layers [20,21].RBF networks have several advantages over those of MLP type.An RBF network usually has a single hidden layer containing radial neurons, each of which models a Gaussian response surface [20,21].Kohonen networks are one of the basic types of self-organising networks.Their capacity for selforganisation opens up entirely new possibilities, involving adaptation to previously unknown input data.The most interesting effects are obtained by applying Kohonen methods to two-dimensional neural networks [20,21].

A sensorless method for compensation of thermal deformations of ball screw
In analysing the energy dissipated between a screw and a nut and in bearing units due to friction, one may adopt the simplifying assumption that the quantity of energy dissipated depends on the design of the servodrive and on its conditions of operation, namely the angular velocity and the torque transferred by the ball screw.The accuracy of this assumption is confirmed by various authors [22][23][24], who present equations for the dissipation of energy between a screw and nut in Eq. ( 1) and in bearing units in Eq. ( 2): where Ġ nut is the quantity of energy dissipated between screw and nut (W), f 0 is a coefficient describing the type of nut and method of lubrication, ν 0 is the lubricant viscosity (m 2 /s), n is the rotational speed of the screw (rpm), and M is the total moment of friction between screw and nut (N•m).
, 10 047 1 where Ġ bearing is the quantity of energy dissipated in bearing units (W), n is the rotational speed of the screw (rpm), and M is the total moment of friction between screw and nut (N•m).
The essence of the new proposed method for compensation of thermal deformations of ball screws lies in the use of information from the machine's control system and drive concerning the current value of rotational speed and torque.This information, given sufficient frequency of measurement, will form the basis for the construction of a model of thermal compensation of ball screws, based on artificial neural networks.The authors intend to prove the hypothesis that, by analysing the instantaneous values of the torque and rotational speed of the motor, it is possible to state to a certain degree of approximation the quantity of energy dissipated in the screw, which determines its elongation.Combined with a measurement of ambient temperature, it will be possible to describe effectively the phenomenon of thermal convection.The greatest advantage of the proposed method is the complete absence of any sensors for measuring temperature or elongation on the tested object.A ball screw can be treated as a semi-closed system.The energy balance of such a system is given by Eq. (3): where p(t) is the quantity of energy supplied to the system in unit time, and q(t) is the quantity of energy flowing out of the system in unit time.
We can distinguish three basic routes by which energy is transmitted in Fig. 2a): t Q  , the flux of energy supplied to the system due to friction between screw and nut; u Q  ,the flux of energy transferred to the environment by convection; and p Q  , the flux of energy transferred by conduction between it and neighbouring elements.Energy lost to the surroundings by radiation is excluded from the energy balance, in view of the very small temperature changes and consequently the negligibly small amount of energy lost by this route, as confirmed in research by Hu Shi et al. [9], which can be described by the Stefan-Boltzmann law in Eq. ( 4): where e is the quantity of radiated energy,e is emissivity, σ 0 is Stefan-Boltzmann constant and T is termodynamic temperature.
In view of the nature of the operation of the ball screw in numerically controlled machines, it is required to be divided into elementary sections in Fig. 2b).The value of the compensation is determined individually for each section, thus enabling effective compensation of the screw.The model of each elementary section should take account of the assumptions relating to the energy balance for the screw.
The proposed compensation method entails continuous analysis of the speed and the torque transferred by the ball screw.Based on a previously conducted cycle of individual tuning for the screw, the algorithm determines the change in length for an elementary section in unit time.Each elementary section is represented as an element of a screw pitch error array, available in most modern control systems.A change in the length of an elementary section modifies the value of compensation of the pitch error, enabling effective compensation of thermal deformations without the need to intervene in the internal structures of interpolators, reducing the contour errors of the machined part.It is important that no new value of compensation of screw pitch error is assigned during the cutting process.A discrete change in the compensation value will cause an error in the contour, visible on the machined surface.A good opportunity to assign a new compensation value is provided by the tool change process.This takes place sufficiently often, particularly on small machines, which are subject to a high rate of change in the positioning error due to thermal expansion of the ball screw [2].
To determine the effect of friction on warming of the ball screw transmission, as well as the effect of convection, the transmission was heated uniformly, that is, along its whole length.Adoption of the whole of the transmission as an elementary section led to simplification of the model, and enabled conduction within the screw to be neglected.
Based on the aforementioned simplifying assumption, it was concluded that the energy dissipated in the elementary section is a function of the torque transferred by the screw and the rotational speed in Eq. ( 5): where M is the torque transferred by the screw, and v is the speed of the support runners.Due to character of work of machine tools, the effective compensation for thermal deformations of the ball screw requires that the screw be divided into elementary segments (X 1 -X n ) in Fig. 2b).The compensation values are then determined on an individual basis, for each segment.
The used experimental apparatus includes a servo drive characterized by a travel length of 640 mm.The applied control system was provided by Beckhoff Automation GmbH & Co. Measurements of elongation of the ball screw drive were performed using the Renishaw XL-80 laser interferometer.Fig. 3 shows the used experimental apparatus.

Proposed models of predictive compensation
In the case of MLP networks, the network inputs contain the speed and load, and the output indicates the elongation of the screw.MLP networks were built with a single hidden layer.Experiments related to the construction of MLP neural network models were parameterised with two parameters: the number of neurons in the hidden layer (values from 3 to 30) and the number of learning epochs (values from 4 to 300).After each experiment, tests were carried out to obtain information on erroneous mappings.The number of neurons in the hidden layer was selected experimentally.However, the network architecture does not fully define its features -also important are the activation functions responsible for transmission of the signal from preceding neurons, which is defined by a specific mathematical expression.The choice of activation function has a large influence on the network's operation.In the case of neurons in the hidden layer, the activation function may be of the following types: linear, logistic, Tanh (hyperbolic tangent), or exponential.The activation function of the output neurons is a linear function, Tanh, or Softmax.For the MLP networks the BFGS (Broyden-Fletcher-Goldfarb-Shanno) learning algorithm was used.This is one of the most effective learning algorithms for neural networks.The error function is used to evaluate the current quality of the network during its learning process.This is used to determine the required changes in the weights of neurons at each iteration.Error functions were applied in the form of sum of squares (SOS) functions.Each of the discussed parameters influenced the effectiveness of the neural networks.The effectiveness of a neural network was computed as the proportion of correctly classified cases among all cases in the set.
In many respects, RBF networks are similar to multilayered perceptrons.Firstly, they again use singledirectional signal transmission, and each neuron sends its output to each neuron in the next layer.However, there are fundamental differences between RBF and MLP in how input-output relations are modelled.In the case of RBF networks, learning takes place in two different and independent stages.In the first, the probability distribution of the data is modelled using radial basis functions.Only in the second stage does the network learn the relations of input x to output t.Hence in RBF networks (unlike in the MLP case) we have two types of parameters: (1) the position and width of each basis function; and (2) the weights binding the basic functions with the output neurons.The RBF network had one hidden layer, containing radial neurons.The experiments related to construction of RBF neural network models were parameterised by two parameters: the number of neurons in the hidden layer (values from 15 to 60) and the number of learning epochs (values from 50 to 300).After each experiment tests were carried out to obtain information on erroneous mappings.The number of neurons in the hidden layer was selected experimentally.Error functions were applied in the form of sum of squares (SOS) functions.A Gaussian function was used as the activation function in the hidden layer, and a linear function in the output layer.Each of these parameters influences the effectiveness of the neural networks.An important feature of neural networks using an error back-propagation learning function is the uniform way of treating all neurons in the network during learning: each neuron undergoes learning according to the same rule.Networks with a competitive learning method (Kohonen networks, SOFMs) deviate from this scheme.
Here any input signal is applied at the input to the network; then all neurons in the topological layer compute their output signal, and the neuron that produces the largest output signal is deemed the winner.Kohonen networks use unsupervised learning.Their task is the automatic detection of regularities in the set of learning cases.They are exceptional in that they use a mechanism which links the method of learning of individual neurons with their relative location in the layer.In the case of the Kohonen networks the inputs contain the speed, load, and elongation.The experiments related to construction of Kohonen neural network models were parameterised with two parameters: the number of neurons in the topological layer (values 2×6, 3×4, 5×5, 4×6, 6×6, 4×9, 9×10, 10×10) and the number of learning epochs (values from 100 to 1000).After each experiment, tests were carried out to obtain information on wrongly classified decisions.The number of neurons in the topological layer was selected experimentally.A Kohonen learning algorithm was used for these networks.The best networks were constructed when the number of epochs was 1000.Tab. 1 shows the parameters describing the experiments for the different network structures: MLP, RBF and Kohonen.Network effectiveness is expressed as a percentage.The best neural networks were selected in the experiment.

Results and discussion
The effectiveness of the neural networks was computed as the proportion of correctly classified cases among all cases in the set.Fig. 5 shows a graph of the effectiveness of the neural networks of MLP, RBF and Kohonen types.The MLP networks had a short learning time, and had the lowest effectiveness.The RBF networks displayed better effectiveness, but the hidden layer contained more neurons in each network, which increased network complexity and learning time.The Kohonen networks proved to be the best, but they had a much more complex structure.Kohonen networks require more time for the learning process.Therefore, if MLP or RBF networks fulfil our expectations, and good or very good results are obtained at the output, then it is appropriate to use the simplest networks to solve a problem.Moreover, in the course of the experiments, mappings of elongation based on speed and load were made for the neural networks in Fig. 6.The shape of the mappings is different for different networks.These shapes are strongly different for neural networks of a lower effectiveness (a) MLP 2-14-1 (effectiveness 93.54%), c) RBF 2-15-1 (effectiveness 95.57%) and e) Kohonen 3-12 (3×4) (effectiveness 98.85%).Just as activity of these networks for new input values.Mappings in the each best networks MLP 2-30-1 (99.80%),RBF 2-60-1 (99.998%) and Kohonen 3-100 (10×10) (100.00%) are much better (Fig. 6b), 6d) and 6f)).The operation and effectiveness of the neural network models were tested for new input data and compared with the standard.Tab. 2 indicates the performance of neural networks for new input data.Performance is tested by comparing the network output data with the standard given in the final column of the table.
The best Kohonen networks, with 100.00% effectiveness, were found to be 3-90 (9×10) and 3-100 (10×10).Slightly poorer results were obtained for 3-36 (6×6) (99.997%) and 3-36 (4×9) (99.998%).Precise ball screw transmissions, in view of the advantages they offer, are widely used in modern numerically controlled machines.A constant striving for increased productivity, manifested for example in the growth in the travel speeds of controlled axes, is strongly correlated with an increase in the quantity of energy dissipated between screw and nut.This leads directly to an increase in the error of positioning in servo-drives having an indirect measurement system.In view of the great practical importance of the problem, finding an effective, reliable and cheap method for the compensation of deformations of a ball screw transmission system continues to be a significant challenge, particularly in the case of small machines, where the methods used to date are ineffective or economically unjustifiable.
This research has shown that it is possible to achieve predictive compensation of thermal deformations of the ball screw transmission using artificial neural networks trained on a set of historical data on the operation of the servo-drive, obtained from the control system.The results indicate the high potential of the proposed new sensorless method for compensation of thermal deformations of a ball screw transmission, demonstrating the need to continue research with the aim of further developing this method.It is significant that the method does not require any additional devices, and thus does not entail any extra costs.
The benefits of the use of neural networks exceed many times over the work required to create them.In practice the longest stage of the process of creating the networks is the collection and preparation of source data.
The experiments conducted have demonstrated the usefulness of neural networks and their high effectiveness for predictive compensation of thermal deformations of ball screws in CNC machines.Interesting results were obtained from the comparisons of MLP, RBF and Kohonen networks.MLP networks are a very good universal tool for solving complex problems.RBF networks give faster results.Comparison of these with Kohonen networks enabled verification of the behaviour of different classes of networks: supervised and unsupervised learning.

Figure 1
Figure 1 Temperature distribution on an axis moving with a transverse velocity of 20 m/min

Figure 2
Figure 2 Energy balance of a ball screw -a) Energy acquired and lost by the system and b) Division of screw into elementary sections [2]

Figure 3
Figure 3 The experimental apparatus Under these assumptions, models were constructed for predictive compensation of thermal deformations of ball screws in CNC machines, using neural networks of MLP, RBF and Kohonen type.The measurement data used to construct the neural network models, in the form of a learning file, contain the speed (mm/s), load (N•m) and elongation [µm].The range of speeds runs from 25 to 300 with a step size of 25.Part of the data is shown in Fig. 4. The testing and validation files have the same structure.The learning file contains 70% of cases, the

Figure 4
Figure 4 Part of the data from the learning file

Figure 5 Figure 6
Figure 5 Comparison of the effectiveness of MLP, RBF and Kohonen neural networks a) b) c)

Table 1
Parameters of the best MLP, RBF and Kohonen networks

Table 2
Comparison of the responses of MLP, RBF and Kohonen neural networks with the standard