Tool wear status recognition based on Mahalanobis distance

To improve the reliability of current signal monitoring tool wear status, a method based on Mahalanobis distance to identify tool wear status is proposed. First, the obtained current signal is analysed in time domain, frequency domain and wavelet domain, and several features that have good correlation with tool wear status are selected to form the feature vector. The feature vector of the current signal in normal tool wear status is taken as the reference vector. Then calculate the Mahalanobis distance value of the feature vectors of the current signal of the tool with moderate wear and severe wear, so that two corresponding thresholds T 1 and T 2 can be obtained. The feature vector of an unknown wear status is calculated using the Mahalanobis distance and then compared with the two thresholds obtained previously. When the calculated value is between threshold T 1 and T 2, the tool is judged to be in moderate wear status. When its Mahalanobis distance value is greater than the threshold T 2, it is judged that the tool has been seriously worn. Finally, multiple unknown wear status is identified. It is believed that the recognition method based on Mahalanobis distance can accurately determine the tool wear status.


Introduction
Tool wear is an unavoidable problem in the process of the numerical control machine tools. Tool wear can lead to increase in cutting force, cutting temperature and workpiece surface roughness. In severe cases, it also affects the normal operation of the entire processing system, hence causing immeasurable losses [1]. According to the statistics, 75% of failures in the machining process are caused by tool failure [2]. Therefore, it is very important to be able to monitor the wear status of the tool online and timely find that the tool has been worn.
The tool wear status monitoring method can be divided into direct monitoring and indirect monitoring [3]. Direct monitoring cannot be online monitoring, such as optical method, resistance method and other detection methods need to stop to get the tool wear value, so generally automated system is not used [4]. Although indirect monitoring can do online monitoring, most monitoring methods, such as cutting force signal detection method and vibration detection method, will affect the process due to the installation of sensors.
Considering the automatic processing process and the actual processing environment, indirect monitoring is a better monitoring method to monitor the current signal online. At present, most studies are to monitor the current signal of the machine tool spindle or feed motor [5]. The main principle is that when the tool is worn or damaged, the cutting power is increased due to the increase in the cutting force, which increases the load power of the spindle motor of the machine tool [6]; because the power of the motor is related to the current, the monitoring of the tool status can be achieved indirectly by measuring the change in the current of the spindle motor; because the input three-phase current of the machine tool is highly correlated with the current of the spindle motor and the feed motor, this paper adopts the input three-phase current of the machine tool to monitor the wear state of the tool.
For the collected monitoring signals, mathematical processing is also needed. The feature that can obviously reflect the change in the tool wear status is extracted. The feature extraction of signals is very critical, which directly affects the effective pattern recognition and state classification of samples. At present, the obtained monitoring signal is only analysed in the time domain or frequency domain to determine the tool wear status, which is not reliable and will be affected by some accidental factors. Therefore, in this paper, based on the time-frequency domain analysis of the machine tool input three-phase current signal, the Mahalanobis distance method is added. The Mahalanobis distance can be compared with a reference metric to analyse and identify different patterns. It is often used to measure the degree of abnormality between status relative to the normal status [7]. Therefore, it can be used as a more effective and accurate method to detect tool wear status identification.

Mahalanobis distance
Mahalanobis distance is put forward by Indian statistician Mahalanobis, which represents the covariance distance of data. It takes into account the connections between various features. It can be used to calculate the similarity of two unknown sample sets. The calculation of Mahalanobis distance is based on the overall sample and excludes the interference of correlation between variables. It is an effective method to measure the similarity between two unknown sample sets [8]; because the algorithm is simple and suitable for small sample problems, it is widely used in the field of fault diagnosis [9].
The advantages of Mahalanobis distance are as follows: first, it has nothing to do with the computing unit of sample data; second, it removes the interrelated interference of sample data. Third, the results of sample variable standardisation and centralisation are the same [10].
First, m different variables are selected from the data samples in the normal status. Each variable contains n sample points, which constitute the reference state matrix X = x i j m*n . Regularise it as follows: In the formula, μ i is the average value of the ith variable, s i is the standard deviation of the ith variable, i = 1,…,m, j = 1,…,n. In this way, the regularised reference matrix Z = z i j m*n can be obtained.
Next, for an unknown status feature vector y 0 = y 1 0 , y 2 0 , …, y m 0 T , it is also regularised to obtain the feature vector y = [y 1 , y 2 , …, y m ] T .
Finally, the Mahalanobis distance from the feature vector y 0 to the reference matrix X is defined as follows: In the formula, C is the correlation matrix of matrix Z. It is defined as follows: The Mahalanobis distance has two characteristics. First, when the feature vector belongs to the normal state sample group, the MD 2 is ∼1; when the feature vector does not belong to the normal sample group, the MD 2 changes with the degree of its unusual state [11]. For the identification of the tool wear status, tool wear status can be divided into three stages: normal wear, moderate wear and severe wear. The normal wear of the tool corresponds to the normal status, and the moderate wear and the severe wear correspond to the abnormal condition. For the determination of tool wear status, it is necessary to set an appropriate threshold value T. When MD 2 < T 1 , the tool can be considered to be in normal wear. When T 1 < MD 2 < T 2 , it can be considered that the tool has been moderate wear. When MD 2 > T 2 , the tool can be considered as a tool. Has been severely wear.

Experimental analysis
The cutting experiment was carried out on the VMC850 vertical machining centre. The cutting tool was a four-tooth carbide face milling cutter. The spindle speed is 4000 r/min, feed speed is 1000 r/min, back knife is 1 mm, and side knife is 5 mm, sampling frequency is 4096 Hz. VB is the wear value of the tool after the tool surface, as the standard to measure the degree of tool wear, when VB is <0.1 mm is normal wear, when VB is 0.1-0.2 mm is moderate wear, and when VB is >0.2 mm is serious wear. The tool wear can be directly measured by a professional microscope.
From normal wear to severe wear, the three-phase current signal is collected to obtain the three-phase current signal data of U, V and W. Fig. 1 is a section of the three-phase current signal.

Extraction of signal feature vectors
For the collected three-phase current signals, the data of threephase current signals with different degrees of tool wear are intercepted. These data are used as sample data to extract feature vectors. A total of 251 three-phase current signals were intercepted as 251 sets of sample data, and each set of data contained 4096 sampling points.
Time domain analysis was carried out for each group of data, and the eigenvalues in time domain such as mean, mean square value and variance were calculated. The calculation results of some eigenvalues are shown in Fig. 2.
Wavelet analysis is a widely used method to analyse the threephase current signal. The zoom characteristic of wavelet analysis enables wavelet analysis to display local features in both time domain and frequency domain. In addition, the size of the window function is constant and the shape is variable, which makes it capable of multiresolution analysis. In the study of weak fault information in complex signals and non-stationary signals, wavelet analysis has very prominent advantages.
In this paper, three-phase current signal is reconstructed by three-layer decomposition based on db1 wavelet, so as to obtain three-layer detail signal (D1, D2, and D3) and approximation signal (A3). Fig. 3 is the signal of each layer obtained after wavelet decomposition of one set of sample data.
The approximation signal A3 mainly reflects the macro trend of the signal, and the details of each layer contain the details information of the original signal. After the wavelet decomposition of the sample data, the three layers of detail signals (D1, D2, and D3) and approximation signals (A3) are also calculated to obtain the mean value, mean square value, variance and other characteristic values of the signals at each layer. Fig. 4 shows the calculation results of some eigenvalues.
According to the earlier steps, many different features of the three-phase current signal are extracted, and some of them are closely related to tool wear. To reflect the tool wear state more accurately, the correlation between all the features and tool wear is  analysed. According to the size of the correlation coefficient and combined with the number of features, several features with good correlation are selected and combined into the feature vector, so that the obtained feature vector can best reflect the tool wear. Table 1 shows the results of correlation analysis between all features and tool wear.
In Table 1, the last letter of each name represents the threephase current U, V and W three phases; X represents the average value, Xrms represents the mean square value, and Var represents the variance, such as Xrmsu represents the mean square value of the U-phase current signal, and VarD1w represents the variance of the detail signal D1 after the wavelet decomposition of the Wphase current signal.
It can be seen from Table 1 that the five eigenvalues Xrmsu, Xrmsw, XrmsA3u, XrmsD3u, and XrmsD3w have a good correlation, so the feature vector are composed of the five features for subsequent analysis.

State recognition based on Mahalanobis distance
First, we need to establish a reference state matrix. The sample data of 20 sets of three-phase current signals at the beginning of cutting were extracted. According to the correlation analysis mentioned earlier, five eigenvalues with good correlation are selected to build a reference state matrix with dimension 5×20.
Next, select five groups of three-phase current signal data samples under normal tool wear, extract the five features to form the feature vector, and calculate MD 2 relative to the reference state matrix. The results are shown in Table 2.
In the same way, five sets of data samples with moderate wear were selected to extract the feature vector and calculate MD 2 . The results are shown in Table 3.
Finally, five sets of data samples with severe tool wear were selected to extract the feature vector and calculate MD2. The results are shown in Table 4.
According to Tables 2-4 and the characteristics of Mahalanobis distance, the threshold T 1 and T 2 can be set as 0.037 and 0.042, respectively. When the MD 2 is <0.037, it indicates that the tool    belongs to normal wear; When the MD 2 is between 0.037 and 0.042, it indicates that the tool has been moderately worn and needs to be prepared for tool replacement. When the MD 2 is >0.042, the tool has been seriously worn, unable to continue cutting, and need to replace the tool in time.
In order to ensure the accuracy of threshold value determined by Mahalanobis distance, several groups of sample data of unknown wear status were selected. By calculating the Mahalanobis distance of its feature vector, the wear status is obtained after comparing with the threshold value and then compared with the actual wear state. Table 5 shows the verification results of several groups of samples.
It can be seen from Table 5 that the judgment result of the threshold comparison is completely consistent with the actual wear status of the tool. It is sure that the method based on Mahalanobis distance can accurately and effectively judge the tool wear state.

Conclusion
In this paper, according to the actual processing situation, the method of indirect monitoring of current signal can not only realise the online monitoring that cannot be achieved by direct monitoring but also avoid the influence of sensor installation on processing. In addition, the influence of tool wear on the current signal of spindle motor and feed motor can also be taken into account. In this way, the change in monitoring current signal is more obviously affected by tool wear. After analysing the current signal in time domain and wavelet, the feature vector with good correlation with tool wear degree is obtained. Mahalanobis distance is combined with tool wear condition identification. According to the threshold value determined by Mahalanobis distance, the unknown state of the current signal calculator Mahalanobis distance is compared with the threshold value, so that the tool wear state can be more accurately and effectively monitored.