Use of Neural Networks in Tool Wear Prediction

Modern CNC machine tools include a number of sensors that collect machine status data. These data are used to control the production process and for control of the CNC machine status. No less important part of the production process is also a machine tool. The condition of the cutting tool is important for the production quality and its failure can cause serious problems. Monitoring the condition of the cutting tool is complicated due to its dimensions and working conditions. The article describes how the tool wear can be predicted from the measured values of vibration and pressure by using neural networks.


Introduction
The quality of the tool is direct correlation to the quality of the product. Because of this fact the monitoring of the state of the tool is an important procedure in the manufacturing process. The effort to reduce manufacturing costs, the increase of quality and continuity of manufacture leads to finding ways of detection of wear the tools.
The principles of detecting the wear of a tool can be divided as direct and indirect. Direct methods need to use special sensors. These sensors must be resistant to vibrations, temperature or cooling emulsions. Their use in serial manufacturing is complicated and expensive.
Indirect methods used to detect the wear the information gained from the CNC machine and they are founded on the relationship between the wear and the actual power of the motor or the pressure of the tool. There are methods used to create mathematical-physical model; for example, mathematical modelling -the wavelet analysis or neural networks. Their disadvantage is the need to create the mathematical-physical model of tool wear.
With the development of neural networks and with the availability of IT tools can neural networks be just the solution for creating the mathematical-physical model. Neural networks are an excellent tool for creating a predicting model and description of non-linear relations. [1] The disadvantage is the necessity of training on sample data that describe the manufacturing process. The obtaining of these during the manufacturing process can complicate the deployment of NN in practice. Modern CNC machines for their regulation and monitoring scan the parameters that can be used as the entering parameters for the mathematical-physical model of tool wear. [2][3][4][5] This article describes the method of creating models of neural networks for solving the prediction of tool wear in the manufacturing process. Its aim is to suggest and check the technique that is possible to apply in real conditions without special equipment.

The process of the experiment
An experiment on three axis CNC milling machine was chosen to verify the suggested technique. It was supposed to simulate the manufacturing process and it used only commercially accessible devices. [6] The obtaining of the data from processing the product was from steel 12050. As a testing tool a four blade end mill was used with the diameter of 10 mm. It was shouldered with cutters from fast cutting steel HSS-CO 8 %. [7] The process of the experiment was supposed to simulate a real working environment. Due to this the machining process took place in cycles. One cycle was made of machining and transferring the machine to starting point. During the transfer was the speed of boosted to 2500 rpm due to cooling the tool down. [8][9] For each tool there were 10 cycles of machining repeated and after their end a reading of wearing out was measured with a microscope. The exact technological parameters of machining can be seen in Table 1. Table 1. Technological parameters of machining.

Technological parameters of machining
Shift on blade -f z 0,0375 mm Axial amplitude of mesh -a p 15 mm CNC mill was not equipped with a special scanning device. All of the data were collected via built-in sensors and loaded with interface OPC-UA.
The recorded data were during the measuring uploaded to database along with time mark. With this data storage method, a sampling rate of approximately 25 Hz was achieved. One of the measuring had this structure: timestamp, speed of spindle, amplitude of power of spindle, amplitude of deviation for axis X, Y, Z. Together there were approximately 120 000 vectors that described the usage of three mills. Fig. 1 shows the amplitude of deviation on axis Z (blue colour), amplitude of power on spindle (green colour) and speed of spindle v f (red colour). From the Fig. 1 can tell there is a correlation between wear and increasing time of machining. Therefore, a strong presumption can be made that a neural network can find this correlation.

Preparation of data
The neural network needs training before usage. In this experiment the course of wearing out was needed to be estimated, Vb value for each of the measured data collection. To determine the curve there are tribological procedures. These procedures are too complicated to be used in manufacture. The experiment was supposed to be simulating the manufacturing process and it was needed to simplify the preparation of data. The model of tool wear is a linear function -the relation between Vb and time. The linear function is close to experimental knowledge of machining theory. Especially if the tools were not totally destroyed. The presumption is that at the beginning of machining the tool has a zero wear out. After ten cycles the wearing down was measured by a laboratory microscope ( Table 2). The average measurement is 200 μm and it is considered inappropriate for usage in the manufacture.

The design of neural network
The primary design of neural network came from the presumption of relations between input parameters, mostly from amplitude of power and deviation on axis Z and from tool wear. This model could not decrease the loss function to acceptable value. With the second design the time relation of wear a tool was taken into consideration. The entering data were not the measurements of the amplitude at the head start, but the collection of data from the 10 last measurements, e.g. 60 values. Therefore, the input layer has 60 neurons.
The output layer has exactly one neuron that describes the Vb value in time with the last vectors used. The course of wearing out for each measurement was calculated from measured value of wearing out ( Table 2) and the number of vectors measured.
The resultant neural network has three hidden layers and is designed as a feedforward network. The topology of the network is 100, 50 and 20 neurons for the hidden layers. Between the first and second layer is inserted a drop layer with the dropping parameter of 0,3.
Based on this topology approximately 50 000 input and output vectors were made from the first and third measuring. This number partially compensated for the lack of experimental samples. The vectors were divided into training and validating part with 2:1 ratio.
The neural network was created using the libraries Keras and Tensorflow in the programming language Python. The training of the network run on two core processor Intel(R) Core(TM) i5 2,20 GHz and it took approximately 140 seconds.

Training
Parameter characterizing the process of the NN training is the loss function and describes the distance between the trained and measured values. The course of loss function distance during the learning shows a suitable architecture of NN because the loss function is approx. 0,15 %, or more precisely 0,1 % for the validating part of data. This course of loss function also shows strong correlation between input and output parameters which corresponds with visualisation in Fig. 2.   Fig. 2. The course of loss function during the learning of neural network.

Prediction
To verify the model data not used in training the NN are applied. In this experiment the data were from the machining by tool number 2.

Fig. 3. Graphic comparison of predicted and expected tool wear
It is apparent from the graph that the neural network can predict wearing down very well. Jumping frequency at the beginning of machining corresponds with adaption of the system machine, tool and workpiece. Neural network detected increased wear down at the beginning of the cycle, when the rotating mill hits the workpiece at the start of a new cycle.
Medium quadratic error of predicted measuring is 9,85. RMS calculated above the average of all values of wear measured is 4,7 %.
In the figure there is marked a boundary value of wearing down which is 200 μm. This value if included in practice, would mark threshold when the mill would be considered as worn out.

Conclusion
The article presents a method of predicting the wearing down with the help of neural network with aspiration of simple implementation in the manufacturing process. Despite many simplifications during the preparation of data and the measuring, the NN showed the skill to precisely predict the wearing out even with little information.
There are several conclusions to be made from the results:  neural networks are a useful tool for modelling tool wear,  the topology of designed neural network reached an excellent result of RMS 4,7 % even with testing data,  for the prediction in manufacturing process is convenient to mark the threshold value of wearing out but only predict its overlapping,  the demands of neural network and the collecting of data via OPC-UA make it possible to work in real time,  the effect of oversimplifying the model of wearing out is needed to be more closely examined.