In-situ prediction of the spatial surface roughness profile during slot milling

. Quality inspection is traditionally considered non-productive. That is why the manufacturing industries aim to decrease inspection times to a bare minimum without sacrificing part quality. Alongside the implementation of the Industry 4.0 paradigm, data-driven in-situ quality control is a potential enabler for minimizing inspection times. In that, the surface roughness parameter prediction is the subject of a large body of research, but studies on the spatial surface roughness profile prediction are limited. This research contributes to this field by using vibration signals and physics-informed machine learning models for the in-situ prediction of the surface roughness profile. A tri-axial accelerometer mounted on the machine tool spindle is used to capture the vibrations during a slot milling process. For one tool revolution during a stable cut, the observed acceleration in the three axes and the surface roughness profile are periodic. A model is constructed to establish the correlation between the input signals and the spatial surface roughness profile by utilizing a physics-based model of the tool trajectory together with a two-layer feed-forward neural network. Furthermore, the feature engineering of denoised velocities and displacements derived by the numerical integration of the acceleration signals improves the prediction performance with overfitting. The results show a good correlation between the spatial surface roughness and the accelerometer signals.


Motivation
Surface quality is among the most important performance criteria of machined components. Besides optical reasons, machined surfaces significantly affect the friction properties of contact partners in relative motion. As such, the surface roughness is directly connected to energy consumption and wear. About 25 % of the energy losses in modern parts are due to friction. Wear also limits the parts' remaining useful time of life. Since the early 2000s, there has been significant progress in developing data-driven predictive models for metal cutting. The use of Machine Learning (ML) and Artificial Intelligence (AI) in improving manufacturing processes has also drastically increased. One such improvement aspect is data-driven quality prediction, which aims to decrease the time and costs related to machining inspection and quality assurance. Out-of-tolerance surface roughness values result from abnormalities in the machining process, such as worn-out tools, machine tool deterioration, varying cutting parameters, and improper lubrication.

State of the art
Data-driven surface roughness prediction is an industry-relevant and very active research topic. Various researchers have successfully used vibration data measured during the process to predict surface roughness and part quality in general, e.g., during turning [1,2] or the peripheral milling of thin-walled components [3]. LI ET AL. [4] used vibration data to predict roughness but also noise and texture during the machining of nickel alloys. Vishnu et al. [5] implement a data-driven digital twin of a CNC to predict machining quality, including various process parameters, and achieve good accuracy between measured and predicted surface roughness. LIU ET AL. [6] built a data-driven digital twin based on Improved Particle Swarm Optimization-Generalized Regression Neural Networks and accurately predict surface roughness and tool wear. Besides vibration measurement, other non-invasive measurements are researched, e.g., the application of computer vision to predict surface roughness [7]. Also, unconventional machining processes are in the academic and industrial focus. LI ET AL. [8] predict the surface roughness of an extrusion-based additive manufacturing process. ULAS ET AL. [9] study different parameters during electrical discharge machining and predict the final part quality with ML. SIZEMORE ET AL. analyze the high-precision diamond turning of Germanium and Copper using Artificial Neural Networks (ANN) [10]. One recent development is the introduction of physics-informed machine learning (PIML) [11]. WANG ET AL. [12] use such a hybrid approach to predict the quality of high-entropy alloy fabrication in additive manufacturing.

Objective and scope
This study aims at establishing a methodology to correlate the spindle vibrations to the machined surface quality. The goal is to utilize data-driven models in combination with physics-based information on the machining process for robust identification of the spatial roughness profile in slot milling. These hybrid models are known in the literature as PIML models.
In-situ measurements of vibrations are usually not feasible due to the rotation of the tool. In the case of high stiffness tools and spindle units, however, one can assume that the vibrations at the spindle housing correlate with the motion of the tool at the Tool Center Point (TCP). To show the feasibility of the approach, only one type of tool and machining operation was considered. The process parameters lead to stable cutting with low observed forced vibrations. The prediction of surfaces during unstable cutting conditions as well as the extension to new manufacturing processes was out of scope of this paper and is planned as future work.

Methodology
In the first step, experimental data is collected. A slot milling process was chosen, and workpieces of varying heights were machined with varying process parameters. Synchronous to the machining process, the vibrations of the spindle-housing were assessed with a tri-axial accelerometer. The machined surfaces are then cleaned and analyzed in a white-light interferometer and stored in a database for further processing.
In a second step, a subset of the results was selected for the training of the datadriven TCP deflection. The training target was the prediction of the surface pattern within a periodic area of the measured machined surface. The predicted surface pattern for one revolution of the tool was then projected alongside a physics-based calculation of the tool path incorporating the actual measurement data of the accelerometer to predict the three-dimensional surface of the machined part. The fixture used to clamp the Aluminum workpiece is a modular machine vise made up of the HRC59 steel alloy. Due to the low cutting forces produced during Aluminum machining compared to steel, fixture distortion and vibration are considered negligible in this study. The dynamic nature of the workpiece is also assumed to be rigid in this study. The workpiece is of Aluminum grade 6XXX, and the cutting forces required for machining are low compared to steel which is the reason for the material selection. The workpiece is a cuboid with 151 mm in length, a width of 93.5 mm, and a height of 38 mm. The whole setup is depicted in Fig. 1. Design of Experiments. The Design of Experiments (DOE) is based on a full factorial plan varying the spindle speed, the feed per tooth, and the depth of cut. Table 1 shows an overview of the chosen parameters. Given the different levels of the parameters, 48 slots were machined in total. The feed of the slot milling operation is in the X-direction of the machine tool. The machining is performed dry, and a pneumatic system at the front end of the spindle evacuates chips from the cutting area during the cutting process. The same cutting tool has been used for all cuts. After the machining trials, the tool showed no significant wear, so degrading effects were not further studied in this analysis.

Acceleration measurements
A tri-axial accelerometer from the company DYTRAN INSTRUMENTS INC., Chatsworth, California, United States of America, is glued to the spindle housing close to the spindle's front bearing. The sensor has a sensitivity of 11.00 mV/g, 10.26 mV/g, and 10.06 mV/g in the X-Y-Z directions, respectively. The data acquisition unit LMS Test.Lab by SIEMENS PLM SOFTWARE, Leuven, Belgium, samples the signal at 12,800 Hz. The signals are then post-processed by using a low pass filter with a cut-off frequency of 1,200 Hz to remove the higher frequency amplitudes and noise.

Surface measurements
A three-dimensional optical profiler type Zygo NewView 7300 from the company ZYGO CORPORATION, Middlefield, Connecticut, United States of America, is used to capture the texture of the machined surfaces after the completion of the machining trials. Fig. 2 shows the three essential aspects of surface topography, i.e., its form, roughness, and waviness, together with the optical profiler used in this study. The main objective of this research is to predict the change in surface roughness patterns due to the cutting parameter variations. Hence, a sequence of post-processing techniques was applied according to ISO 4287:1997 to extract the roughness profile. Fig. 3 depicts the post-processing. The primary surface of the raw data is obtained by removing the form of the surface with a polynomial curve. The roughness is separated from the waviness by applying high and low pass filters, respectively. A three-dimensional surface topography consists of sections of two-dimensional roughness profiles. In this research, the two-dimensional surface profile along the feed direction at the center of the width of the cut is considered for predictive model construction. During a stable cutting process, the surface roughness patterns are repetitive at a frequency equal to the feed per tooth and one rotation of the tool. Of the 48 experimental slots machined, 21 slots with repeating surface patterns equal to one revolution of the cutting tool were used for the model construction and training. The rest of the surface profiles were reserved as validation data.

3
Physics-informed data-driven surface predictions

Approach
The core assumption of this study is that similar peaks of amplitudes exhibited by the vibration signals, i.e., stable machining conditions, respond to similar surface roughnesses. In the first step, experimental data is collected on various slot milling processes with varying process parameters. The resulting surface roughness is measured on a white-light interferometer and stored in a database. During the cutting, an accelerometer captures the occurring vibrations. In the current setup, it is not possible to precisely synchronize the resulting cutting surface pattern with the acceleration data. Hence, each stable cutting condition with regular acceleration patterns was manually matched to regular surface patterns found close to the given time stamps. The second step is the training of the ML model for the prediction of a cut section of one tool revolution. Therefore, a moving window was used, which convolutes over the measured acceleration data for the prediction of each labeled surface.
In the last step, new acceleration data is used together with a physics-based model of the tool trajectory to generate the revolute cutting pattern. This is achieved by projecting the generated cutting section over a superimposed movement of the cutting tool revolution and feed motion. Eq. (1) displays the equation used for the calculation of the position of the functional point ⃗ , i.e., the predicted section of the cut during time in the X-Y machine tool coordinate system spanned with the unit vectors ⃗ and ⃗ depending on the spindle speed in RPM, the cutting diameter in mm, and the feed in x direction in mm/min. The feed relates to the feed per tooth given in Table  1 via Eq. (2), whereas is the number of teeth.   4 shows the procedure of revoluting a predicted surface section using the tool trajectory. The predicted two-dimensional roughness profile along the center of the width of the cut is split into separate sections equal to one revolution. For a spindle speed of = 5,000 RPM with a feed rate of 500 mm/min, the time frame or the window to separate individual roughness profiles (R1, R2, R3, …, Rn) is 0.012 s. The two-dimensional shapes of separate roughness profiles are revolved using the tool radius 6 mm by consecutively moving the revolve radius (tool radius + R1, R2, R3, ..., Rn) forward in the feed direction. The revolved profiles' minimum Z values are stitched together to form the total roughness topography for the given process data.  5 demonstrates the frequency spectrum of the acceleration in the X, Y, and Zaxis and the roughness magnitude of the stable cut experiments ( = 5,000 RPM, Fr = 1,000 mm/min, DOC = 2 mm). Also, the cutting forces were measured but not used in this study.
The highest peak amplitude occurs at the cutting frequency (83.33 Hz), followed by the tooth hit frequency (166.66 Hz) in the feed direction, i.e., the X-axis, and the Yaxis. Similar trends were observed for all the cutting experiments with repetitive surface roughness patterns. The process data is in the time domain, and the roughness data is relative to the displacement along the feed direction. To construct a predictive model, it is essential to standardize all the data in a single domain. The two-dimensional roughness data in the displacement domain is hence converted into the time domain by dividing the Z-axis displacement by the feed rate (mm/min). This mechanism of constructing the roughness profile is based on homogeneity, assuming that no other influence affects surface roughness in different parts along the width of the cut.

Model training
A feed-forward two-layer neural network with a sigmoid transfer function is used to construct the predictive model. Each layer consists of 10 nodes. One of the goals for the model is to generalize well as it must cover a wide variety of input parameters and predict the response accordingly. The model is trained by using 50% training data, 25% test, and 25% validation data. Data from the external validation represent the process data that are not used in the internal training, testing, and validation of the neural network model but are instead used to check the model's performance on untrained data. Additionally, external validation data was used to check if the model interpolates well enough. Levenberg-Marquardt was selected as the training algorithm [13], with the Mean Squared Error (MSE) of the predicted roughness as the target for the loss function. Fig. 6 shows the convergence of the MSE during the training. It is noted that the model converges very quickly. Also, the train, validation, and testing graphs align very well, indicating that the model does not need to generalize much and consists of training data that is very similar in its nature. Based on the acceleration data, the predictive model had a correlation coefficient 0.58, which is mediocre in terms of its predictive capability. Adding more features during the training is one way to improve the score. However, the extent of the increase is critical, as adding features can also result in less generalization capability of the model. One solution to this problem is careful feature engineering, i.e., the generation of new data via signal processing or transformation from existing data. This study found that the feature engineering of velocity and displacement data by integration of acceleration data provides useful information about the machined roughness variation. A challenge during the integration is the presence of a constant offset, known as the signal's Direct Current (DC) part. A sufficient high pass filter helps to detrend the data in this case. In total, three predictive models were constructed to analyze the impact of feature engineered data on and the model's generalization ability. The process is shown in Fig. 7. Fig. 7. Feature engineering process for the three predictive models. With feature engineering of velocity data, the score has improved by 24.5% to 0.72. Also, adding the displacement data improved the model's correlation further to 0.81, which is an overall increase of 39.7% over the pure accelerationbased model. Fig. 8 shows the models' error histograms. As the training target is to reduce the error between measured and predicted roughness, the model with the lowest value has the widest error distribution and vice-versa.

Results
A set of preciously unused validation data is used to validate the predictive model. The measured surface roughness is compared with the predicted surface roughness. Average surface roughness & , root mean square roughness ' , and kurtosis roughness () are shown to demonstrate the accuracy of the surface topography prediction. Table 2 displays the numeric values. Fig. 9 shows the generated topographies for a qualitative comparison. In general, the achieved prediction capability in all tests is sufficient for the in-situ monitoring of the machined surface roughness during slot milling.

Conclusion and outlook
The prediction of the surface roughness of machined parts is of high importance to the machining industry as it is an essential part of the manufactured parts' quality. In stable cutting conditions, it is possible to use an accelerometer at the spindle housing to gather in-situ information of the vibrations during the manufacturing process. These vibrations can be used to train a ML model for the prediction of two-dimensional surface profiles. By then including a physics-based approach in modeling the tool's motion, the twodimensional surface profiles can be extruded to full three-dimensional surface topographies. As the involved calculations are computationally inexpensive, such an approach can be integrated for the in-situ monitoring of the machined surface quality and can lead to a reduction of time spent in the subsequent quality assurance. Fig. 9. Comparison of measured and predicted surface topographies on previously unseen acceleration measurement data.
One of the major limitations of this study was the consideration of solely stable cutting conditions. At this point, it is unclear how the proposed approach performs on cutting conditions with higher variability or different tools and material combinations. There is also no indicator provided for the extrapolation to less regular cutting signals, and the validity boundaries were not examined. Besides these open issues, future work should consider incorporating a three-dimensional material removal simulation to also cover the reoccurrence of cuts as the cutting edges move over previously machined surfaces during the process as well as the prediction of the surface roughness at extreme positions, e.g., perpendicular to the feed direction.