Enhancing 3D Printing Producibility in Polylactic Acid Using Fused Filament Fabrication Fused Deposition Modelling and Machine Learning

: Polylactic acid (PLA) is one of the high applicable material which is used in the 3D printers due to some significant features like its deformation property and affordable cost. For improvement of the end-use quality, it is of significant importance to enhance the quality of Fused Filament Fabrication (FFF)-printed objects in PLA. The purpose of this investigation is to boost toughness and to reduce the production cost of the FFF-printed tensile test samples with the desired part thickness. Due to prevent from many numerous and idle printing samples the response Surface Method (RSM) is used. The statistical analysis is performed to deal with this concern considering extruder temperature (ET), infill percentage (IP), and layer thickness (LT) as controlled factors. The tensile test specimens are printed based on the designed experiments, and the tensile strength tests are conducted by SANTAM 150 universal testing machine based on ASTM D638. The pattern for filling is designed based on honeycomb which is applied to produce lightweight and high-strength specimens. The area under Force- Extension curve up to fracture is acquired as the toughness of the printed specimens. This study also developed a modeling process using artificial neural network (ANN) and artificial neural network- genetic algorithm (ANN-GA) techniques to develop an accurate estimation for toughness, part thickness, and production cost dependent variables. Results were evaluated by correlation coefficient and RMSE values. According to the modeling results, ANN-GA as a hybrid machine learning (ML) technique could enhance the accuracy of modeling about 7.5, 11.5 and 4.5 % for toughness, part thickness, and production cost, respectively, in comparison with those for the single ANN method. On the other side, the optimization results confirm that the optimized specimen is cost-effective and able to comparatively undergo deformation, which enables the usability of printed PLA objects. The research is accomplished under the constraints of PLA compatibility with existing Fused Filament Fabrication installation, in the absence of the functional assistant of the machine. Although the mechanical properties and dimensional accuracy of PLA have already been studied, there is little literature on the toughness of the printed PLA with honeycomb internal fill pattern.


Introduction
The industrial companies are gradually adapting to additive manufacturing (AM) technologies due to higher flexibility, less waste material, fewer tooling requirements [1]. Some traces are emerging in a number of industries for the replacement of Traditional Manufacturing (TM) with Additive Manufacturing (AM). FFF is one of the most applicable AM technologies used to fabricate plastic products. FFF printer directly builds 3D parts from a 3D Computer-Aided Design (CAD) model by fusing successive extruded layers of feedstock material that fuse together to produce components layer by layer.
Several studies have evaluated FFF process parameters on mechanical properties and dimensional tolerances of printed parts by the design of experiments method [2][3][4][5][6] and by evolutionary algorithm [7]. Qattawi et al. [1] checked the effects of processing criteria on mechanical properties and dimensional accuracy using 18 printed samples. Ceretti et al. [8] statistically analyzed the implementation of the two types of the process criteria and the extrusion head on the dimensions of multi-layered PCL scaffolds and pores in the deposited material using a modified FFF printer. The extrusion heads were wire extrusion and powder extrusion head. Extrusion head type did not strongly influence resulting geometry of the samples. Griffiths et al. [9] used design of experiments method (DOE) to quantify the effects of build. Results indicated that infill percentage and number of shells are significant factors to optimize tensile properties. Moreover, maximum layer thickness and lowest infill percentage, and number of shells have to be used to optimize efficiency outputs. Lieneke et al. [10] developed a method to identify realistic tolerance values for additive manufacturing and factors influencing the geometrical accuracy. The materials, machines, and process parameters for FFF, laser sintering (LS), and Laser Melting (LM) were defined for the development of the method. Rezaie et al. [11] objective were to study implementing a mathematical tool used in the conceptual design stage for topology optimization. They investigated the application of topology optimization for the production of meso-scale structures to realizing intermediated density regions. Mahmood et al. [6] applied Taguchi's experiment method to test the effects of process parameters on structural definitude and geometric characteristics [7].
The mechanical properties of additively manufactured parts suffer compared to conventionally manufactured parts [12]. PLA presents a relatively brittle behavior under tensile loading [13]. Although the dimensional accuracy and mechanical properties of PLA have been already studied, there is little literature on the printed PLA's toughness with honeycomb internal fill pattern [14][15][16][17][18]. Hence, effects of extruder temperature (ET), infill percentage (IP), and layer thickness (LT) and their interactions on toughness, thickness, and production cost of the 3D printed specimens in PLA are investigated by Response Surface Methodology (RSM). One reason may more significant about using of RSM in many scientific studies is that this method shows better the interaction between parameters and by graphic diagrams [7].
Recently, Machine learning (ML) techniques have become as one of the effective tools for modeling and simulating scientific phenomena, mechanical properties, engineering processes and different material behaviors in mechanical engineering fields. This section presents the notable studies which employed ML techniques to handle modeling and predicting tasks in FFF 3D printers. Buys et al [14] conducted research on 3D printer for the multi-material structure of the polymeric matrix. In this research, they evaluated mechanical properties of samples such as wear, Flexural, and morphological properties. PLA-PA6/TiO2 polymeric matrix are printed and the wear examination shows that the wear rate for PA6/TiO2 samples is 823 µm and for PLA samples is 1092 µm. Yadav et al [14] employed adaptive neuro-fuzzy inference system (ANFIS) as a hybrid ML technique for the prediction of tensile strength in PETG and ABS in the presence of temperature, material density and layer height as input variables. Results were evaluated by error percentage. According to results the ANFIS could successfully cope with the task by error percentage 2.63. The maximum tensile strength was estimated to be 0.0405 kN/mm2 for PETG in the presence of 0.1 mm layer height, material density 1.27 g/cm3 and extrusion temperature 225 °C. Ali and Chowdary [15] employed ANN for the prediction the mechanical characteristics of FFF printed parts in the presence of air gap, raster angle, number of contours and build orientation as input variables. ANN was trained using a Bayesian function. Results were evaluated by accuracy. According to the results, ANN could successfully cope with the task by enhancing the accuracy by about 5%. Sheoran and Kumar [16] developed a comparative study for analysing GA, Taguchi method, gray relational, RSM, ANN, fractional factorial and Fuzzy logic for handling the FFF approach to enhance the structural specifics as well as printed sample quality. According to the results, hybrid ML techniques improved the accuracy and increased performance compared to the single ML techniques.
According to the literature, the ML techniques can be effective tools for modeling the FFF process [14][15][16][17]. In addition, hybrid ML techniques provided higher accuracy and performance compared with single ML techniques [15]. This made us to move toward comparing ANN as the frequently used and simple ML technique with ANN-GA as the hybrid ML technique. Therefore, the objectives of the present work can be categorized into two main stages. The first step is to improve the mechanical behaviour of the FFF printed PLA under tensile loading and reduce the production cost of the specimens. The second step is to estimate the Toughness (N-mm), Part thickness (mm) and Production Cost ($) in the presence of LT, LP and ET using ANN and ANN-GA techniques. The honeycomb internal fill pattern is applied to increase the printed samples' ductility and decrease material use. The area under Force-Extension curve up to fracture is considered the toughness of the printed specimens. The part thickness is measured by a micrometer of 0.01 mm resolution made by Mitutoyo (Mitutoyo company, Model 500-196-30 AOS Absolute Digimatic Caliper, Japan). The production cost is calculated using a formula based on reasonable prices in the FFF 3D printing market. The acquired data is analysed by Design-Expert V8 software via the response surface method. The independent factors are optimized and examined to affirm that the research method is viable.

Response surface methodology and ANN-GA
RSM is based on applied mathematics and the statistical techniques to determine functional relationships between output responses which are affected by input factors [17]. RSM generates an empirical polynomial model of approximation for response surface over a factor region [18]. The smaller the region of interest, the better the approximation. When all the independent factors are continuous and can be estimated and regulated for experimental studies. Thus, the response surface can be presented through the Equation 1 [19].
Y= f(x1, x2, x3, ..., xk) Here, k is the number of independent factors. The approximation of its mathematical model is represented through the infinite strings of x Taylor. A quadratic polynomial function expressed in Equation 2 is implemented in RSM [12,13,20].
Here, the input factors include extruder temperature, infill percentage layer, and thickness. As discussed by Moradi et al. [19] the data is obtained from an experimental analysis using Design-Expert V8 software. Table 1 shows three factors, i.e., the statistical analysis based on Central Composite Design (CCD), full replication of three agents, and five stages. Based on the previous research [19] for each of factors is set significant domain because higher and lower these ranges the 3D printer has proper efficiency. Toughness (N-mm), part thickness (mm), and production cost ($) have opted as output responses. The samples are printed by FFF printer model Sizan 3 (Sizan company, Kashan, Iran). The part thickness is measured by a micrometer of 0.01 mm resolution made by Mitutoyo. The production cost of the specimens is calculated by a formula obtained from 3D printing market. Equation (3) offers the production cost of PLA printed parts in terms of build time and part weight. The design matrix and experiment results are reported in Table 2 [23].
Production Cost = 0.5 Build time (min) + 0.03 Part weight (gr) ANNs are considered as computational intelligence tools inspired by the biological neural networks [7,21]. ANNs train to do tasks by considering the existing mapping of the dataset. The architecture of ANN is based on connections of layers by nodes called neurons and neurons of the biological brain. Each connection transmits a signal from neurons to other neurons, which is like the synapses in a biological brain [22].
The output values of each neuron is affected by weights and bias values. All links between input layers and hidden layers composed the input weight matrix and all links between hidden layers and output layers composed the output weight matrix. Weight (w) which controls the propagation value (x) and the output value (O) from each node is modified using the value from the preceding layer according to Eq. 4 that presents the relation for producing the output values of each neurons [24].
Where T is the specific threshold (bias) value for each node. f is a non-linear sigmoid function, which increases monotonically. The architecture of the proposed ANN is presented in Figure 1. The training phase is performed by MATLAB software. For the implementation LT, IP and ET are used as input variables for the prediction of Toughness, Part thickness, and Production cost, respectively. 70% of total data were separated randomly for developing the training process by the network. The remaining data were employed for the testing process and evaluating the accuracy of the network. The training phase was initiated using 10 neurons in the hidden layer and continued to 16 neurons by interval 2 neurons. For each step, output data were generated and evaluated by evaluation criteria in comparison with target values.
Recently, hybrid methods provided a higher accuracy compared with single techniques [25,26]. These techniques employ a predictor and an optimizer for developing an accurate prediction model. The general mechanism is to employ an optimizer for improving the architecture of the predictor for reaching the best response. One of the frequently used and popular hybrid methods is ANN-GA. A population of candidate solutions to an optimization problem is evolved toward an optimal implementation in the GA. Each candidate solution has a set of properties to reduce the cost function errors. In ANN-GA technique, cost function is the output of layers as a function of weights and bias values. GA employs population and generation sizes as a set of properties and compounds a cost function. The optimization of the cost function aims at reducing the error values. In this case, the error values reduction contributes to providing accurate outputs for the network compared to using a single ANN. Figure 2 represents the flowchart of the proposed machine learning hybrid model of ANN-GA, adapted and reproduced from [27].  Table 3 presents the evaluation criteria that compare predicted and output values. These factors are also called performance factors that handle the target and output values (the predicted by models). The correlation coefficient is an index for measuring the linearity of target and output values. The root mean square error calculates the deviation error of the output values compared to the target values [28]. These factors are considered the frequently used evaluation metrics in different modeling tasks [29].

Experimental work
The tensile test samples fabricated in PLA are investigated mechanically, dimensionally, and economically. Polylactic acids are generated from renewable sources with numerous benefits and divided to some categories, for example the PDLA (Poly-D-lactic Acid), PLLA (Poly-L-lactic Acid), and PDLLA (Poly-DL-lactic Acid) [30]. PLA has a low printing temperature and can be printed both with and without a heated print bed. Material properties of PLA are shown on Table 4. Despite all of these notable characteristics, PLA is brittle and it is not a true choice for items which might be bent, twisted, or dropped. Simplify3D software is employed to fine-tune build parameters of the specimens. Simplify3D includes comprehensive tools to work with 3D printers. The tensile test sample is modeled as a STL file by Solidwork based on international standard ISO 527-2 and imported in Simplify3D. Table 5 illustrations definitions of FFF build parameters that are permanent for all experiments. Bottom solid layers - 6 5 Default printing speed mm/min 3600 6 Retraction speed mm/min 1800 7 Outline overlap -Full Honeycomb 8 Interior fill percentage % 15 The infill pattern may significantly affect the strength of the 3D printed part. The honeycomb internal fill pattern is applied for the production of light-weight and high-strength specimens. The honeycomb internal fill adhered to top and bottom solid surfaces offers an excellent rigidity. Figure  3 shows the sample size based on ISO 527-2 standard for the tensile examination. Figure 4 depicts 20%, 30 %, and 40 % full honeycomb infill. Figure 5 presents the 3D printed parts in PLA. The SANTAM 150 universal test (SANTAM company, Tehran, Iran) is used to conduct tensile strength tests according to ASTM D638 at the constant rate of 2 mm/min. As the Table 2 indicates the specimens have two types of fracture under in-plane loading. Most of the specimens demonstrate brittle behaviour with no visible deformation before fracture. Only five specimens represent tough fracture and apparent deformation occurs before separation. These specimens have both strength and ductility higher than brittle specimens.

Results
The effects of input factors on outputs can be signified by the analysis of variance (ANOVA) results. The ANOVA is created by assuming that the elements are fixed, not random and the design is crossed, not nested. The software selects polynomial terms in the mathematical model. However, the terms must be significant to refrain from aliasing of the model. Design-Expert calculates statistics such as p-values, lack of fit, Adj R-Squared, and Pred R-Square values to appraise the models. The difference between predicted adjusted R-squared and R-Squared indicates whether the model can reliably be used to interpolate data. If the difference is less than 0.2, then the model is fitting the data and can be used to interpolate data.

Toughness
The analysis of the variance table discloses that LT is the main controlling factor influencing toughness. Interaction between infill percentage and extruder temperature is also crucial. Table 6 depicts the ANOVA results of toughness. The difference between predicted R-squared and adjusted R-squared is 0.042, which affirms that the model can efficiently interpolate data.
The equation (6) The relative significance of the factors can be obtained by comparing the coefficients of the factors. Figure 6-a depicts the perturbation plot of toughness. A, B, and C curves illustrate sensitivity of toughness to LT, IP, and ET, respectively. The plot indicates that the toughness of specimens is much more sensitive to LT than other controlled factors. The remarkable point is that IP and ET have a similar influence on the toughness while changing one factor and keeping the others constant. Figure 6-b demonstrates 3D surface plot of toughness in terms of ET and IP. As it displays the tough behavior in the printed PLA can be achieved by two procedures. The first way is to increase extruder temperature and decrease IP at a time. The other way is to increase IP and to decrease ET concurrently. The plausible arguments for the improvement of the toughness by the first way are the enhancement of interlayer adhesion between plastic strings at higher temperature and reduction of the trapped air pockets between the strings at lower IP. Moreover, the time required to build inside sections is considerably dependent on the IP. By increasing IP, the nozzle extrudes more hexagonal pattern lines at the inside sections which takes more time considering the same printing speed for all cases of IP. Therefore, there is less time for heat transfer and variation in LTs using lower IP which results in a better fusion between plastic strings. Figure 6-c depicts 3D surface plot of toughness in terms of LT and ET. The surface plot indicates that increasing LT and LT at a time results in increasing toughness. In a specimen with higher LT, a fewer number of sections are needed to print the part. Therefore, a specimen with a thicker layer consists of less interlayer bonding which are potential places to raise stress concentration and crack propagation. Figure 7 is beneficial to compare interlayer bonding and trapped air using thin and thick LT. In addition, higher LT results in lower heat transfer rates and variation in layer temperatures [23] and consequently, better fusion and adhesion of the extruded layers on the solid layers is expected. Figure 8 demonstrates a schematic of temperature variation in lower and higher LT at the same printing speed. It is evident that printing PLA at lower temperatures results in poor layer bonding. The 3D surface plot (3D-SP) of toughness in terms of IP and LT is presented in Figure 9. The 3D-SP implies that increasing LT and IP leads to an increase in toughness. The IP patterns and IP influence the interior solidity of the printed parts. For uniform stress distribution during the tensile test, hexagonal cells can withstand a mechanical load to impede stress increases on the neighboring cell. Additionally, IP specifies hexagonal cell size, and smaller cell sizes result in higher densities and higher strength. Therefore, it is rational to conceive that higher internal IP results in higher toughness.

Part thickness
The dimensional accuracy of plastic printed parts is affected by many parameters. The melted strings are deposited based on the sliced G-Code file. In addition to the investigated parameters, the part geometry and printing speed may influence the strings' placement and, thus, dimensional accuracy of the part. After it has been deposited out of the nozzle, the plastic behavior depends on plastic temperature, stable temperature, and ambient temperature. Although PLA does not shrink that much, it is essential to study the effects of process parameters on the dimensional accuracy of the printed parts in PLA. The variance table analysis indicates that although all input factors and their interactions influence the part thickness, the interaction between LT and IP is the significant parameter influencing the part thickness. Table 7 demonstrates the ANOVA results of the part thickness.
The Eq.

Production cost
The ANOVA illustrates the LT is the most important factor influences the production cost. Table  8 depicts the ANOVA outputs of production cost. Also, the "Adj R-Squared" and "Pred R-Squared" are in excellent agreement.
The Eq.10 expresses anticipating model of production cost in terms of actual values: As the coded equation shows, LT has the highest coefficients among equation terms. Figure 11a depicts a perturbation plot of production cost. The plot confirms production cost is much more sensitive to LT than other input parameters. Figure 11-b shows the effects of LT and IP on production cost in the form of a 3D surface. Build time has a major impact on the production cost based on the suggested equation. The build time is the sum of extruding time of top and bottom solid surfaces and inside sections. The parameter that defines the number of sections to produce a part is LT, and the parameter that determines the extruding time of inside sections is IP.
(a) (b) Figure 11. a) Perturbation plot of production cost b) 3D-SP of production cost in phrases of LT and IP

ANN and ANN-GA Techniques
ANN and ANN-GA techniques were performed to develop an accurate model for the prediction of toughness, part thickness, and production cost. In the first step, ANN was developed by 10, 12, 14 and 16 neurons in its single hidden layer for choosing the best number of neurons in the hidden layer in the presence of 70 % of total data. Results were evaluated by correlation coefficient and RMSE values and were tabulated in Table 9. As is clear, the best response is related to neuron number 12. Therefore, the architecture of 3-12-3 was selected as the base ANN's architecture to be optimized by GA.
GA implemented ANN's selected architecture in four treatments (based on our experiences in previous studies). These treatments included population size 50, 100, 150, and 200. The results were tabulated in Table 9. Based on Table 9, Pop. Size 150 with Max generation 360 provides higher accuracy for toughness and production cost and Pop. Size 100 for part thickness compared with other Pop. Sizes. this Pop. Size increased the accuracy by about 9.7, 5.8, and 1.2% respectively for Toughness, Part thickness, and Production Cost compared with single ANN. By considering the training stage, the elected architectures were employed for the testing stage. The results were tabulated in Table 10. As is clear, the accuracy of testing and training stage for single ANN don't match, in another word, there is a higher difference between the accuracy of testing and training stages for single ANN method. This makes ANN an untrusted approach. On the other hand, hybrid ANN-GA benefits higher sustainability by comparing testing and training results, which provides almost similar accuracy.   Figure 13 presents the deviation from target values for comparing ANN and ANN-GA. These figures contain relative deviation error values for testing data in two categories, including single ANN and hybrid ANN-GA. The horizontal 0 line refers to target values, and columns refer to relative deviations for each predicted testing data from target values. As is clear for all three variables, a single ANN provides a higher deviation from target values compared with the hybrid ANN-GA method. These observations claim that hybrid methods offer higher accuracy and lower error compared with single methods.

Numerical optimization
The process parameters are optimized based on a criterion defined in Table 11. The standard aims to increase the toughness, achieve the desired thickness and decrease 3D printed parts' production cost at a time. It is anticipated that the optimized specimen demonstrates tough behavior at the least possible production cost with the desired part thickness. The predicted and the experimental results for the implementation of the optimized process parameters are shown in Table  12. The optimum solution has a high level of desirability. Figure 14 depicts the Force-Extension diagram of the tensile test specimens fabricated by the optimal setting. The optimized specimen's improved toughness is more due to an increase in ductility rather than the specimen's strength. By overlaying contour maps from multiple responses, RSM can be used to find the ideal window of operability. The overlaying contour maps to create ideal printed samples is shown in Figure 15. On each contour map, regions that do not meet the significations are grayed-out [31].

Conclusions
The present work aimed to enhance the production of PLA printed parts via investigation toughness, thickness, and production cost of the tensile test specimens. Also, Training was performed by ANN and ANN-GA techniques for developing an accurate model for the prediction of toughness, part thickness, and production cost. This method is performed by MATLAB software and calculates a superb prediction of output parameters. The tensile test of samples not only broad a deep insight of a main PLA's features, but also it can present brilliant results of printed samples which are printed by some criteria such as IP, ET and LT. The DOE of this study declined 125 tests to only 20 test which it has a big impact on saving time and produced cost. From the results obtained the following concrete conclusions are made. Although PLA is brittle in nature, the results confirm that it is feasible to improve the printed parts' toughness to develop PLA's end-use mechanical applications. Furthermore, because build time plays a major role in determining production cost, it is possible to reduce production cost without a significant impact on desired properties. It is also concluded that, interaction among LT and IP is the main parameter that has an impact on the thickness of the printed part. It can be conceived that due to little shrinkage of the PLA, extruder temperature has less influence on the dimensional accuracy of the PLA. In addition, the optimized setting to enhance producibility of PLA printed parts is layer thickness = 0.28mm, infill percentage = 34%, and extruder temperature = 222°C. The improved toughness of the optimized specimen is more due to an increase in ductility rather than the strength of the specimen. The results also showed that a single ANN model could provide a higher deviation from target values for all three outputs compared with the hybrid ANN-GA method. For future research, comparative analysis of the hybrid, ensemble, and deep learning models is strongly encouraged to improve the accuracy of the models.

Competing interests:
The authors declare no competing interests. Figure 1 The architecture of ANN Figure 2 The owchart of ANN-GA developing process Figure 3 The sizes of samples based on ISO 527-2 standard for the tensile examination     Extension-Force diagram of the optimized specimen Overlaying contour maps in terms of (a) LT and IP (b) IP and ET