Milling diagnosis using arti ﬁ cial intelligence approaches

. The Industry 4.0 framework needs new intelligent approaches. Thus, the manufacturing industries more and more pay close attention to arti ﬁ cial intelligence (AI). For example, smart monitoring and diagnosis, real time evaluation and optimization of the whole production and raw materials management can be improved by using machine learning and big data tools. An accurate milling process implies a high quality of the obtained material surface (roughness, ﬂ atness). With the involvement of AI-based algorithms, milling process is expected to be more accurate during complex operations. In this work, a milling diagnosis using AI approaches has been developed for composite sandwich structures based on honeycomb core. The use of such material has grown considerably in recent years, especially in the aeronautic, aerospace, sporting and automotive industries. But the precise milling of such material presents many dif ﬁ culties. The objective of this work is to develop a data-driven industrial surface quality diagnosis for the milling of honeycomb material, by using supervised machine learning methods. In this approach cutting forces are online measured in order to predict the resulting surface ﬂ atness. The developed diagnosis tool can also be applied to the milling of other materials (metal, polymer, etc.).


Introduction
The Industry 4.0 framework needs more and more smart monitoring and diagnosis, real time evaluation and optimization of the whole production and raw materials management.Therefore, the manufacturing industries recently pay close attention to artificial intelligence (AI) and big data tools [1].An accurate milling process implies a high quality of the obtained material surface (roughness, flatness) [2].With the involvement of AI-based algorithms and machine learning (ML) techniques, the milling process is expected to be accurate during the milling of delicate materials and complex operations.
A diagnostic system based on ML techniques automatically learns, which calculated features deduced from measured signals, to detect failure patterns in the training dataset.The obtained trained model is then used as a failure predictor for new measured data.
ML algorithms can be divided in broad categories based on supervised, unsupervised, semi-supervised, and reinforcement learning, depending if labels (or class) are used.A diagnostic system is a good application of supervised classification task [14]: it is trained with many variables and features along with their class (e.g.faulty or healthy), and it has to learn how to classify new variables and features.The output of the trained model is the label of each new dataset.
Particular attention should be paid to the features calculation and selection which are depending on the application field.Therefore the field knowledge has to be taken into account.Moreover, ML algorithms selection and tuning is another difficult task.
In the field of the milling operations, only few authors worked on artificial intelligence developments and tools [15,29].Most of the works involved Artificial Neuronal Networks (ANN) and related approaches (e.g.associated with Fuzzy-logic).
Mikołajczyk et al. developed an Artificial Neuronal Network (ANN) for tool-life prediction in machining with a high level of accuracy, especially in the range of high wear levels, which meets the industrial requirements [3].They combined a multi-layers ANN model with image processing.It has to be noticed that ANN is the most used AI approach in the image processing.
Pimenov et al. evaluated and predicted the surface's roughness through artificial intelligence algorithms by using random forest and standard Multilayer perceptron (ANN) [4]: in their investigation the obtained performance depends on the parameters contained in the dataset.
Correa et al. compared the performances of Bayesian networks (BN) and artificial neural networks for quality detection in a machining process [5].
The work of Zhang et al. [21] concerns the cutting tool life in dry milling environment, based on Neuro-Fuzzy Network (NFN) approaches.
Durmus [27] worked on the prediction and the control of surface roughness in CNC by using artificial neuronal networks (ANN).Based on the ANN training model, he could find good machining parameters.
Rui et al. [24] implemented a hybrid approach for tool wear prediction by using local feature-based gated recurrent unit (LFGRU) networks.
By also using artificial neuronal network Azlan [28] has developed a surface roughness prediction models for end milling machining.
The mostly used sensors are vibration sensors and cameras.Another approach consists to measure and analyze the drive power (for example by current measuring) [31].In this paper few artificial intelligence methods are tested: random forest (RF), standard Multilayer perceptrons (MLP), Regression Trees, and radial-based functions.The approach is not applicable in our experimental setup; we do not have access to the drive power measures.
The diagnostic algorithms are implemented into (dedicated) computers.Another interesting approach consists to use cloud implementation.For example, Wu et al. [25] worked on cloud-based random forest algorithms for tool wear prediction in milling.
A close attention to features calculation is necessary.In fact, Javed et al. have shown in [26] that prognostic efficiency is closely related to the extracted features.
In our work, a milling diagnosis of composite sandwich structures with honeycomb cores is developed by using cutting/milling forces measurements, instead of vibration sensors, cameras, or drive power measurement (as indicated in the published works by other authors).Then the features are deduced from the measured forces generated during milling operations.
Such material structure has grown considerably in recent years, in different industrial domains and applications.Recent development projects for Airbus A380 and Boeing 787 confirm the increased use of the honeycomb material.But the precise milling of such material presents many difficulties: unevenness, uncut fibers and tearing of fibers can result.
The objective of our work is to develop an industrial data-driven surface quality diagnosis for the milling of honeycomb material, by using supervised machine learning methods which can be easily implemented in constrained embedded systems, such as kNN, Trees, SVM algorithms.On the contrary, ANN methods usually need more size and calculation power and therefore are not used in this study.The developed diagnosis tool can also be applied to the milling of other materials (metal, polymer, etc.) and material structures.

Description of the experiments 2.1 Workpiece material and tools
The workpiece material studied in this investigation is Nomex ® honeycomb cores with thin cell walls.Such pieces, produced from aramid fiber dipped in phenolic resin (Fig. 1), consist of continuous corrugated ribbons of thin foil bonded together in the longitudinal direction.The aim is to create a structure allowing lightness and stiffness together thanks to the hexagonal geometry of formed cells.The geometric characteristics of the honeycomb cores are indicated on Figure 1.The use of honeycomb material in sandwich composite is limited by the fragility of each wall of the honeycomb, which influences the quality of obtained surfaces after machining [7,8,9].
Uncut fibers and tearing of fibers are obtained defects (see Fig. 4) related to its composite nature and the cutting conditions.Moreover, the alveolar geometry of the structure causes vibrations on the different components of the cutting effort [10] which increase the defects.
In fact, cutting tools and the mechanical and geometrical characteristics of honeycomb cores have a crucial effect on machinability and on the quality of the resulting surface [11].Ordinary cutting tools are not adequate for machining honey-comb cores.
In our study, the used milling cutter (see Fig. 2) is provided from our industry partner, the EVATEC Tools Company.This combined specific tool with two parts is designed for surfacing/dressing machining operation.The first part is a cutter body made of high speed steel with 16 mm in diameter and having ten helixes with chip breaker.The second part is a circular cutting blade made of tungsten carbide with a diameter of 18.3 mm and having a rake angle of 22°and a flank angle of 2.5°.These two parts are mechanically linked to each other with a clamping screw.

Milling experiments
All experimental data are obtained from a three-axis vertical machining center Realmeca ® RV-8.The main technical specifications of this machine are given in Table 1.
The cutting forces generated during cutting, are measured by using the Kistler dynamometer model 9129AA.The Kistler table is mounted below the Nomex honeycomb sample in order to measure the three orthogonal components (F x , F y and F z ) of the machining force as shown in Figure 3.During the measurements, the x-axis of the dynamometer is aligned with the feed direction of the milling machine and the longitudinal direction of the workpiece (parallel to core ribbons and the direction of honeycomb double wall).The signals are stored in a laptop for on-line data processing and diagnosis (data filtering, features calculation, machine learning application).
The milling experiment conditions are summarized in Table 2. Four different speeds (high and low speeds) and four feed values were selected.
The surface quality is of high importance for the use of the Nomex ® honeycomb in sandwich materials.
The machining defects cause a reduction of bond strength between the skin and the honeycomb core, and thus a weaker joint for composite sandwich structures.Two main types of surface damage are observed after the milling: uncut aramid fibers along the machined surface and tearing of the walls, Figures 4a, 4c and 4d.The appearance of the uncut fibers is a machining defect specific to the composite material which depends on the type of the fibers and their orientation.The tearing of Nomex ® paper, linked to the cellular appearance of the honeycomb structure, occurs under the shear loading effect [5,12].

Measured signals
Many milling experiences have been made in our study.For example, Figure 5 shows the milling forces measured for honeycomb at 2000 rpm spindle speed and 3000 mm/min feed rate.
As seen in Figure 5, cutting forces do not exceed 60 Newtons.During the milling, the vertical cutting force component is greater than other forces components which     can be attributed to the mechanical properties the honeycomb structure.In fact, the honeycomb structure is characterized by a better out-of-plane compression behavior.
The cutting forces show significant oscillations, due to the vacuum in the cells of the honeycomb and the angle between the cutting direction and the honeycomb cell wall direction.
The obtained surface quality (in our case the flatness) has been measured for various combinations of cutting conditions as the spindle speed and the feed rate.One can see the flatness quality in Figure 6.The flatness defects are increased for low rotational speed of the tool.An unevenness exceeding 500 mm characterizes a severe tearing of the honeycomb walls.
The quality of the obtained surface allows to establish a criteria for determining the machinability of the honeycomb structures.
Alternatively a surface response [30] could have been built in order to predict the milling surface quality.But close milling parameters (such as splindle speed, feed rate, depth of cut) can lead to different results, depending on the material, the quality of the machining tool, etc.Therefore, in our approach supervised machine learning techniques (with labeled measurements for the model training) are used.These tools need the construction of features associated with the measurements.These features can be calculated online during the measures acquisition, by using a time sliding window: the features are calculated along the window for each sampling time (few ms for the chosen sampling time).

Milling diagnosis using machine learning techniques
Machine learning techniques can be separated mainly in two categories [17,22,23]: -Unsupervised approaches: based on unlabeled input data.The goal is to find groups and structures in the data set, in order to classify new observations (measurements) into the different groups, without labels.-Supervised approaches: based on labeled input data.
With such approaches the data used to train the model must be labelled.The goal is to predict the labels of new measures (or data).
A machine learning based diagnosis system needs different steps: measurements of the adequate signals.
signal processing (typically low pass filtering) features calculation and normalization model training with machine learning approaches, using labeled data : training phase test phase: label predictions using the trained model.The predicted labels are compared with the known labels in order to optimize the model (with the help of the confusion matrix, ROC diagram, …) and the different setting parameters.
The raw data (measurements) are firstly filtered, with low pass filters (typically with Butterworth filters order 2 or 4) in order to eliminate high frequency noises, and labeled.Two labels are used: "obtained signals for good surface quality", "obtained signals for bad surface quality".Then the features are calculated offline or (online in a real time implemented diagnosis system).
All the experiments are then split into two groups: 75% for the machine learning model training, 25% for the obtained model evaluation also called test phase in the literature (another percentage can be chosen, for example 60-40%, depending on the number of experiments).This can be made randomly, but the ratio "good surface quality" and "bad surface quality" must be kept in each group.

Features calculation
The features are calculated in time and frequency domains [6,13] from the raw signal represented in Figure 7.We calculated the features in steady state behavior (between the two red lines).Therefore, transient time zones of the milling (when the cutting tool entries or exits the honeycomb core) are not considered in this study.
All the measured milling force signals are filtered with a low pass Butterworth filter.The filtered signal is called hereafter x(t).Therefore, we don't calculated the features from the raw signal but from the filtered signal.Then 19 features are calculated in time domain, as detailed below.
The calculated time domain features are: -Maximum of x(t) (1) -Minimum of x(t) (2) -Difference between the maximum of x(t) and the minimum of x(t) : amplitude range (3) -Median value of x(t) (4) -Maximum of the absolute value of the signal: -Interquartile range: where Q 3 and Q 1 represents respectively the upper and lower quartile.
-Inter decile range: where D 90 and D 10 means respectively the 90th ant the 10th decile.Both Inter quartile and Inter decile range are a measure of statistical dispersion of the values in a set of data.
-Average value of the signal: -Average value of the absolute value of the signal: -Average value of the absolute value of the derivative signal: -Variance: -Energy of the signal: -Energy of the centered signal: -Energy of the derivative signal: -Skewness: -Kurtosis: -Moment order i (i = 5 10): -Shannon entropy: -Signal rate: Then, another 19 features are calculated in the frequency domain, in a similar way for the measured milling force signal.To do this, the Fast Fourier transformation (FFT) of the signal x(t) is firstly calculated: where N is the number of samples of the signal x(t).
The frequency domain features are calculated for the Y(f) signal, in a similar way as for the time signal.
The normalization of the features (in time domain and frequency domain) has been made as follows [16]: Thus we obtain:

&
Our elaborated surface quality diagnosis was also tested with non-normalized features.Nevertheless, the feature normalization improved the accuracy of our approach.
All the calculated features, in time and frequency domains, are normalized and stored in a table.In this table the rows and columns respectively represent the experimental numbers (also called instances) and the associated feature values.
The obtained normalized feature table contains 38 calculated features and 3 input values for each experiment (each experiment corresponds to a row in the matrix).The input values are the tool rotation speed, the cutting speed and the depth of cut.

Reduction of the features
It is necessary to avoid overfitting of the classifier.In fact, in the case of overfitting, the model is usually well trained but is unable to predict with a good accuracy the labels of new data (measurements).Therefore it is necessary to make a dimensional reduction of the feature table.
Dimensional reduction can be made by using two major techniques such as feature reduction and feature selection.In feature reduction the original high-dimensional feature-table is mapped into a lower-dimensional table.In the classical approach the transformed features are linear combinations of the original features.In the second approach (the features selection), an optimal subset of features is selected according to an objective function.
For a linear supervised problem, different feature reduction algorithms can be used, such as [18]: -PCA: Principal Component Analysis.The features are transformed into a new ordered set, the principal components being the eigenvectors of a covariance matrix.-CCA: Canonical Correlation Analysis (used to analyze the relation between a pair of datasets).-LDA: Linear Discriminant Analysis.
-PLS: Partial Least Squares (It can be used to overcome the limits of PCA in regression).
The PCA algorithm [18,19] is one of the most used algorithms for dimensional reduction in industrial context.This reduction approach is used in our study: by keeping the five first principal components we reached a variance percentage of 99%.

Labeled data
Different settings of the milling parameters lead to surface flatness variations.The experimental results are illustrated in Figure 6.Then we defined two classes (labels) which indicate the surface quality: best surface quality, and worst surface quality (see Tab. 3).The labels, attached on each data set (measure and the calculated features from the measure) enable the using of supervised machine learning techniques.
The best surface quality corresponds to the label A, and the worst surface quality to the label B. Then we adopted the following rule for the prediction of the surface quality: -If prediction probability result ≥ 0.5 : class A -If prediction probability result < 0.5 : class B

Applied supervised learning algorithms
In this work, several three classification algorithms have been implemented in the Matlab software environment [20,21]: k-nearest neighbor (KNN), Decision trees (DT) and Support Vector Machine (SVM).Each algorithm having different internal parameters (various distances, different kernels, etc.), their influence on the classification efficiency has been analyzed.The KNN classifier was implemented with two different distances: the Euclidean distance and the Chebyshev distance.For these two configurations, we selected a small number of neighbors.This approach can be improved by choosing a weighted KNN (the labels are weighted).
The decision tree algorithm is a fitted binary classification decision tree.This tree is pruned in order to reduce the computing time (decision time) keeping nearly the same performance.The best pruning level is obtained by optimization.
The last one we implemented is the SVM classifier and we used two algorithms: the linear SVM for a two-class (two labels) data set and the Gaussian SVM algorithm (which a normalized polynomial kernel).
4 Obtained results

Results of the trained models
The different machine learning algorithms (with their adapted tuning parameters) are applied to the normalized labeled training data set (75% of the total experiments).The obtained trained models are then tested on the labeled test data set (25% of the total experiments).The objective is to find again the labels of the test data set: Table 4 shows the obtained accuracy result of each tested algorithm.The relation (22) gives the definition of the accuracy.
Classical decision tree classifier leads to the best trained model for predicting the label (best or worst surface quality) of new data set.Nevertheless, by pruning the decision tree classifier, the accuracy is significantly decreased.The pruning can be necessary in the case of a real time implementation, in order to be as fast as possible.
The next step consists to reduce the dimension of the normalized feature table by using the PCA algorithm and then to train the supervised machine learning models.The obtained accuracy results are illustrated in Table 5.
In this study k is an even number for the KNN algorithms.Different odd and even numbers will be tested in the next future (It should be preferable to choose an odd number).
For the dimension reduced feature table, obtained by PCA, the algorithms gave better results, as expected: the algorithms produce high accuracy rate.In fact, linear SVM is very efficient with fast running time.

Prediction results for new experimental data
The trained models are used to predict the labels of new experimental data sets.In this phase, corresponding to the test phase: the predict labels are compared with the known labels associated of the new data.Then the confusion matrix is deduced and the performance is calculated.The final goal is to predict online (that means during milling) the surface quality: best or worst surface.
For the trained linear SVM classifier model, the predicted results are given in Table 6: the percentage of true positive rate and false negative rate are obtained from the evaluation of the prediction (of the new experimental data sets).We can observe that the best predicted class is the negative class B. In this study the linear SVM algorithm leads to the best prediction rate (for the test data).It should be noted that in our application this model needs the lowest training time.
For automatic classifier performances evaluation (useful for the optimization of the algorithm parameters for example), different evaluation metrics (22) to (25) or ROC diagram surface can be used.
Accuracy (the percentage of predictions that are correct): Precision (the percentage of positive predictions that are correct): Sensitivity (the percentage of positive cases that were predicted as positive): Specificity (the percentage of negative cases that were predicted as negative): In this application, we directly used the confusion matrix (Tab.6) to evaluate the performances of the SVM classifier (for the test data).

Conclusion and further works
Not only the rapidity and the precision play an important role but also the roughness and the flatness of resulted surface characterize the milling's performance.This work in focused on the flatness diagnosis of milled surfaces.To do this, features were firstly calculated from measured milling forces.The features can be normalized or not.Then several Artificial Intelligence (AI) based model have been trained by the labeled set of features.In fact, supervised machine learning algorithms have been implemented in this application of honeycomb material milling.The best results are obtained with the SVM algorithm.The developed diagnosis approach can also be applied to the milling of other materials.
The next step consists to test and compare different feature reduction algorithms with measures having uncertainties, in order to have a fast and robust real time milling diagnosis system.

Table 3 .
Label table for the experimental observations.

Table 4 .
Prediction error for the normalized data set.

Table 5 .
Prediction error for the normalized weighted data set obtained by PCA.