Identification of Tool Wear During Cast Iron Drilling Using Machine Learning Methods

The paper concerns the monitoring of the tool condition on the basis of vibration acceleration signals. The cutting edge condition is determined by wear on the flank surface of the drill. As tools, a twist drills made of cemented carbide were used. A gray cast iron plate EN-GJL-250 was used as the workpiece. Based on the signals, appropri - ate measures correlated with the wear of the drill were developed. By using binary decision trees CART (Clas - sification and Regression Tree) with two data partitioning methods (Gini index and Cross-entropy), the original number of measures was limited to the most common and those that provide the smallest error in the tool condition classification. Comparing the results for the best trees built with different measures of partition quality in nodes for all available data indicated a better performance of the Gini index. The applied solution allows for high accuracy of the tool classification. The solution is to be used in industry.


INTRODUCTION
The condition of the cutting tool during machining is one of the most important parameters. This parameter significantly affects the suitability of the tool during the machining process. Tool wear is important due to its tool life and the quality of the machined hole. Therefore, online monitoring of the drill condition and its earlier prediction is extremely important and improves the efficiency and reliability of the operation. When machining cast iron, wear occurs in various forms, i.a. abrasion, chipping, diffusion and adhesion [1][2][3]. There are many articles the concerns monitoring the condition of cutting tools.
In the article [4] the authors used artificial neural networks with back propagation error and one hidden layer to predict tool wear when drilling with a HSS drill. As input data they used: spindle speed, feed rate, drill diameter, trust force, torque and chip thickness. They noticed that chip thickness was an important input. The use of this parameter allowed to reduce the prediction error and the number of iterations compared to the network without the use of chip thickness. In the case of the best network, they obtained a prediction error of 0.00016-7.465%. The authors of the article [5] describe the prediction of drill bit wear when machining a copper and cast iron components. They compare three machine learning methods with each other: optimizing the extreme gradient boosting algorithms hyperparameters by a spiral dynamic optimization algorithm (XGBoost-SDA), support vector machines (SVM), multilayer perceptron artificial neural networks (MLP-ANN). As input, they reuse the parameters as in article [4], except for chip thickness. For each of the compared methods, they obtained satisfactory results, there wasn't the case where RMSE error exceeded 10%, and the correlation coefficient R 2 was higher than 0,9. The best results were achieved with the XGBoost-SDA method. In the article [6] the authors monitor the condition of the tool while drilling three varieties of graphite cast Identification of Tool Wear During Cast Iron Drilling Using Machine Learning Methods irons. The electric current, machining power and AE signals were monitored and evaluated in both time and frequency domains. The objective was to evaluate which of these output parameters has the highest sensitivity to tool condition changes and the potential to predict the tool wear. Observing the tested signals, they came to the conclusion that the best signal to monitor the condition of the edge is electric current and machining power.
The authors of many articles show the relationship between vibration and tool wear. A direct relationship between vibration and tool wear is shown [7,8] when machining steel. In the article [9], the authors proposed a method of monitoring the edge condition while turning a gray cast iron element by using a vibration signal in three directions. This algorithm is based on mean power evolution scanning using a sliding window. The algorithm was used to binary determination of the tool transition from stable operation to accelerated wear. Xu et al. [10] proposed a model for predicting the wear of coated carbide tools during milling of gray cast iron. At work, they compared several machine learning models, the best results they obtained for adaptive neuro-fuzzy inference system (ANFIS) for teaching which they used vibration and communication particle swarm optimization (VCPSO). For the proposed solution, they obtained the percentage estimation error (MAPE-mean absolute percentage error) equal to 6,5% with the correlation of the results R 2 = 0,954. The VCPSO algorithm was adopted for multi-objective optimization of milling parameters. In [11], the researchers proposed a mathematical model (RA) and a model based on neural networks (ANN) with two hidden layers based on the Levenberg-Marquardt algorithm. The models were used to predict the value of tool wear (VB) when turning AISI 52100 hardened steel with carbide inserts. As input parameters, they used cutting parameters (cutting speed, feed per revolution and depth of cut) and vibration accelerations in three directions (feed Vx, radial Vy and tangential Vz). For the RA model, they obtained the correlation coefficient R 2 = 0,89 with a maximum prediction error of 11% for the ANN model 0,98 with a maximum prediction error of 9,7%. Panda et al. [12] analyzed the possibility of using vibration acceleration signals during online monitoring of the tool condition (flank wear at nose radius corner VB C ) and the quality of the machined surface (arithmetic surface roughness average Ra). They use multiple quadratic and linear regression (MLR, MLR) when turning hardened steel with multi-coated cemented carbide inserts. In their research, they found that vibrations in the radial direction are the most suitable for predicting tool wear and surface quality. They noticed that only the MQR model is suitable for monitoring both studied variables. For tool wear, the average percentage error was 4,17%, for roughness 4,37%. In [13], also quadratic regressions were used to monitor tool wear. In [14], the authors developed a tool condition monitoring model during titanium alloy machining. Using decision trees, they selected the most important vibration statistics (statistical error, kurtosis and median), which then served as input parameters for the classification neural network. A high classification ability of about 95% was obtained. The researchers in [15] used neural networks to qualify the condition of the tool. With the proposed solution, they achieved a qualification precision of 94%. Stavropoulos et al. [16] developed a tool wear prediction model during gray cast iron milling (CGI 450) based on a third level regression model and pattern recognition systems. In this solution, based on the mean square acceleration vibration and electrical current, they assessed the tool wear according to three levels: high, medium, low. In [17], a transition of the tool into a state of accelerated wear was also detected. In their work, the authors used the Spectral Center of Gravity of vibrations in two axial and radial directions to observe the acceleration of wear. Babouri, M.K., et al. [18] used a combination of wavelet multi-resolution analysis (WMRA) and Empirical Mode Decomposition (EMD) to analyze vibration during AISI D3 turning with carbide inserts. The authors [19] proposed to monitor the tool condition in two models based on neuro-fuzzy hybridization, i.e. the synergy of neural networks and fuzzy logic. Four values measured during turning (time, cutting forces, vibrations and acoustic emissions signals) were used as input. The best results were achieved with the transductive-weighted neurofuzzy inference system, the percentage error of the model 2-6.5%. TWNFIS has also been used by Gajate et al. [20] used the same input parameters to predict tool wear during turning of cast iron. The percentage error of prediction was 3.98-7.19%. In [21], in the cast iron milling process, the authors identified the degree of tool wear by creating a deep learning network (DLN). The networks were based on input data from the spectrum of vibration accelerations measured during machining. The data are then pre-processed using the fast Fourier transform (FFT) method to reveal the relevant outstanding features in the frequency domain. In [22], the authors analyze the images created on the basis of short-term spectra from the vibration band and obtain information about Probability Density Function (PDF) in the form of lower order moments, thus obtaining robust tool wear state descriptors. The authors [23] created a model to monitor the tool condition in real time. The model is based on the vibration accelerations recorded during machining. The convolutional neural network (CNN) is used for data selection for bidirectional long short-term memory (BiLSTM) network with an attention mechanism (CABLSTM). The model proposed by the authors shows the classifi cation effi ciency at the level of 97%. In [24], the authors monitored tool wear and wall defl ection during the machining of thinwalled elements. They used a support vector machine (SVM) for monitoring the tool wear, based on cutting forces and vibration accelerations. A condition recognition accuracy of about 90 % has been achieved during the experiments. In [25], the researchers used the measurement of vibration acceleration, acoustic emission and cutting forces to estimate tool wear when machining Inconel 718. The obtained signals were subjected to wavelet packet transform (WPT) signal analysis, then they served as input data for neural networks. With the best network architecture they achieved a MAPE estimation error of 5,17%. Zhang et al. [26] used long short-term memory (LSTM) network and particle fi lter (PF) algorithm to predict the stochastic tool wear values.
The authors of this article aimed to create a simple and autonomous cutting tool condition classifi cation system in real time. One of the main assumptions was to limit the input data only to the signal of vibration acceleration coming from the sensor. It was important to eliminate cutting parameters from the input data set, which in industrial conditions would have to be entered by the machine operator, which cause errors. Contrary to the above-mentioned articles, the authors started to build decision trees using data from, inter alia, from the active bands (the bands where the amplitude changes during the process), not from the entire spectrum. This allowed for smaller classifi cation errors and elimination of cutting speed from the input data set. At the beginning, the authors did not limit the set of input variables of measures, they created an algorithm that selects the most important variables, so that none of the measures important due to the classifi cation was omitted.

MATERIALS AND METHOD
Drilling tests were carried out on a threeaxis CNC milling machine DMC 70V hi-dyn by DMG. Used the gray cast iron plate EN-GJL-250 as workpiece (Fig. 1). In the study a Walter DC150-03-08.000D0-WJ30RE carbide twist drills with a diameter of D C = 8,5 mm were used. Total drill hole depth L = 30 mm. Holes were made in two passes -20 mm in the fi rst pass, and 10 mm in the second. A three-direction vibration acceleration sensor by Brül & Kjear was used to measure the vibrations. It was attached to the machine table by means of a threaded connection. Figure 2 shows the measurement path. The signal fragments were cut so as to refer to the main drilling phase (without the tool entering the material). It was done automatically on the basis of information about the vibration noise level occurring in the phase before drilling and taking into account the experimentally determined time delay period after a signifi cant increase in the vibration level. Longer signal fragments were divided into smaller ones in order to obtain more training examples. Finally, 1692 recordings of the vibration signal were obtained.
Tool life tests of drilling were carried out for the following parameters: Only the variable cutting speed is analyzed in the article, as it has the greatest impact on tool wear and vibration acceleration [11,12]. After every 50 holes done, the tool wear was measured as determined by the VB C coeffi cient -fl ank wear at nose radius corner, as shown in fi gure 3. The value of the wear coeffi cient was calculated by subtracting the distance V (Fig. 3b) from the length of the new corner L N (Fig. 3a). The V value was measured from the baseline to the end of the wear area. The wear was measured using the Zeiss Stereo Discovery V.20 microscope.

Tool wear analysis
Based on the obtained data, a plot of fl ank wear as a function of cutting time was prepared for the speed v c = 100-200 m/min (Fig. 4). For v c = 100 m/min (blue), there was very slight increase in wear of the tool during the fi rst 35 minutes of operation, after which there was a upsurge of wear. In the range of t c = 50-100 min, the wear was proportional, and then the VB C coeffi cient value surged again. Figure 5 shows selected images of the tool wear on the fl ank face for various states  has a slightly diff erent progress than for the speed v c = 100 m/min. In the fi nal phase of the process, an intensive increase in the VB C coeffi cient is visible, and there were no sudden increase in the value of this coeffi cient. Figure 6 shows the tool wear images on the fl ank face, similarly to the previous case. Figure 7 shows the tool wear images for cutting speed v c = 200 m/min. In order to determine of the tool life, a geometric dullness criterion determined by the VB C coeffi cient was assumed:

Dullness criterion -VB C < 0.5 mm
The value of the dullness criterion was selected on the basis of previous studies, and this value is the most optimal for this type of operation. The adopted value means that when the tool exceeds the value of VB C = 0.5 mm, it should be considered blunted and replaced. Otherwise, the tool can still be used. For the assumed criterion, the tool life was determined and the collective graph is shown in Figure 8 in a double logarithmic system.
For the tested cutting speeds, the signals of vibration acceleration were recorded. Each recorded signal corresponded to a specifi c edge wear value. In this way, the dependences of the amplitudes of vibration accelerations as a function of the tool wear were obtained (Fig. 9). rms (root mean square) values were calculated from the entire analyzed frequency range. The correlation coeffi cients R 2 for the experimental data do not show cause-eff ect relationships between the determined vibration measures and the tool wear determined by the VB C coeffi cient. Measurements determined in the frequency domain show a much higher utility (Fig. 10).   on measurements in the frequency domain, sets were prepared and applied in the machine learning stage to supervise the edge wear process based on vibration acceleration signals.

Machining learning
Two classes of the tool condition were adopted: usable / unserviceable, with the tool wear limit VB C = 0.5 mm as the limit tool wear. As a result of this division, 72% of the available examples were in a fi t condition, and the remaining 28% in a unsuccessful condition. In the fi rst stage, the recorded signals were parameterized. A number of signal measures were determined throughout the recorded band, and in bands that were found to be useful. For this purpose, a comparison was made of the amplitude spectra representing cases related to low tool wear (below the adopted threshold) and to high tool wear (signifi cantly above the adopted threshold). Through the comparisons made, it was possible to identify a number of frequency bands that diff ered signifi cantly in the eff ective values and the nature of the spectrum for the two compared states of the tool. Some of the fi nally selected bands overlap, which is due to the fact that, as a result of many comparisons, the diff erences occurred in diff erent bands, which depended, for example, on the cutting speed v c . Widening the band and replacing the plurality of discrete bands with one could result in the reduction of sensitivity of some signal measures to changes in cutting edge state. The list of the separated frequency bands, which diff ered for the fi t and unfi t condition of the tool for the three measurement directions, is presented in Table 1.
For each of the above-mentioned bands and each direction, numerous signal measures were determined, both on the basis of the time course of the vibrations and the amplitude spectrum.  Among other things, commonly used measures in technical diagnostics were determined: rms value, mean value from the rectified signal, peak value, square root amplitude, slack factor, crest factor, shape factor, impulse factor, kurtosis, the square of the signal, or the number of samples above the thresholds set against effective value. Additionally, some measures of the amplitude spectrum in previously identified bands were used. And this is how the spectral slenderness coefficient in a given band was determined: Effective values are calculated directly from the power spectrum (square of the amplitude spectrum). Values much higher than 1 indicate the presence of a significant spectrum component in relation to the overall rms level in the band. Values less than 1 for lack of such component.
Another measure was the symmetry coefficient of the spectrum in a given band: Effective values were calculated directly from the power spectrum. Another important measure was the frequency coordinate of the spectrum's center of gravity in a narrow band (CMF).
In total, 693 signal measures were obtained, but to increase the reliability of inference in industrial conditions, where the tool state detection method would be used, information about the tool life or cutting speed was not taken into account. Such parameters, in practice, would have to be obtained from the operator of a technological machine, which, if incorrect information was entered, could result in an unsupported condition diagnosis.
Most of the measures are of course redundant and linearly dependent. A feature space that is too large is a problem in data analysis because it is hardly ever filled with examples. To reduce the feature space, it was decided to use the machine learning algorithm in the form of a binary tree CART (Classification and Regression Tree). The use of a tree in this case has its significant advantages. Firstly, during its construction, the tree itself selects features, using only those that are significant in the division of examples representing state classes. Using a given measure of partition quality, the tree-building algorithm selects those features that receive the highest scores and which lead to the most effective class partitioning. In this way, features that are not needed to identify the state class can be discarded. Secondly, on the basis of the generated tree, a set of simple classification rules can be obtained, which constitute induced knowledge very accessible to a human, easy to modify or supplement by an expert and very easy to implement in real-time surveillance systems. Since the set of signal measures "selected" by the tree may be very numerous anyway, which may be a computational problem for  an industrial system, it was decided to reduce it by observing changes in the classifi cation error along with removing some of the attributes that are used least frequently. In this way, the supervision system can be signifi cantly simplifi ed to the necessary minimum by accepting a certain accepted rate of classifi cation error. The algorithm for such a procedure is presented in Figure 11. Due to the relatively small number of available examples, it was decided to use the hold-on test repeated 1000 times with a division of 60% of training data and 40% of the test data. Then, the analysis was made of what attributes (signal measures) among all the occurring (693 attributes) are used by trees and with what frequency, creating an output set of attributes used by the tree building algorithm. The tree-building algorithm uses two data partitioning methods at the tree-building stage -Gini index and Cross-entropy. The output set in the case of the Gini index measure included 88 attributes, and in the case of Cross-entropy as many as 130 attributes. The other measures did not occur even once in any of the 1000 trees. On the basis of the performed test, the average test error was determined. In the next steps, the number of available attributes was limited by removing the least common ones, performing the aforementioned test each time and observing the average classifi cation error. It turns out that the originally defi ned set of attributes available for the set of trees is redundant. By limiting their number, removing the least frequently used ones from the set of attributes, it is possible to build a set of trees that was characterized by a comparable, or even smaller than the initial, average classifi cation error. In this way, the most important measures of signals that should be measured in the supervision system and which ensure the smallest error in the classifi cation of the tool condition were selected. Figure 12 shows the values of the average test error for a set of trees depending on the number of the highest-rated attributes (most often occurring in the output set of measures -selected using the fi rst test), for division using the Gini index, and in Figure 13 using Cross-entropy. The fi gures show with a horizontal line the value of the average error obtained when all the attributes were available in the tree-building process. Additionally, the ranges of one standard deviation of the classifi cation error for 1000 trees are marked.
As shown in Figure 12, it is not necessary to calculate all measures of the signal, and even measures initially selected by a tree set of 88 measures. Equally good results can be obtained by using the number of measures in the range from 10 to 20, greatly simplifying the diagnostic system monitoring the condition of the tool. Similar conclusions can be drawn in the case of Figure 13 concerning the cross-entropy tree used in the construction of the tree.
Ultimately, it was decided to limit the quantities measured by the system to 10 measures. The number of attributes could be further reduced without a signifi cant increase in error, but it seems that a slight excess of the number of attributes, due to the mechanism of automatic selection during tree building, is desirable and may increase the fl exibility of the system, e.g. in the event of training necessary. Table 2 shows the fi rst 10 signal measures most often found in the learned trees with the tree node's split algorithm parameter as the Gini index and the relative frequency of their occurrence in the originally induced trees. Note that some Fig. 11. The algorithm for selecting a set of diagnostic measures measures may repeat multiple times in a given tree. Table 3 shows a similar statement for the division of a given tree node using cross-entropy.
The analysis of both tables shows that neither of the measurement directions can be omitted in the supervisory system being built. It is also important that the system should implement the procedure of calculating the amplitude spectrum from which many measures are calculated. The identifi cation of a representative frequency (calculated as a weighted average) in a given band turns out to be a very eff ective margin for identifying the condition class. It is also necessary to apply digital fi ltering of the signal due to the measures determined on the time signal. In the case of the fi rst algorithm, such fi ltration should be performed in the following bands: 0-5000, 12 900-16 600, 11000-15 300 and 20 000-25600 Hz, while in the case of the second one in the bands 0-5000, 5000-9900, 12 900-16 600 and 20,000-25,600 Hz. It can be seen that the information distinguishing the state classes is contained in both In the last stage, the best classifiers were selected from the set generated for both methods, learned on the basis of the available 10 signal measures presented in Tables 2 and 3 and tested on the basis of the selected test set. These classifiers allowed for the omission of small errors, but it seems that due to the relatively small number of examples, such an evaluation of the classification error is underestimated. They were also tested on the basis of the entire available data set. The error assessment obtained in this case is also underestimated (the tree was built on the basis of some of the examples on which it was tested), however, it gives a certain prospect of the classifier's capabilities.
Comparing the results for the best trees built with different measures of partition quality in nodes for all available data indicated a better performance of the Gini index. Table 4 shows the result of the assessment of the best classifier that will be implemented in the supervision system. Of course, in industrial practice, rather greater errors in classification are to be expected. Table 5 shows the quality of the classification for the best classifier.
It should be noted that the best classifier does not use all 10 signal measures (6 of them), which means that the measurement system can still be simplified. Figure 14 shows the best tree selected as a classifier for the designed system.

CONCLUSIONS
The use of cutting speeds of 150 and 200 m / min changes the nature of the wear of the corner and the cutting edge of the tool i.e. fatigue wear. At these speeds, chipping of the blade occurs, and at a cutting speed of 150 m/min, also chipping of the cutting edge. In the case of a speed of 100 m/min, there is mainly friction wear.
The presented methodology made it possible to distinguish from a large number of measures, the most important quantities and bands that allow the identifi cation of the edge condition. As a last resort, it is enough to implement several signal measures in the proposed system to obtain (estimated on the basis of available data) slight errors in the state assessment. Based on the obtained data, it can be said that the classifi cation system does not require information about the cutting speed -very good results were obtained without such a hint. The proposed supervision system can be reduced to a few classifi cation rules derived from a tree, which are a very accessible representation of knowledge.   Table 2 with CMF values converted as values expressed in kHz. The classes were marked 0-pass and 1 failed