PREDICTION OF BUILDING ORIENTATION EFFECTS THROUGH MACHINE LEARNING PROCESS OF ADDITIVELY MANUFACTURED TRIPLY PERIODIC MINIMAL SURFACE SCAFFOLDS

Triply periodic minimal surfaces (TPMS) are porous structures which can be used to create multifunctional materials for various technological applications. TPMS have a complex geometry, therefore, additive manufacturing is shown as the ideal method for their manufacturing, due to the flexibility of such method. Thus, this work aims to predict the building orientation effects through machine learning process of additively manufactured triply periodic minimal surface scaffolds. DOE (Design of experiments) was used to determine the effect of the 30°, 60° and 90° angles of the X, Y and Z axes of the TPMS and ANOVA (Analysis of variance) to determine the relevant statistical interactions. Subsequently, the Multi-Layer Perceptron, Random Tree and Multiple Linear Regression machine learning algorithms were used through WEKA software to predict the cost and support material consumption for each TPMS. The results showed that the cost of TPMS can vary between about 12 and 15% according to the most expensive to the most economical building orientation. The Multiple Linear Regression algorithm obtained the best result for the cost prediction and in the support material consumption prediction the Multi-Layer Perceptron algorithm got the best.


Introduction
Additive manufacturing has been one of the most promised technologies in industry 4.0 context. This process, which was previously used only for product models and prototype parts, according to Wong, et al. [1], nowadays it has been widely used mainly in the creation of complex parts, which would be impossible to be manufactured through conventional manufacturing process.
One of the most used additive manufacturing methods is the Material Extrusion (MEX), due to its low cost. Ngo, et al. [2], claim that in the MEX method a continuous filament of a thermoplastic polymer is used to print the materials layers in 3D. The filament in the nozzle is heated reaching a semi-liquid state, to be extruded on the platform or on top of other layers.
The thermoplasticity of the polymer filament is an essential property for this method as it allows the filaments to melt during printing and then solidify at room temperature after printing.
Considering that, process planning is essential when the objective is to reduce costs and get the best result. One of the steps in the additive manufacturing planning process is the building orientation, which consists in the definition of part angles orientation according to the X, Y and Z axes. According to Allen and Dutta [3] the building orientation is one of the firsts and most influential steps in the additive manufacturing process, because through this orientation, the manufacturing process time and the number of the layers will be defined. Furthermore, Croccolo, et al. [4] mention that the building orientation can make significantly influence in the product fatigue resistance, preventing failures, optimizing the general strength and expanding the material properties compared to conventional manufacturing.
Machine learning is another technology that has been widely disseminated, this technology aims to predict parameters through a sample data [5]. We can use machine learning in additive manufacturing to predict, for example, the product cost or the amount of material used in the manufacturing process.
Gradually machine learning has been related in additive manufacturing process in different ways. Mohamed et al. [6,7] used machine learning to optimize process parameters, improving the product viscoelastic responses and predicting the product dynamic modulus elasticity. Sood et al. [8] used machine learning to optimize the parameters and improve mechanical strength of the product. Jiang et al. [9], were able to minimize the support material wasting through the use of machine learning in MEX additive manufacturing. Thus, it is clear that there are several different ways to apply machine learning in the additive manufacturing process.
Triply periodic minimal surface (TPMS) are porous structures which can be used to create multifunctional materials for various technological applications. These structures are infinitely extensible and continuous surfaces which has two intertwined regions [10,11].
Regarding the triply periodic minimal surface produced through additive manufacturing, the literature shows several studies using this technology. Maconachie et al. [12], carried out a study investigating the effects of the layers thickness on the manufacturing capacity and on the mechanical properties of the Gyroid TPMS, manufactured using the MEX method. De Aquino et al. [13] investigated the effect of the loading direction combined with TPMS scaffold type on the mechanical properties of scaffolds manufactured by MEX.
Karimipour-Fard et al. [14] studied the effect of design, porosity, and biodegradation on the mechanical and morphological properties of TPMS scaffolds. In the Moleirinho et al. [15] study, columns were built based on the Gyroid geometry using the MEX method with two different ligands: diethylaminoethyl (DEAE) and hydroxyapatite for the purification of oncolytic adenovirus and lentiviral vectors.
Thus, the general objective of this study is to predict the building orientation effects through machine learning process of additively manufactured triply periodic minimal surface scaffolds. A design of experiments (DOE) was used to analyze the building orientation effect in the TPMS cost, and the machine learning to predict parameters from DOE, comparing the effectiveness of the machine learning algorithms.

Materials and methods
Based on previous work by De Aquino et al. [13], were selected three triply periodic minimal surfaces: Diamond, Gyroid and Primitive. The TPMS parameters are shown in Table   1 and the TPMS can be seen in Figure 1:   Table 2 shows the variables used in the experiment. Using these data, the product cost was estimated based on the absorption costing, it is possible to observe the application of the costing in table 3, through the categories: material, production, printer, labor and total costs. The material was price was got from a Stratasys supplier in December 2020. Both the model material and the support material have the same price that is equivalent to $ 0,20 / cm³.
Regarding to the production, the energy price per kWh was based on an average of the US kWh value in December 2020. The machine consumption was based on the printer user's manual. The annual maintenance value was established as a 10% of the printer value. The depreciation and the service life time were based on 5 years.
In the machine category, considering that the printer is no longer being produced, the price was based on a used printer of the same model. In labor, the salary was based in a Google research about the American 3D machine operator and the USA labor charges reach about 40%.
And in the total costs, there are the sum of all these costs, estimating the total cost of each product produced.
Finally, we carried out the cost values and support material consumption prediction, through the machine learning algorithms application using the WEKA software. We used the following algorithms: Random Tree, Multilayer Perceptron and Multiple Linear Regression from WEKA. For all the experiments, the training set method was used. In the Multilayer Perceptron settings, 500 training times were determined, and in the other two algorithms, the standard settings were used.

Design of Experiments (DOE)
According to analysis of variance (ANOVA), Montgomery and Runger [16] affirms that DF are the degrees of freedom, SS is the sum of squares, the F value is the division of the mean of the squares by the mean of the squares of the error, and the P value determines whether the factors have statistical significance. Table 4 shows the analysis of variance (ANOVA) that sought to identify the interaction between TPMS and the X, Y and Z axes. The significance level used in P Value is 0.05, thus, the cost analysis of variance shows that the TPMS and the Y axis are significant for the cost because it has a value less than 0.05, but the X and Z axis have no significance due to their higher values. The 2-way interactions express that TPMS and X axis and TPMS and Y axis are significant. Considering that the X and Y axes have no significance between them, the 3 and 4-way interaction will also not be significant, because it demonstrates that the factors are independents [17]

Main effects plot
In the main effects plot in figure 2, are shown only the significant parameters, which are, TPMS and Y axis, so in the TPMS factor it is understood that the order from highest to lowest cost is, Diamond, Gyroid and Primitive. In the Y axis, it is possible to understand that the 60° angle has a tendency to obtain the highest cost, and the 90° angle tends to obtain a lower cost.

Effects on TPMS Cost
According to each set of angles in the building orientation, it was observed that several angles contribute to the higher or lower materials consumption, as well as the longer or shorter production time affecting the cost. To illustrate, in table 5 it is possible to observe the highest and lowest costs of each TPMS and the percentage difference between the highest and lowest.  We proceeded to the second stage of the study, which has the objective, to predict the values related to the cost and support material consumption through machine learning algorithms with the WEKA software.

Prediction through the machine learning algorithms
The algorithms application, brought the following results:

Multi-Layer Perceptron
First, we applied the Multi-layer Perceptron algorithm, a neural network algorithm,

Random Tree
Subsequently, the Radom Tree algorithm was applied to predict the cost and the support material consumption, this algorithm is based in decision trees.
As we can see in Table 8, the Random Tree algorithm proved to be very efficient for the cost prediction with a correlation coefficient of 0,996, and with a mean absolute error of only 2,2025. In the support material prediction, the algorithm reached a correlation coefficient of 0,9862, with a mean absolute error of 0,2902.  terminal nodes starting from the root node can be seen.

Multiple Linear Regression
Finally, the Multiple Linear Regression algorithm was used, this is a multiple linear regression algorithm. The algorithm reached the correlation coefficient of 1 and a mean absolute error of 0, proving that the algorithm worked perfectly in the cost prediction. In the support material prediction, a correlation coefficient of 0.9896 and a mean absolute error of 0.3017 were obtained.

Discussion
Comparing to design of experiments (DOE) method, some studies have shown good results applying this method to obtain the best building orientation to the additive manufacturing. Srivastava et al. [18] conducted a study which aimed to optimize the materials consumption and improve the production time using the MEX method. That study used DOE to analyze the building orientation and the layer resolution. The building orientation definition was 0°, 15° and 30° for the X and Y axes and the layer resolution was 0.1778 mm, 0.254 mm and 0.3302 mm. The result showed that for a better material consumption optimization and the production time improvement, the building orientation on both axes must be at 0° and the layer resolution at 0.254 mm. That study shows a similar approach as we used in the present study, with a similar objective of reducing material consumption and production time and consequently in cost.
In the study by Mwema and Akinlabi [19], DOE was used to optimize the roughness using also the MEX method, in the study they used the 0°, 15°, 30°, 45°, 60° e 90° angles on the X and Y axes for the building orientation, and 0.1 mm, 0.2 mm and 0.3 mm for the layer resolution. Finally, the study concluded that the layer resolution of 0.1 mm and the 0° and 90° orientations on the X and Y axes, respectively, obtained the smallest roughness. When comparing these results to the present work, it is clear that the experimental method was similar, demonstrating that it is possible to not only optimize costs, but also the product roughness.
When using the DOE for determining parameters and the WEKA software for predicting the best parameters, the study by Molero et al. [20] has an approach similar to that used in the present study. That study aimed to predict the roughness for a specific product manufactured by the MEX method, the authors defined some parameters as the layer resolution and the flow, these parameters were tested in two fixed orientations, X = 0° and Y = 90° and X = 0° and Z = 90°. The DOE experiment was carried out and through WEKA some algorithms tests. Despite of that study parameters are different from the present study parameters, it is possible to understand that this approach is efficient in the planning process, and in the patterns prediction in additive manufacturing.
In the study by Huynh et al. [21], the objective was to predict the product mechanical properties also using the MEX method. In that study, print speed, layer resolution and extrusion temperature were used as parameters, the DOE was performed and, the results were submitted Through these studies, it is understood that the design of experiments (DOE) approach and the algorithms predictions in the additive manufacturing planning process is a really effective method, however, until then, similar studies using triply periodic minimal surface are not found in the literature, demonstrating that this is a unique study, so, it is necessary to carry out other experimental approaches about it to obtain more data.

Conclusion
This work aimed to present prediction of building orientation effects through machine learning process of additively manufactured triply periodic minimal surface scaffolds. This objective was concluded through the DOE method and the use of algorithms present in WEKA software.
it was possible to conclude that the DOE method was very effective, demonstrating the interactions that are really relevant to the work, and it was possible to see that with a good process planning, it is possible to save a lot with material cost. For the Diamond type, the ideal orientation setting is X = 30°, Y = 90° and Z = 60° with a cost of $165,17, being 15,08% less than the highest cost orientation. For the Gyroid type, the angles X = 30°, Y = 90° and Z = 30° obtained a cost of $130,41, 15,71% more economical than the most expensive orientation. And finally, if the building orientation of Primitive type is set at X = 60°, Y = 30° and Z = 90°, it will cost $88,62 being 12,50% less than the most expensive orientation option.
Machine learning enabled the prediction of the cost and consumption of support material. However, despite the excellent efficiency of all the algorithms used, for the cost prediction, the multiple linear regression algorithm, was the best algorithm of the three studied, due to the perfect cost prediction, obtaining 1 correlation coefficient and 0 mean absolute error.
In the support material prediction, all the algorithms were very efficient, but Multi-Layer Perceptron algorithm reached the best result, reaching 0,9983 of correlation coefficient and 0,178 of mean absolute error.
Then, we can conclude that in these experimental conditions the study showed good feasibility to predict the optimized conditions of costs and support material for the studied TPMS. There is a need for further research regarding these same algorithms using other test methods in the WEKA software.