In-Situ Monitoring and Diagnosing for Fused Filament Fabrication Process Based on Vibration Sensors

Fused filament fabrication (FFF) is one of the most widely used additive manufacturing (AM) technologies and it has great potential in fabricating prototypes with complex geometry. For high quality manufacturing, monitoring the products in real time is as important as maintaining the FFF machine in the normal state. This paper introduces an approach that is based on the vibration sensors and data-driven methods for in-situ monitoring and diagnosing the FFF process. The least squares support vector machine (LS-SVM) algorithm has been applied for identifying the normal and filament jam states of the FFF machine, besides fault diagnosis in real time. The identification accuracy for the case studies explored here using LS-SVM is greater than 90%. Furthermore, to ensure the product quality during the FFF process, the back-propagation neural network (BPNN) algorithm has been used to monitor and diagnose the quality defects, as well as the warpage and material stack caused by abnormal leakage for the products in-situ. The diagnosis accuracy for the case studies explored here using BPNN is greater than 95%. Results from the experiments show that the proposed approach can accurately recognize the machine failures and quality defects during the FFF process, thus effectively assuring the product quality.


Introduction
The fused filament fabrication (FFF) technique is a generic additive manufacturing (AM) technology [1][2][3][4] for thermoplastic materials and has been increasingly used in various fields like aerospace and healthcare [5,6]. The FFF process provides great flexibility in fabricating a three-dimensional (3D) part with complex geometry at a relatively low cost. However, qualifying these parts is challenging due to the open-loop control of the FFF process. There is an urgent need to develop an advanced monitoring and closed-loop quality control methods for monitoring the FFF process [3,7].
The studies on the states of the FFF machine mainly focus on the plugged nozzle, broken or depleted filament, and driving belt fracture. Wu et al. [8,9] developed an AE monitoring method based quantitative and qualitative model. The effectiveness of the proposed method was demonstrated by simulation studies and experimental data. Ertay et al. [31] presented an integrated methodology to control the tangential path velocity, material deposition rate, and extruder temperature, the experiment results showed that the material was deposited more uniformly at sharp curvatures and the dimensional accuracy of printed parts was improved. Anderegg et al. [32] introduced a novel FFF nozzle that achieved in-situ monitoring. The flow temperature and pressure during extrusion, as well as a number of important insights into the printing process, were provided by the novel nozzle, which are vital for improving FFF printed parts. Go et al. [33] studied the FFF build rate, which was influenced by three main modules of FFF systems (the material extrusion, material heating, and positioning modules), suggesting that significant enhancements in FFF build rate with targeted quality specifications were possible via mutual improvements to the extrusion and heating mechanism along with high-speed motion systems.
To handle the large amount of data from sensors, data-driven methods are used owing to its flexibility in modeling, fast processing of prediction, and consideration of defect formation mechanisms [34]. The data driven methods used in-situ monitoring and diagnosing during the FFF process contains K-means [11], SVM [8,10], HSMM [9], compressive sensing [13], unsupervised density-based clustering method [11], and so on. In this paper, two data driven methods-the least squares support vector machine (LS-SVM) and the back-propagation neural network (BPNN) model-are introduced for in-situ monitoring and diagnosing during the FFF process.
The monitoring systems mentioned previously focused on the use of sensors. However, there are issues when carrying out the monitoring with these systems. Firstly, the multiple sensors used in diagnosing single defect for FFF process are costly. Secondly, very few sensors can precisely monitor and recognize both machine states and product quality during the FFF process. Further, the correlation between the defects and the variation in the information corresponding to various defect formations is hitherto unclear.
To solve the above issues, a simple and effective approach based on vibration sensors is introduced for in-situ monitoring and diagnosing the machine state and product quality during the FFF process. For recognizing the states of FFF machine, there are three features: the root mean square (RMS), crest factor (CF), and Kurtosis index (KI). These features are extracted from the acceleration data of the build platform. The normal and filament jam states are identified by the LS-SVM and SVM models, respectively. For predicting the product quality during the FFF process, the acceleration data of four channels from both the extruder and build platforms are collected, and RMS, mean, and standard deviation (STD) are applied. The normal, warpage, and material stack are recognized with the help of the BPNN model. The proposed approach can potentially serve as a diagnostic and prognostic tool during the FFF process.

Methodology and Experimental Setup
The methodology and the experimental setup proposed in this study are detailed in this section and the corresponding flowchart is shown in Figure 1. The basic steps for in-situ monitoring and diagnosing for the FFF process are as follows: (1) experiment setup, (2) vibration signal preprocessing, (3) training process, and (4) testing process. In step 1, the experiment system has been established by the FFF machine, vibration sensors, data acquisition (DAQ) device, and desktop computer. In step 2, the signals are collected and the features are selected. In steps 3 and 4, both the machine state and product quality are monitored and diagnosed with data driven models.

Experimental Setup
The established system consists of the FFF machine, vibration sensors, DAQ system, and a desktop computer, as shown in Figure 2. The FFF machine used in this study is Markforged Two, a high-performance fiber composite FFF machine made by Markforged, (Watertown, MA, USA). The vibration signals are collected by two piezoelectric vibration sensors made by Endevco (Sunnyvale, CA, USA). One vibration sensor (7251A-500, single channel) with 500 mV/g output has been mounted on the build platform and the other (65-10, three channels) with 10 mV/g output is attached on the extruder. The signals are processed by a DAQ card, NI 9234 and a compact DAQ chassis, NI cDAQ-9174 made by National Instruments (NI), (Austin, TX, USA). The real time signals can be processed by a digital signal processing module on the laptop. The laptop used is Thinkpad T460p made by Lenovo and the signal processing software here is LabVIEW 2014. All data training and testing process is performed in a MATLAB environment. The specification of the FFF process in this paper is listed in Table 1. The Onyx in Table 1 is nylon mixed with chopped carbon fiber, which offers a high-strength thermoplastic with excellent heat resistance, surface finish, and chemical resistance, the heat deflection temperature of Onyx is 145 °C . The filling feed rate is 40 mm/s, the outer contour feed speed is 30 mm/s, and the inner contour rate is 18 mm/s. All of the three feed rates are calculated by dividing distance by time.

Experimental Setup
The established system consists of the FFF machine, vibration sensors, DAQ system, and a desktop computer, as shown in Figure 2. The FFF machine used in this study is Markforged Two, a high-performance fiber composite FFF machine made by Markforged, (Watertown, MA, USA). The vibration signals are collected by two piezoelectric vibration sensors made by Endevco (Sunnyvale, CA, USA). One vibration sensor (7251A-500, single channel) with 500 mV/g output has been mounted on the build platform and the other (65-10, three channels) with 10 mV/g output is attached on the extruder. The signals are processed by a DAQ card, NI 9234 and a compact DAQ chassis, NI cDAQ-9174 made by National Instruments (NI), (Austin, TX, USA). The real time signals can be processed by a digital signal processing module on the laptop. The laptop used is Thinkpad T460p made by Lenovo and the signal processing software here is LabVIEW 2014. All data training and testing process is performed in a MATLAB environment. The specification of the FFF process in this paper is listed in Table 1. The Onyx in Table 1 is nylon mixed with chopped carbon fiber, which offers a high-strength thermoplastic with excellent heat resistance, surface finish, and chemical resistance, the heat deflection temperature of Onyx is 145 • C. The filling feed rate is 40 mm/s, the outer contour feed speed is 30 mm/s, and the inner contour rate is 18 mm/s. All of the three feed rates are calculated by dividing distance by time.

Vibration Signal Preprocessing
To obtain satisfactory results from the analyzing vibration signal, three factors need to be considered in practice.
Firstly, the quality of the signal is very important. Good signal acquisition accounts for more than 70% of success [35]. To improve the quality of the signals and ensure the repeatability of the results, mature and stable products are selected for the equipment listed in this paper, such as the FFF machine, vibration sensors, and DAQ system. The dimensions of the specimens used in this paper are according to ISO 178 [36].
Secondly, it is important to determine the right sampling rate for digitizing the vibration signal. The sample rate should be large enough to cover maximum useful information. According to the Nyquist theorem, the sampling frequency should be at least twice the maximum frequency present in the vibration signal. Nevertheless, excessive sampling rate may increase the cost of computation. Hence a sampling rate of 2.5 KHz has been used in the experiments to balance the information integrity with the computational efficiency.
Thirdly, to distinguish different operating states during FFF printing, the extracted features should be highly sensitive to operating conditions instead of being insensitive to noises. In this work, five commonly used features in time-domain signal, including mean, STD, RMS, CF, and KI have been introduced. For a vibration signal, ( ) x n , let N, u , and σ denote the value of length, mean, and STD, respectively. Then RMS, CF, and KI can be expressed as follows.

Vibration Signal Preprocessing
To obtain satisfactory results from the analyzing vibration signal, three factors need to be considered in practice.
Firstly, the quality of the signal is very important. Good signal acquisition accounts for more than 70% of success [35]. To improve the quality of the signals and ensure the repeatability of the results, mature and stable products are selected for the equipment listed in this paper, such as the FFF machine, vibration sensors, and DAQ system. The dimensions of the specimens used in this paper are according to ISO 178 [36].
Secondly, it is important to determine the right sampling rate for digitizing the vibration signal. The sample rate should be large enough to cover maximum useful information. According to the Nyquist theorem, the sampling frequency should be at least twice the maximum frequency present in the vibration signal. Nevertheless, excessive sampling rate may increase the cost of computation. Hence a sampling rate of 2.5 KHz has been used in the experiments to balance the information integrity with the computational efficiency.
Thirdly, to distinguish different operating states during FFF printing, the extracted features should be highly sensitive to operating conditions instead of being insensitive to noises. In this work, five commonly used features in time-domain signal, including mean, STD, RMS, CF, and KI have been introduced. For a vibration signal, x(n), let N, u, and σ denote the value of length, mean, and STD, respectively. Then RMS, CF, and KI can be expressed as follows.

•
RMS is proportional to the energy contents of the signal in time domain, whose changes might signify the change of the 3D printer operating states, or it can be related to product defects.
• CF is the ratio of peak-to-valley value to the RMS value of the vibration signal and elucidates any outcome present in the vibration signal [37].
• KI is the fourth standardized moment, which measures the degree of "peakiness" of a distribution compared to a normal distribution. Here, KI can be used as an indicator to measure the degree of vibration signal amplitude [37,38].

In-Situ Monitoring and Diagnosing for the FFF Machine Based on LS-SVM
In this experiment, we studied filament jam, one of typical failure states of the FFF machine. In its normal state, the spring supports the drive wheels, which aligns the filament and the coaxial connector in a line (see Figure 3a). Once the spring fatigues the drive wheels sink, which leads to the friction force between filament and the coaxial connector increasing. Then the failure mode, i.e., the filament jam, is generated (see Figure 3b). The worn coaxial connector is shown in Figure 3c and the fatigued spring is shown in Figure 3d. From Figure 3d, we can learn that the length of normal spring is 17.0 mm, while the fatigued spring in this experiment is 16.1 mm. The specimen (∅12 mm × 30 mm) have been designed with CATIA V5 and then transformed into STL files. The specimen built in the normal state is shown in Figure 3e, while the specimen in Figure 3f has been built in filament jam state.
The vibration sensor attached on the build platform has been used to diagnose the filament jam mode, considering that the filament jam easily causes the motor to be out of step, and the abnormal vibration that the FFF machine generates, including the build platform. In addition, the filament jam mode makes the mount of the filament for the extruder decrease, which reduces the force between the extruder and the building part. Then the amplitude of the build platform decreases accordingly.
In this paper, the normal and filament jam states are identified and recognized by the LS-SVM algorithm [39]. LS-SVM, like SVM [40], is based on the margin maximization principle, which performs structural risk minimization. LS-SVMs are closely related to regularization networks and Gaussian processes, but additionally emphasize and exploit primal-dual interpretations [41,42]. SVM has been adopted to identify the FFF machine conditions and it achieves good results [8,10]. However, the computational cost of SVM is high due to the constrained optimization programming [42], especially when the data is very large. In comparison to SVM, LS-SVM requires only the solution to a convex linear problem (a quadratic problem in SVM), which simplifies the solution of Lagrange multipliers and reduces the computational cost [43]. In view of this, the LS-SVM has been introduced for in-situ monitoring and diagnosing for the FFF machine.
The process of in-situ monitoring and diagnosing for FFF machine is given below ( Figure 1). Firstly, the acceleration signals of the built platform are collected from the vibration sensor. Then, the off-line study is implemented. To improve the accuracy of recognition, the efficient features that are highly sensitive to the operating states of the FFF machine are selected. Subsequent to the features selection, LS-SVM with the radial basis function (RBF) kernel is used to classify the normal and abnormal states, and the classification results are compared with SVM. Lastly, online testing data are used to demonstrate the performance of the LS-SVM model.
In this experiment, we studied filament jam, one of typical failure states of the FFF machine. In its normal state, the spring supports the drive wheels, which aligns the filament and the coaxial connector in a line (see Figure 3a). Once the spring fatigues the drive wheels sink, which leads to the friction force between filament and the coaxial connector increasing. Then the failure mode, i.e., the filament jam, is generated (see Figure 3b). The worn coaxial connector is shown in Figure 3c and the fatigued spring is shown in Figure 3d. From Figure 3d, we can learn that the length of normal spring is 17.0 mm, while the fatigued spring in this experiment is 16.1 mm. The specimen (⌀12 mm × 30 mm) have been designed with CATIA V5 and then transformed into STL files. The specimen built in the normal state is shown in Figure 3e, while the specimen in Figure 3f has been built in filament jam state.

In-Situ Monitoring and Diagnosing for Product Quality Using the BPNN Model
In the FFF process, the product quality depends on two fundamental parameters: the strength of the filament extruded by the heated nozzle and the strength of each of the extruded filament bonds in horizontal and vertical directions [44]. Generally, the strengths of extruded filaments and their mutual bonding are affected by the state of the FFF machine. However, quality defects may appear even when the FFF machine runs normally. The defects of the production are still generated because of the inaccurate adjustments of printer settings, chamber temperature abnormality, or the vibration induced by the external excitations. Warpage and abnormal leakage are two typical production defects.
Warpage reduces the vibration strength of the build platform and the influences of the frictional forces between the extruder and specimen. The defect of the warpage has been developed by the residual strains or due to the stresses caused by the non-uniform thermal gradients [45], Abnormal leakage leads to material stack on the specimen, which causes abnormal vibration for the extruder and build platform. Abnormal leakage can be caused by the prolonged heating of the extruder or the degradation of the composites due to moisture. The specimen size is 80 mm × 10 mm × 4 mm and its geometric models have been designed according to the ISO 178. The reason to choose the specimen is that the warpage is easily discovered compared to other parts we used. As for Markforged Two (the FFF machine used in this experiment), the temperature and feed rate cannot be modified by users.
After repetitious experiments, we find that when the fill rate is 100% and layer thickness is 0.2 mm, the warpage could occur. To identify the warpage and abnormal leakage, both the vibration sensors mounted on the build platform and extruder are used (see Figure 1). In this experiment, fault injection method is introduced for the abnormal leakage (see Figure 4c), and the length of the material stack caused by abnormal leakage is about 5 mm. Warpage is shown in Figure 4b   BPNN [46] is a network that utilizes the errors, owing to the discrepancy between the predicted outputs, desired outputs, and gradient descent, which realize the modifications for the connection weight. The modification for the connection weight of the network is targeted for minimizing errors. The fact that a single hidden layer BP network can approximate any measurable function arbitrarily has been proven in [47], wherein a larger number of hidden neurons brings a higher capability in approximating the complex relationships. However, having a larger number of hidden neurons is not necessarily desirable since two drawbacks will appear as the number grows [48]. The first one is overfitting, where once the prediction is outside the training domain, the results differ more significantly. The second is an increase in the computation burden. More unknown parameters need to be optimized if the number of hidden neurons grow, which may significantly increase the computational cost.
The process of in-situ monitoring and diagnosing for product quality during the FFF process is shown in Figure 1. Firstly, the vibration signals are collected and features extracted. The acceleration signals of extruder and built platform are collected. Before the features are extracted, the dimensions of signals are reduced and the synthetic acceleration (SA) is calculated. Then, during the training process, the efficient features that are highly sensitive to the defects are selected for building the product during 3D printing. The BPNN model are trained to identify the defects of building parts with the selected features. The k-fold cross validation (k-CV) method has been proposed to help determine the optimized number of hidden neurons and avoid overfitting to certain extent. Lastly, the trained BPNN model is used to predict the defects of building parts during the FFF process.

Results and Discussion
Experimental results during the FFF process have been analyzed in this section. In Section 3.1, the failure state and filament jam are diagnosed based on the LS-SVM model. In Section 3.2, the detection of the two common defects, warpage and abnormal leakage, using the BPNN model are detailed.

Signal Processing and Feature Extracted
The acceleration signals of the build platform have been collected using mounted vibration sensors ( Figure 2). Further, the specimens built in this experiment have been shown in Figure 3. Before extracting features, the length of data cells has been initially determined. The data cell should contain the basic working conditions to maximally cover the signal information. The basic working BPNN [46] is a network that utilizes the errors, owing to the discrepancy between the predicted outputs, desired outputs, and gradient descent, which realize the modifications for the connection weight. The modification for the connection weight of the network is targeted for minimizing errors. The fact that a single hidden layer BP network can approximate any measurable function arbitrarily has been proven in [47], wherein a larger number of hidden neurons brings a higher capability in approximating the complex relationships. However, having a larger number of hidden neurons is not necessarily desirable since two drawbacks will appear as the number grows [48]. The first one is overfitting, where once the prediction is outside the training domain, the results differ more significantly. The second is an increase in the computation burden. More unknown parameters need to be optimized if the number of hidden neurons grow, which may significantly increase the computational cost.
The process of in-situ monitoring and diagnosing for product quality during the FFF process is shown in Figure 1. Firstly, the vibration signals are collected and features extracted. The acceleration signals of extruder and built platform are collected. Before the features are extracted, the dimensions of signals are reduced and the synthetic acceleration (SA) is calculated. Then, during the training process, the efficient features that are highly sensitive to the defects are selected for building the product during 3D printing. The BPNN model are trained to identify the defects of building parts with the selected features. The k-fold cross validation (k-CV) method has been proposed to help determine the optimized number of hidden neurons and avoid overfitting to certain extent. Lastly, the trained BPNN model is used to predict the defects of building parts during the FFF process.

Results and Discussion
Experimental results during the FFF process have been analyzed in this section. In Section 3.1, the failure state and filament jam are diagnosed based on the LS-SVM model. In Section 3.2, the detection of the two common defects, warpage and abnormal leakage, using the BPNN model are detailed.

Signal Processing and Feature Extracted
The acceleration signals of the build platform have been collected using mounted vibration sensors ( Figure 2). Further, the specimens built in this experiment have been shown in Figure 3. Before extracting features, the length of data cells has been initially determined. The data cell should contain the basic working conditions to maximally cover the signal information. The basic working conditions have been illustrated in Figure 5. The odd-layer printing process contains two basic working conditions: contour and 45-degree filling (see Figure 5a) The contour and 135-degree filling are contained in the even-layer printing process (see Figure 5a). Therefore, there are three basic working conditions in the FFF process, viz., contour, 45-degree filling, and 135-degree filling. To cover these conditions, a data cell has been set as a continuum between the odd-layer and even-layer data regions (see Figure 5b). The vibration signals for both the normal and the filament jam states have been recorded, which is shown in Figure 5b, where the upper signal represents the normal state whereas the lower one represents the filament jam state. conditions have been illustrated in Figure 5. The odd-layer printing process contains two basic working conditions: contour and 45-degree filling (see Figure 5a) The contour and 135-degree filling are contained in the even-layer printing process (see Figure 5a). Therefore, there are three basic working conditions in the FFF process, viz., contour, 45-degree filling, and 135-degree filling. To cover these conditions, a data cell has been set as a continuum between the odd-layer and even-layer data regions (see Figure 5b). The vibration signals for both the normal and the filament jam states have been recorded, which is shown in Figure 5b, where the upper signal represents the normal state whereas the lower one represents the filament jam state. The signal for filament jam has more abrupt changes and smaller amplitude in comparison with the normal state signal of the build platform. Both the CF and KI can be used as the indicators for measuring the degree of abrupt changes, whereas RMS can reflect the energy contents of the signal. In this perspective, the RMS, CF, and KI are selected as the features.
The two categories of specimens have been built by the FFF machine in normal and filament jam states. For each specimen, there are almost 360 million data collected in 25 min. The total layers for each of the specimen are 150. The first 100 layers are set as the training group, while the data from layer 101 to 140 are set as the testing group. The number of data cells in the training group are 50 and the number in testing group is 20. Each cell has one 45-degree filling, one 135-degree filling and two contours. The values of RMS, CF, and KI for the training data are shown as Figure 6. In each panel of Figure 6, the red lines represent the faulty state, whereas the green lines represent the normal state. The panels in the first column of Figure 6 is for 45-degree filling, the middle column for 135-degree filling, and the last column for contour.
To determine whether there are differences in the values of RMS, CF, and KI for normal and filament jam states, a one-way analysis of variance (ANOVA) followed with a Tukey HSD test at the 0.05 probability level is conducted to identify significant differences among the filling and contour conditions. The signal for filament jam has more abrupt changes and smaller amplitude in comparison with the normal state signal of the build platform. Both the CF and KI can be used as the indicators for measuring the degree of abrupt changes, whereas RMS can reflect the energy contents of the signal. In this perspective, the RMS, CF, and KI are selected as the features.
The two categories of specimens have been built by the FFF machine in normal and filament jam states. For each specimen, there are almost 360 million data collected in 25 min. The total layers for each of the specimen are 150. The first 100 layers are set as the training group, while the data from layer 101 to 140 are set as the testing group. The number of data cells in the training group are 50 and the number in testing group is 20. Each cell has one 45-degree filling, one 135-degree filling and two contours. The values of RMS, CF, and KI for the training data are shown as Figure 6. In each panel of Figure 6, the red lines represent the faulty state, whereas the green lines represent the normal state. The panels in the first column of Figure 6 is for 45-degree filling, the middle column for 135-degree filling, and the last column for contour.
To determine whether there are differences in the values of RMS, CF, and KI for normal and filament jam states, a one-way analysis of variance (ANOVA) followed with a Tukey HSD test at the 0.05 probability level is conducted to identify significant differences among the filling and contour conditions.
In Table 2, the mean and STD values of RMS, CF, and KI for normal and filament jam states are calculated. For 45-degree filling and 135-degree filling conditions, the mean values of RMS, CF, and KI in normal state are smaller than that in filament jam state, so do the STD values. For contour conditions, except that the mean value of RMS in normal state is bigger than that in filament jam state, both mean and STD values in normal state are smaller than that in filament jam state. These results are in accord with the abrupt changes of the signals for filament jam state. The p-values (p ≤ 0.5, which is considered significant) of all pairs for normal and filament states in Table 2 are nearly zero, which means that the mean values of RMS, CF, and KI for normal and filament jam states are significantly different across normal and filament states. In Table 2, the mean and STD values of RMS, CF, and KI for normal and filament jam states are calculated. For 45-degree filling and 135-degree filling conditions, the mean values of RMS, CF, and KI in normal state are smaller than that in filament jam state, so do the STD values. For contour conditions, except that the mean value of RMS in normal state is bigger than that in filament jam state, both mean and STD values in normal state are smaller than that in filament jam state. These results are in accord with the abrupt changes of the signals for filament jam state. The p-values ( ≤ 0.5, which is considered significant) of all pairs for normal and filament states in Table 2 are nearly zero, which means that the mean values of RMS, CF, and KI for normal and filament jam states are significantly different across normal and filament states.

Filament Jam Diagnosis Based on LS-SVM
Following the extraction of features, both SVM and LS-SVM are applied for the state identification. The effect of the penalty parameter C in SVM and the regularization parameter γ in LS-SVM is similar, thus determining the trade-off between the fitting error minimization and smoothness. Considering the ability of nonlinear classification, the RBF has been chosen as the kernel function [48,49]: where, σ 2 is the bandwidth that controls the scaling ratio.
Here, a grid search is employed to determine the value of the parameters C, γ and σ. The value of C and γ has been selected as five and the value of σ as two. To avoid the over-fitting problem, K-fold cross-validation method has been introduced to test the SVM and LS-SVM models, and the value of k is ten.
The results of the state identification for the training group using SVM and LS-SVM, respectively, have been shown in Table 3. To the 45-degree filling, the results from the CF and KI are better than that of the RMS. Nevertheless, the accuracy in using SVM and LS-SVM are nearly the same, except the RMS whose results using LS-SVM has been more accurate (82% > 80%). To the 135-degree filling, the CF and KI also have better performance than the RMS, and the accuracy of the RMS (81%) and KI (99%) using LS-SVM is higher than SVM (80% and 98%). To contour, the RMS performs better than the CF and KI, and the result of the CF (73%) using LS-SVM is more accurate. From the above analysis, we find that LS-SVM performs better than SVM and the results of the 45-degree and 135-degree fillings are more accurate than that of the contour. Considering the improved performance, the LS-SVM model has been used for in-situ monitoring and diagnosing for the FFF machine. In general, this single feature reflects less information in comparison with the multiple features. To improve the accuracy of the fault diagnosis, the RMS, CF, and KI are together taken as inputs for the LS-SVM model. The results of state identification for training group and testing group are shown in Table 4. The calculations of the 45-degree filling, 135-degree filling, and contour for the training group are 100%, 99%, and 81%, respectively. Comparing the results in Tables 3 and 4, the LS-SVM model with multiple inputs is more accurate than the model with a single input. Using the training model, the results of 45-degree filling, 135-degree filling, and the contour, for testing the group are 97.5%, 97.5%, and 91.25%, respectively. The results of the prediction are shown in Figure 7. The green markers represent the cells from the training set and the red markers represent cells from the testing set. The circles represent the cells from normal state and the stars represent the cells from the filament jam state. The results of the 45-degree filling are shown in Figure 7a, whereas the results of the 135-degree filling are shown in Figure 7b, beside the markers circled by black circles, which represent mis-predicted points.

Signal Processing and Feature Extracted
To diagnose the defects of the building products during the FFF process, the acceleration signals are collected from the two installed vibration sensors as shown in Figure 2. There are four signal channels: one is from the sensor mounted on the build platform and the other three are from the sensors attached to the extruder. The examples of the four-channel signals are shown in Figure 8. The three columns in Figure 8 denote the signal of normal, warpage (defect 1), and material stack specimens caused by the abnormal leakage (defect 2), respectively. The first three rows (Figure 8a-i) display the vibration signals of the extruder in the x, y, and z directions, respectively, and the fourth row (Figure 8j-l) is the signals in the z-direction for the build platform.
The synthetic acceleration (SA) has been employed to reduce the computational complexity. When compared with the uniaxial acceleration (UA), the SA can reveal more information. The SA is defined as: = ( ( )) + ( ( )) , = 1, 2, 3, . . . , where is the SA for the extruder, , , and are the UA of x, y and z directions for the extruder respectively, ∈ {1, 2, 3, . . . , } is the data number, is the UA of z-direction for build platform, and is the SA for , , , and . The comparison between the SA signals of the normal and abnormal specimens are shown in Figure 8m-o. The SA signal for material stack has smallest amplitude in the three SA signals, whereas the SA signal for warpage has the biggest amplitude. Therefore, the features closely relate to the mean, STD, and RMS can be used as the candidates. In this experiment, the mean, STD, and RMS are selected as the features.
Considering the fill style for building the specimens as shown in Figure 8, the length of the data cell (marked by the yellow zone in Figure 8p) has been determined as the two round-trips of the

Signal Processing and Feature Extracted
To diagnose the defects of the building products during the FFF process, the acceleration signals are collected from the two installed vibration sensors as shown in Figure 2. There are four signal channels: one is from the sensor mounted on the build platform and the other three are from the sensors attached to the extruder. The examples of the four-channel signals are shown in Figure 8. The three columns in Figure 8 denote the signal of normal, warpage (defect 1), and material stack specimens caused by the abnormal leakage (defect 2), respectively. The first three rows (Figure 8a-i) display the vibration signals of the extruder in the x, y, and z directions, respectively, and the fourth row (Figure 8j-l) is the signals in the z-direction for the build platform.
The synthetic acceleration (SA) has been employed to reduce the computational complexity. When compared with the uniaxial acceleration (UA), the SA can reveal more information. The SA is defined as: where a Ei is the SA for the extruder, a x Ei , a y Ei , and a z Ei are the UA of x, y and z directions for the extruder respectively, i ∈ {1, 2, 3, . . . , n} is the data number, a Bi is the UA of z-direction for build platform, and a i is the SA for a x Ei , a y Ei , a z Ei , and a Bi . The comparison between the SA signals of the normal and abnormal specimens are shown in Figure 8m-o. The SA signal for material stack has smallest amplitude in the three SA signals, whereas the SA signal for warpage has the biggest amplitude. Therefore, the features closely relate to the mean, STD, and RMS can be used as the candidates. In this experiment, the mean, STD, and RMS are selected as the features.
Considering the fill style for building the specimens as shown in Figure 8, the length of the data cell (marked by the yellow zone in Figure 8p) has been determined as the two round-trips of the extruder, whereas there are 1120 data elements in a cell. The step length used in this experiment is set as one round-trip with 560 data elements in a step. extruder, whereas there are 1120 data elements in a cell. The step length used in this experiment is set as one round-trip with 560 data elements in a step.

Multi-State Identification Based on BPNN
In this section, the BPNN model for a single hidden layer is selected to monitor and diagnose the quality defects. Three data groups are used in the training process. The first group is for the normal specimens where 90 data cells are obtained from 110,000 data elements. The second group is for the warpage specimens where 50 data cells are obtained from 60,000 data elements. The third group is for the material stack specimens caused by abnormal leakage, where 60 data cells are obtained from 70,000 data elements. To ensure the effectiveness and credibility of the defect identification, all the data used here are collected from Layer 10 (a total of 20 layers).
The k-CV method has been introduced to help determine the number of hidden neurons for the BPNN and to avoid overfitting to a certain extent. The inputs of BPNN model contain the mean, STD, and RMS. The outputs of BPNN model contains the normal, warpage, and material stack, and the output format is shown in Table 5. Here, the value of k in k-CV is set as 10 and the number of hidden neurons has been determined as four after cross-validation. Three data groups are used in the testing process. The first group is for the normal specimens where 45 data cells are obtained from 55,000 data elements. The second group is for the warpage specimens where 25 data cells are obtained from 30,000 data elements. The third group is for the material stack specimens caused by abnormal leakage where 30 data cells are obtained from 35,000 data elements.

Multi-State Identification Based on BPNN
In this section, the BPNN model for a single hidden layer is selected to monitor and diagnose the quality defects. Three data groups are used in the training process. The first group is for the normal specimens where 90 data cells are obtained from 110,000 data elements. The second group is for the warpage specimens where 50 data cells are obtained from 60,000 data elements. The third group is for the material stack specimens caused by abnormal leakage, where 60 data cells are obtained from 70,000 data elements. To ensure the effectiveness and credibility of the defect identification, all the data used here are collected from Layer 10 (a total of 20 layers).
The k-CV method has been introduced to help determine the number of hidden neurons for the BPNN and to avoid overfitting to a certain extent. The inputs of BPNN model contain the mean, STD, and RMS. The outputs of BPNN model contains the normal, warpage, and material stack, and the output format is shown in Table 5. Here, the value of k in k-CV is set as 10 and the number of hidden neurons has been determined as four after cross-validation. Three data groups are used in the testing process. The first group is for the normal specimens where 45 data cells are obtained from 55,000 data elements. The second group is for the warpage specimens where 25 data cells are obtained from 30,000 data elements. The third group is for the material stack specimens caused by abnormal leakage where 30 data cells are obtained from 35,000 data elements.
The results from the comparison for the SA and UAs are shown in Table 6. For the first data group, the accuracy rate for the SA is 95.56%, which is equal to the results for the z-axis acceleration for extruder, but better than the results (84.4%, 93.3%, and 93.3%) for the other three UAs. For the second data group, the accuracy rate for the SA is 96%, which is better than the results (84%, 68%, 72%, and 80%) for the four UAs. For the third data group, the accuracy rate for SA is 100%, which is equal to the results for extruder z-axis acceleration, but better than the results (96.67%, 93.3%, and 93.3%) for the other three UAs. For the total of three data groups, the accuracy rate for the SA is 97%, which is better than the results (88%, 87%, 91%, and 90%) for the four UAs. Considering the results in Table 6, the BPNN model with SA performs better than that with UAs. The predicted results using the BPNN model with SA is shown in Figure 9: defects 1 represents the material stack caused by abnormal leakage and defects 2 for the warpage. The markers circled by black circles are mis-predicted points. Figure 9 shows that the warpage markers are closer to normal markers, which implies that the degree of vibration for normal and warpage are nearly the same. The results from the comparison for the SA and UAs are shown in Table 6. For the first data group, the accuracy rate for the SA is 95.56%, which is equal to the results for the z-axis acceleration for extruder, but better than the results (84.4%, 93.3%, and 93.3%) for the other three UAs. For the second data group, the accuracy rate for the SA is 96%, which is better than the results (84%, 68%, 72%, and 80%) for the four UAs. For the third data group, the accuracy rate for SA is 100%, which is equal to the results for extruder z-axis acceleration, but better than the results (96.67%, 93.3%, and 93.3%) for the other three UAs. For the total of three data groups, the accuracy rate for the SA is 97%, which is better than the results (88%, 87%, 91%, and 90%) for the four UAs. Considering the results in Table 6, the BPNN model with SA performs better than that with UAs. The predicted results using the BPNN model with SA is shown in Figure 9: defects 1 represents the material stack caused by abnormal leakage and defects 2 for the warpage. The markers circled by black circles are mis-predicted points. Figure 9 shows that the warpage markers are closer to normal markers, which implies that the degree of vibration for normal and warpage are nearly the same. Figure 9. The predicted results for SA, where the green markers represent cells from the training set and the red markers represent the cells from the testing set. The stars, circles, and triangles represent the cells from the normal state, warpage, and material stack. The markers circled by black circles are mis-predicted.

Conclusions
In this paper, an approach based on the vibration sensors and data-driven methods has been introduced for in-situ monitoring and diagnosing during the FFF process. Both machine states and production quality are monitored for the sake of high product quality.

Conclusions
In this paper, an approach based on the vibration sensors and data-driven methods has been introduced for in-situ monitoring and diagnosing during the FFF process. Both machine states and production quality are monitored for the sake of high product quality.
The normal and filament jam states are effectively recognized by both SVM and LS-SVM, while LS-SVM achieves better performance. The LS-SVM model with multiple inputs is more accurate than the model with a single input. Using the training model, the testing results of 45-degree filling, 135-degree filling, and the contour, for testing the group are 97.5%, 97.5%, and 91.25%.
The normal, warpage and material stack are predicted with the help of the BPNN model. Both the UA and SA are used for predicting the defects during the FFF process where SA gets a better accuracy rate than UAs. The predicted results of normal, warpage and Material stack using the BPNN model with the SA are 95.56%, 96%, and 100%.
The study presents a useful method to in-situ monitor and diagnosis for the FFF process. However, limits exist in this study. Firstly, the vibration intensity is strongly affected by the feed rate. Owing to restrict of the close-loop process of the FDM machine used in this work, the feed rate cannot modify. Secondly, warpage and abnormal leakage is indeed found with vibration sensors, but the formation mechanisms for the defects are not researched. Therefore, further investigations will be centered on following areas. Primarily, the FFF machines with open parameters settings are given priority. The filament jam would be further studied with different parameter settings, such as feed rate, extruder temperature, and so on. Secondarily, the residual stress and extruder temperature would be in-situ monitored and studied to find out the formation mechanisms of warpage and abnormal leakage during the FFF process.