Mathematical Modeling and Optimization of Fused Filament Fabrication (FFF) Process Parameters for Shape Deviation Control of Polyamide 6 Using Taguchi Method

Fused filament fabrication (FFF) is a layer-by-layer additive manufacturing (AM) process for producing parts. For industries to gain a competitive advantage, reducing product development cycle time is a basic goal. As a result, industries’ attention has turned away from traditional product development processes toward rapid prototyping techniques. Because different process parameters employed in this method significantly impact the quality of FFF manufactured parts, it is essential to optimize FFF process parameters to enhance component quality. The paper presents optimization of fused filament fabrication process parameters to improve the shape deviation such as cylindricity and circularity of 3D printed parts with the Taguchi optimization method. The effect of thickness, infill pattern, number of walls, and layer height was investigated as variable parameters for experiments on cylindricity and circularity. The MarkForged® used Nylon White (PA6) to create the parts. ANOVA and the S/N ratio are also used to evaluate and optimize the influence of chosen factors. As a result, it was concluded that the hexagonal infill pattern, the thickness of 5 mm, wall layer of 2, and a layer height of 1.125 mm were known to be the optimal process parameters for circularity and cylindricity in experiments. Then a linear regression model was created to observe the relationship between the control variables with cylindricity and circularity. The results were confirmed by a confirmation test.


Introduction
In the additive manufacturing process (AM), one of the fast prototyping methods, the CAD model is designed first and then made in 3D. The AM process is a layer-by-layer production process. Other names for this process are layer manufacturing, additive procases, free-form fabrication, and solid free-form fabrication [1]. Three-dimensional printed parts show different properties depending on other AM techniques [2]. Fused deposition modeling (FDM), selective laser melting (SLM), multi-jet modeling (MJM), laminated object manufacturing (LOM), and stereolithography (SLA) and selective laser sintering (SLS) are various additive manufacturing (AM) methods [3][4][5][6][7][8]. Additive manufacturing provides the ability to produce complex geometries that are difficult to produce by conventional methods without complex tooling. The usage of AM technology has risen in recent years. Today, the use of AM method has increased because it reduces post-processing, material wastes, lower costs, creates high customization manufacturing parts, and greatly reduces overall product development [9,10].
Fused filament fabrication (FFF) is the most common process, and it is a 3D printing process that has been extensively investigated to produce metal and thermoplastic structures [11]. Due to less waste of material, high quality, and low manufacturing cost it is a experiments on flatness and circularity. The layer height, work envelope, and orientation were all investigated. The variation in cylindricity was maximum at 90 • orientations, according to the results.
One of the most critical problems in the manufacturing of polymer parts is deformation during the process, which depends on the material's rheological behavior. Also, 3D printing as one of the manufacturing methods is deformed due to the presence of micro voids in the interfaces of the deposited layers and layered structure of the 3D printing. Therefore dimensional stability is an essential factor for the designer. One of the methods to control geometric accuracy and reduce the resulting errors is to optimize the process parameters. In this paper, the cylindricity and the circularity as geometric tolerances of PA6 parts fabricated by FFF with variable parameters such as infill pattern, wall layers, layer height, and thickness were analyzed. The S/N ratios and ANOVA were employed to analyze the significant impacts and find the optimal parameter for minimum cylindricity and circularity simultaneously. Regression model of cylindricity and circularity was developed to predict them and to examine the correlation between different variables, which determines the relationship between each response and process parameters.

Materials and Methods
In this research, the Markforged printer, one of the advanced FFF desktop 3D printers, has been used to 3D print the parts from polyamide 6 ( Figure 1). Nylon White is a commercial material that Markforged Company (Watertown, MA, USA) developed. Nylon 6 or polycaprolactam are other names for polyamide 6 (PA6). It is one of the most widely used polyamides in the world due to its versatility. It also outperforms other polymers such as PLA and ABS in terms of mechanical properties, and the surface quality of PA 6 is excellent. Also, the 3D printer used is capable of printing limited materials such as PA 6, so this material was selected for experiments. As shown in Figure 2 for the experiments, hollow cylindrical parts with a fixed height of 40 mm and inner diameter of 10 mm, but variable outer diameter with the amounts of 20, 30, and 40 mm, were designed by CATIA-V5 software (V5, Dassault Systèmes, Paris, France), and STL files have been exported from it. The parts were printed using thermoplastic (polyamide 6) at a temperature of 273 • C. Table 1 represents the levels, and the process parameters that will be employed in the experiment. In this table the column of thickness shows the difference between the outer and inner diameter, and infill pattern identifies the structure and shape of the material inside of a part. Also, the thickness of each layer of deposited material is given by layer height, and wall layer indicates the thickness of the part's walls. In this printer, some parameters have limitations, for example, for the layer height variable, the numbers 1, 1.125 and 2 can be selected. The selection of these parameters and the selection of different levels of each parameter primarily were performed based on the limitation of the variable parameters of the markforged 3D printer. Selected thicknesses were considered to observe both small and large dimensions of the responses. The number of wall layers was also selected based on the dimensions of the cylinder. Considering the volume required to apply different infill patterns, the number of one wall created an unsuitable surface in the cylinder. Table 2 shows the Taguchi orthogonal array that controls the parameter combinations for each experiment.   The standard modeling software CATIA-V5™ was used for 3D modeling. An STL file is extracted from the designed CAD model. Then, pieces were 3D printed, and all the parts were scanned with a 3D laser scanner named Solutionix D500 (Medit, Seoul, Korea). This professional scanner specializes in scanning small and detailed things and the most complex products. It has a resolution of 0.055 mm and an accuracy of 0.01 mm. Also, the scan speed in this scanner is high because of more powerful engines and enhanced algorithms. The 3D scanner scans the product from multiple angles automatically. A blue light reflects objects and reaches the camera lens, which obtains point-by-point coordinate measurements and geometry of the parts. The STL files were exported from the Solutionix ezScan which controls the Solutionix D500 scanner. The evaluation of shape deviation errors was undertaken with Geomagic ® Control X™ software (based on ASME Y14.5M standard, v2020.1.1, 3D Systems, Research Triangle, SC, USA) by comparing the CAD model whit STL files were exported from Solutionix ezScan™. On the other hand, The STL scanned file must be aligned with CAD using component alignment to obtain con-   The standard modeling software CATIA-V5™ was used for 3D modeling. An STL file is extracted from the designed CAD model. Then, pieces were 3D printed, and all the parts were scanned with a 3D laser scanner named Solutionix D500 (Medit, Seoul, Korea). This professional scanner specializes in scanning small and detailed things and the most complex products. It has a resolution of 0.055 mm and an accuracy of 0.01 mm. Also, the scan speed in this scanner is high because of more powerful engines and enhanced algorithms. The 3D scanner scans the product from multiple angles automatically. A blue light reflects objects and reaches the camera lens, which obtains point-by-point coordinate measurements and geometry of the parts. The STL files were exported from the Solutionix ezScan which controls the Solutionix D500 scanner. The evaluation of shape deviation errors was undertaken with Geomagic ® Control X™ software (based on ASME Y14.5M standard, v2020.1.1, 3D Systems, Research Triangle, SC, USA) by comparing the CAD model whit STL files were exported from Solutionix ezScan™. On the other hand, The STL scanned file must be aligned with CAD using component alignment to obtain con-  The standard modeling software CATIA-V5™ was used for 3D modeling. An STL file is extracted from the designed CAD model. Then, pieces were 3D printed, and all the parts were scanned with a 3D laser scanner named Solutionix D500 (Medit, Seoul, Korea). This professional scanner specializes in scanning small and detailed things and the most complex products. It has a resolution of 0.055 mm and an accuracy of 0.01 mm. Also, the scan speed in this scanner is high because of more powerful engines and enhanced algorithms. The 3D scanner scans the product from multiple angles automatically. A blue light reflects objects and reaches the camera lens, which obtains point-by-point coordinate measurements and geometry of the parts. The STL files were exported from the Solutionix ezScan which controls the Solutionix D500 scanner. The evaluation of shape deviation errors was undertaken with Geomagic ® Control X™ software (based on ASME Y14.5M standard, v2020.1.1, 3D Systems, Research Triangle, SC, USA) by comparing the CAD model whit STL files were exported from Solutionix ezScan™. On the other hand, The STL scanned file must be aligned with CAD using component alignment to obtain consistent results. At least four points of cloud data must be matched to the CAD model during the Polymers 2021, 13, 3697 6 of 17 alignment process. The circularity and cylindricity were evaluated by using the standard ASME Y14. 5M 19,941 The measured values of cylindricity and circularity are shown in Table 3. In Figure 3, each step in the flowchart will be used in the rest of the article.

Analysis of Experimental Data
S/N ratio and ANOVA were used to analyze data from the experiments. Experimental measured data of Table 3 for the cylindricity and circularity were analyzed by using the statistical software MINITAB 19.0 ® (LLC, State College, PA,USA).

Analysis Using S/N Ratio
To analyze the effect of process variables on each response (cylindricity), the S/N ratio was utilized. When the experimental results were presented as S/N ratios, it was discovered that they varied linearly. For the data analysis, out of the different quality characteristics of S/N ratio, the 'smaller is better' was considered. S/N ratio (η) can be obtained by using Equation (1), where MSD stands for mean-square deviation, the average of the data points is indicated by the Y, and Y0 represents the target value, and σ 2 is the variance. Equation (2) calculates the MSD value [30].

Analysis of Experimental Data
S/N ratio and ANOVA were used to analyze data from the experiments. Experimental measured data of Table 3 for the cylindricity and circularity were analyzed by using the statistical software MINITAB 19.0 ® (LLC, State College, PA, USA).

Analysis Using S/N Ratio
To analyze the effect of process variables on each response (cylindricity), the S/N ratio was utilized. When the experimental results were presented as S/N ratios, it was discovered that they varied linearly. For the data analysis, out of the different quality characteristics of S/N ratio, the 'smaller is better' was considered. S/N ratio (η) can be obtained by using Equation (1), where MSD stands for mean-square deviation, the average of the data points is indicated by the Y, and Y 0 represents the target value, and σ 2 is the variance. Equation (2) calculates the MSD value [30].

Response Table for S/N Ratio for Cylindricity and Circularity
These S/N ratios are added for each level of each parameter according to Taguchi's procedures, and then their average is determined. The highest minus the lowest average is the delta statistic and the individual contribution of the parameters (Rank) is shown in Tables 4 and 5.

Mean Affects Plots for S/N Ratios
In Figures 4 and 5, The S/N graphs were used to determine the optimal parameters in the form of average S/N ratios for cylindricity and circularity. As minimization of the output parameters is required, the smaller is better is selected to maximize mathematical expression for the S/N ratio for cylindricity and circularity. In Figures 4A-D and 5A-D correspond to thickness, infill pattern, layer height, and wall layer, respectively. The horizontal axis shows the different levels for each parameter. According to the respective average S/N ratios, all phases of the given graphs show that in the 5 cm thickness, hexagonal infill pattern, 1.125 mm layer height, and two wall layers are the required 3D printing parameters for the best cylindricity and circularity values.

Mean Affects Plots for S/N Ratios
In Figures 4 and 5, The S/N graphs were used to determine the optimal parameters in the form of average S/N ratios for cylindricity and circularity. As minimization of the output parameters is required, the smaller is better is selected to maximize mathematical expression for the S/N ratio for cylindricity and circularity. In Figures 4A-D and 5A-D correspond to thickness, infill pattern, layer height, and wall layer, respectively. The horizontal axis shows the different levels for each parameter. According to the respective average S/N ratios, all phases of the given graphs show that in the 5 cm thickness, hexagonal infill pattern, 1.125 mm layer height, and two wall layers are the required 3D printing parameters for the best cylindricity and circularity values.

Analysis of Variance
The ANOVA method was used to determine the significance and contribution of each process parameter to the response variables. The results are shown in Tables 6 and  7, where DF represents degrees of freedom, and Adj SS shows the adjusted sum of squares and can be calculated as shown in Equation (3) where ηi shows the mean S/N ratio and ηj shows the total mean of S/N ratio and n is total number of experiments. Adj MS is the adjusted mean sum of squares, F-Value and p-Value are the variance of the group means and probability value respectively. p-Value describes the significance level of each parameter, and it can be calculated as shown in the 4, where SSD is sum of squared deviations each process parameter and SST is Total sum of squared deviations [30]. The findings reveal that the F-Value of thickness and infill pattern is greater than the F-Value of the wall layer and layer height. As a result, they have the greatest influence on cylindricity and circularity values.

Analysis of Variance
The ANOVA method was used to determine the significance and contribution of each process parameter to the response variables. The results are shown in Tables 6 and 7, where DF represents degrees of freedom, and Adj SS shows the adjusted sum of squares and can be calculated as shown in Equation (3) where η i shows the mean S/N ratio and η j shows the total mean of S/N ratio and n is total number of experiments. Adj MS is the adjusted mean sum of squares, F-Value and p-Value are the variance of the group means and probability value respectively. p-Value describes the significance level of each parameter, and it can be calculated as shown in the 4, where SS D is sum of squared deviations each process parameter and SS T is Total sum of squared deviations [30]. The findings reveal that the F-Value of thickness and infill pattern is greater than the F-Value of the wall layer and layer height. As a result, they have the greatest influence on cylindricity and circularity values.
s eq ss D s eq ss T (4)

Response Surface Regression Model
Since the Taguchi approach just analyzes the major factors which influence variables, without taking account of the correlation between them, response surface regression was used to determine the relationship between the control variables and response variables for polyamide 6. The purpose of the response surface method is to formulate the response as a function of contributing variables and to discover the best set of factor levels that provides the best response value depending on the research goals.
Constants and predictor coefficients made up the regression model. The linear response surface regression model is represented by Equation (5) [39].
where x i is the process parameter and β is the coefficient to be determined based on the experimental data (β 0 = constant coefficients , β 1 , β 2 , . . . , β j = linear coefficients) and ε describes the measurement error. The response y can be any of the output parameters. Here A, B, C and D are the factors that represent the thickness, infill pattern, layer height and wall layer, respectively. The above empirical model predicts the cylindricity and circularity for any combination of process parameters. The correlation coefficient or R-squared is a statistical measure that represents a dependent variable's proportion of variation and usually is between 0 to 100%. In the preceding model of cylindricity and circularity, the values of R-squared is 86.40% and 84.67%, respectively, which demonstrates that the actual and predicted values have a good correlation.
In a DoE study, response surface plots are extremely beneficial for evaluating the interaction effects between two parameters simultaneously on the responses. The contours of a response surface will be plotted to help visualize the shape of the response surface, and each contour corresponds to a certain response surface height. Response surface plots and contour plots of each two parameter combination on cylindricity (Figures 6 and 7) and circularity (Figures 8 and 9) are plotted when the other two parameters are held constant at their default values, as shown in the upper right area. As is shown in Figures 6 and 7, cylindricity is plotted versus different levels. Contour plots show that cylindricity is minimal at low thickness values and hexagonal infill patterns (B). Similarly, from the interaction plot of the thickness and layer height on cylindricity at low values of thickness and layer height levels, cylindricity is minimum. Also, at low levels of thickness and levels of wall layer, cylindricity is low. Cylindricity is minimum at low layer height levels and hexagonal infill pattern. At low wall layer levels and hexagonal infill pattern, cylindricity is low. Also, cylindricity is minimal in low wall layers and low layer height values. The 3D surface plots show the same combination of process variables.  Contour and surface plots for circularity are shown against various levels in Figures  8 and 9. From the interaction plot of the thickness and infill pattern, low values of the thickness, and hexagonal infill patterns, circularity is low. At lower thickness and layer height levels, circularity is also minimal. Circularity is low at low thickness levels and wall layers values. Circularity is minimal in lower layer height levels and hexagonal infill pattern. Also, lower wall layer levels with a hexagonal infill pattern provide lower circularity. Cylindricity is minimal in low wall layers levels and low layer height values. The 3D contour plots show the same combination of process variables. Contour and surface plots for circularity are shown against various levels in Figures 8 and 9. From the interaction plot of the thickness and infill pattern, low values of the thickness, and hexagonal infill patterns, circularity is low. At lower thickness and layer height levels, circularity is also minimal. Circularity is low at low thickness levels and wall layers values. Circularity is minimal in lower layer height levels and hexagonal infill pattern. Also, lower wall layer levels with a hexagonal infill pattern provide lower circularity. Cylindricity is minimal in low wall layers levels and low layer height values. The 3D contour plots show the same combination of process variables.  Taguchi design was used to create reproducible and valid results to investigate the effect of selected parameters on the geometrical error. This study revealed many unexpected findings. The impact of each is further analyzed by the impact of parameters on the responses and compared with related sources: 1. Parts with higher thickness have more material mass than the smaller diameter parts, and this causes the gravity force, which is one of the forces affecting the deformation, to be higher, and it will cause more geometric error so that the lowest thickness is shown better responses. 2. As it turns out, the amount of geometric error is minimal in the hexagonal infill pattern. This could be due to the polymer nodes. The more nodes, the tighter the piece and the less deformation. Since the number of polymer nodes increases in the hexagonal pattern, the deformation is less than other infill patterns. In the research mentioned in the introduction, the effect of the infill pattern was studied, and similarly, the hexagonal infill was introduced as the optimal infill pattern [28]. 3. As the layer height is decreased, the number of deposited layers increases, and this will cause more interfaces and adhesion will be reduced. On the other hand, a high layer height causes higher thermal gradients between the layers, and more deformation will be accrued, and geometrical errors will be increased. But as mentioned in the literature of the article with different materials, it was observed that as the layer height decreased, the shape errors decreased. The reason may be the type of material that is used in this article. However, the layer height study results in other materials such as ABS and PLA showed that the lower the layer height, the lower the geometric and dimensional accuracy at lower layer heights. This difference in results between other research and the current research can be due to the limitation of the 3D printer used because values less than 1 and more than 2 cannot be selected as layer height [28,36,40]. 4. According to the results, it was found that the amount of cylindricity and circularity is less for a lower number of wall layers. This may be because, in 3D printing of parts, the wall layers are first deposited on the platform, and then the internal infill will be deposited. During this short period, the wall layer will be fully solidified. Therefore, Figure 9. Circularity contour plots.
Taguchi design was used to create reproducible and valid results to investigate the effect of selected parameters on the geometrical error. This study revealed many unexpected findings. The impact of each is further analyzed by the impact of parameters on the responses and compared with related sources:

1.
Parts with higher thickness have more material mass than the smaller diameter parts, and this causes the gravity force, which is one of the forces affecting the deformation, to be higher, and it will cause more geometric error so that the lowest thickness is shown better responses.

2.
As it turns out, the amount of geometric error is minimal in the hexagonal infill pattern. This could be due to the polymer nodes. The more nodes, the tighter the piece and the less deformation. Since the number of polymer nodes increases in the hexagonal pattern, the deformation is less than other infill patterns. In the research mentioned in the introduction, the effect of the infill pattern was studied, and similarly, the hexagonal infill was introduced as the optimal infill pattern [28].

3.
As the layer height is decreased, the number of deposited layers increases, and this will cause more interfaces and adhesion will be reduced. On the other hand, a high layer height causes higher thermal gradients between the layers, and more deformation will be accrued, and geometrical errors will be increased. But as mentioned in the literature of the article with different materials, it was observed that as the layer height decreased, the shape errors decreased. The reason may be the type of material that is used in this article. However, the layer height study results in other materials such as ABS and PLA showed that the lower the layer height, the lower the geometric and dimensional accuracy at lower layer heights. This difference in results between other research and the current research can be due to the limitation of the 3D printer used because values less than 1 and more than 2 cannot be selected as layer height [28,36,40].

4.
According to the results, it was found that the amount of cylindricity and circularity is less for a lower number of wall layers. This may be because, in 3D printing of parts, the wall layers are first deposited on the platform, and then the internal infill will be deposited. During this short period, the wall layer will be fully solidified. Therefore, we will not have good adhesion in the interface of walls and infill sections compared to the internal infill section. However, wall thickness (wall layer) studies on PLA revealed that the dimensional accuracy would be improved and optimized in average wall thickness values. The explanation for the variation in findings might be related to limitations in the design of the cylinders and 3D printers that were utilized. The type of material used may affect the results [33].

Confirmation Test
To validate the established empirical models, a confirmation experiment was carried out. The optimal process parameter condition was used to conduct a confirmation test. The optimal values for parameters were hexagonal infill pattern, two wall layers, 1.125 mm layer height, and 5 cm thickness. Therefore, a part with optimal parameters was 3 D printed, and the Solutionix D500 scanner measured the cylindricity and circularity values. Then the optimal values of the parameters were placed in the developed cylindricity and circularity formulas, and the obtained values were compared with the values obtained from the experiment. Table 8 shows these values. Because of the uncertainty, output response was predicted to fall within the confidence interval range. The confirmation test revealed that the suggested models for cylindricity and circularity were acceptable in 95% of the experimental domain's confidence interval (CI). According to the results presented in Table 8, it was found that the error of cylindricity and circularity is less than 20%, which is acceptable [41]. The results of the confirmation tests indicate that the optimization was successful.

Conclusions
The present work leads to the following conclusions of experimental research on the effect of layer height, infill pattern, and the number of wall layers on shape deviation (cylindricity and circularity) in different thicknesses in the FFF process.
According to the L9 orthogonal array, the experiments were carried out by a MarkForged ® Mark Two 3D printer.
The cylindricity and circularity indicator was measured using a Solutionix D500 scanner and Geomagic ® Control X™ software. According to the results from ANOVA, the layer height and thickness influence is much more significant than the influence of the infill pattern and wall layers on cylindricity. Similarly, the effect of layer height and thickness on circularity is much more significant than the influence of the infill pattern and wall layers, according to DOE and optimization results.
Also, the results can help the designer to understand the phenomenological interactions between the parts' dimensions and the evolution of the geometric tolerances. From the (S/N) analysis for the cylindricity and circularity, it was found that layer height of 1.125 mm, hexagonal infill pattern, 5 mm thickness, and two wall layers were the optimal process parameters to minimize shape deviations. Also, a regression model was developed, and a confirmation test was applied to show that the predictions are in good agreement with experimental data.
Three-dimensional printing results can be influenced by unstable machine conditions, operator error, and other factors. Regression models were established to predict cylindricity and circularity.