2. State of the Art
Research has been done [
1] with good results on increasing the accuracy of FDM manufactured parts by fabricating components followed by parametric compensation of the 3D model using data obtained by high precision metrology.
Studies by Yadav D. et al. [
2] have been performed on improving the tensile strength of additive manufactured parts by employing neural networks trained on parameters such as infill density, extrusion temperature, and material density. The study was performed on parts obtained from materials such as Acrylonitrile Butadiene Styrene (ABS) and Polyethylene Terephthalate Glycol (PETG) and showed good results, improving the tensile strength by 4.54% in subsequent samples.
Research on predicting optimal manufacturing parameters by Deshwal S. et al. [
3] to increase the tensile strength of parts obtained from Polylactic Acid (PLA) material has been performed by training neural networks on process parameters such as nozzle temperature, printing Speed, and infill density. The study reported an increase in tensile strength of ~2 MPa using predictions from a neural network trained at 99.89% accuracy.
Research studies by O.A.Mohamed et al. [
4] have been performed regarding the ability of artificial neural networks to predict dimensional characteristics of parts obtained through the FDM process by analysing parameters such as slice thickness, the number of perimeters, deposition angle, part print direction, and raster to raster air-gap. The study compared the precision of neural networks to classic regression techniques and showed that neural networks can account for dimensional deviations.
Tura A.D. et al. [
5] performed studies on predicting the effects on surface roughness of FDM process parameters such as layer thickness, orientation angle, and infill angle with good results showing a high impact of layer thickness on surface roughness and the ability of neural networks to predict the effects.
Lyu et al. [
6] researched the ability of neural networks to predict dimensional characteristics of FDM manufactured parts by analysing the complex relationship between nozzle temperature, layer thickness, and infill density and their effects on dimensional characteristics.
Previous research by A. D. Sterca et al. [
7] was conducted to determine if the main FDM process parameters, e.g., temperature, speed, and part/layer orientation, influence the dimensional accuracy of 3D printed parts. The study was performed using regression analysis on data obtained by high precision metrology on a set of test parts. The study showed a strong correlation between the main process parameters and dimensional accuracy. The study also showed that 40% of the dimensional deviation from nominal is caused by a combination of factors that are not accounted for and by complex interactions between parameters which can not be modelled by a simple linear regression function.
Based on previous research [
7], a correlation exists between geometric feature size and dimensional deviation, accounted for by the material shrinkage rate.
The research performed in this study characterises the materials used in terms of their shrinkage rate with the aim of increasing the accuracy of dimensional deviation predictions. In addition, the study takes printing speed into account, which has been shown to affect dimensional deviations through a combination of effects [
7]. Part warping has been shown to be the most important factor in dimensional accuracy and is strongly influenced by part and layer cooling times and material shrinkage rates. Cooling times for both parts and layers are determined by a number of parameters such as printing speed, layer cooling fan speed, nozzle temperature, and heated bed temperature. These parameters all affect the temperature gradient throughout the part and thus the degree to which the part warps. Therefore, this study proposes including all of these parameters as inputs for training the neural network, filling gaps in the field by accounting for the fundamental parameters such as printing speed and material shrinkage rate, which have been shown to influence part quality but have not been studied in a correlative manner. The study also proposes the development of separate neural networks for each predicted characteristic (mechanical behaviour, dimensional deviations) in a cross-platform environment, allowing for modularity and the ability to develop more complex networks that can make design decisions using predictions produced by the different modules.
The study presented in this paper aims to determine the ability of artificial neural networks to learn and approximate the complex functions needed to predict dimensional deviations and mechanical behaviour of parts obtained by the FDM process using the main process parameters as well as material properties as inputs and empirical data obtained from high precision metrology and tensile strength measurements as outputs. A predictive mathematical model can provide information in the form of deviation from nominal, which can be used to improve dimensional accuracy in the design stage by applying corrections based on predictions to a parametric 3D model of the part, reducing or eliminating the need to manufacture and measure a series of parts to compensate for dimensional accuracy. Predictions of the mechanical characteristics of 3D printed parts can be used in the design process for guiding decisions regarding layer orientation and feature dimensions to ensure proper mechanical behaviour of the manufactured part. The predictions for dimensional and mechanical characteristics can be used to train an additional artificial neural network to provide a good compromise between dimensional accuracy and mechanical properties.
The ability to predict the characteristics of additive manufactured parts can increase the quality and interchangeability of these components and can even lead to a tolerance standard for components obtained through these techniques.
3. Materials and Methods
A test part geometry is designed and manufactured from PETG and PLA materials using different printing speeds, nozzle temperatures, and orientations. The parts obtained by the FDM process are measured using Coordinate measuring techniques and 3D scanning techniques. Tensile strength measurements are performed on the parts to determine if and how the mechanical characteristics are affected by different process parameters.
Different Artificial Neural Network (ANN) architectures are developed and trained using empirical data acquired through measurements and material properties data obtained from the manufacturer and public databases. The performance of Artificial neural networks is determined by comparing predictions with real-world data. The predictions can be tested either by manufacturing a new set of parts to be used as test data or by splitting the existing dataset into Training and Validation Data. In this study, the second method will be used, splitting the dataset into two subsets, 80% being used as training data and 20% for validation. The data splitting is done at random, providing an unbiased test of the performance. The performance of the ANN is determined by the ability of the model to generalise [
8]. The experimental process is described in the flowchart presented in
Figure 1, where the entire experimental process from part design through measurement, data management, and neural network training and performance analysis processes are set in order. Neural network performance analysis through comparisons between training accuracy and validation accuracy can be done at the same time after each training iteration, or a network can be validated on new data after the training has been performed to a satisfactory accuracy. This study performs validation after each training iteration, providing a plot of the performance at every step. This allows for close monitoring of the performance and early identification of unsatisfactory models.
A test part presented in
Figure 2 is designed using the SolidWorks [
9] software suite. The geometry of the test part is chosen to amplify the effects of process parameters on the dimensional and mechanical characteristics of the manufactured parts. A high length to thickness ratio increases the effect of part warping during cooling. A low surface area zone (marked as Width3 in
Figure 2) is used as a breaking point for tensile strength measurements as well as for amplifying the effects of different parameters on surface quality. A transition from a low to a high surface area defined by Angle1 and Angle2 is used to determine the variation of surface quality while at the same time providing a possible clamping feature for tensile strength measurements. The test part geometry includes different linear and circular features, which can provide measurement data for different layer orientations. The part is designed and annotated according to ISO 1101 [
10].
A total of 36 parts are manufactured, 12 using DevilDesign PETG material [
11] and 24 using DevilDesign PLA [
12]. The parts are manufactured on two FDM 3D printers, an Anycubic ProMax2 [
13] presented in
Figure 3a for the PLA parts and a LeapfrogXS [
14] as seen in
Figure 3b for the PET-G parts. Manufacturing is carried out in sets of two parts simultaneously, one in horizontal and one in a vertical orientation, as seen in
Figure 3b, to ensure identical conditions for both orientations. The parameters of nozzle temperature and print speed is varied for each set of parts according to
Table 1. and the values are chosen to represent the minimum, medium, and maximum temperature and speed for the material and machine used. A fractional factorial design is preferred to force the neural network to learn correlative functions. The parameter variation for the fractional factorial design is chosen in a range to be statistically significant, providing two extremes (minimum and maximum) and a median point. A minimum of three sample points for the values is needed for the neural network to identify them as variable instead of categorical data. If a neural network shows good performance in terms of generalisation and convergence, a full factorial design can be implemented to increase the prediction accuracy. All parts were manufactured using a 0.5 mm nozzle, 0.25 mm layer height, 5 mm wall thickness, 1 mm top/bottom thickness, and 30% infill using a linear infill pattern. The 5 mm wall thickness ensures a 100% infill for the 5 × 5 mm area designated as the breaking point for tensile strength tests. A sample of the manufactured parts can be seen in
Figure 3c.
The naming of the test parts within the context of this paper is done according to
Table 1 and takes the form of Temp_Speed_Orientaion_Material; thus, a part with the designation 210_90_V_PLA is identified as the test part manufactured with a nozzle temperature of 210 °C at a printing speed of 90 mm/s in the vertical orientation using PLA material.
Dimensional and geometric measurements are performed using two main techniques, coordinate measuring and 3D scanning. High precision measurements are obtained using a Cimcore Stinger 2 [
15] Coordinate Measuring Arm (
Figure 4a) and Autodesk PowerInspect [
16] software. Three-dimensional surface scan data is acquired using a Gom Atos II (Compact Scan) [
17] structured light 3D scanner (
Figure 4c). Computed Tomography data is acquired using a Werth XS Tomoscope [
18] (
Figure 4d), providing in-volume and surface 3D scans of the parts. Data obtained from optical 3D scans and computed tomography is used for CAD for actual mesh comparison using the Gom Inspect suite [
19] software, providing a detailed analysis of geometric and dimensional deviations. These methods of measurement are chosen to provide as much detail as possible concerning dimensional and geometric characteristics of the manufactured parts, which are needed to guide decisions on how the input and output data should be chosen for ANN training as well as to provide information regarding the architecture of the ANN. Multiple points are sampled for each measured feature, and the results are averaged to reduce outliers and avoid sampling manufacturing artefacts such as holes or material overextrusion. Three-dimensional optical scans are used to corroborate results from CMM measurements and to provide details on surface topology and part warping. The ability to sample a large number of points for dimensional measurements using 3D scan data allows for better averaging of deviations and the eliminations or reduction of outliers caused over and under extrusion artefacts. Scans of the parts in the form of STL files can be used in the future for developing a more advanced neural network trained using printing parameters, CAD nominal model, and actual part 3D model.
Tensile strength measurements are performed on an Instron 3366 [
20] tensile tester (
Figure 4b). The data provided by these measurements can be used to model the mechanical behaviour of the manufactured parts, which can then be used to create an orthotropic material profile for CAD systems that can inform decisions of layer orientation and feature dimensions in the design stage, as well as provide data for the training of an ANN that can predict the mechanical behaviour of a part. The tests are performed on all test parts, and the results are plotted for pairs representing the horizontal and the vertical orientations for each combination of parameters, providing a comparative study of tensile strength for the different orientations used.
Artificial neural network development is performed using the Python [
21] programming language through the PyCharm [
22] Integrated Development Environment. To facilitate universality and cross-platform availability of the code, as well as to use various functions and tools optimised for machine learning, the neural network architectures are developed using the TensorFlow [
23] machine learning library with the Keras [
24] frontend. The architecture and performance of the tested neural networks are analysed using the TensorBoard [
25] visualisation kit for TensorFlow. The performance analysis is displayed as a plot of ‘Training accuracy’ Vs. ‘Predictions on validation data’ accuracy in the form of the Mean Absolute Error (MAE) between predicted and actual values. A tendency of the MAE values to decrease indicates the ability of the model to learn the complex correlative function and the ability to generalise. The Mean Absolute Error metric is defined by Equation (1),
where MAE = Mean Absolute Error, y
i is the prediction, x
i is the true value, and “n” is the number of samples.
A base program is developed to create every neural network analysed in this study. The source code is written in the Python Programming language and is available for reference in
Appendix A. The neural network is implemented as a Sequential Model inside the base program to facilitate the implementation of different model architectures. A neural network architecture in this context is defined by the number of layers and the number of nodes in every layer. A deep neural network (DNN) is defined as a neural network that contains multiple layers (also known as hidden layers) between the input and output layers. All of the neural networks analysed in this study are of the Deep Neural Network Type. Different architectures are developed by modifying the number of hidden layers and nodes in the sequential model implemented in the base program.
In the context of this paper, the neural network architecture will be defined as the number of hidden layers times the number of nodes per layer because all architecture will employ hidden layers with equal numbers of nodes; therefore, 3 × 32 indicates an architecture containing 3 hidden layers and 32 nodes per layer.
This study is performed on a number of neural networks composed of 2, 3, and 4 fully interconnected hidden layers containing 8, 32, and 64 nodes each, for a total of 9 architectures; thus, the number of weights (trainable parameters) is dependent on the number of nodes and the number of hidden layers used. The optimisers [
26] used are Stochastic Gradient Descent and ADAdelta. The selection of the optimiser and the parameters for the optimiser (learning rate) is determined by observing the performance of the network under test (speed of convergence, accuracy of predictions). The weights and bias values of the neural networks are initiated as zeroes and adjusted by the optimiser during the training process. The number of hidden layers and nodes-per-layer are selected to represent networks with increasing parameter spaces (trainable parameters) in order to determine the optimal combination for best accuracy without overfitting the data. As the number of hidden layers and nodes-per-layer is highly dependent on the number of samples in the training dataset as well as the complexity of the problem to be solved, these parameters are subject to fine-tuning based on the observed performance of the network under test, as there is currently no clear mathematical formula for determining the exact architecture for a specific problem. The smallest network contains 2 hidden layers and 8 nodes per layer and is selected to provide a number of trainable parameters smaller than the number of samples in the present dataset and serves as a good starting point. The developed architectures are presented in
Table 2 as well as the activation function for the hidden layers and the number of trainable parameters for each architecture.
The number of epochs [
27] for training the neural networks is not predetermined. The networks are allowed to train until they diverge or until the decrease in prediction error becomes insignificant.
Input and output layer shapes are determined by the number of input and output parameters, and the activation function for the output layer is Linear.
Strategies to prevent overfitting can be employed in the form of l2 regularisers [
28] and Dropout layers [
29] which can be implemented after each hidden layer. Dropout layers do not affect the number of trainable parameters and are employed only in architectures that show a tendency to overfit. The parameters for l2 regularisers and dropout layers are chosen by fine-tuning for best performance.
Separate neural networks are employed for predicting dimensional characteristics and mechanical characteristics. This modular approach allows for separate training of the neural networks according to the availability of data, while at the same time allowing for interconnectivity with other networks, i.e., the predictions for dimensional deviations and mechanical behaviour can be used as inputs for another network that can inform decisions on the best compromise between dimensional accuracy and mechanical properties.
The data used for training is provided in the form of comma separated values (CSV) tables containing both input and output data. The input data used for training the neural network employed for predicting dimensional deviations are in the form of the values for feature length, nozzle temperature, printing speed, orientation, material shrinkage rate, print cooling fan speed, and heated bed temperature. The material shrinkage rate is provided as a minimum, medium, and maximum shrinkage. The minimum and maximum shrinkage for PLA are 0.3% and 0.5%, and for PET-G 0.2% and 1% [
30]. The medium shrinkage value is calculated as the average between the minimum and maximum values. The output data is in the form of deviations from the nominal dimension of the feature, the value of which is obtained through high precision metrology measurements. An example of the table head and a sample of values is presented in
Table 3.
The neural networks employed in predicting mechanical properties have input data in the form of values for nozzle temperature, printing speed, material and orientation. The value for “material” represents categorical data; therefore, each material is encoded in the form of a number “1” for PETG and ”2” for PLA to avoid not a number (NaN) errors during training. Considering that for this dataset, the orientation also takes on only two values, horizontal and vertical, this feature is also encoded as a number “1” for horizontal and “2” for vertical. For datasets where the orientation takes on many different values, these can be provided as angles. The output data used for training the neural network are provided in the form of tensile strength values in [Mpa] obtained from tensile strength measurements. An example of a table head and a sample of values is presented in
Table 4.
A graphical representation of a neural network analysed in this study showing the path of the data and the operations performed throughout the network during training is presented in
Figure 5, showing the path of the data through the neural network. Data enters through the dense layers (dense, dense_1, dense_2), where an inference (prediction) is made. The result of the inference is used in combination with the actual value to compute the Mean Absolute Error (MAE). The error is used to adjust the value of the weights and biases to a degree determined by the optimiser employed, i.e., for
Figure 5, the optimiser used is Stochastic Gradient Descent (SGD). The network design also employs functions to prevent NaN scenarios. The data is normalised (values scaled between 0 and 1) externally to allow for better portability of the model. Normalisation is performed to increase the speed of convergence by reducing the difference in scale between the various parameter values. Data normalisation is optional; however, it can increase model performance and decrease convergence times. The normalised data takes values from 0 to 1 but preserves the relative ratios between the original values.
5. Discussion
The study shows that predicting dimensional deviations and mechanical behaviour in the form of tensile strength is feasible. The ability of the model to generalise is dependent on the quantity, quality, and variety of the input data. The dataset used in this study is limited, however, it is sufficient to prove that predictive models can be created, encouraging future research on large datasets. The models present predictions with higher accuracy than the predictions obtained through linear regression in previous studies. The predictions provided by the models can be used for guiding decisions regarding the choice of parameters for manufacturing and for compensating dimensional deviations in the design phase, leading to a lower number of failed parts and the reduction or elimination of postprocessing operations.
The findings are consistent with the results of previous studies in the field.
The inclusion of additional parameters such as shrinkage rate, printing speed, part fan cooling speed, and heated bed temperature as input training data does not diminish the neural network’s ability to learn and approximate the predictive function, indicating that a correlation exists between these parameters and dimensional deviations. However, the dataset needs to be improved in variety and quantity for these parameters to be statistically significant and to increase prediction accuracy. An absolute minimum of three different values for each of the parameters must be used, i.e., three different materials, three different heated bed temperatures, etc.
The study shows a strong correlation between parameters that affect part and layer cooling times and dimensional deviations. Therefore, ambient temperature plays an important role; however, the study was performed under controlled laboratory conditions of constant temperature and humidity; thus, future datasets must include environmental variables such as ambient temperature and relative humidity.
The neural networks developed in this study can be used to provide predictions in the form of dimensional deviation or tensile strength of a part for a given parameter combination or for determining the best parameter combination for a given dimensional deviation or tensile strength value by reversing the input and output configuration of the model. The predicted values for dimensional deviations can be used to adjust a parametric CAD model of the part to compensate for the errors. The predicted tensile strength values can guide decisions for optimal part orientation and manufacturing parameter selection. However, while the networks developed for this study provide simple predictions of deviations and tensile strength that can be used in real-world applications for improving part quality and mechanical behaviour, the main utility of these networks is for informing the development of more complex networks or as modules in interconnected network designs.