1 Introduction

During the design and operation of manufacturing systems, there are four key attributes, which should be optimized by engineers to maximize the performance of the manufacturing system, namely time, cost, flexibility and quality [1]. However, since these are conflicting attributes, in the sense that the effort towards optimization of the one might impact the others negatively, the optimal compromise among those should always be searched for [2]. Modern machinery has employed the latest technological advances to deliver high-performance processing capabilities [3]. As a result, manufacturing engineers should aim to optimize the operation of manufacturing system through research on process planning [4], monitoring [5] and real-time control [6]. Especially in the current era, where digitalization of manufacturing processes is highly pursued [7], technologies that enable safe and productive autonomous operation of machinery are of utmost importance [8].

Regarding the milling process, one of the key limitations that hinders the productivity of the process and is a key barrier for autonomous operation of the machine tools is chatter [9]. When the milling process is stable, forced vibrations are exhibited at the cutting tool, as a result of the harmonic nature of the cutting loads, which rise and drop down to zero as the cutting edge enters and exits the cut at each rotation of the tool. These vibrations are harmless to the process, workpiece and cutting tool and any local instabilities that might lead to an instantaneous disturbance are suppressed by the process itself. On the other hand, when the system is unstable, chatter occurs. Chatter is a form of self-excited vibration that is introduced during the machining process, due to the dynamic characteristics (stiffness and damping) of the machining system (machine tool, workpiece, cutting tool). Chatter is an uncontrollable and unattenuated vibration that results in large oscillations between the workpiece and the cutting tool and has a detrimental effect on the surface quality, the tool life and the health of the machine tool components. Moreover, chatter is also a regenerative phenomenon, which means that the marks left on the workpiece surface, due to the oscillation of the tool, create a varying chip load that further excites this uncontrollable vibration.

Chatter has been a challenge for researchers in machining science for over a century. Even from 1907, F. W. Taylor, who was a pioneer of the science of metal cutting, has stated that “Chatter is the most obscure and delicate of all problems facing the machinist –probably no rules or formulae can be devised which will accurately guide the machinist in taking maximum cuts and speeds possible without producing chatter” [10]. The first part of this statement is still valid. Indeed, chatter is the most complex and challenging phenomenon that machinists, process planners and manufacturing engineers have to tackle during milling. However, there have been a number of excellent works in literature that have facilitated the understanding and prediction of the phenomenon. Tlusty and Polacek [11] and Tobias and Fischwick [12] have presented the first pioneering works, where the phenomenon of regenerative chatter has been analysed and the chatter behaviour of the process has been formulated mathematically. Later on, Altintas and Budak [13] have developed an analytical solution for the evaluation of the stability status of the machine, without the need for a time domain simulation. After these fundamental works, the research regarding chatter has been extended in several milling operations, such as 5-axis milling [14, 15], milling of flexible workpieces [16], micromilling [17] and robotic milling [18], among others. Combination of artificial intelligence with physics-based modelling has also been proposed to increase the accuracy of chatter prediction [19]

Through the numerous approaches that have been proposed in literature so far, it is now possible to predict the occurrence of chatter during the process planning stage and select the appropriate process parameters to ensure chatter free machining with a high level of accuracy. However, this accuracy level is highly dependent on the quality of measurements of the dynamic response of the structure, which are often required to be repeated when components of the machine tool-tool holder-cutting tool system are exchanged. Especially when machining close to the stability limit, the analytical predictions can often lead to errors. Therefore, it is necessary to implement monitoring systems that can evaluate the status of the process in real-time and provide feedback to control algorithms that can act upon the process, in order to facilitate a truly autonomous milling operation [20].

For the development of the sensing layer that will be used to capture the process-generated signals, the most common approaches include the use of accelerometers, piezoelectric force sensors, microphones, acoustic emission sensors or their combinations [21]. Additionally, use of internal sensors of the machine tool [22] or sensor-integrated tooling [23] has been proposed, in order to provide a more industrialized solution. Analysis of the milling signals in the frequency domain is one of the most effective and commonly utilized methods for identification of chatter, since it enables the separation of the portion of the signal related to the tooth passing frequency and its harmonics, from the portion of the signal related to chatter [24]. Advanced signal processing methods can support this aim even for very complex operations, such as thin-walled milling [25]. However, this approach requires prior knowledge of the machine tool dynamic behaviour, in order to have a first estimation of the potential chatter frequencies that are going to be excited during a milling operation. Such knowledge stems from complex experiments, such as the impact testing of the machine tool [26], requiring expensive equipment and rendering this approach unsuitable for some use-cases.

Additionally, several features can be extracted from the signal, either in the time or in the frequency domain, in order to be used as chatter indicators. The drawback of such methods is that new thresholds for chatter occurrence might need to be set among different milling operations, thus reducing their adaptability [27]. Instead, artificial intelligence (AI) can be employed as a tool to build a chatter detection system, as it can automate the process of evaluating the chatter status, through the use of a series of chatter indicators, based on a training dataset [28]. The main drawback of AI-based approaches is that their performance is heavily dictated by the nature of the dataset that is used during the training process. In processes such as milling, where a diverse set of materials, machine tools, cutting tools etc. is used, AI-based approaches might be overfitted for a specific milling application, leading to a need for retraining, in order to transfer them to another machine tool, workpiece material etc. [29].

Since chatter is a phenomenon of high interest in machining science, there have been a wide range of publications in available literature that investigate the detection of chatter from process-generated signals. Several different approaches have been utilized to identify the presence of chatter, ranging from model-based to purely statistical, and an amplitude of sensing elements have been integrated in machine tools to provide the required data sources. Since the phenomenon of chatter exhibits itself both on the time-domain evolution of the signal, as well as the frequency domain, where the signal energy is shifted from the tooth passing frequency and its harmonics towards the chatter frequencies, the respective analyses have been performed in the time, frequency or time–frequency domains [21]. Recently, a lot of effort has been put by researchers to employ advanced signal processing algorithms, in order to decouple the part of the signal that is related to chatter from the part that is related to the forced vibrations due to the cutting action, while artificial intelligence has been widely employed to evaluate the stability of the process.

Liu et al. [30] have utilized a piezoelectric dynamometer to measure the cutting force signals. The signals were decomposed with variational mode decomposition (VMD), and the evolution of the energy entropy on the modes close to the chatter frequencies were investigated. Based on the energy transfer from the forced vibration modes to the chatter modes, they were able to identify stable and chatter-related signals. In another work, Liu et al. [31] have also investigated using VMD to decompose the signal and multiscale permutation entropy as a chatter indicator. However, further work on improving the computational efficiency of their approach and validating it in real milling scenarios was required. Yang et al. [32] have also used an optimized VMD on force signals to evaluate the process stability, by examining the evolution of approximate entropy and sample entropy on the decomposed modes and identify chatter at its onset. VMD was also coupled with wavelet packet decomposition by Zhang et al. [33], and the energy entropy of the signals was used as an indicator of the existence of chatter. Although the method was able to identify chatter effectively, its performance was heavily relying on the selection of VMD and WPD parameters that requires significant experience from the user. In an effort to remove the signal component that is related to the tooth passing frequency and its harmonics, Li et al. [34] have used angular synchronous averaging (ASA). Then, they calculated the multiscale permutation entropy (MPE) and the multiscale power spectral entropy (MPSE) of the residual signal and fed these values to a gradient tree boosting classifier. Their approach has been implemented online with a high accuracy level.

Apart from cutting force signals, chatter detection approaches from vibration measurements have also been widely reported in the available literature. Perez-Canales et al. [35] have analysed the randomness index of the approximate entropy of vibration signals during machining, in order to set the threshold upon which chatter occurred. A very popular decomposition algorithm that has been very often utilized by researchers is ensemble empirical mode decomposition (EEMD). Chen et al. [36] have decomposed the vibration signals measured during the process with EEMD and used a wide range of statistical features, calculated from the decomposed modes, to train a support vector machine (SVM) classifier that was able to detect the existence of chatter. EEMD was also used by Ji et al. [37], who have removed the portion of the signal related to the forced vibration due to the cutting action and reconstructed the residual signal. The residual signal was then divided in segments and fractal dimensions and power spectral entropy (PSE) were used as metrics for chatter presence. Fu et al. [38] used EEMD and identified the chatter-related modes through their principal energy, while a Gaussian mixture model (GMM) was used to classify the process between stable and unstable. Cao et al. [39] used EEMD to decompose vibration signals and applied the C0 complexity and power spectral entropy of the chatter-related modes as chatter indicators. Other decomposition techniques have been applied in vibration signals as well. Cao et al. [40] have used wavelet packet transformation to extract the information of the vibration signal that was related to chatter and then reconstructed the selected, chatter-rich wavelet packets. Hilbert-Huang transform (HTT) was applied on the reconstructed signal, and the mean value and standard deviation of the Hilbert-Huang spectrum were used as chatter indicators. Vibration signals were also evaluated without decomposition. An interesting approach was proposed by Chen et al. [41]. They have calculated the spectrograms of the vibration signals and processed them as image data. Then, by calculating image-related features, they were able to identify chatter presence, through a support vector machine classifier.

Often, a single sensor approach cannot provide an adequate accuracy level for a given application, so researchers have proposed sensor fusion approaches, regarding the data source. Kuljanic et al. [42] have combined cutting force and vibration signals in their analysis and decomposed them with wavelet decomposition. They have calculated statistical features (mean, standard deviation, skewness) of the signals and trained a neural network to evaluate the process stability. Fusion of cutting force and vibration signals was also proposed by Sun et al. [43], who developed an online chatter detection and control system. Improved local mean decomposition was used to decompose the signal and preserve only the chatter-rich information, while features that were sensitive to chatter were calculated. Then, a Hidden-Markov model was trained to effectively capture chatter evolution on-line.

Besides the aforementioned approaches, other non-conventional sensing layers were proposed. Aslan and Altintas [22] have measured the current that was drawn from the spindle motor. Using a comb filter to remove the signal components related to the tooth passing frequency and applying the direct Fourier transform on the residual signal, they were able to evaluate chatter presence from its magnitude, through a pre-defined threshold. Cao et al. [44] have set up a monitoring system based on a microphone that recorded the sound produced during the process. Through synchrosqueezing transform of the signals, they were able to remove the portion related to the tooth passing frequency and its harmonics. By conducting singular value decomposition on the time–frequency domain representation of the residual signals and setting up a threshold-based algorithm they were able to detect the presence of chatter.

Existing approaches in the available literature have investigated the use of advanced signal processing algorithms and several features as potential chatter indicators. However, most approaches lack adaptability to different machining scenarios, since they use manual thresholds for the decision-making between chatter and stable machining, while being validated in a limited set of machining operations, running the risk of overfitting. This issue significantly limits their industrial practicality and their potential to be utilized in real industrial scenarios. To this end, this work presents the development of a chatter detection algorithm, based on signals from a vibration sensor and decomposition of the signal with variational mode decomposition (VMD). In order to enable VMD to be used in different kinds of milling scenarios (machines, cutting tools and milling operations), a novel, adaptive version of VMD is proposed for online automated selection of its hyperparameters. Through the selection of the signal features that hold chatter-rich information and have potential to be used as chatter indicators, artificial intelligence is utilize to handle the process of decision-making between chatter and stable machining, thus eliminating the need to set manual thresholds, which is the most common practice in literature. Specifically, a support vector machine (SVM) classifier is utilized for the evaluation of the stability of the process. To prove the adaptability of the proposed approach, a diverse set of experiments is conducted, using different stock materials, cutting tools, monitoring setups and process parameters.

The paper is organized as follows. First of all, the methodology that was followed for the development of the chatter detection algorithm is analysed. Moreover, the case study and the experimental campaign that was employed to train, test and validate the algorithm are presented, as well as the results that have been achieved. Finally, the concluding remarks and the potential for future work are outlined.

2 Materials and methods

2.1 Variational mode decomposition

Variational mode decomposition (VMD) has been proposed by Dragomiretskiy and Zosso in 2014, as an algorithm for the decomposition of a signal into its principal modes [45]. VMD aims to decompose the real-valued input signal into a discrete number of sub-signals (modes), which are compacted around a centre frequency and have specific sparsity properties with the aim to reproduce the signal through their superimposition. The sparsity prior of each mode is its bandwidth in the spectral domain.

In order to assess the bandwidth of each mode (\({u}_{k})\), the algorithm of VMD starts with computing the associated analytic signal through the Hilbert transform, in order to obtain a unilateral frequency spectrum. The frequency spectrum of each mode is shifted by mixing it with an exponential tuned to the respective estimated centre frequency. The bandwidth of each mode can be estimated through the H1 Gaussian smoothness of the demodulated signal.

The decomposition of the original signal (\(s(t)\)) into a set of K modes becomes a constrained variational optimization problem as follows:

$$\begin{array}{c}\underset{\{{u}_{k}, {\omega }_{k}\}}{\mathrm{min}}\left\{\sum\limits_{k}{\Vert {\partial }_{t}\left[\left(\delta \left(t\right)+\frac{j}{\pi t}\right)*{u}_{k}\left(t\right)\right]{e}^{-j{\omega }_{k}t}\Vert }{}_{2}^{2}\right\}\\s.t. \sum\limits_{k}{u}_{k}= s\end{array}$$
(1)

where \(\{{u}_{k}\} := \left\{{u}_{1}, \dots ,{u}_{K}\right\}\) and \(\{{\omega }_{k}\} := \left\{{\omega }_{1}, \dots ,{\omega }_{K}\right\}\) are the sets of all modes and their centre frequencies, respectively, while \(\delta\) represents the Dirac distribution and \(*\) denotes convolution.

In order to address the constraint of accurate reconstruction, VMD introduces the quadratic penalty term, called alpha (α), and the Lagrangian multipliers, λ, thus rendering the problem unconstrained. The quadratic penalty term encourages reconstruction fidelity, typically in the presence of noise, and the Lagrangian multipliers are a common way of enforcing constraints strictly. Then, the constrained problem presented in Eq. (1) can be formulated as follows.

$$\begin{aligned}L\left(\left\{{u}_{k}\right\}, \left\{{\omega }_{k}\right\}, \lambda \right) :&=a\sum_{k}{\Vert {\partial }_{t}\left[\left(\delta \left(t\right)+\frac{j}{\pi t}\right)*{u}_{k}\left(t\right)\right]{e}^{-j{\omega }_{k}t}\Vert }_{2}^{2} +{\left\|s\left(t\right)-\sum_{k}{u}_{k}\left(t\right)\right\| }_{2}^{2} \\&+\langle \lambda \left(t\right), s\left(t\right)-\sum_{k}{u}_{k}\left(t\right)\rangle\end{aligned}$$
(2)

The solution of this optimization problem as it regards can be achieved through a sequence of iterative sub-optimizations called alternate direction method of multipliers (ADMM) and the formulation of each mode is the following.

$${\widehat{u}}_{k}^{n+1}\left(\omega \right)= \frac{\widehat{s}\left(\omega \right)- \sum_{i\ne k}{\widehat{u}}_{i}\left(\omega \right)+\frac{\widehat{\lambda }(\omega )}{2}}{1+2\alpha {(\omega -{\omega }_{k})}^{2}}$$
(3)

where the ^ superscript indicates the Fourier transform of the signal. Similarly, the optimization of each centre frequency can be solved as follows.

$${\omega }_{k}^{n+1}= \frac{{\int }_{0}^{\infty }\omega {\left|{\widehat{u}}_{k}(\omega )\right|}^{2}d\omega }{{\int }_{0}^{\infty }{\left|{\widehat{u}}_{k}(\omega )\right|}^{2}d\omega }$$
(4)

The algorithm uses two key hyperparameters, which are the number of modes that the signal should be decomposed into (K) and the quadratic penalty term (α). Indeed, these two key parameters have a tremendous impact on the quality of decomposition. Wrong choice of these parameters can lead to several issues (mode mixing, information loss during decomposition, mode duplication etc.), as it has been explained in detail by the developers of the algorithm [45], as well as other researchers that have employed VMD for various applications [46, 47]. This means that the two hyperparameters should be known before hand, in order to achieve proper decomposition of the signal.

However, in the case of machining processes, knowledge of the correct values that should be selected, especially as it regards the number of modes, requires a lot of experimental testing (e.g. identification of the structural modes of the machine tool-workpiece-cutting tool system) and simulation of the process [48]. This hinders tremendously the adaptability and robustness of VMD for the decomposition of machining signals. Hence, it is necessary to develop a methodology that can determine the optimal values for K and α, during the real-time operation of the machine.

As mentioned previously, there are three key problems that arise when wrong hyperparameter values are selected, namely loss of information from the signal, mode mixing and mode duplication. So, in this work, two metrics are utilized to assess the decomposition quality, thus creating an adaptive VMD algorithm that can calibrate itself as soon as the milling process starts. The first metric considers the aspect of information loss during decomposition, and it is the root mean square error (RMSE). The signal (s) is reconstructed after decomposition, through the superimposition of the decomposed modes and the RMSE between the original and reconstructed signal is calculated.

$$RMSE= \sqrt{\frac{1}{N}\sum_{i=1}^{N}{({s}_{real}-{s}_{reconstructed})}^{2}}$$
(5)

The next aspects to be addressed are mode mixing, where a mode (uk) is shared by its two neighbouring modes, and mode duplication, where two modes are generated around the same centre frequency. In both cases, the neighbouring modes will have some correlation. In order to examine the existence of such a correlation, the Pearson correlation coefficient (r) is calculated for every pair of neighbouring modes, where the \(\stackrel{-}{}\) superscript, indicates the mean value of a mode.

$$r= \frac{\sum_{i=1}^{N}\left({u}_{i+1}-{\overline{u} }_{i+1}\right)\left({u}_{i}-{\overline{u} }_{i}\right)}{\sqrt{\sum_{i=1}^{N}({{u}_{i+1}-{u}_{i+1})}^{2}\sum_{i=1}^{N}({{u}_{i}-{\overline{u} }_{i})}^{2}}}$$
(6)

Then, the following synthetic index is used to quantify the decomposition quality for each pair of K and α, which should be minimized for optimal decomposition.

$$Index=RMSE*r$$
(7)

2.2 Feature extraction

The extraction of features from the signal that withholds chatter-related information can increase the prediction performance of the algorithm and reduce the computational time, since few numerical values are evaluated instead of the whole signal. As a first step for the analysis of the vibration signals that are generated from the process, it is necessary to identify the mode that is related to the existence of chatter. Extracting chatter-related features from each and every mode would increase computational time and undermine the value that is provided by the decomposition process.

The metric that is used to identify the mode that is highly related to chatter is the kurtosis. Kurtosis is the fourth statistical moment of a signal and describes the “tailedness” of its probability distribution. The magnitude of the kurtosis is related to the magnitude of excess or outlier values existing in a signal. Moreover, the kurtosis is a metric of the transient phenomena existing in a signal. For example, a negative kurtosis indicates that a signal is stationary, whereas a pure sine wave has a kurtosis of 1.5. Figure 1 shows the evolution of the value of kurtosis of the vibration signal of the x-axis during stable machining and machining with chatter. Window sampling is performed on the signal, with a window length of 500 samples, and the kurtosis is calculated for each window. We can observe that for stable machining the kurtosis remains negative, whereas when chatter occurs, the kurtosis becomes positive, and its magnitude is following the magnitude of chatter.

Fig. 1
figure 1

Evolution of kurtosis of the vibration signal for stable machining (left) and machining with chatter (right)

After the best mode is selected, based on the kurtosis criterion, the rest of the features that will be used to feed the chatter detection algorithm can be selected. Apart from kurtosis, two other features will be calculated. The other statistical feature that will be considered is the standard deviation of the signal, since it can describe the sparsity of the data points that are sampled. When chatter occurs, standard deviation will increase due to the irregularity of the vibrations of the system [49].

The final feature that is considered is based on the analysis of the signal on the frequency domain. As mentioned previously, during stable machining, the energy of the signal is concentrated around the tooth passing frequency and its harmonics. On the other hand, during chatter occurrence, the energy of the chatter frequency rises. This is also a feature of the signal that can be utilized as a piece of information regarding the existence of chatter. To this end, a new feature is developed, namely the energy ratio. The energy ratio is the ratio between the energy of the chatter-related mode, which is selected based on the kurtosis criterion, and the energy of the whole signal and is formulated as follows.

The energy (E) of a continuous signal s(t) is calculated as follows:

$${E}_{continuous}= {\int }_{-\infty }^{\infty }{|s\left(t\right)|}^{2}dt$$
(8)

and for a discrete signal with n samples (sampled in the time domain):

$${E}_{discrete}= \sum_{i=1}^{n}{|{s}_{i}|}^{2}$$
(9)

Then, the energy ratio of the k-th mode will be:

$$Energy\;Ratio= \frac{{E}_{k}}{E}$$
(10)

where E is the energy of the whole signal.

Those features are calculated from the decomposed vibration signals of both the x-axis and y-axis, leading to a total of six features that will be used as an input for the classification algorithm.

2.3 Support vector machines

Support vector machines (SVM) are very popular classification algorithms and have been chosen in this work to perform the chatter detection, based on the features calculated from the decomposed signals. The main working principle of the SVM algorithm is that it tries to construct a hyperplane that separates the classes of the training dataset with the maximum margin. The hyperplane has a dimension of n-1, where n is the dimension of the dataset, i.e. the number of input features. Figure 2 outlines the way that different hyperplanes can be constructed with the aim to minimize the margin between the two classes.

Fig. 2
figure 2

Possibility of different hyperplanes for separation of the dataset

The three key parameters that should be optimized during the design of a classifier based on SVM are the kernel function, the magnitude of slack variable (C) and the parameter gamma (γ). The kernel function is used to manipulate the data points and explore their relationships in higher dimensions, in order to construct the hyperplane (Fig. 3). Hence, kernel functions provide the possibility for the SVM algorithm to handle a non-linear dataset effectively. Thus, the appropriate selection of the kernel function is of utmost importance on the performance of the algorithm.

Fig. 3
figure 3

Use of kernel functions to map data into a higher dimensional space

The slack variable allows for some misclassification during the training phase, with the aim of tackling the effect of outliers in the construction of the hyperplane. By allowing for some misclassifications during training, it is possible to maximize the margin between the hyperplane and the data points of the two classes, thereby increasing the classification performance in the testing phase. The slack variable indicates how far from the hyperplane can a datapoint, which is misclassified, lie. Finally, the gamma parameter defines the maximum distance that a data point can have, in order to influence the calculations that determine the location and orientation of the hyperplane. In order to select the optimal values for each of the three parameters, an initial investigation on the classification performance of each kernel function is performed. When the best kernel function is selected, an exhaustive grid search is performed to find the optimal pair for C and γ. A fivefold cross-validation scheme has been employed. For each of the two hyperparameters, 1,000 different values have been tested, which have been evenly spaced in a logarithmic scale. The range for C was [0.01, 100000] and for γ the range was [0.00000001, 100]. The results of this process are presented in Sect. 3.

The implementation of the SVM algorithm was performed in Python, using the scikit-learn package [50], which is a very popular package for implementation of various machine learning algorithms.

2.4 Framework of the proposed methodology

The proposed methodology has been conceived with the aim of being implemented online as part of a chatter detection and suppression system. In a real production scenario, when the machining process would start, the VMD parameters would need a re-calibration, since for each new cutting tool, workpiece or set of process parameters, the optimal values of K and α would change. Therefore, the initialization phase would receive a first vibration signal, set a grid of [K, α] pairs based on some predefined limits for their values and perform an exhaustive grid search to find the optimal combination of the hyperparameters of VMD, based on the synthetic index, as described in Sect. 3.1. After the initialization phase, the system could run with the optimal K and α values. Figure 4 summarizes the overall concept of the methodology, as well as the way that it is envisaged to be implemented in an on-line chatter detection scenario, during the actual milling process.

Fig. 4
figure 4

Overall concept of the proposed methodology

2.5 Case study

The methodology of the proposed work is targeted for chatter detection in milling processes. However, milling processes are very diverse in nature and can differ in several attributes, such as degrees of freedom (e.g. 3-axis and 5-axis), milling operation types (e.g. side milling, pocketing and slotting) and harshness of the operation (e.g. roughing or finishing). As a result, it is necessary to focus on a limited case study to show the applicability of the algorithm for chatter detection in milling processes. Nevertheless, the generation of a diverse dataset (to the extent that this was possible under the scope of this work) was pursued. In order to generate a diverse dataset for training and testing of the chatter detection algorithm and also evaluate the potential of the proposed methodology to be generalized in a wide range of machining operations, two different machining operations were used. A wide range of experiments has been performed on an Aluminium workpiece (7075-T6 alloy) and on a carbon steel workpiece (1.0037 material number). The hardness of these workpiece materials was measured with a Rockwell hardness tester at 85 HRB for Aluminium and 120 HRB for the carbon steel. The detailed composition of each material is provided in Tables 1 and 2. A diverse set of process parameter combinations was used, in order to collect data for chatter and stable processes. During the experiments, the feed axis has been varying between the x-axis and y-axis of the machine, in order to introduce an additional varying parameter in the process-generated data. The milling process employed was side milling with half immersion for aluminium and slot milling for steel. For both machining operations, climb cutting strategy was employed and the samples were machined dry. Table 3 presents the process parameters that were employed for steel and aluminium machining. A different set of cutting speeds, radial depths of cut and feed per tooth were examined in a full factorial plan (all possible combinations were examined). For each cutting speed, radial depth of cut and feed per tooth combination, the axial depth of cut was increased until chatter was reached. Then, an additional increase on the axial depth of cut was performed to record data from a process with intense chatter, and the next combination of cutting speed, radial depth of cut and feed per tooth was examined in a similar fashion.

Table 1 Aluminium 7075-T6 chemical composition
Table 2 1.0037 carbon steel chemical composition
Table 3 Table of experiments

Apart for the experiments that were used to source datasets for the development of the algorithm, a set of additional validation experiments have been performed. A staircase geometry has been machined (Fig. 5), so that side milling passes could be performed with increasing axial depth of cut.

Fig. 5
figure 5

Geometry of staircase workpiece

This way, it is possible to evaluate if the proposed methodology can capture chatter at its onset. The materials used for the staircase experiments were aluminium 7075-T6 and 1.7227 low alloy steel (Table 4 presents its chemical composition). Hardness was measured for the low alloy steel with a Rockwell hardness tester at 370HRB. Table 5 presents the detailed process parameters used for the staircase experiments.

Table 4 1.7227 low alloy steel chemical composition
Table 5 Experimental plan for the staircase validation experiments

2.6 Experimental setup

The machine that was used for the training, testing and validation experiments is an XYZ SMX SLV vertical CNC milling machine, equipped with a Prototrak SMX controller. The technical specifications of the milling machine are presented in Table 6, and the experimental setup is depicted in Fig. 6.

Table 6 Technical specifications of CNC milling machine
Fig. 6
figure 6

Experimental setup

For the collection of the data from the process, a tri-axial accelerometer was mounted on the spindle head of the milling machine. Mounting of the sensor was achieved through a M6 mounting stud. The accelerometer was a Kistler 8762A10 ceramic shear accelerometer and its specifications are presented in Table 7.

Table 7 Technical specifications of the Kistler accelerometer

The accelerometer was connected to a National Instruments PXI-4472 sound and vibration module for data acquisition. Each accelerometer channel, corresponding to a different axis, was recorded separately. Labview was utilized for collecting and storing the data in a separate file, for further offline analysis.

The cutting tool that was used for the training and testing experiments was a Sandvik R390-016A16-11L indexable milling cutter (tool #1), and the cutting inserts were Sandvik R390-11 T3 04E-NL H13A for aluminium machining and Sandvik R390-11 T3 02E-PM 4340 for steel machining. The specifications of the cutting tools are presented in Table 8. Additionally, for the staircase experiments a second tool was used (tool #2), in order to test the performance of the proposed approach, when different tool dynamics are considered. This tool was a Sandvik R390-010A10-07L indexable end mill with Sandvik 390R-070202 M-PM 4340 inserts. The milling tool overhang was 60 mm for tool #1 and 35 mm for tool #2. The tools were mounted in the milling machine through a BT40 tool holder and ER32 collets. Tool run-out was measured at 0.01 mm at the cutting tools, using dial indicator. This information has been included in the text.

Table 8 Cutting tools specifications

A total of 40 experiments with different process parameters have been performed with tool #1. The sampling rate for the signals that were generated by the accelerometer was 1 kHz, and a total of 7,000 samples was recorded for each machining experiment, which translates to 7 s of machining for each experiment. This led to a total of 280 × 103 samples that could be utilized for the analysis, separated in 40 different time-series datasets. For each experiment, the presence of chatter has been identified manually through the distinct sound that it produces during the process. Also, the resulting surface was evaluated, in cases that chatter was not severe and characterization by ear was difficult. In such cases, the chatter marks that were left behind in the workpiece were evaluated to characterize the dataset. The visual and audible observations have been confirmed by analysing the signals in their frequency spectrums and identifying the tooth passing frequencies and chatter frequencies.

In order to further validate the generalizability of the proposed methodology and ensure that it could be applicable in different machining scenarios, the sensing setup has been completely changed for the staircase validation experiments. Specifically, a Micromega Dynamics IAC-CM-U-03 tri-axial accelerometer has been utilized, which has been integrated on the machining vice, where the workpieces were clamped. The data were recorded via a Labjack T7-Pro Data Acquisition device at a 5 kHz sampling rate and stored for offline analysis, through the proprietary software of LabJack, used to drive the DAQ (LJStreamM). Table 9 outlines the technical specifications of the Micromega accelerometer, while Fig. 7 depicts the sensing setup.

Table 9 Technical specifications of the Micromega accelerometer
Fig. 7
figure 7

Sensing setup used in the staircase validation experiments

Fig. 8
figure 8

Results of VMD optimization for x-axis vibrations

Fig. 9
figure 9

Results of VMD optimization for y-axis vibrations

3 Results and discussion

3.1 Decomposition of the signal with adaptive VMD

The adaptive VMD has been applied separately to x-axis and y-axis vibration signals. Since the structural dynamics of the machine are not the same in these two dimensions, one can expect that the vibration modes might be different both in quantity and in value of their centre frequency. An exhaustive grid search has been performed to optimize the hyperparameters of VMD for the x-axis and y-axis vibration signals. The values that have been examined for each hyperparameter are the following:

  • For the number of modes (K), the range was from 2 to 10 with a step of 1.

  • For the quadratic penalty (α), the range was from 100 to 10,000 with a step of 200.

The results of this process are presented in Figs 8 and 9.

By observing the Figs. 8 and 9, there are some conclusions regarding the decomposition quality that can be drawn. As the value of K rises, the RMSE of the decomposition is diminished. On the other hand, as the value of α rises, the correlation follows the same trend. However, this does not imply that one should just select a high K and low α. Indeed, for low K values, the decomposition results to loss of information. However, when K is larger than the optimal, the only information that is lost is related to noise but, in the end, contributes to the RMSE of the decomposition. So, when the RMSE is coupled with the Pearson’s correlation coefficient, the optimal values can be identified. The value of the correlation rises in general with the increase of K, since mode duplication occurs, especially for low values of α that allow wideband modes to be formed.

Based on the exhaustive grid search, it has been concluded that the optimal VMD hyperparameters are K = 6 and α = 10,000, for both x-axis and y-axis vibration signals. Utilizing these two optimal values, the decomposition of the signals is performed. The results are presented in Figs. 10 and 11. Both signals correspond to aluminium milling, with a spindle speed of 3600 RPM. For the cutter used in this work that has two cutting edges, the tooth passing frequency corresponds to 120 Hz. Additionally, the feed per tooth was 0.06 mm for the stable case and 0.05 mm for the chatter case. Finally, the axial depth of cut was 0.5 mm for the stable case and 1 mm for the chatter case. In the FFT plots of the original signals, the tooth passing frequency and its harmonics can be observed, as well as the way that VMD decomposes the signal in its principal modes, which are centred around the tooth passing frequency and its harmonics. By comparing Figs. 10 and 11, the energy shift that takes place during chatter is evident. When chatter occurs, a significant portion of the signal energy is centred around the chatter frequency of 300 Hz, whereas in the stable case, the energy at this frequency is negligible. Once more, VMD is able to decompose the original signal into is principal modes, so that the identification of the chatter-related mode and the feature extraction can be performed, according to the follow-up steps of the methodology. Additionally, the quality of decomposition with VMD is validated, since there is no mode mixing or mode duplication, and the decomposed modes match the modes that were expected to be found, by observing the FFT plots of the original signals.

Fig. 10
figure 10

Decomposition of the vibration signal with optimal VMD hyperparameters for stable machining

Fig. 11
figure 11

Decomposition of the vibration signal with optimal VMD hyperparameters during machining with chatter

3.2 Feature extraction

After the determination of the optimal parameters for VMD, the decomposition of the signals and the extraction of the chatter-related features can be performed. The following procedure has been applied to the vibration signals that have been recorded in each of the 40 machining experiments:

  • Window sampling has been performed on each x-axis and y-axis signal of each experiment with a rectangular window with a length of 500 samples.

  • For each window, the x-axis and y-axis signals were decomposed with VMD by using the optimal hyperparameters that have been calculated previously.

  • The best mode is selected for x-axis and y-axis vibration signals according to the maximum kurtosis criterion.

  • For the best mode of x-axis and y-axis signals the kurtosis, standard deviation and energy ratio are calculated.

A total of 347 data points was collected with each datapoint having 6 features (kurtosis, standard deviation and energy ratio for x-axis and y-axis chatter-related IMF) and the class that they belonged in (stable or chatter). In order to showcase the suitability of the selected features to be used as indicators for the presence of chatter, Fig. 12 shows a scatter plot of the three features that have been calculated from the vibration signals in the x-axis. It is evident that there is already very good separation between the data points corresponding to stable and chatter machining. Therefore, this can facilitate the accuracy of the classifier.

Fig. 12
figure 12

Plot of the features calculated from the dataset for vibrations in the x-axis

3.3 Classification performance

The SVM classifier has been set-up with the scikit-learn package and the dataset has been split with a 70% of the data points (243) being dedicated for the training phase and 30% of the data points (104) being used for testing.

For the selection of the kernel function, the four available kernel functions of the package have been tested, namely radial basis function (RBF), sigmoid, polynomial and linear. In order to select the appropriate kernel function, an initial comparison among those has been performed, by evaluating the precision, recall and f1-score for each one. The results are presented in Tables 10, 11, 12, 13, 14, 15, 16 and 17.

Table 10 Classification performance for RBF kernel
Table 11 Confusion matrix of RBF kernel
Table 12 Classification performance for polynomial kernel
Table 13 Confusion matrix of polynomial kernel
Table 14 Classification performance for sigmoid kernel
Table 15 Confusion matrix of sigmoid kernel
Table 16 Classification performance for linear kernel
Table 17 Confusion matrix of linear kernel

The best classification performance is achieved by the RBF, linear and polynomial kernels, with RBF having a slight advantage, whereas the sigmoid kernel performs poorly. Based on that, the RBF kernel is selected for the next stage of the exhaustive grid search. The metric that has been employed for the evaluation of each pair of C and γ during the exhaustive grid search is the area under the ROC (receiver operating characteristic) curve, also known as AUC. The ROC plots the true positive rate (TPR) against the false positive rate (FPR) and is able to provide an overview of the true performance of the classifier, as opposed to accuracy, which can lead to misleading results. The ROC depicts the trade-off that is required on the FPR to increase the TPR. Ultimately, the perfect classifier will have an AUC score of 1.0. Based on the exhaustive grid search, the best hyperparameters for the classifier have been identified as

  • C = 10

  • gamma = 0.02732

The performance of the classifier is presented in Tables 18 and 19 and Fig. 13.

Table 18 Classification performance for optimal classifier
Table 19 Confusion matrix of optimal classifier
Fig. 13
figure 13

ROC curve for optimal classifier

Based on the results that were presented above, it can be concluded that the optimization was successful, since the performance of the classifier has been significantly increased. Overall, the classifier has a very good AUC score (93%), which indicates that is has been successfully designed.

The final aspect that needs to be considered is the computational efficiency of the proposed methodology. Since it has been conceptualized with the aim to be implemented online, it should provide rapid chatter detection capabilities that could act as a feedback for a control system. In order to identify the detection speed, the system has been put to test, where it was asked to perform the complete workflow. Specifically, the workflow consisted of the following tasks:

  • A.csv file containing a data packet that will be received in the real-time operation was opened, containing 500 samples of time, x-axis acceleration and y-axis acceleration data.

  • The x-axis and y-axis acceleration signals were read.

  • The x-axis and y-axis signals were decomposed with VMD, by using the optimal K and α values for the specific operation.

  • The best modes were identified and the signal features (kurtosis, standard deviation, energy ratio) were calculated.

  • The classifier was called to predict the chatter status.

  • The chatter status was printed.

This workflow was wrapped in a Python function and the timeit module was used, which is a built-in python module that can measure the execution time of code blocks. The function was executed multiple times and is average value, and standard deviation was calculated. The execution time was 26.1 ms ± 157 μs in a Dell Latitude 5501 laptop with the following technical specifications:

  • CPU: Intel Core i7-9850H with 2.6 GHz clock speed, 6 Cores and 12 Logical Processors

  • RAM: 16 GB

  • Operating System: Windows 10 Pro

  • Hard Drive: Western Digital SN730 NVMe Solid-State Drive

It can be observed from the speed test results that the system shows a very good detection speed, which enables it to be used in the context of real-time control.

3.4 Staircase validation experiments

In this section, the results of the staircase validation experiments are presented. Experiment S1 was characterized by a stable start leading to chatter after a few steps. Experiment S2 was characterized by chatter from the very start of the machining pass, while experiment S3 was characterized by a mostly stable cut that transitioned to chatter towards the end of the machining pass.

In order to facilitate the assessment of the chatter status of the machining process, the machined surfaces have been captured using an Insize ISM-DL301 optical microscope. The following sections present the evolution of the machined surfaces, chatter features and SVM prediction, as well as the vibration signal and its spectrogram along the whole toolpath.

3.4.1 Experiment S1

Figure 14 presents the evolution of the machined surface along the toolpath length. We can observe the onset of chatter towards the end of the second step of the staircase, i.e. at a machined length of 28 mm. The axial depth of cut that initiated the chatter was 2 mm.

Fig. 14
figure 14

Evolution of machined surface over the toolpath length for experiment S1

Figure 15 presents the vibration signals in x-axis and y-axis, as well as their spectrograms versus the machining length, while Fig. 16 depicts the evolution of chatter features and the prediction of the SVM algorithm over the machining length. By comparing Fig. 16 with Fig. 14, it is evident that the proposed algorithm can capture chatter at its onset. Overall, a very good detection performance is observed, except for a misclassification at the 50 mm mark. Nevertheless, considering the cycle time of the whole chatter detection procedure (26.1 ms), such a misclassification would not be detrimental in a real machining scenario, since the phenomenon would be detected in the next cycle and a control system could be activated to suppress chatter.

Fig. 15
figure 15

Vibration signal (a) and spectrogram (b) of the x-axis and y-axis (c and d) over the machining length for experiment S1

Fig. 16
figure 16

Evolution of chatter features and SVM prediction over machining length for experiment S1

3.4.2 Experiment S2

Experiment S2 was characterized by a case of severe chatter from the very beginning of the cut. The machining induced damage and the compromised surface integrity is evident from Fig. 17. Figure 18 presents the vibration signals in x-axis and y-axis, as well as their spectrograms versus the machining length, while Fig. 19 depicts the evolution of chatter features and the prediction of the SVM algorithm over the machining length. It can be observed that for this case of severe chatter, the chatter detection algorithm has a 100% classification accuracy, predicting the chatter status throughout the whole machining length.

Fig. 17
figure 17

Evolution of machined surface over the toolpath length for experiment S2

Fig. 18
figure 18

Vibration signal (a) and spectrogram (b) of the x-axis and y-axis (c and d) over the machining length for experiment S2

Fig. 19
figure 19

Evolution of chatter features and SVM prediction over machining length for experiment S2

3.4.3 Experiment S3

Experiment S3 was characterized by a stable cut for the largest portion of the toolpath. However, at the 3.5 mm axial depth of cut, the process started to chatter, as it can be observed in Fig. 20. Figure 21 presents the vibration signals in x-axis and y-axis, as well as their spectrograms versus the machining length, while Fig. 22 depicts the evolution of chatter features and the prediction of the SVM algorithm over the machining length. Also in this case, the chatter detection algorithm predicts the chatter at its onset. By comparing Figs. 20 and 22, one can observe that the chatter prediction is earlier in the toolpath than the area where the actual chatter marks can be observed. This could be attributed to the window sampling that has been performed in the signal of these experiments. Specifically, each window corresponded to 0.2 s or 1.6 mm of machining for the specific combinations of sampling rate (5,000 Hz), window length (1,000 samples) and feed rate (500 mm/min). This means that each portion of the segment that is equal to 1.6 mm of length receives a single characterization (chatter or stable), even if the process started to chatter at the very end of this segment.

Fig. 20
figure 20

Evolution of machined surface over the toolpath length for experiment S3

Fig. 21
figure 21

Vibration signal (a) and spectrogram (b) of the X-axis and Y-axis (c and d) over the machining length for experiment S3

Fig. 22
figure 22

Evolution of chatter features and SVM prediction over machining length for experiment S3

4 Conclusions

This work proposes a methodology for chatter detection in milling, based on variational mode decomposition, chatter sensitive feature extraction and support vector machines. Based on the investigations that have been performed within this work, as well as the obtained results, the following conclusions can be drawn:

  • VMD can effectively be used to decompose the milling vibration signal into its principal modes, which has been evident by comparing the frequency spectrum of the original signal with the centre frequencies of the obtained IMFs

  • The use of RMSE and Pearson’s correlation as metrics to evaluate the decomposition quality in real-time operation of the system and find the optimal VMD hyperparameters can successfully enable the automated selection of the appropriate VMD hyperparameters. This can address the key limitation for the application of VMD in signals generated from machining operations.

  • The transient characteristics of the phenomenon (kurtosis, standard deviation) compared to stable cutting, as well as the energy shift (energy ratio) that takes place in the frequency spectrum from the tooth passing frequencies to the structural modes of the machine, have been proven to be chatter sensitive features. As such, they have enabled the development of an accurate chatter detection algorithm.

  • The use of a support vector machine classifier enabled a very good classification accuracy (93% AUC score), as well as an excellent classification speed (26.1 ms), which will enable this system to be implemented in a real-time monitoring and control system.

  • The proposed methodology can successfully identify chatter at its onset, as it has been proven through the staircase validation experiments.

  • The ability of the proposed methodology to be used for different workpiece and cutting tool materials, as well as different tool dynamics, showcases that it can be a promising solution to address the generalizability constraints of most AI-based approaches that are used for chatter detection in milling.

The most important step that should be taken towards future work is to close the loop with the machine and develop a real-time chatter suppression system, based on the feedback generated by the proposed methodology. Moreover, the proposed system should be trained and validated with additional datasets coming from a diverse set of milling operations, utilizing different process parameters, cutting tool and workpiece materials and machine tools. Finally, the system could be potentially tested in other machining operations, such as turning or grinding.