Sound Detection Monitoring Tool in CNC Milling Sounds by K-Means Clustering Algorithm

Computer numerical control (CNC) is a machine used in the manufacturing industry to produce components quickly for the engineering field or the desired shape. In the milling process carried out by CNC machines, sometimes vibrations occur that cause unwanted cracks or damage, which if left unchecked, will cause more severe damage. For this reason, this study describes how to monitor and analyze the sound produced by CNC during the milling process. This study uses six sound sample videos from YouTube, and there are two modes: (1) the operating mode is three different shapes with XY, XZ, and XYZ axes, and the second (2) is based on material differences. Namely, wood, Styrofoam, and plastic. The sound generated from all samples of the CNC milling processes will be detected using a sound detection program that has been designed in the LabVIEW using a simple microphone. The resulting sound frequency will be analyzed using the fast Fourier transform (FFT) process in spectral measurements, which will produce the amplitude and frequency of the detected sound in real time in the form of a graph. All frequency results that have been obtained from the sound detection monitoring tool in the CNC milling machine will be imported into the K-means clustering algorithm where the different frequencies between the resonant frequency and noise will be classified. Based on the experiments conducted, the sound detection program can detect sounds with a significant level of sensitivity.


Introduction
Computer numerical control (CNC) [1] is a machine that is universally used in the industrial world to facilitate the manufacture of goods according to the desired shape and condition by entering commands that have been designed. The working principle of CNC begins with the sequence of shapes to be made by typing directly on a CNC machine or a PC pad with CNC programming applications. The program or order that has been made after that is sent and executed by a CNC machine carries out the order process according to the program and the desired shape.
During the CNC milling process, the milling machine will emit sounds and vibrations [2], where these vibrations produce a specific frequency range according to the pressure applied and also as an indicator of the smoothness of the milling process, it can be determined based on the vibration during the process, whether this is normal or has the possibility of errors such as balance, physical, or mechanical determination.
A. A. Jaber et al. [3] provide signal considerations as a technique that uses engine condition data as a solution to avoid sudden shutdowns and to prevent failures in complex systems. By using wavelet transforms in the LabVIEW program and MATLAB capabilities, the faults in industrial machinery can be detected in the early stages before they have reached critical levels. This author [4] presents a way to detect a given echo audio signal from human voice or sonar based on knowledge of acoustics and signal processing using amplitude and frequency graphs, the results of which are exported using Origin Software and the resulting high-quality graphics. The results of the resonant signal frequency from sound detection that have been carried out will be classified with a K-means algorithm to separate the resonant frequency signal or noise so that it makes classification easier; the results of this K-means clustering will be plotted again with Excel to obtain a good picture. Figure 1 shows the experimental system and implementation of the experiment in the form of a block diagram. The sound detection from the CNC milling is captured by the microphone to be programmed and will be classified using the clustering algorithm by K-means.

Block Diagram of Sound Detection Monitoring and Analysis System
Sensors 2021, 21, x FOR PEER REVIEW 3 of 19 After ensuring that the calibration results and sound detection are stable, an experiment was carried out on six samples of CNC Milling videos. With sound detection that has been designed in LabVIEW, the output of sound detection in LabVIEW is in the form of amplitude and frequency graphs, the results of which are exported using Origin Software and the resulting high-quality graphics. The results of the resonant signal frequency from sound detection that have been carried out will be classified with a K-means algorithm to separate the resonant frequency signal or noise so that it makes classification easier; the results of this K-means clustering will be plotted again with Excel to obtain a good picture. Figure 1 shows the experimental system and implementation of the experiment in the form of a block diagram. The sound detection from the CNC milling is captured by the microphone to be programmed and will be classified using the clustering algorithm by K-means.

Sound Detection for Hardware Acquisition
The integration system uses a sound detection program designed in LabVIEW to obtain the resonant frequency of each sound produced during the milling process on a CNC machine, Figure 2 shown the system structure of hardware for experimental setup. • Microphone A microphone is a receiver that translates sound vibrations in the air into electronic signals or writes them onto a recording medium. This study uses Intopic JAZZ-016, which is a mini-PC desktop microphone to complement the computer used for voice recording and a sensitive microphone for the noise problem to make less noise from the environment.

Sound Detection for Hardware Acquisition
The integration system uses a sound detection program designed in LabVIEW to obtain the resonant frequency of each sound produced during the milling process on a CNC machine, Figure 2 shown the system structure of hardware for experimental setup.

• Microphone
After ensuring that the calibration results and sound detection are stable, an experiment was carried out on six samples of CNC Milling videos. With sound detection that has been designed in LabVIEW, the output of sound detection in LabVIEW is in the form of amplitude and frequency graphs, the results of which are exported using Origin Software and the resulting high-quality graphics. The results of the resonant signal frequency from sound detection that have been carried out will be classified with a K-means algorithm to separate the resonant frequency signal or noise so that it makes classification easier; the results of this K-means clustering will be plotted again with Excel to obtain a good picture. Figure 1 shows the experimental system and implementation of the experiment in the form of a block diagram. The sound detection from the CNC milling is captured by the microphone to be programmed and will be classified using the clustering algorithm by K-means.

Sound Detection for Hardware Acquisition
The integration system uses a sound detection program designed in LabVIEW to obtain the resonant frequency of each sound produced during the milling process on a CNC machine, Figure 2 shown the system structure of hardware for experimental setup. • Microphone A microphone is a receiver that translates sound vibrations in the air into electronic signals or writes them onto a recording medium. This study uses Intopic JAZZ-016, which is a mini-PC desktop microphone to complement the computer used for voice recording and a sensitive microphone for the noise problem to make less noise from the environment.
• myRIO (National Instrument) A microphone is a receiver that translates sound vibrations in the air into electronic signals or writes them onto a recording medium. This study uses Intopic JAZZ-016, which is a mini-PC desktop microphone to complement the computer used for voice recording and a sensitive microphone for the noise problem to make less noise from the environment.
• myRIO (National Instrument) LabVIEW myRIO 1900 [18] is an embedded system for real-time evaluation. It is a tool to support work including data acquisition and frequency resonance analysis to be more efficient and faster when used on systems that require a fast response such as CNC machines.

Sound Detection for Software Design
LabVIEW provides helpful graphical programming to visualize an application's aspect, including hardware applications, data measurement, and debugging. It uses a graphic or block diagram-based programming language. The LabVIEW program is known as Vi or Virtual Instruments because its appearance and operation can resemble an instrument. In this study, sound detection that has been made in the LabVIEW program uses the following parameters are shown in Table 1. Table 1. Parameters used in this experimental.

Flowchart Diagram Implementation
The experimental process is shown in the flow diagram in Figure 3. In this experiment, a sound sample from a CNC machine process is rotated and captured by a microphone, producing a digital signal in the output sound. Sound is filtered using a bandpass filter with Butterworth topology and analyzed the resonant frequency with FFT in spectral measurements. Once the results are obtained, the frequency will be classified using the clustering algorithm by K-means.

Signal Filtering by Butterworth Filter
This study uses sound detection with bandpass as a filter; a bandpass filter passes signals with a frequency range (passband) and pastes signals with frequencies outside this range. For the response filter, the infinite impulse response (IIR) filter is used comprehensively because of the sharper transition area [20]. The filter used is a butterwort topology [21] because the advantages of the Butterworth filter are smooth, monotonous, maximum  This study uses sound detection with bandpass as a filter; a bandpass filter passes signals with a frequency range (passband) and pastes signals with frequencies outside this range. For the response filter, the infinite impulse response (IIR) filter is used comprehensively because of the sharper transition area [20]. The filter used is a butterwort topology [21] because the advantages of the Butterworth filter are smooth, monotonous, maximum flatness, with an ideal unity response in the passband and zero in the stopband, and the frequency drops by 3 dB, which corresponds to a specified cutoff frequency.

Spectral Measurement
Spectral measurements are carried out with the resulting spectral magnitude measured in peak values at the resonant frequency. In this study, a zero-phase spectrum was arranged with an average linear value. Tone measurements [22] will be analyzed to determine the single tone with the highest amplitude or find a frequency range.

Resonant Frequency and Amplitude by Fast Fourier Transform
Fast Fourier transform [23] is an algorithm used to represent internal signals discretetime domain and frequency domain. Discussing FFT-IFFT indeed cannot be separated from discrete Fourier transform (DFT) [24]. DFT is a mathematical transformation method for discrete time signals into the domain frequency. DFT is a mathematical signal transformation method of discrete time, while FFT is the algorithm used to perform the transformation formulated together. Mathematically, DFT can be formulated as follows: where W nk N is called the twiddle factor and has a value, e −j2πnk N , so that Meanwhile, inverse discrete Fourier transform (IDFT) can be formulated as follows: So that the IDFT equation can also be written as follows: FFT is used to reduce the complexity of the transformations performed with DFT.

Clustering Algorithm by K-Means
K-means clustering is a non-hierarchical cluster analysis procedure to partition existing objects into separate, one, or more clusters or teams of objects according to their respective characteristics. Each object with the same characteristics is grouped into the same cluster, and objects with different characteristics are grouped into another cluster. The Kmeans clustering method seeks to classify the information contained into several groups. Information in one group has the same characteristics and has different characteristics from information in other groups [25].
The average algorithm is one of the simplest and most famous unsupervised learning methods. It is an extension of the vector quantization method in signal processing.
With different analysis methods, different cluster classification algorithms are naturally derived, which are generated based on different foundations. The grouping definition of will also changes accordingly.
The aggregation or splitting is selected for screening, and then, an appropriate number of clusters is selected from the result as the final result. The mathematical formula of the average algorithm is as follows: kk k = number of clusters; 3. n = number of cases; 4. X = case i; 5. C = centroid for cluster j; 6. X (j) i − C j = Euclidean distance between X i and C j .
where X i and C j are two parts in dimensional Euclidean space [18].
Algorithmic steps for k-means clustering: X = {x1, x2, x3, . . . . . . xn} are the set of data points, and C = {c1, c2, c3, . . . . . . , cn} are the set of centers. For the first, randomly select "j" cluster centers and calculate the distance between each data point and cluster center, then assign the data point to the cluster center whose distance from the cluster center is the minimum of all the cluster centers. Recalculate the new cluster center using: The K-means average algorithm is to set the number of clusters to be grouped at the beginning and, then, achieve the purpose of grouping by repeatedly modifying until the group center is stable and there is no change. K-means averaging algorithm is based on the sum of the squared difference of the distance between each point in each cluster and the cluster center to which it belongs, as small as possible.
By K-means, the average algorithm has the characteristics of fast calculation speed and real-time update of the group center. It analyzes, classifies, and identifies CNC milling machines' frequency with different drilling methods and other materials. Figure 4 shows the process of K-means grouping step diagram.
then assign the data point to the cluster center whose distance from the cluster center is the minimum of all the cluster centers. Recalculate the new cluster center using: The K-means average algorithm is to set the number of clusters to be grouped at the beginning and, then, achieve the purpose of grouping by repeatedly modifying until the group center is stable and there is no change. K-means averaging algorithm is based on the sum of the squared difference of the distance between each point in each cluster and the cluster center to which it belongs, as small as possible.
By K-means, the average algorithm has the characteristics of fast calculation speed and real-time update of the group center. It analyzes, classifies, and identifies CNC milling machines' frequency with different drilling methods and other materials. Figure 4 shows the process of K-means grouping step diagram. In this study, all experimental results from sound detection samples on the CNC milling process video are carried out 10 times. All frequency data results are collected, and clustering will be run on the K-means program that has been designed on the LabVIEW software. Figure 5 shows the block diagram of the program flow analysis process presenting the input information of initialization, the performance evaluation of clustering, and the sound model saving of milling process that has been designed on the K-means program. In this study, all experimental results from sound detection samples on the CNC milling process video are carried out 10 times. All frequency data results are collected, and clustering will be run on the K-means program that has been designed on the LabVIEW software. Figure 5 shows the block diagram of the program flow analysis process presenting the input information of initialization, the performance evaluation of clustering, and the sound model saving of milling process that has been designed on the K-means program. In this study, all experimental results from sound detection samples on the CNC milling process video are carried out 10 times. All frequency data results are collected, and clustering will be run on the K-means program that has been designed on the LabVIEW software. Figure 5 shows the block diagram of the program flow analysis process presenting the input information of initialization, the performance evaluation of clustering, and the sound model saving of milling process that has been designed on the K-means program. The explanation of the block diagram is explained as follows: The explanation of the block diagram is explained as follows: • Initialization The first thing to do for initialization is to import data through a training data file (CSV) where comma-separated values (CSV) [26] are plain text files that store table and spreadsheet information in the form of table text, numbers, or dates. CSV-designed programs are used to import data from the experimental results of the CNC milling process with a feature trend for value and sample.

• Clustering
After the data are received, they will enter the clustering section using the evaluation metric, the Rand Index is selected to evaluate the clustering model being used, because the lower the metric value, the better the separation of the clustering model. The data will be entered, and the clustering result will be displayed. Additionally, the initial method determines the method for selecting the initial centroid, and K-means ++ (default) is selected to select the initial centroid in a way that always accelerates convergence.

• Model Saving
For the saving model, K-mean is chosen as the model to be saved.

Experiments
In this experiment, there are two different modes. The first is the mode of operation shape of the process with XY, XZ, and XYZ axes [27] are shown in Figure 6. The second is an analysis based on the same axes but with different materials Shown in Figure 7, where the materials used are Styrofoam [28], wood [29], and plastic [30]. The 6 video samples of the CNC milling process were obtained from YouTube with the analysis range setting at 1000-1700 Hz.

Experiments
In this experiment, there are two different modes. The first is the mode of operation shape of the process with XY, XZ, and XYZ axes [27] are shown in Figure 6. The second is an analysis based on the same axes but with different materials Shown in Figure 7, where the materials used are Styrofoam [28], wood [29], and plastic [30]. The 6 video samples of the CNC milling process were obtained from YouTube with the analysis range setting at 1000-1700 Hz.

Working Structure: Operation Shapes of CNC Milling Process
• Movement plane at XY axes to obtain corner and edge information.
The X-axes and the Y-axes form the XY coordinate plane and contain points whose triple sequence is (x, y, 0). The equation = 0 represents the XY plane. The horizontal is the X-axes as well as the vertical is the Y-axes [34]. In Figure 6a, the shape of the material to be sculpted is a rectangle whose motion has an X coordinate and a Y coordinate. For the CNC machine used on the XY axes, this takes a video of the CNC process of the CNC machine from the DATRON MXCube.

•
Movement plane at XZ axes to obtain the low and high information.
The x-axes and the z-axes form the XZ coordinate plane and contain points whose ordered triples are of the form (x, 0, z). The equation y = 0 represents the XZ plane [35]. Figure 6b shows that the sculpted shape is half a circle whose motion has an X coordinate and a Z coordinate.

•
Movement plane at XYZ axes to obtain inward loop information.
The horizontal line where the wall to the left and the floor intersects is the X-axes. The Y-axes are where the horizontal line on the wall to the right and the floor intersect. The Z-axes are vertical lines on intersecting walls [35,36]. The part of the line from inside the room is the positive part of each axes. This is illustrated by the halves of each axes labeled by X, Y, and Z. In Figure 6c, the sculpture forms a cylinder downward along the X, Y, and Z-axes. For CNC, the cutting machine parameters on the XYZ axes are in this video: 28K revolutions per minute (RPM); 130-140"/min; 0.160" step over; 0.0225 step down.

•
Material Density of Wood to Milling Process Operation In Figure 7a, using material wood samples by a CNC machine determines the milling process' signal information on wood material with an automated CNC router machine.

•
Material Density of Styrofoam to Milling Process Operation In Figure 7b, using a sample of Styrofoam material by a CNC machine determines the milling process' signal information on Styrofoam material with a CNC machine from DATRON foam cutter.

•
Material Density of Plastic to Milling Process Operation In Figure 7c, using plastic material samples by a CNC machine determines the milling process signal information on plastic materials. For CNC cutting machine parameters, this material is 1-flute, 1/8 Up spiral Endmill; super-PID controlled router at 10K revolutions

Working Structure: Operation Shapes of CNC Milling Process
• Movement plane at XY axes to obtain corner and edge information.
The X-axes and the Y-axes form the XY coordinate plane and contain points whose triple sequence is (x, y, 0). The equation = 0 represents the XY plane. The horizontal is the X-axes as well as the vertical is the Y-axes [33]. In Figure 6a, the shape of the material to be sculpted is a rectangle whose motion has an X coordinate and a Y coordinate. For the CNC machine used on the XY axes, this takes a video of the CNC process of the CNC machine from the DATRON MXCube.

•
Movement plane at XZ axes to obtain the low and high information.
The x-axes and the z-axes form the XZ coordinate plane and contain points whose ordered triples are of the form (x, 0, z). The equation y = 0 represents the XZ plane [34] Figure 6b shows that the sculpted shape is half a circle whose motion has an X coordinate and a Z coordinate.

•
Movement plane at XYZ axes to obtain inward loop information.
The horizontal line where the wall to the left and the floor intersects is the X-axes The Y-axes are where the horizontal line on the wall to the right and the floor intersect The Z-axes are vertical lines on intersecting walls [34,35]. The part of the line from inside the room is the positive part of each axes. This is illustrated by the halves of each axes labeled by X, Y, and Z. In Figure 6c, the sculpture forms a cylinder downward along the X, Y, and Z-axes. For CNC, the cutting machine parameters on the XYZ axes are in this video: 28K revolutions per minute (RPM); 130-140"/min; 0.160" step over; 0.0225 step down.

Different Materials: Operation Materials of CNC Milling Process
• Material Density of Wood to Milling Process Operation In Figure 7a, using material wood samples by a CNC machine determines the milling process' signal information on wood material with an automated CNC router machine.

•
Material Density of Styrofoam to Milling Process Operation In Figure 7b, using a sample of Styrofoam material by a CNC machine determines the milling process' signal information on Styrofoam material with a CNC machine from DATRON foam cutter.

•
Material Density of Plastic to Milling Process Operation

Results and Discussion
After the sound signal is received, the waveform parameters are determined as stable resonance information. Analysis of the realization of sound detection for each sample was applied with the LabVIEW program and re-plotted using the Origin Software [40], and the signals obtained after conducting 10 experiments were grouped with the K-means algorithm in the LabVIEW program and re-plotted using Excel.

Resonant Frequency Calibration with Do Re Mi Fa Sol Tone
The calibration simulation was carried out with Do Re Mi Fa Sol Tone played sequentially to see the resulting frequency range, then played back randomly 10 times, and always produced frequencies with the same range, "Do" at 10,050 Hz, "Re" at 1800 Hz, "Mi" at 1250 Hz, "Fa" at 1400 Hz, and "Sol" at 1570 Hz. This proves that the designed sound detection is consistent and stable. The results obtained are following the results of the frequency issued by each tone shown in Figure 8 as below: In Figure 7c, using plastic material samples by a CNC machine determines the milling process signal information on plastic materials. For CNC cutting machine parameters, this material is 1-flute, 1/8 Up spiral Endmill; super-PID controlled router at 10K revolutions per minute (RPM); 315+ inches per minute (IPM) rapids (10 mm lead ball screws on X and Y).

Results and Discussion
After the sound signal is received, the waveform parameters are determined as stable resonance information. Analysis of the realization of sound detection for each sample was applied with the LabVIEW program and re-plotted using the Origin Software [39], and the signals obtained after conducting 10 experiments were grouped with the K-means algorithm in the LabVIEW program and re-plotted using Excel.

Resonant Frequency Calibration with Do Re Mi Fa Sol Tone
The calibration simulation was carried out with Do Re Mi Fa Sol Tone played sequentially to see the resulting frequency range, then played back randomly 10 times, and always produced frequencies with the same range, "Do" at 10,050 Hz, "Re" at 1800 Hz, "Mi" at 1250 Hz, "Fa" at 1400 Hz, and "Sol" at 1570 Hz. This proves that the designed sound detection is consistent and stable. The results obtained are following the results of the frequency issued by each tone shown in Figure 8 as below:

Analysis for Operation Mode Process
Analysis for operation mode process using a CNC process formed with the XY axes shown in Figure 9 and Figure 10, XZ axes shown in Figure 11 and Figure 12, and XYZ axes shown in Figure 13 and Figure 14.

Analysis for Operation Mode Process
Analysis for operation mode process using a CNC process formed with the XY axes shown in Figures 9 and 10, XZ axes shown in Figures 11 and 12, and XYZ axes shown in • XY Axes Figure 9a shows an operation sketch of XY axes. When milling leads to shaping at corners (X) such as in Figure 9b, a frequency of around 1170 Hz is obtained, and when milling continues, the unidirectional process (Y) produces a frequency of 1157 Hz. Experiments will be carried out 10 times, and the results obtained will be of the same range. The frequency generated by the CNC milling process video can be obtained for voice changes, alternating between 1170 Hz and, then, 1157 Hz, as shown in Figure 9c. On the XY axis shown in Figure 10, the frequency difference between the X-axes and the Y-axes are not significant, and the data similarity is high between 1157 and 1170 (Hz). The average is about 1165-1167 (Hz). Therefore, the iterative conversion will be more frequent when grouping. It needs to wait for the program to find a suitable group center as the final result, and the final result will be closer.
• XZ Axes  • XY Axes Figure 9a shows an operation sketch of XY axes. When milling leads to shaping at corners (X) such as in Figure 9b, a frequency of around 1170 Hz is obtained, and when milling continues, the unidirectional process (Y) produces a frequency of 1157 Hz. Experiments will be carried out 10 times, and the results obtained will be of the same range. The frequency generated by the CNC milling process video can be obtained for voice changes, alternating between 1170 Hz and, then, 1157 Hz, as shown in Figure 9c. On the XY axis shown in Figure 10, the frequency difference between the X-axes and the Y-axes are not significant, and the data similarity is high between 1157 and 1170 (Hz). The average is about 1165-1167 (Hz). Therefore, the iterative conversion will be more frequent when grouping. It needs to wait for the program to find a suitable group center as the final result, and the final result will be closer.
• XZ Axes    Figure 11a shows an operation sketch of XZ axes. When the cutting position started such as in Figure 11b and reached the high position (X), the octave frequency of 1200-1350 Hz went down. When the low position (Z) goes up to 1458-1560 Hz, the experiment was repeated 10 times, and the results obtained were in a similar range. The frequency according to the CNC milling process can be obtained from time to time. The alternating sound changes between 1200 and 1350 Hz then 1458 and 1560 Hz are shown in Figure 11c, and each actual sound change is only about one second. In the XZ axes, the X-axes frequency is about 1200-1350 (Hz). The Z-axes is about 1458-1560 (Hz) on average, so after grouping, you can see in Figure 12 two separated clusters; one is the X-axes sound frequency that will be drilled at the beginning, and the other one is the Z-axes sound frequency that will be drilled later.
• XYZ Axes  Figure 13a shows an operation sketch of XYZ axes. When the milling touched the material's surface of the trajectory of the tool such as in Figure 13b, the frequency obtained was around 1220 Hz, and when rotating down, it was around 1450-1470 Hz. The experiment was repeated 10 times. The frequency generated by the CNC milling process video can be obtained to sound changes, back and forth between 1220 Hz and, then, 1450-1470 Hz, as shown in Figure 13c. In the XYZ axes, when the drill bit is drill down, the X-axes sound frequency will appear, so the amount of data obtained will be more, the frequency is about 1450-1470 (Hz). The frequency of the Y and Z axes is steadily located at about 1220 (Hz). Therefore, after grouping, it can be seen in Figure 14 that the numbers in the two clusters are different, but the cluster classification is precise.   Figure 13a shows an operation sketch of XYZ axes. When the milling touched the material's surface of the trajectory of the tool such as in Figure 13b, the frequency obtained was around 1220 Hz, and when rotating down, it was around 1450-1470 Hz. The experiment was repeated 10 times. The frequency generated by the CNC milling process video can be obtained to sound changes, back and forth between 1220 Hz and, then, 1450-1470 Hz, as shown in Figure 13c. In the XYZ axes, when the drill bit is drill down, the X-axes sound frequency will appear, so the amount of data obtained will be more, the frequency is about 1450-1470 (Hz). The frequency of the Y and Z axes is steadily located at about 1220 (Hz). Therefore, after grouping, it can be seen in Figure 14 that the numbers in the two clusters are different, but the cluster classification is precise.

Analysis for Different Material
In simulations with different materials, the materials used are wood shown in Figure  15 and Figure 16. Styrofoam shown in Figure 17 and Figure 18, and plastic shown in Figure 19 and Figure 20.

•
Simulation result with wood material.  Figure 9a shows an operation sketch of XY axes. When milling leads to shaping at corners (X) such as in Figure 9b, a frequency of around 1170 Hz is obtained, and when milling continues, the unidirectional process (Y) produces a frequency of 1157 Hz. Experiments will be carried out 10 times, and the results obtained will be of the same range. The frequency generated by the CNC milling process video can be obtained for voice changes, alternating between 1170 Hz and, then, 1157 Hz, as shown in Figure 9c.
On the XY axis shown in Figure 10, the frequency difference between the X-axes and the Y-axes are not significant, and the data similarity is high between 1157 and 1170 (Hz).
The average is about 1165-1167 (Hz). Therefore, the iterative conversion will be more frequent when grouping. It needs to wait for the program to find a suitable group center as the final result, and the final result will be closer.
• XZ Axes Figure 11a shows an operation sketch of XZ axes. When the cutting position started such as in Figure 11b and reached the high position (X), the octave frequency of 1200-1350 Hz went down. When the low position (Z) goes up to 1458-1560 Hz, the experiment was repeated 10 times, and the results obtained were in a similar range. The frequency according to the CNC milling process can be obtained from time to time. The alternating sound changes between 1200 and 1350 Hz then 1458 and 1560 Hz are shown in Figure 11c, and each actual sound change is only about one second.
In the XZ axes, the X-axes frequency is about 1200-1350 (Hz). The Z-axes is about 1458-1560 (Hz) on average, so after grouping, you can see in Figure 12 two separated clusters; one is the X-axes sound frequency that will be drilled at the beginning, and the other one is the Z-axes sound frequency that will be drilled later.
• XYZ Axes Figure 13a shows an operation sketch of XYZ axes. When the milling touched the material's surface of the trajectory of the tool such as in Figure 13b, the frequency obtained was around 1220 Hz, and when rotating down, it was around 1450-1470 Hz. The experiment was repeated 10 times. The frequency generated by the CNC milling process video can be obtained to sound changes, back and forth between 1220 Hz and, then, 1450-1470 Hz, as shown in Figure 13c.
In the XYZ axes, when the drill bit is drill down, the X-axes sound frequency will appear, so the amount of data obtained will be more, the frequency is about 1450-1470 (Hz). The frequency of the Y and Z axes is steadily located at about 1220 (Hz). Therefore, after grouping, it can be seen in Figure 14 that the numbers in the two clusters are different, but the cluster classification is precise.

Analysis for Different Material
In simulations with different materials, the materials used are wood shown in Figures  15 and 16. Styrofoam shown in Figures 17 and 18, and plastic shown in Figures 19 and 20.

•
Simulation result with wood material.  Figure 15a shows an operation sketch for wood material. When the milling position reaches the start shown on the trajectory of a tool in Figure 15b, the octave frequency is around 1500 Hz; when the milling continues, it will be around 1200 Hz. The experiment was repeated 10 times. The alternating sound changes between 1200 Hz then 1500 Hz are shown in Figure 15c, and each actual sound change is only about one second. material. Figure 15a shows an operation sketch for wood material. When the milling position reaches the start shown on the trajectory of a tool in Figure 15b, the octave frequency is around 1500 Hz; when the milling continues, it will be around 1200 Hz. The experiment was repeated 10 times. The alternating sound changes between 1200 Hz then 1500 Hz are shown in Figure 15c, and each actual sound change is only about one second. Under the wood material, it can be seen in Figure 16 that when the milling machine drills a straight line and a right angle, the sound frequency changes significantly. When encountering a turning pitch, the frequency is considerably higher, about 1500 (Hz), while the linear frequency is stable at about 1200 (Hz). There are apparent divisions because the straight-line distance is longer, the drilling time is also longer, so the data obtained are relatively high.

•
Simulation result with Styrofoam material. For experiments on the Styrofoam material, the shape that will be formed by CNC milling is the S shape such as in the operation sketch in Figure 17a. When the tool started in the trajectory of a tool such as that in Figure 17b, the frequency of the milling process in Figure 17c is around 1495-1505 Hz. For the detection performed on the Styrofoam material, it records sound when performing the track without a load, so there is no distension signal for the Styrofoam material. Styrofoam is relatively soft compared to other materials. In Figure 18 shows the sound frequency is relatively unchanged. When nothing is milling, the frequency is natu- For experiments on the Styrofoam material, the shape that will be formed by CNC milling is the S shape such as in the operation sketch in Figure 17a. When the tool started in the trajectory of a tool such as that in Figure 17b, the frequency of the milling process in Figure 17c is around 1495-1505 Hz. For the detection performed on the Styrofoam material, it records sound when performing the track without a load, so there is no distension signal for the Styrofoam material. Styrofoam is relatively soft compared to other materials. In Figure 18 shows the sound frequency is relatively unchanged. When nothing is milling, the frequency is naturally 0, and the Styrofoam sound frequency will fall in the range of 1495~1505 (Hz), and the neatest and clear division can be seen from the grouping.

•
Simulation result with plastic material.  Figure 19a shows an operation sketch for plastic material when the milling started the process shown on the trajectory of a tool in Figure 19b. When milling touches the material's surface, the frequency is around 1495-1499 Hz, and when the milling process rotates, it forms a circle and the endpoint hole is 1501-1503 Hz, as shown in Figure 19c. In plastic material, it can be seen in Figure 20, the frequency graph that the values are too close. Therefore, the cluster centers may be too close to each other, resulting in too many iterations and unstable results. However, there was a phenomenon in the past; the maximum number of iterations is set to 100, so the result of 100 iterations is the final result.

Results for Example if an Error Occurs
The results for the example if an error occurs are obtained using one of the samples from the six videos, namely wood, in this experiment. We will combine the wood video as signal and "Do" sound as noise to prove the effectiveness of this monitoring system shown in the figure 21.   Figure 19a shows an operation sketch for plastic material when the milling started the process shown on the trajectory of a tool in Figure 19b. When milling touches the material's surface, the frequency is around 1495-1499 Hz, and when the milling process rotates, it forms a circle and the endpoint hole is 1501-1503 Hz, as shown in Figure 19c. In plastic material, it can be seen in Figure 20, the frequency graph that the values are too close. Therefore, the cluster centers may be too close to each other, resulting in too many iterations and unstable results. However, there was a phenomenon in the past; the maximum number of iterations is set to 100, so the result of 100 iterations is the final result.

Results for Example if an Error Occurs
The results for the example if an error occurs are obtained using one of the samples from the six videos, namely wood, in this experiment. We will combine the wood video as signal and "Do" sound as noise to prove the effectiveness of this monitoring system shown in the figure 21.  Figure 15a shows an operation sketch for wood material. When the milling position reaches the start shown on the trajectory of a tool in Figure 15b, the octave frequency is around 1500 Hz; when the milling continues, it will be around 1200 Hz. The experiment was repeated 10 times. The alternating sound changes between 1200 Hz then 1500 Hz are shown in Figure 15c, and each actual sound change is only about one second.
Under the wood material, it can be seen in Figure 16 that when the milling machine drills a straight line and a right angle, the sound frequency changes significantly. When encountering a turning pitch, the frequency is considerably higher, about 1500 (Hz), while the linear frequency is stable at about 1200 (Hz). There are apparent divisions because the straight-line distance is longer, the drilling time is also longer, so the data obtained are relatively high.

•
Simulation result with Styrofoam material.
For experiments on the Styrofoam material, the shape that will be formed by CNC milling is the S shape such as in the operation sketch in Figure 17a. When the tool started in the trajectory of a tool such as that in Figure 17b, the frequency of the milling process in Figure 17c is around 1495-1505 Hz. For the detection performed on the Styrofoam material, it records sound when performing the track without a load, so there is no distension signal for the Styrofoam material.
Styrofoam is relatively soft compared to other materials. In Figure 18 shows the sound frequency is relatively unchanged. When nothing is milling, the frequency is naturally 0, and the Styrofoam sound frequency will fall in the range of 1495~1505 (Hz), and the neatest and clear division can be seen from the grouping.

•
Simulation result with plastic material. Figure 19a shows an operation sketch for plastic material when the milling started the process shown on the trajectory of a tool in Figure 19b. When milling touches the material's surface, the frequency is around 1495-1499 Hz, and when the milling process rotates, it forms a circle and the endpoint hole is 1501-1503 Hz, as shown in Figure 19c.
In plastic material, it can be seen in Figure 20, the frequency graph that the values are too close. Therefore, the cluster centers may be too close to each other, resulting in too many iterations and unstable results. However, there was a phenomenon in the past; the maximum number of iterations is set to 100, so the result of 100 iterations is the final result.

Results for Example if an Error Occurs
The results for the example if an error occurs are obtained using one of the samples from the six videos, namely wood, in this experiment. We will combine the wood video as signal and "Do" sound as noise to prove the effectiveness of this monitoring system shown in the Figure 21. As seen in the left picture, when there is a sound difference during the sound detection monitoring process, the result of the frequency that appears on the monitor does not match the sound rhythm when it is normal. So, we can find out by monitoring if there is a difference in the spectrum during the milling process on a CNC.

Conclusions
This study uses a sound detection program in LabVIEW as system integration. The experiment was carried out on the tone "Do Re Mi Fa Sol" to prove that the program was running well and obtained the same and stable frequency range for the calibration.
The conclusions are based on the results of real-time testing and the simulation of six sound videos of the CNC milling process with operation mode XY, XZ, XYZ axes and three different materials, namely wood, Styrofoam, and plastic.
The result of operation mode for the XY axes when milling leads to shaping at corners (X); a frequency of around 1170 Hz is obtained. When milling continues, the unidirectional process (Y) produces a frequency of 1157 Hz. For the XZ axes, when the cutting position reaches the high position (X), the octave 1200-1350 Hz frequency will go down, and the low position (Y) will go up to the frequency of 1458-1560 Hz. For the XYZ axes, when the milling touched the material's surface, the frequency obtained was around 1220 Hz, and it reached the final point at 1450-1470 Hz.
The yield of different wood materials when the milling position reaches the start, the octave frequency is near 1500 Hz. As the milling continues, the frequency is near 1200 Hz. In the Styrofoam material, the result is in the form of a frequency near 1495-1505 Hz. For plastic material, when the milling touches the material's surface, the frequency is close to 1495-1499 Hz, and when the milling process turns around to form a circle, the endpoint hole is 1501-1503 Hz.
In this test, it was found that the sound detection program was running well and when clustered using the K-means algorithm, the results were appropriate. Additionally, if there was a change in sound during the milling process or signal constraints, the oper- As seen in the left picture, when there is a sound difference during the sound detection monitoring process, the result of the frequency that appears on the monitor does not match the sound rhythm when it is normal. So, we can find out by monitoring if there is a difference in the spectrum during the milling process on a CNC.

Conclusions
This study uses a sound detection program in LabVIEW as system integration. The experiment was carried out on the tone "Do Re Mi Fa Sol" to prove that the program was running well and obtained the same and stable frequency range for the calibration.
The conclusions are based on the results of real-time testing and the simulation of six sound videos of the CNC milling process with operation mode XY, XZ, XYZ axes and three different materials, namely wood, Styrofoam, and plastic.
The result of operation mode for the XY axes when milling leads to shaping at corners (X); a frequency of around 1170 Hz is obtained. When milling continues, the unidirectional process (Y) produces a frequency of 1157 Hz. For the XZ axes, when the cutting position reaches the high position (X), the octave 1200-1350 Hz frequency will go down, and the low position (Y) will go up to the frequency of 1458-1560 Hz. For the XYZ axes, when the milling touched the material's surface, the frequency obtained was around 1220 Hz, and it reached the final point at 1450-1470 Hz.
The yield of different wood materials when the milling position reaches the start, the octave frequency is near 1500 Hz. As the milling continues, the frequency is near 1200 Hz. In the Styrofoam material, the result is in the form of a frequency near 1495-1505 Hz. For plastic material, when the milling touches the material's surface, the frequency is close to 1495-1499 Hz, and when the milling process turns around to form a circle, the endpoint hole is 1501-1503 Hz.
In this test, it was found that the sound detection program was running well and when clustered using the K-means algorithm, the results were appropriate. Additionally, if there was a change in sound during the milling process or signal constraints, the operating point was linked to resonance frequency and amplitude to monitor the CNC production process in real time, so that if there is an error or vibration outside the process that occurs, it can be monitored. This system can be applied to various types of CNC milling processes, which work well for process data.
For further research, after reading several reference journals [41][42][43][44], it is possible to make an alarm notification during the milling process. If an error occurs during the milling process, it will be notified via an alarm, and this research can be continued by combining artificial intelligence to monitor more than one machines for one operator.