Introduction

With the rise of technological innovation and the industrial revolution, Additive Manufacturing (AM, also called 3D printing) technology has entered a period of rapid development and becomes a symbol of the third industrial revolution. In recent years, many countries around the world have put a lot of effort to promote the development of the 3D printing industry, and already made great breakthroughs in this field. Additive Manufacturing, with the advantages of rapid prototyping and free manufacturing, is the significant character of 3D printing. This production mode will be an important trend of global manufacturing transformation.

Fused deposition modeling (FDM) is one of the main techniques in additive manufacturing. It has been widely used for its lower cost and better reliability. There are three steps in the production process. Firstly, three-dimensional design software is used to create the theoretical model, which will then be converted into an STL file, the standard document format for rapid prototyping. Secondly, one chooses appropriate printing process parameters, such as layer thickness, extruder diameter, base plate and extruder temperature, printing speed and extrusion speed. Then three-dimensional model slicing software is used to generate G-code, which can be understood and executed by a 3D printing machine. Lastly, when the temperature of the nozzle reaches the preset value, an autonomous building will take place layer by layer with the movement of the nozzle and work plate. From this point of view, it can be found that the manufacturing quality of the parts is affected by a variety of factors. Low and inconsistent geometric accuracy is a major issue of FDM. The dimensional inaccuracy of FDM parts can be attributed to model error and processing error sources. The model error refers to the staircase effect that occurs in the process of slicing. Processing error sources include material phase change, extruder positioning error, and other variations (Wang et al. 2017a, b). Therefore, defect detection and quality control of the fused deposition modeling process is necessary. Wu et al. (2016) used acoustic emission techniques to monitor the FDM process, and effectively identified the failure mode of material breakage or depletion and extruder clogging. Yoon et al. (2014) and He et al. (2017) developed a prognostics and health management approach to the 3D printer health monitoring, using acoustic emission sensor and piezoelectric strain sensor. Wang et al. (2006) built a real-time remote monitoring system for FDM. Fang et al. (1998) proposed FDM prototype internal defect detection method using image processing technology. Many scholars have also studied the optimization of process parameters, because layer thickness, temperature, speed and other process parameters have a great impact on the part quality (Garg et al. 2014; Thorsten et al. 2014; Mohamed et al. 2016; Sbriglia et al. 2016; Sood et al. 2011; Luo et al. 2016). Rao et al. (2015) used multi-sensor to monitor the manufacturing process and studied the influence on the surface roughness of the parameters, such as material extrusion speed, layer thickness, and extruder temperature. Some researchers studied the method of reducing the model error by adapting the layer thickness and optimizing the STL model (Pandey et al. 2003; Siraskar et al. 2015; Zha and Anand 2015). Some scholars have also studied the compensation of shape deviations. Tong et al. (2003, 2008) propose a parametric error model, which models the repeatable errors of stereo lithography appearance (SLA) machine and FDM machine with generic parametric error functions. Huang and his research team have been dedicated to developing a predictive model of geometric deviations that can learn from the deviation information obtained from a certain number of tested product shapes (Huang et al. 2014a, b, 2015; Kusiak et al. 2008; Xu et al. 2013). Geometric accuracy is one of the most important indicators of FDM product quality. However, there is lack of studies on monitoring geometric error of the product in the FDM process.

Statistical process control (SPC) methods are widely used to monitor quality characteristics of manufacturing processes, which can quickly detect out-of-control conditions. This paper presents an approach to monitoring the geometry quality of FDM parts using SPC method. Traditional SPC techniques are mainly applicable to the conditions where the quality of the product is represented by key product characteristics (KPCs) or a small number of sampling data. However, 3D printing is generally used to build parts with complex structure, so the KPCs of the products may lose a lot of important information, which results in the inadequate fault detection capability. The choice of KPCs is mainly up to the limitation of measurement technologies years ago. Nowadays with the advanced measurement and sensing technology, it is no longer difficult to collect a huge number of samples in real time. Machine vision has recently emerged as a measuring technology that can rapidly provide such information. Therefore, it is necessary to develop SPC methods to handle these large data sets.

Profile-monitoring techniques transform point clouds into linear profiles that can be monitored by well-established univariate or multivariate control charts. Profile monitoring is applied to the situation that quality characteristics are not dependent on a single variable but functionally dependent on two or more variables. At present, some scholars study on profile monitoring techniques and apply it to the analysis and optimization of the complex manufacturing process. Kusiak et al. (2008) adopted parametric and non-parametric models to monitor the turbine performance which was captured with a power curve constructed using historical wind turbine data. Long et al. (2015) proposed a wind power curve profile monitoring method based on multivariate and residual approaches to identify the turbines with weakened power generation performance. Kang and Albin (2000) put forward a quality control method of semiconductor manufacturing process based on the linear relationship between pressure and the rate of flow. Woodall et al. (2004) and Woodall (2007) gave a broad review of current research on profile monitoring and suggested that the monitoring of the linear profile can be replaced by monitoring linear regression parameters using univariate or multivariate control charts. The estimated regression parameters include the slope, y-intercept and the variance of the errors. He et al. (2017) used control charts in Enhancing the monitoring of 3D scanned manufactured parts and achieved an ideal effect. Xiong et al. (2014) used a neural network to predict the geometry of rapid manufacturing and got an ideal result. Woodall et al. (2004) also pointed out that the research on monitoring product shapes using profile control chart is valuable because the shape is usually an important quality characteristic. Therefore, in this paper profile monitoring technology is applied to detect the geometric quality of FDM products basing on large image data.

In the following sections, a machine vision system is provided to capture the entire product geometry information during the fused deposition modeling process. A border signature method is adopted to analyze the geometrical deviation from nominal of the parts and to generate contour error point cloud data. Afterwards, to take advantage of the huge number of sample points, Quantile–Quantile (Q–Q) method is used to transform the huge sample to a linear profile, which can be monitored by well-established profile charting techniques. Then, two EWMA control charts are used to monitor the quality of fused deposition modeling process. Finally, laboratory experiments are conducted to demonstrate the effectiveness and applicability of the proposed approach.

Geometric deviation of the fused deposition modeling parts

The geometric feature of FDM parts is an important aspect of quality evaluation. In current practice, the control of dimensional accuracy remains a major issue for application of FDM in direct manufacturing. Different from subtractive techniques that are used in traditional manufacturing processes, FDM is a class of additive manufacturing technique that forms part’s surface geometry layer by layer by joining of materials. Therefore, in the manufacturing process, the geometrical deviation of each layer could affect the whole part quality. In this section, the geometrical deviation is inspected by comparing the profile of manufactured parts with their corresponding design (CAD) profile.

Profile detection using image processing technology

With the development of computer and sensing technology, machine vision is widely used in non-contact measurement, which makes it possible to collect a huge number of samples intelligently and automatically during the manufacturing process. In this paper, CCD camera is used to capture pictures of each layer of the part, by which the measurement of the profile will not be limited by its complex structure. The composition of the machine vision detection system is given in Fig. 1, mainly including the hardware system and software system. Accordingly, an image acquisition system is established and shown in Fig. 2. In the first place, CCD camera will transform the optical signal of the part on the work plate into an analog current signal, which will then be converted into digital image information by an image acquisition card. After that, a computer is used to store the information and obtain the profile data.

Fig. 1
figure 1

The composition of the machine vision detection system

Fig. 2
figure 2

Illustration of the image acquisition system

The profile presents the geometric information of the manufactured parts. To obtain the profile of each layer, the following image processing stages are necessary, which are illustrated in Fig. 3.

Stage 1 ( image preprocessing ) At this stage, preprocessing techniques are used to obtain valid part images and improve image quality, including image cropping, smoothing, sharpening and enhancement techniques.

Stage 2 ( image segmentation ) The main work at this stage is to identify the target image from the original image and segment it from the background. Threshold segmentation method is used to transform the grayscale into a binary image. Threshold segmentation method is as follows. Assuming that f(xy) is a grayscale image after extracting the component map, and T is selected as the gray threshold. The image after segmentation is given by:

$$\begin{aligned} g(x,y)= \quad \left\{ \begin{array}{l} 1, f(x,y)>T \\ \\ 0, f(x,y)\le T \\ \end{array}\right. \end{aligned}$$
(1)

Stage 3 ( profile extraction ) At this stage, a boundary tracking technique is used to extract the part profile and to obtain the position coordinates of each point of the profile, prior to which the morphological operation and image filling steps need to be done.

Fig. 3
figure 3

Illustration of the image processing process

Geometry deviation analysis based on border signature method

After given the two-dimensional profile consisting of pixels, the entire geometry of each layer of the manufactured part can be obtained. As mentioned earlier, to detect the part’s dimensional deviation from nominal, the comparison between these as-built profiles and their corresponding design (CAD) models should be made. Traditionally, the method of the fitting parametric function is often used to characterize the profile and calculate profile error. However, it is difficult and even impossible to have an accurate function for a complex profile. To deal with the problem, this paper proposes to transform the profiles into a function about distance and angle using the border signature method. This method is applicable to both simple and complex shapes (Li et al. 2012). It analyzes the deviation from nominal more conveniently and accurately. Figure 4 shows the representation of geometry deviation analysis based on the border signature method.

Fig. 4
figure 4

Deviations from nominal analysis based on border signature method. a The X–Y coordinate representation of boundary pixels of the part. b The polar coordinate representation of boundary pixels of each layer. c Geometry deviation representation under the d\(\theta \) coordinate

Since the relative position of printed layers is fixed, this paper establishes a polar coordinate system with reference to the first layer. As shown in Fig. 4a, the center point of the first layer profile, \(O(X_0 ,Y_0 )\), is selected as the origin, and \(\theta \) denotes the angle, ddenotes the radius, and z denotes the layer height in the polar coordinate system. Then each of the other layers is projected in this polar coordinate system. We assume that Fig. 4b is the projection relationship between layer 1 and layer i (i = 2,3,...), while the dashed represents the ideal design profile. Therefore, at an angle \(\theta \)\((-180{^\circ }< \theta _{}< 180{^{\circ }}\)), the actual profile point on layer i (i = 1, 2,...) is \(P_{i }(z_{i,} d_{i,} \theta )\), while the point on the ideal profile is \(P'(z_{i,} d',\theta )\). At this point, the geometric deviation of each layer of the part can be characterized by the radius difference between the corresponding points on the ideal profile and actual profile at the same angle.

Calculating the angles and radius of every boundary pixel of each layer, and taking the angle as the horizontal axis, radius as the vertical axis, plotting them in plane Cartesian coordinates. The illustration is shown in Fig. 4c. Thus, the profile error of layer i at angle \(\theta \)\((-180{^{\circ }}< \theta < 180{^{\circ }})\) can be calculated by:

$$\begin{aligned} \textit{error}_i (\theta )=d^{\prime }(\theta )-d_i (\theta ) \end{aligned}$$
(2)

where \(\mathrm{d}^{\prime }\)(\(\theta \)) denotes radius of the ideal profile at an angle \(\theta \), and \(d_{i}(\theta )\) denoting radius of the actual profile layer i at angle \( \theta \).

Based on the analysis above, obtaining the profile error point cloud data of each layer of the printed part, which can be noted as:

$$\begin{aligned} \textit{error}_i ={\{}{} \textit{error}_i (\theta _1 ),\textit{error}_i (\theta _2),\ldots ,\textit{error}_i (\theta _j),\ldots {\}} \end{aligned}$$
(3)

where i denotes layer number, i=1,2,..., and \(-180{^{\circ }}<\theta _{ j}{} { \le }180{^{\circ }}\).

Noted that the image information collected by machine vision system is represented in units of pixels. To obtain the physical size of the measured part, CCD dimension calibration needs to be conducted. To simplify the computation, one needs to avoid the effects of translation, torsion, and lens distortion as much as possible. Then the pixel equivalent can be given by a constant:

$$\begin{aligned} d=\frac{L}{N}\,\mathrm{(mm\,pixel^{-1})} \end{aligned}$$
(4)

where N is the total number of pixels corresponding to the physical length L (mm).

Statistical process monitoring of FDM part geometry quality

As mentioned earlier, it is impossible to express a complex shape with an exact parameter model. Thereby a geometry description method based on border signature is used to detect the distribution of deviations from nominal, which is a discrete function with angles and distances as variables. However, such a distribution of deviations only provides the information of a single layer rather than monitoring the layer-to-layer variation, which is important for fused deposition modeling process quality control. In this section, this paper proposes to apply profile-monitoring techniques to the quality control of fused deposition modeling process.

Q–Q method for monitoring profile error point cloud data

As can be learned from Eq. (3), a distribution of deviations from nominal may consist of huge profile sample data. The illustration of profile error point cloud data of one layer can be shown in Fig. 5.

The profile points on each layer can be measured at a fast rate by the machine vision system. To monitor the process using such rich data, we’d better not use the summary statistics of the sample, because the out-of-control data would be averaged out and buried in the huge sample (Wang and Tsung 2005). To deal with such a problem, they proposed a Q–Q method to transform this situation into a profile monitoring problem, which played a good effect in a data-rich manufacturing environment (Wang and Tsung 2005; Wells et al. 2012).

Fig. 5
figure 5

Illustration of profile error point cloud data

Quantile–Quantile (Q–Q) plot is a graphical method to check the goodness of fit. It provides a powerful method for visualizing distributional data and helps practitioners check whether the two sample sets come from the same population (NIST/SEMATECH 2003), which is generated by plotting the quantiles of the first data set against the quantiles of the second data set.

If the second data set is fixed as the reference, the Q–Q plot can compare the distributional differences between many data sets by one-by-one comparison with the reference. A linear trend will be observed once the reference data set and the compared dataset follow the same distribution (Wang and Tsung 2005).

During a fused deposition modeling process, distribution of deviations from nominal of each layer is regarded as a sample data set. When the manufacturing process is only affected by random factors, that is, the process is in a controlled state, the distribution of each sample will be very similar. On the other side, when a shift in the process occurs, the distribution of out-of-control sample data will less resemble the reference in-control distribution (Wells et al. 2012). Therefore, an in-control layer’s deviation distribution is set as the reference first. And then the following layers are compared to the reference by drawing their Q–Q plot. Afterwards, the least-squares method is used to estimate the parameters of the fitted line for each Q–Q plot, including slope k and y-intercept b parameters.

Profile monitoring using control charts techniques

Process parameters (mean and variance) are the key to statistical process control. The main goal of phase I is to obtain an accurate estimation of the process parameters. One important work is to check whether the historical sample data are collected from the in-control process, and to remove the out-of-control data. After that, the target value of the process parameters is estimated from the in-control historical observations.

In this paper, linear profile monitoring based on Q–Q method is applied in SPC of 3D printing process.

The targeted sample data here is the profile point error data set (distribution of deviations from nominal) of the printed layer \(i (i = \)1,2,...):

$$\begin{aligned} \textit{error}_i =\{\textit{error}_i (\theta _1 ),\textit{error}_i (\theta _2 ),\ldots ,\textit{error}_i (\theta _j ),\ldots \} \end{aligned}$$

It is assumed that an in-control layer profile point error data set is:

$$\begin{aligned} \textit{error}_0 =\{\textit{error}_0 (\theta _1 ),\textit{error}_0 (\theta _2 ),\ldots ,\textit{error}_0 (\theta _j ),\ldots \} \end{aligned}$$

which is fixed as the reference. Then the Q–Q plots are generated by plotting the quantiles of error\(_{i}\) (i = 1,2,...) and against the quantiles of error\(_{0.}\)

Each of the Q–Q plots can be fitted with a linear regression model using least squares method, and parameters of the linear profile include slope and y-intercept:

$$\begin{aligned} y_i =b_i +k_i x,i = 1,2,\ldots \end{aligned}$$
(5)

where \(y_{i}\) and x represent the ith layer observation and the reference distribution respectively, and \(k_i \)and\( b_{i}\) are the regression coefficients of the ith layer observation.

Table 1 Summary of parameters of simulation
Fig. 6
figure 6

Out-of-control ARL for: a global mean shift, b global variance shift, c localized mean shift, d localized variance shift introduced in the simulation process

Fig. 7
figure 7

The printed models, where model 1, 2 are nominal parts with different shapes, and model 3, 4, 5 are defective parts with different types of variation

Table 2 Basic parameters of the printed models

Suppose that there are n groups of historical sample data available for process parameters estimation. Denote \(\mu _k \) and \(\mu _b \) as the mean value of slope k and y- intercept b, \(\sigma _k \)and \(\sigma _b \) as the standard deviation value of slope k and y-intercept b, respectively.

Then the process parameters can be easily calculated by

$$\begin{aligned} \mu _k= & {} \frac{\sum _{i=1}^n {k_i } }{n}, \sigma _k =\sqrt{\frac{\sum \limits _{i=1}^n {(k_i \hbox {-}\mu _k )^{2}}}{n}}\nonumber \\ \mu _b= & {} \frac{\sum \limits _{i=1}^n {b_i } }{n}, \sigma _b =\sqrt{\frac{\sum \limits _{i=1}^n {(b_i } \hbox {-}\mu _b )^{2}}{n}} \end{aligned}$$
(6)
Fig. 8
figure 8

Details of image processing and deviation calculation

The main job in phase II is designing control chart and monitoring the modeling process state. When an out-of-control alarm occurs, practitioners need to check and adjust the process promptly.

The EWMA control chart was well used in detecting small shift of the monitoring process. In addition, the EWMA statistic removes the uncontrol-label noise based on combining information from all previous observations through a smoothing parameter. Kim et al. (2003) proposed EWMA control chart methods for linear profile process monitoring. The validity of the EWMA method was verified by Wang et al. (2017a) and Wells et al. (2012).

Table 3 Basic experimental parameters
Fig. 9
figure 9

Geometric shape and its representation based on border signature, for: a the ideal profile, b the actual as-built profile

Fig. 10
figure 10

Visualization of the profile error curve at the range of [−180\(^{\circ }\), 180\(^{\circ }\)]

Fig. 11
figure 11

The Q–Q plot and its fitting, where (a), (c), (e) are the linear models of non-defective layers and (b), (d), (f) are the linear models of defective layers

In this paper, two EWMA control charts are used to monitor the parameters of the linear profile (slope k and y-intercept b). The recursive relations and control limits are given by

$$\begin{aligned} \left\{ \begin{array}{lll} E_k (i) = \lambda k_i +(1-\lambda )E_k (i-1) \\ CL_k = \mu _k \pm w\sigma _k \sqrt{\frac{\lambda }{1\hbox {-}\lambda }} \\ \end{array}\right. \end{aligned}$$
(7)
$$\begin{aligned} \left\{ \begin{array}{lll} E_b (i)=\lambda b_i +(1-\lambda )E_b (i-1) \\ CL_b =\mu _b \pm w\sigma _b \sqrt{\frac{\lambda }{1\hbox {-}\lambda }}\\ \end{array}\right. \end{aligned}$$
(8)

where\(E_k (i)\)and\(E_b (0)\)are the EWMA statistics for the ith observation tailored to slope k, y-intercept b, respectively; \(CL_K \)and\(CL_b \)are the control limits of the two EWMA control charts; \(\lambda \)is the smoothing parameter of EWMA control chart, and wis the design parameter of the control chart. What’s more, \(E_k (0)\) is taken as \(\mu _k \), and \(E_b (0)\) is taken as \(\mu _b \).

Fig. 12
figure 12

The linear models from the three in-control layers and one of each of the defective models

Table 4 Process parameters of the slope \((k_{i})\) and y-intercept \((b_{i})\)
Table 5 Control limits of the slope (\(k_{i})\) and y-intercept (\(b_{i})\)
Fig. 13
figure 13

EWMA control charts in phase II for: a the slope of model 1. by-intercept of model 1. c the slope of model 2. dy-intercept of model 2. e the slope of model 3. fy-intercept of model 3. g the slope of model 4. hy-intercept of model 4. i the slope of model 5. jy-intercept of model 5

Experimental studies

The effectiveness of the approach for monitoring the Q–Q plot has been verified by Wells et al. (2012), using Monte Carlo simulations. In that simulation, 10,000 in-control observations (parts geometrical deviations from nominal) were simulated and each observation includes 1000 sampling points that independently follow the standard normal distribution. Process parameters and the control charts design parameters under ARL = 200 are shown in Table 1.

Afterwards, global and localized shifts were introduced to the mean and variance of the process respectively. For that situation, the sampling points would be followed the distribution \(N(\delta _\mu ,(1+\delta _\sigma )^{2})\). The out-of-control ARLs of each case were shown in Fig. 6, from which we can see the detecting performance of this method.

In this section, the proposed method was applied to monitor practical fused deposition modeling process and to detect the geometrical deformations of the manufactured parts. In the course of this experiment, two normal parts with different shape and three defective parts with different detection mode were printed to emulate the in-control and out-of-control states of fused deposition modeling process, as shown in Fig. 7. The deformation modes include shift-variation, step-variation, and trend-variation, which are the typical defects of fused deposition modeling parts. The basic parameters of the printed 3D models are shown in Table 2.

In this paper, these models were printed by a Flash Cast Creator 3D printer. During the fused deposition modeling process, image data of as-built part was collected by a version MVC13000F-M00 CCD image sensor, which was connected with a computer system. Table 3 shows the basic experimental parameters.

Afterwards, image processing technologies were used to obtain the geometric features of each layer of the part. MATLAB software was used to calculate the layer’s deviations from nominal based on border signature method. Details are provided in Fig. 8.

Theoretically, each model will be sliced into 100 layers so 100 observations can be obtained. Taking one layer of model 1 as example, the border signature result is shown in Fig. 9, and the profile error curve is given in Fig. 10 after calculating the error between theoretical and practical values at each angle \(\theta \).

As is shown in Fig. 9, the center of the geometric figure was selected as the origin, represented by a red dot. The horizontal axis represents angle values, while the vertical axis represents distance. Pixel equivalent is about \(0.13\,\mathrm{mm\,pixel^{-1}}\) in this experiment. It can be seen from Fig. 10 that, in the case of normal printing, the contour random error is within the normal range of [−0.5, 0.5 mm]. During the printing process, the phase change of the material and the accuracy of the machine are the main causes of errors. Note that, ideally the smaller sampling angle interval is, the more accurately profile information can be represented. In the study, the sampling angle interval was set to \(1{^{\circ }}\). In other applications, the position of sampling points can be different depending on the desired minimum fault size to be detected.

In this study, what need to be inspected and monitored are the data sets (distributions of deviations from nominal) that obtained from previous steps. For each of the models, one of the nominal layers’ sample data was selected as the reference at first. Afterwards, the linear profile model was obtained by creating Q–Q plots of each of the remaining layers’ deviation data versus the reference data. Figure 11 shows several Q–Q plots and their corresponding linear regression model, where the lines (a), (c), (e) are the linear models of the non-defective layer and (b), (d), (f) are the linear models of defective layers. Furthermore, Fig. 12 shows these linear models from the three in-control layers and one of each of the defective models. It can be seen that the linear model of the defective layers has obviously changed.

Multivariate EWMA control charts are used to monitor the parameters (slope and y-intercept) of the linear model, so as to monitor the quality of the products during FDM process. In this experiment, 40 of normal layers were chosen at random as the historical observations. In phase I analysis, Shewhart-type I-MR control chart is used to check whether the historical observations are in control. Then the process parameters (mean and standard deviation) of each of profile monitoring parameters (the slope and y-intercept) are evaluated using Eq. (6). The process parameters are given in Table 4.

After given the target value of process parameters, the important work in phase II is to monitor the variations using control chart techniques. In this paper, two individual EWMA control charts are established to monitor the slope and y-intercept, respectively. Control limits and monitoring statistics are calculated according to Eqs. (7) and (8). The control limits of each chart are given in Table 5. Figure 13 shows the EWMA control charts in phase II.

Figure 13a–d show the control charts for normal cylindrical model 1 and normal polygon model 2, respectively. From the figures it can be seen that several observations of both the slope and y-intercept are out of control, which can be attributed to the warpage deformation caused by uneven work plate and heat conduction at the beginning of the manufacturing process. However, other observation values of the nominal parts are within control limits. Figure 13e–j show the control charts for defective models 3, 4 and 5, respectively. The figures show that at least one of the control charts can successfully detect the out-of-control condition.

Conclusions

The methodology of analysis of geometric manufacturing errors and quality control in the process of FDM is researched in this paper. The result shows that the machine vision based non-contact measure method can overcome the shortcomings of traditional measure methods like CMM that can only get the key quality features and can only measure after the manufacturing process is finished. In this way, the complete geometry information of manufacturing process can be obtained in time. In the profile based statistical quality control every layer is monitored so the whole process of FDM is under control. In this paper five models are designed. Three are designed separately with defects of dislocation, staircase and gradual change. The other two are normal parts with different shapes. The experiments show that with the method the abnormities can be found effectively. When defect occurs, it can be located in the part body and the corresponding error information can be obtained in time.