Parametric Modeling and Optimization of Dimensional Error and Surface Roughness of Fused Deposition Modeling Printed Polyethylene Terephthalate Glycol Parts

Polyethylene Terephthalate Glycol (PETG) is a fused deposition modeling (FDM)-compatible material gaining popularity due to its high strength and durability, lower shrinkage with less warping, better recyclability and safer and easier printing. FDM, however, suffers from the drawbacks of limited dimensional accuracy and a poor surface finish. This study describes a first effort to identify printing settings that will overcome these limitations for PETG printing. It aims to understand the influence of print speed, layer thickness, extrusion temperature and raster width on the dimensional errors and surface finish of FDM-printed PETG parts and perform multi-objective parametric optimization to identify optimal settings for high-quality printing. The experiments were performed as per the central composite rotatable design and statistical models were developed using response surface methodology (RSM), whose adequacy was verified using the analysis of variance (ANOVA) technique. Adaptive neuro fuzzy inference system (ANFIS) models were also developed for response prediction, having a root mean square error of not more than 0.83. For the minimization of surface roughness and dimensional errors, multi-objective optimization using a hybrid RSM and NSGA-II algorithm suggested the following optimal input parameters: print speed = 50 mm/s, layer thickness = 0.1 mm, extrusion temperature = 230 °C and raster width = 0.6 mm. After experimental validation, the predictive performance of the ANFIS (mean percentage error of 9.33%) was found to be superior to that of RSM (mean percentage error of 12.31%).


Introduction
In recent years, additive manufacturing has grown rapidly to produce a variety of functional parts involving complex geometries with specific functionalities made from a wide range of materials. In contrast to traditional machining, where material is carved out from a block using suitable cutting tools to obtain the desired geometry [1,2], fused deposition modeling (FDM) is an extrusion-based AM process involving the layer-wise deposition of thermoplastic filaments in a semi-liquid state [3][4][5] using a computer-controlled deposition nozzle [6]. FDM allows researchers to obtain complex yet flexible and functional parts from a standard tessellation language (STL) file quickly, with high quality and a wide range of engineering thermoplastic materials [1], along with offering reduced assembly costs [7]. It is finding applications in the production of conceptual models/prototypes of functional parts for use in aerospace engineering [8], telecommunications [9] and automotive and biomedical implants. However, certain drawbacks, such as its lower dimensional accuracy, irregular surface finish and poor mechanical properties [7], limit its application. In recent years, numerous research endeavours have been performed that aimed to improve the quality and strength-related variables, including surface roughness, dimensional errors, strength and stiffness [10].
Dimensional accuracy is a measure of the variation in the size and specifications of the designed and the as-built parts [1,11] and improved dimensional accuracy is essential Spearman's ρ and Kendall's τ correlation coefficient. The surface roughness and tensile strength of PLA parts were studied by Altan et al. [29] in a study based on the Taguchi (L16) orthogonal array with layer thickness, deposition head velocity, nozzle temperature and cooling effect on the samples as the input parameters. ANOVA analysis revealed the former three parameters to be significant, with the effect of layer thickness being similar to the previous work. Nozzle temperature or the use of cooling fans were found to be the least effective parameters for controlling surface roughness.
Apart from these works, attempts focussing on the multi-objective optimization of the two output responses of interest were also reviewed. Anusree et al. [30] conducted a study investigating the influence of layer thickness, raster width, print speed and support material density on the dimensional accuracy, tensile strength and surface finish of ABS build helical parts. The study was unique, as the surfaces selected for experiment were helical instead of flat or circular, as opted for in the majority of the works in this field. Similar to Sood et al. [18], the three responses were converted into grey relational grade, which was further maximized using the Taguchi method. For the optimal parameter configuration, a smaller layer thickness value, higher raster width and intermediate print speed in conjunction with a rough support material density was recommended. The same three output responses were considered by Chung Wang et al. [31] with the input parameters being layer thickness, deposition style, support style, deposition orientation in the Z and X direction, and build location for ABS-built parts. The experimental methodology was similar to Anusree et al. [30], but with an extension of the verification of the results using a technique for ordering performance by similarity to the ideal solution. The findings of the study based on ANOVA revealed that deposition orientation in the Z direction and layer thickness were the most influential factors on dimensional accuracy and surface roughness, respectively. Bakar et al. [32] studied the variation in dimensional error and surface roughness with changing part shapes by considering different shapes, including slot, cube, ring and cylinder. The dimensional accuracy and surface roughness were found to depend on the specimen shape, with the cylindrical shape generally leading to higher dimensional deviation, whereas a complex curvy surface was found to give a deteriorated surface finish. A wider raster width was recommended for an improved surface finish while layer thickness was found to have a similar influence as reported in the reviewed literature.
It can be inferred from the literature review that the problem of minimizing the dimensional errors and surface roughness of FDM-built parts using parametric optimization is well known and studied by numerous research groups. For dimensional accuracy, lower levels of layer thickness and extrusion temperature are desired. Out of the several input parameters considered, the effects of varying the raster width and print speed have not been comprehensively reviewed and understood. For surface roughness, layer thickness has been determined to be the most significant parameter, followed by raster width, with lower levels of both recommended for obtaining an improved surface finish. Print speed is also a significant parameter influencing the surface finish of the built part. Moreover, the dimensional deviations were found to have different behaviour along the length, width and height of the samples and a different combination of parameters is desirable for minimizing these deviations. The dependence of surface roughness on the specimen shape has also been highlighted, with its magnitude being influenced by the flat or curvy nature of surfaces, as well as their orientation, i.e., flat or vertical.
Therefore, in the present work, the influence of selected input parameters on the dimensional deviations along the length, width and thickness, along with the surface finish of both flat as well as complex curvy surfaces, was investigated with an aim to achieve combinations of parameters that would lead to high dimensional accuracy and part finish for varying directions and differently oriented surfaces. Also, as both of these quality objectives are often concurrently desired and are differently influenced by different parameters [10], a need for the simultaneous optimization of the objectives was felt. Since the FDM process involves numerous conflicting parameters, the conventional optimization methods, such as the Taguchi and grey relational analysis [1] which have been used by majority of researchers, are less suitable due to their limited proficiency in describing a complex functional relationship for a non-linear process involving a number of interacting parameters [18,33]. The present investigation hence utilizes the non-dominated sorting genetic algorithm II (NSGA-II), an evolutionary algorithm that generates a set of nondominated solutions called the pareto front and allows the user to select the most fit solution from a given set of solutions.
It is inferred that most of the research work undertaken in the field of parametric optimization for the improvement of mechanical and physical parameters of FDM-built parts is dedicated to ABS and PLA material. In recent times, attempts have been made to investigate the applicability of previously unexplored FDM materials for various applications. Rahmatabadi et al. [34] explored the mechanical properties of food-grade, unmodified polyvinyl chloride for potential biomedical applications. The authors considered numerous tension modes, including compression, bending and tension, and studied the variation in strength with varying printing parameters. The study revealed the raster angle and print speed to be significant parameters, while the layer thickness and nozzle diameter had little effect on the said responses. Another FDM-compatible material, polyethylene terephthalate glycol (PETG), is gaining popularity in recent times. PETG is a glycol-modified version of polyethylene terephthalate (PET) [35] having high toughness, chemical resistance, durability, low forming temperature and, hence, proving to be a good material for thermoforming [36], extrusion, injection molding and FDM [36][37][38][39][40]. In recent times, PETG has found applications in medical industries, food packaging industries, electronics, etc. [41,42]. In FDM, the important benefits of printing with PETG over ABS include higher durability and strength, lower shrinkage with little or no warping, better recyclability [43], lower particle and volatile organic compound (VOC) emissions, and improved chemical resistance to alkali, acid and water [44]. Expanding on its application, Soleyman et al. [45] investigated the 4D printing capability and shape memory effect of PETG as a novel shape memory thermoplastic. The authors studied the appearance of a curved third shape sample as a function of printing temperature and speed and observed pronounced shape memory-affecting behaviour, with the total shape recovery exceeding 96%. These advantages have led researchers to perform investigative works to explore the potential of PETG as an alternative to ABS and PLA, as a filament material [46]. However, the majority of research efforts dedicated to the FDM printing of PETG parts aimed to analyse the relation between the process parameters and mechanical behaviour of the test specimens [47][48][49][50]. An eminent research gap was felt in studies aiming to understand the influence of FDM process parameters on dimensional errors in different directions and surface roughness on varied part surfaces and features along with the subsequent parametric optimization of the parameters. Additionally, no work has been reported performing the multi-objective optimization of PETG parts to minimize dimensional deviations while simultaneously obtaining improved part finishes.
The present research work aims at studying the effect of FDM process parameters, namely, print speed, layer thickness, extrusion temperature and raster width, on the dimensional accuracy and surface roughness of FDM-printed PETG parts. Since dimensional errors along the three directions behave differently, this work aims to understand these variations and how these are governed with the varying printing parameters. As an extension, the influence of the parameters on the dimensional errors introduced in a hole incorporated in the geometry is also considered. In the study, the specimen geometry and shape were selected to allow for the analysis of the significant parameters and their influence on the surface roughness of flat, inclined and curved surfaces. A four-factor, five-level central composite rotatable design was employed for performing a series of experiments. The recorded experimental data were statistically modelled using RSM and the adequacy of the developed models was verified using ANOVA. The significant parameters and their manner of influence on each of the seven output responses, including four dimensional deviations (X, Y, Z directions and hole) and three surface roughness responses (flat, inclined and curved), were considered. A Sugeno-type ANFIS model was also developed for the prediction of output response parameters and multi-objective optimization was conducted using an integrated RSM and NSGA-II algorithm approach. A phase-wise multi-objective optimization was performed to identify the combination of the input parameters that minimizes the dimensional errors as a whole, the combination that improves the overall surface finish and finally the combination that yields a parameter setting that will enable the printing of complicated PETG parts with the overall best quality. To validate the obtained results and compare the predictive performance of the developed models, the required validatory experiments were performed.

Experimental Plan and Procedure
Different process parameters influence the induced dimensional errors and the obtained surface finish on FDM-built parts to a lesser or greater extent [7,11,[51][52][53]. In the present study, the input parameters selected for assessing the dimensional accuracy and surface roughness included print speed (A), layer thickness (B), extrusion temperature (C) and raster width (D), as shown in Figure 1. The printing parameters can be briefly defined as follows: phase-wise multi-objective optimization was performed to identify the combination of the input parameters that minimizes the dimensional errors as a whole, the combination that improves the overall surface finish and finally the combination that yields a parameter setting that will enable the printing of complicated PETG parts with the overall best quality. To validate the obtained results and compare the predictive performance of the developed models, the required validatory experiments were performed.

Experimental Plan and Procedure
Different process parameters influence the induced dimensional errors and the obtained surface finish on FDM-built parts to a lesser or greater extent [7,11,[51][52][53]. In the present study, the input parameters selected for assessing the dimensional accuracy and surface roughness included print speed (A), layer thickness (B), extrusion temperature (C) and raster width (D), as shown in Figure 1. The printing parameters can be briefly defined as follows: Print Speed is referred to the travel speed of the print head along the XY plane (parallel to the build platform) while extruding.
Layer Thickness is the height (or thickness) of layers deposited after extrusion from nozzle tip measured along Z-direction (perpendicular to the build platform).
Extrusion Temperature is referred to as the temperature at which the filament material is heated in the liquefier before extrusion [52]. It depends on properties of thermoplastic material being used.
Raster Width is the width of the molten filament which is deposited on the FDM printer bed [54]. It depends on the diameter of the extruder nozzle tip. The working ranges of the four selected process parameters were divided into five levels, as shown in Table 1. They were chosen on the basis of literature survey, hardware and printer specification restrictions, Ultimaker Cura 15.04.6 building simulation and trial experiments. The trial experiments were conducted in such a manner that only one of the FDM process variables was varied keeping the rest of them fixed. The upper and lower limits were decided based on part quality obtained between them.  Print Speed is referred to the travel speed of the print head along the XY plane (parallel to the build platform) while extruding.
Layer Thickness is the height (or thickness) of layers deposited after extrusion from nozzle tip measured along Z-direction (perpendicular to the build platform).
Extrusion Temperature is referred to as the temperature at which the filament material is heated in the liquefier before extrusion [52]. It depends on properties of thermoplastic material being used.
Raster Width is the width of the molten filament which is deposited on the FDM printer bed [54]. It depends on the diameter of the extruder nozzle tip.
The working ranges of the four selected process parameters were divided into five levels, as shown in Table 1. They were chosen on the basis of literature survey, hardware and printer specification restrictions, Ultimaker Cura 15.04.6 building simulation and trial experiments. The trial experiments were conducted in such a manner that only one of the FDM process variables was varied keeping the rest of them fixed. The upper and lower limits were decided based on part quality obtained between them. composite technique of rotatable configuration was employed, consisting of a total of 30 runs. The 30 runs comprised of 2 4 = 16 runs using half factorial, 6 runs representing center points and 2 × 4 = 8 runs representing star points [55].
With an aim of understanding the distinct manner of influence of the process parameters and arriving at parameter settings to enable optimal printing of complex FDM-printed PETG parts, the specimen geometry was designed such that it had varying surfaces and contours to measure the desired responses. The part was designed using SolidWorks 2021 and had a dimension of 50 × 50 × 25 mm with a hole of 20 mm diameter as shown in Figure 2a. The dimensional errors were measured along the three cartesian axes (X, Y and Z direction) to understand the extent of influence of the dynamic effect of the nozzle (controlling the X and Y direction) and the printer bed drive system (controlling the Z direction), along with the tendency of material expansion and shrinkage across different directions. The hole geometry was studied to further investigate the proneness of material spreading when unconstrained by surrounding extruded filament as a function of varying printing settings. Since the nature of material deposition varies for different surface profiles and features, the printing parameters influence the surface finish of these surfaces differently, as also observed by Khan and Mishra [56]. In line with the objective of the study, the specimen geometry incorporated flat, inclined and curved surfaces (Figure 2b), to enable the recording and analysis of effects of selected printing parameters on the surface roughness of the as printed profiles. Based on the process parameters and their working levels, design of experiment's technique was employed to generate a design matrix using Design Expert v13. To develop the empirical models for dimensional accuracy and surface roughness, four-factor central composite technique of rotatable configuration was employed, consisting of a total of 30 runs. The 30 runs comprised of 2 4 = 16 runs using half factorial, 6 runs representing center points and 2 × 4 = 8 runs representing star points [55].
With an aim of understanding the distinct manner of influence of the process parameters and arriving at parameter settings to enable optimal printing of complex FDMprinted PETG parts, the specimen geometry was designed such that it had varying surfaces and contours to measure the desired responses. The part was designed using Solid-Works 2021 and had a dimension of 50 × 50 × 25 mm with a hole of 20 mm diameter as shown in Figure 2a. The dimensional errors were measured along the three cartesian axes (X, Y and Z direction) to understand the extent of influence of the dynamic effect of the nozzle (controlling the X and Y direction) and the printer bed drive system (controlling the Z direction), along with the tendency of material expansion and shrinkage across different directions. The hole geometry was studied to further investigate the proneness of material spreading when unconstrained by surrounding extruded filament as a function of varying printing settings. Since the nature of material deposition varies for different surface profiles and features, the printing parameters influence the surface finish of these surfaces differently, as also observed by Khan and Mishra [56]. In line with the objective of the study, the specimen geometry incorporated flat, inclined and curved surfaces ( The STL file of the CAD drawing was loaded into Ultimaker Cura to slice the model file into layers, set process parameters and generate a printer-specific g-code for each specimen. The parts were printed as per the instruction code using ShaperJet SJ200 based on FDM technology, having a build size of 200 × 200 × 200 mm, printing speed ranging from 10 to 100 mm/s, extruder temperature 180-270 °C and a blower for cooling printed parts. All the samples were prepared with the raster angle of 45° and printer bed temperature fixed at 70 °C to ensure sufficient bonding of the first layer and avoid warpage of samples. In order to vary the raster width, five different diameter nozzles (0.2 mm, 0.3 mm, 0.4 mm, 0.5 mm, and 0.6 mm) were used. 3DXTech PETG filament wire having a diameter of 1.75 ± 0.05 mm and density of 1.24 g/cm 3 was employed for the experiment.
Once the parts were printed, the dimensional error and surface roughness measurement was done. To measure the dimensional error along the cartesian axis (X, Y and Z) The STL file of the CAD drawing was loaded into Ultimaker Cura to slice the model file into layers, set process parameters and generate a printer-specific g-code for each specimen. The parts were printed as per the instruction code using ShaperJet SJ200 based on FDM technology, having a build size of 200 × 200 × 200 mm, printing speed ranging from 10 to 100 mm/s, extruder temperature 180-270 • C and a blower for cooling printed parts. All the samples were prepared with the raster angle of 45 • and printer bed temperature fixed at 70 • C to ensure sufficient bonding of the first layer and avoid warpage of samples. In order to vary the raster width, five different diameter nozzles (0.2 mm, 0.3 mm, 0.4 mm, 0.5 mm, and 0.6 mm) were used. 3DXTech PETG filament wire having a diameter of 1.75 ± 0.05 mm and density of 1.24 g/cm 3 was employed for the experiment.
Once the parts were printed, the dimensional error and surface roughness measurement was done. To measure the dimensional error along the cartesian axis (X, Y and Z) and cylindrical hole, a Mitutoyo manufactured vernier calliper having a least count of 0.02 mm was used. Three readings of dimensional error were taken along each of the cartesian axes and four readings were taken for the dimensional error of the hole. The mean values of the recorded responses are as shown in Table 2. For surface roughness measurement of the flat, inclined and curved profiles, SURFTEST SJ-210, a compact and portable surface roughness tester, manufactured by Mitutoyo with the lowest count of 0.001 µm was used. The stylus moves across the specimen surface with defined measuring speed and length to trace the irregularities on the workpiece surface. The surface profile and surface roughness (R a ) are displayed as the output on the screen. For the purpose of this measurement, a Gaussian filter was applied and ISO 1997 roughness standard was followed. The cut off wavelength was set at 0.25 mm, measuring speed at 0.5 mm/s and number of sampling lengths at x5. The direction of surface roughness measurement was perpendicular to the lay direction and a sine bar was also used along with SJ-210 for measurement of inclined and curved profiles. The setup used for measurement is shown in Figure 3 while, Figure 4 shows a sample report for flat profile generated by SJ-210 for run 12. A total of five readings were taken for the flat profile and four readings each for inclined and curved surfaces, and their mean values are as shown in Table 2. The readings as shown in Table 2, were supplied to the design of experiments and were used as the input data for making the predictive models as explained further.

Statistical Modelling of Experimental Data
Response surface methodology (RSM) was used to develop statistical model ferent output parameters owing to its better predictive performance for low ord linear processes with a regular experimental domain, as reported by Benyounis et The factor contributions derived from the coefficients in the RSM developed re model allow for identifying the insignificant factors and interactions, thereby r the complexity of the problem. In this study, Design Expert v13 software was use velop second order quadratic RSM models (shown in Equation (1)) on the input da in Table 2 to estimate linear, interaction and quadratic effects of the input factor provide prediction models for response parameters.
Let Q denote the predicted response value dependent on the four input par namely, print speed (A), layer thickness (B), extrusion temperature (C) and raste (D). Then, Q can be written as

Statistical Modelling of Experimental Data
Response surface methodology (RSM) was used to develop statistical models for different output parameters owing to its better predictive performance for low order nonlinear processes with a regular experimental domain, as reported by Benyounis et al. [55]. The factor contributions derived from the coefficients in the RSM developed regression model allow for identifying the insignificant factors and interactions, thereby reducing the complexity of the problem. In this study, Design Expert v13 software was used to develop second order quadratic RSM models (shown in Equation (1)) on the input data given in Table 2 to estimate linear, interaction and quadratic effects of the input factors and to provide prediction models for response parameters.
Let Q denote the predicted response value dependent on the four input parameters namely, print speed (A), layer thickness (B), extrusion temperature (C) and raster width (D). Then, Q can be written as where Q = predicted response value, p i , p j = coded values of the input parameters (A, B, C, D), γ 0 = regression equation constant, γ i = linear coefficient, γ ii = square term of each parameter, γ ij = first order interaction effect. The regression equations for the response parameters are as given in Equations (2)- (8).
The appropriacy of the models developed was confirmed using analysis of variance (ANOVA) and the values obtained are as shown in Table 3. ANOVA was used to test the significance of the developed models and identify the significant linear, quadratic and interaction terms for all output responses. The details on working of ANOVA can be found in Kaufmann et al. [57]. The p-value for developed models of all responses was found to be <0.05, which implied that the models were significant at 95% confidence level. The terms with p-value lower than 0.05 were considered significant and are mentioned in Table 4. The high R 2 values as given in Table 3 are desirable as it shows that a high percent of the observed variation of the dependent variable can be explained based on the alterations in the independent input printing parameters. Higher R 2 values denote lesser influence of external noise on the developed models. Adeq Precision is a measure of the signal-to-noise ratio of the developed models and values greater than 4 verify the signal adequacy.

Output Parameter Significant Factors
Dimensional error X

ANFIS Model for Prediction
Adaptive neuro fuzzy inference system (ANFIS) refers to a neuro-fuzzy system inheriting the advantages of both FIS network and artificial neural network by developing a multilayer feed forward neural network [58]. An artificial neural network can enhance the learning process but has limitation with regards to deduction and expression of the knowledge acquired. The FIS on the other hand, has good knowledge learning capabilities based on linguistic variables that are easy to comprehend and follow, but lacks the learning capabilities of artificial neural network [59]. An ANFIS network integrates these advantages and overcomes the individual drawbacks by employing the neural network architecture for adjusting the FIS parameters including the membership functions and the IF-THEN rules [60]. This working approach renders ANFIS effective in a broader range of real-world applications including FDM process performance prediction [59].
An ANFIS network involves five network layers along with a learning algorithm. The learning algorithm modifies the model as per the input and output dataset by adapting the parameters including, the membership functions and the firing strength of the rule. A brief working of the ANFIS architecture is described here, however, for deeper understanding one can refer Rajpurohit and Dave [61]. Layer 1 as shown in Figure 5a, is the fuzzification layer wherein, each input node is an adaptive node which is converted into linguistics using the membership functions. In the product layer i.e., layer 2, each node is fixed and gets multiplied by the incoming signals, and the firing strength of the rule is adjudged. Normalization of the firing strength of each node from layer 2 is performed in layer 3 where all the nodes are fixed. Layer 4 is the adaptive defuzzification layer where the normalized firing strength of each rule is multiplied with the resulting output response. Layer 5 is the final layer that yields the output modelled by ANFIS network.
In the present study, a Sugeno type ANFIS model was developed consisting of four inputs (A, B, C, D) for each response variable. Moreover, the network used the hybrid learning algorithm which employs the least square method in the forward passage to identify the network parameters and the gradient descendent method while propagating backwards. The hybrid learning approach is very efficient as it converges much faster compared to back propagation algorithm and avoids the tendency of getting trapped at a local minimum [58,60,61].
The Neuro Fuzzy Design tool of MATLAB MathWorks was used to model ANFIS structure for predicting the values of the four responses for dimensional error and the three responses accounting for the surface roughness for different surface profiles. The ANFIS modelling workflow is summarized in Figure 5b. In the present study, a Sugeno type ANFIS model was developed consisting of four inputs (A, B, C, D) for each response variable. Moreover, the network used the hybrid learning algorithm which employs the least square method in the forward passage to identify the network parameters and the gradient descendent method while propagating backwards. The hybrid learning approach is very efficient as it converges much faster compared to back propagation algorithm and avoids the tendency of getting trapped at a local minimum [58,60,61].
The Neuro Fuzzy Design tool of MATLAB MathWorks was used to model ANFIS structure for predicting the values of the four responses for dimensional error and the three responses accounting for the surface roughness for different surface profiles. The ANFIS modelling workflow is summarized in Figure 5b.
The ANFIS network is developed by training the algorithm on a training dataset containing the input/output pairs needed to form the network. The supplied inputs and outputs in the training data set are adaptively mapped using different membership functions, rule bases, and associated parameters acquired from the loaded learning dataset. From the obtained experimental data approximately 85% of the observations were utilized for training the model and finding the premise parameters for the membership functions while the remainder data was reserved for testing purposes. After the training data was loaded in the neuro-fuzzy designer module, the next step involved the generation of FIS which entailed the selection of the membership function. For the study, three different membership functions, triangular membership function (trimf), trapezoidal membership function (trapmf) and gauss membership function (gaussmf) were used to develop three different ANFIS models for each response parameter.
Further, the epochs value was set at 200 and the hybrid optimization method was selected as the learning algorithm with zero error tolerance. The model was then trained with the specified parameters and upon completion of training, dataset for testing was loaded in the ANFIS system. Subsequent testing was carried out for all three membership functions and the root mean square error (RMSE) was recorded for each test performed. Finally, the model with the least average testing error was selected as the final model for The ANFIS network is developed by training the algorithm on a training dataset containing the input/output pairs needed to form the network. The supplied inputs and outputs in the training data set are adaptively mapped using different membership functions, rule bases, and associated parameters acquired from the loaded learning dataset. From the obtained experimental data approximately 85% of the observations were utilized for training the model and finding the premise parameters for the membership functions while the remainder data was reserved for testing purposes. After the training data was loaded in the neuro-fuzzy designer module, the next step involved the generation of FIS which entailed the selection of the membership function. For the study, three different membership functions, triangular membership function (trimf), trapezoidal membership function (trapmf) and gauss membership function (gaussmf) were used to develop three different ANFIS models for each response parameter.
Further, the epochs value was set at 200 and the hybrid optimization method was selected as the learning algorithm with zero error tolerance. The model was then trained with the specified parameters and upon completion of training, dataset for testing was loaded in the ANFIS system. Subsequent testing was carried out for all three membership functions and the root mean square error (RMSE) was recorded for each test performed. Finally, the model with the least average testing error was selected as the final model for prediction purpose. Table 5 documents the average testing error for each of the three selected membership functions for the different quality responses. The bold value highlights least value of RMSE and hence, the model selected for response prediction.  Figure 5c shows a representative ANFIS architecture as modelled in MATLAB. The dynamic training error behaviour against the training dataset during the training of the ANFIS model for dimensional error in X direction based on the trapezoidal membership function is shown in Figure 6. After 200 epochs the error converged to a constant value of 0.048703 signifying adequate model training. Figure 7 gives the variation in the values of dimensional error in X obtained after testing (red asterisks) from the original testing data point values (blue data points) and it was observed that the maximum % error was less than 0.4%. The low errors for all the seven quality responses confirmed that the values predicted by the developed ANFIS models were in good proximity with the experimentally measured values.

S. No.
Membership  Figure 5c shows a representative ANFIS architecture as modelled in MATLAB. The dynamic training error behaviour against the training dataset during the training of the ANFIS model for dimensional error in X direction based on the trapezoidal membership function is shown in Figure 6. After 200 epochs the error converged to a constant value of 0.048703 signifying adequate model training. Figure 7 gives the variation in the values of dimensional error in X obtained after testing (red asterisks) from the original testing data point values (blue data points) and it was observed that the maximum % error was less than 0.4%. The low errors for all the seven quality responses confirmed that the values predicted by the developed ANFIS models were in good proximity with the experimentally measured values.    Figure 5c shows a representative ANFIS architecture as modelled in MATLAB. The dynamic training error behaviour against the training dataset during the training of the ANFIS model for dimensional error in X direction based on the trapezoidal membership function is shown in Figure 6. After 200 epochs the error converged to a constant value of 0.048703 signifying adequate model training. Figure 7 gives the variation in the values of dimensional error in X obtained after testing (red asterisks) from the original testing data point values (blue data points) and it was observed that the maximum % error was less than 0.4%. The low errors for all the seven quality responses confirmed that the values predicted by the developed ANFIS models were in good proximity with the experimentally measured values.

Multi-Objective Optimization Using Integration of RSM and NSGA-II
Multi-objective optimization of the response parameters was performed by integration of RSM and NSGA-II. NSGA-II, a widely used multi-objective evolutionary algorithm is an improved version of NSGA and overcomes limitations such as computational complexity, lack of elitism, and selection of optimal parameter value for sharing parameter [62]. NSGA-II applies binary tournament selection, elitist preserving strategy, non-dominated sorting, and crowding distance mechanism to obtain a good quality and uniformly spread nondominated solution set [63]. The algorithm begins by randomly generating an initial population which is sorted based on non-domination, into fronts. Every individual in each front is assigned rank (fitness) values based on the front it belongs to. In addition to this, crowding distance which is a measure of how close an individual is to its neighbours is also calculated. The parents for the next generation are selected using binary tournament based on rank and crowding distance. An individual with lower rank is preferred during selection, however, in case the rank is same for the two individuals, higher crowding distance is used as the selection criteria. To produce the new population, genetic operators are applied and both the populations, initial and newly formed, are combined to perform non-dominated sorting. The best individuals equal to the population size are then selected and for the last front, selection is again based on the rank and crowding distance [64].
In the present work, multi-objective optimization was performed in three phases to identify optimal parameter combinations for reducing all the dimensional errors (DE x , DE y , DE z , DE hole ), for minimization of surface roughness for different surface profiles (SR flat , SR inclined and SR curved ) and for simultaneously minimizing the dimensional errors and obtaining the best overall surface finish. The 'gamultiobj' algorithm in MATLAB's optimization toolbox was used whose elitism is controlled by two options, ParetoFraction and DistanceMeasureFcn. The former option limits the elite members, i.e., the number of members on the pareto front and the latter maintains the diversity of the population by preferring the members which are relatively far away on the front. To perform the multi-objective optimization, quadratic expressions furnished by RSM, expressed in Equations (2)-(8) were used as the objective functions in the algorithm. The constraints for the optimization problems included lower and upper bound of input parameters, non-negative constraints and the upper bounds for the responses based on the obtained experimental data.
For all three multi-objective optimization problems, the 'gamultiobj' options were kept uniform. The population size was defined as 500, the maximum generations was set at 200, crossover fraction was fixed at 0.8 and elite count was taken to be 0.05 of population size. The algorithm terminated with the message "Optimization terminated: average change in the spread of Pareto solutions less than options. FunctionTolerance." highlighting that the relative improvement in the generated pareto solutions for successive iterations was lower than the minimum threshold as specified in FunctionTolerance which was set at the default value of 1 × 10 −4 . The "gamultiobj" algorithm returned a set of 175 non-dominated or pareto solutions for each problem. Figure 8 summarizes the detailed workflow used in the study for integrated RSM and NSGA-II approach. The solutions generated by NSGA-II are called non-dominated as they are all equally optimal and there is no single solution that simultaneously optimizes all objectives [65,66]. For extracting a single solution, an additional decision-making process was implemented keeping in view the optimization goals along with making necessary trade-offs. The best solutions for the multi-objective optimization problems as recommended by the hybrid approach are summarized in Table 6. Figure 9 shows the graphical depiction of the pareto front obtained for multi-objective optimization problem for simultaneous minimization of surface roughness of all profiles. Table 6. Parameter settings for optimization of quality responses as recommended by the hybrid The solutions generated by NSGA-II are called non-dominated as they are all equally optimal and there is no single solution that simultaneously optimizes all objectives [65,66]. For extracting a single solution, an additional decision-making process was implemented keeping in view the optimization goals along with making necessary trade-offs. The best solutions for the multi-objective optimization problems as recommended by the hybrid approach are summarized in Table 6. Figure 9 shows the graphical depiction of the pareto front obtained for multi-objective optimization problem for simultaneous minimization of surface roughness of all profiles.  In practice, the printing parameters can only take certain discrete values at constant steps in almost all commercially available FDM printers due to limitations of the printer hardware and layer tessellation precision. Therefore, the optimal values of input parameters as suggested by the algorithm were shifted to the nearest coded level for ensuring universal applicability of results. The shifted readings are as summarized in the Table 7.   In practice, the printing parameters can only take certain discrete values at constant steps in almost all commercially available FDM printers due to limitations of the printer hardware and layer tessellation precision. Therefore, the optimal values of input parameters as suggested by the algorithm were shifted to the nearest coded level for ensuring universal applicability of results. The shifted readings are as summarized in the Table 7. Table 7. Shifted parameter settings for optimizing dimensional error and surface roughness.

Discussion on Dimensional Error
Figure 10a-d depicts the response plots of dimensional errors DE x , DE y , DE z and DE hole , showing the effect of various process parameters. ANOVA revealed the layer thickness and raster width to be significant parameters for all the dimensional deviations, which is further supported by the responses' noticeable fluctuation with varying levels of the said parameters. In the FDM process, the heat carried by the extruded material is dissipated via modes of conduction and forced convection as the material cools down from the extrusion temperature to the glass transition temperature. The temperature reduction, as a consequence of this phenomenon, forces the material to rapidly solidify onto the previously deposited layers. The heat content of the just-extruded material, however, causes the localized remelting of the previously solidified material, leading to bonding amongst the deposited rasters [18]. This sequence of rapid cooling and heating cycles results in setting up non-uniform thermal gradients within the deposited material and in turn amplifying its tendency to undergo dimensional distortion or warping. The warping behaviour is restricted as the number of layers is increased, as observed by Wang et al. [67], owing to the lower thermal stress accumulation [11]. A similar trend was observed in the present study, wherein the percentage increase in dimensional errors was reported to be 24%, 49%, 93% and 11% for DE x , DE y , DE z and DE hole as layer thickness increased from 0.1 mm to 0.3 mm. At lower layer thickness values, the number of layers deposited for part fabrication increased and, as a consequence, the dimensional errors were minimized. The high increase in DE z can be attributed to the height error observed along the Z direction, as was also observed by Mohamed et al. [11]. The dimension of the designed part was 25 mm in the Z direction, resulting in the number of layers required to be deposited for printing being 250 and 83.33, respectively, as the layer thickness varied from 0.1 mm to 0.3 mm. In the latter case, 83 layers were deposited normally; however, to account for the left 0.33 layers, the printer deposited another layer (84th) at the layer height of 0.3 mm. Hence, there was an increase in the fabricated part height with reference to the designed height, leading to more pronounced dimensional deviations in the Z direction at a higher layer thickness.
As observed in Figure 10a-d, the dimensional errors reduced as the raster width was reduced from 0.6 mm to 0.2 mm. At finer raster widths, the material exiting the nozzle was reduced, hence the heat content entering the system environment was also less. The lower heat content restricted the localized remelting of the previously deposited material, thereby limiting the thermal stress accumulation at the interface [18]. Moreover, a precise raster width inhibited the radial expansion of the polymer melt exiting the nozzle [54] and hence led to reduced dimensional errors.
For dimensional errors DE x , DE y and DE z , print speed was another significant parameter, as also summarized in Table 4. The increased dynamic effect of the nozzle drive system at higher print speeds gave rise to a jerky motion [52] of the nozzle. The jerky movement inhibited the ability of the nozzle to deposit precise rasters and hence contributed to high dimensional errors in the XY plane. An increase of 27% and 35% was noted for DE x and DE y as the print speed increased from 20 mm/s to 80 mm/s. The percentage increase, however, was found to be even higher in DE z (approximately 50%), due to the combined action of the dynamic drive effect and the drawing phenomenon [19]. The latter occurs at high print speeds, wherein the extruded filament does not adhere to previously fabricated layers but rather moves with the nozzle due to there being insufficient time available for fusing with deposited layers. Thus, for improved dimensional accuracy, lower print speeds are recommended. mm to 0.3 mm. At lower layer thickness values, the number of layers deposited for part fabrication increased and, as a consequence, the dimensional errors were minimized. The high increase in DEz can be attributed to the height error observed along the Z direction, as was also observed by Mohamed et al. [11]. The dimension of the designed part was 25 mm in the Z direction, resulting in the number of layers required to be deposited for printing being 250 and 83.33, respectively, as the layer thickness varied from 0.1 mm to 0.3 mm. In the latter case, 83 layers were deposited normally; however, to account for the left 0.33 layers, the printer deposited another layer (84th) at the layer height of 0.3 mm. Hence, there was an increase in the fabricated part height with reference to the designed height, leading to more pronounced dimensional deviations in the Z direction at a higher layer thickness. As observed in Figure 10a-d, the dimensional errors reduced as the raster width was reduced from 0.6 mm to 0.2 mm. At finer raster widths, the material exiting the nozzle was reduced, hence the heat content entering the system environment was also less. The lower heat content restricted the localized remelting of the previously deposited material, thereby limiting the thermal stress accumulation at the interface [18]. Moreover, a precise raster width inhibited the radial expansion of the polymer melt exiting the nozzle [54] and hence led to reduced dimensional errors. The extrusion temperature was found to exercise a significant influence on DE x and DE y . The increased material fluidity at higher extrusion temperatures led to excessive material spreading post-deposition [12], posing another challenge for depositing precise rasters. However, in the Z direction, the magnitude of the error remained nearly constant, with varying extrusion temperature highlighting that the increased material fluidity exerted a lesser pronounced effect in the Z-direction as compared to the XY movement plane of the printer.
Moreover, the magnitudes of dimensional errors introduced for the internal feature, i.e., the curved hole surface, were, on an average, four times higher than the dimensional errors along the X, Y and Z directions. The explanation for the same can be based on the higher tendency of the semi-molten material to spread, especially when unconstrained by the surrounding material, as in the case of the hole geometry.

Discussion on Surface Roughness
The graphs obtained for the variation in surface roughness with the varying printing parameters are shown in Figure 11a-c. For all the three surfaces considered, ANOVA returned layer thickness and raster width to be the significant parameters. It was observed from the plots that lower layer thickness values led to an improved surface finish, aligning with the majority of the literature reviewed [25,28]. This behaviour can be attributed to the reduced staircase effect owing to the precise layer tessellation under such premises. The trend for roughness magnitude variation was similar for raster width as well, with finer raster widths leading to an improved surface finish by allowing for the deposition of precise rasters. The precise rasters reduce the surface irregularities and roughness. errors along the X, Y and Z directions. The explanation for the same can be based on the higher tendency of the semi-molten material to spread, especially when unconstrained by the surrounding material, as in the case of the hole geometry.

Discussion on Surface Roughness
The graphs obtained for the variation in surface roughness with the varying printing parameters are shown in Figure 11a-c. For all the three surfaces considered, ANOVA returned layer thickness and raster width to be the significant parameters. It was observed from the plots that lower layer thickness values led to an improved surface finish, aligning with the majority of the literature reviewed [25,28]. This behaviour can be attributed to the reduced staircase effect owing to the precise layer tessellation under such premises. The trend for roughness magnitude variation was similar for raster width as well, with finer raster widths leading to an improved surface finish by allowing for the deposition of precise rasters. The precise rasters reduce the surface irregularities and roughness. The factors of print speed and extrusion temperature did not exercise a significant influence on the surface roughness, as also seen in Figure 11a-c, where the magnitude of surface roughness remained nearly the same while varying the said inputs. However, as per ANOVA, the combined interaction effect of print speed and extrusion temperature (AC) was observed to be a significant factor influencing the surface roughness of the flat profile. The quadratic term AC being significant highlights that the simultaneous effect of these parameters on surface roughness for the flat profile is significantly greater than the individual effects they exercise. Figure 12 gives the response plot for the combined interaction effect for AC. When extrusion temperature was fixed at its lowest value, i.e., −2 coded level (200 °C ), and print speed was incremented, the surface roughness was observed to increase. This trend can be attributed to the vibrations induced in the nozzle system while depositing the thermoplastic material at high speeds. However, when the print speed was fixed at the −2 coded level (20 mm/s) and the extrusion temperature was increased, the part surface finish first improved then deteriorated. At lower printing temperatures, the material tended to stick to the nozzle during extrusion, leading to inconsistent deposition, which in turn was re- The factors of print speed and extrusion temperature did not exercise a significant influence on the surface roughness, as also seen in Figure 11a-c, where the magnitude of surface roughness remained nearly the same while varying the said inputs. However, as per ANOVA, the combined interaction effect of print speed and extrusion temperature (AC) was observed to be a significant factor influencing the surface roughness of the flat profile. The quadratic term AC being significant highlights that the simultaneous effect of these parameters on surface roughness for the flat profile is significantly greater than the individual effects they exercise. Figure 12 gives the response plot for the combined interaction effect for AC. When extrusion temperature was fixed at its lowest value, i.e., −2 coded level (200 • C), and print speed was incremented, the surface roughness was observed to increase. This trend can be attributed to the vibrations induced in the nozzle system while depositing the thermoplastic material at high speeds. However, when the print speed was fixed at the −2 coded level (20 mm/s) and the extrusion temperature was increased, the part surface finish first improved then deteriorated. At lower printing temperatures, the material tended to stick to the nozzle during extrusion, leading to inconsistent deposition, which in turn was responsible for surface unevenness post-printing. In the same configuration, when temperature rises, surface finish improves slightly, however, beyond −1 coded level (i.e., 215 • C), the material fluidity increases, causing the material to spread in an unconstrained manner and solidifying unevenly, thereby introducing a poor surface finish. A similar trend was observed as the extrusion temperature was decreased while keeping the print speed fixed at a maximum coded level of +2 (80 mm/s). A poor surface finish was observed when print speed was reduced while keeping th extrusion temperature constant at its maximum value. Although the lower print speed ensured a reduced dynamic drive effect and vibration, it gave more time for the highly fluid material (due to high extrusion temperature) to spread. Surface roughness wa found to be the maximum (10.75 µ m) when the extrusion temperature was at the highes coded level and the print speed was at its lowest value.
Finally, a comparison of the surface roughness of the three different profiles revealed that the surface finish of the flat profile was considerably better than the other two pro files, with the inclined surface having the highest Ra value. The observations can be at tributed to a pronounced staircase effect, especially for 3D-printed curvy surfaces. For th inclined surface profile, the issue was further compounded due to the nature of materia deposition at the surface.

Validation of RSM, ANFIS and Hybrid RSM and NSGA-II Models
In the study, two predictive models, including RSM and ANFIS, were developed and multi-objective optimization was performed using the hybrid RSM and NSGA-I method. As an attempt to validate the appropriacy of the developed models, the inpu parameter settings of the best run identified for performing PETG printing with the leas dimensional deviations and high surface finish, as documented in Table 6, were supplied to the RSM and ANFIS models. The consequent responses, as predicted by the models are documented in Table 8. The values returned by the predictive techniques were in clos proximity to those suggested by the hybrid RSM-NSGA-II approach for the best run. A poor surface finish was observed when print speed was reduced while keeping the extrusion temperature constant at its maximum value. Although the lower print speed ensured a reduced dynamic drive effect and vibration, it gave more time for the highly fluid material (due to high extrusion temperature) to spread. Surface roughness was found to be the maximum (10.75 µm) when the extrusion temperature was at the highest coded level and the print speed was at its lowest value.
Finally, a comparison of the surface roughness of the three different profiles revealed that the surface finish of the flat profile was considerably better than the other two profiles, with the inclined surface having the highest R a value. The observations can be attributed to a pronounced staircase effect, especially for 3D-printed curvy surfaces. For the inclined surface profile, the issue was further compounded due to the nature of material deposition at the surface.

Validation of RSM, ANFIS and Hybrid RSM and NSGA-II Models
In the study, two predictive models, including RSM and ANFIS, were developed, and multi-objective optimization was performed using the hybrid RSM and NSGA-II method. As an attempt to validate the appropriacy of the developed models, the input parameter settings of the best run identified for performing PETG printing with the least dimensional deviations and high surface finish, as documented in Table 6, were supplied to the RSM and ANFIS models. The consequent responses, as predicted by the models, are documented in Table 8. The values returned by the predictive techniques were in close proximity to those suggested by the hybrid RSM-NSGA-II approach for the best run. Moreover, for comparing the predictive performance of the developed ANFIS and RSM models, a comparison between the predicted values of the output responses from these models and the actual values after undergoing experimental validation was performed. The shifted parameter settings, based on the hybrid optimization approach for simultaneously optimizing all of the seven quality responses, as shown in Table 7, were chosen for the experimental run for validation. Three parts were printed and the output responses were measured using the predefined procedure. The mean values of the responses as measured along with the predicted responses from the RSM and ANFIS models are shown in Table 9. The experimental and the predicted value from the models were compared and the deviation of the predictions from the actual values were represented in the form of percentage error bars. Figure 13a,b highlight a higher deviation in the predicted values of dimensional error and surface roughness responses for the RSM design than the ANFIS predictive model. All the predicted values by the ANFIS model except for DE hole were in ±12% of the mean experimental values; however, for RSM, most of the values deviated from the range of faults. As shown in Table 9, the average error in prediction from the ANFIS model was computed to be 9.33%, in contrast to an average error of 12.31% for RSM. Thus, ANFIS was found to have better predictive performance, which can be attributed to its superior knowledge learning capabilities. The limited accuracy of RSM arises due to the limitations in the polynomial estimation leading to a poor representation of the optimal parameters [14].
±12% of the mean experimental values; however, for RSM, most of the values deviated from the range of faults. As shown in Table 9, the average error in prediction from the ANFIS model was computed to be 9.33%, in contrast to an average error of 12.31% for RSM. Thus, ANFIS was found to have better predictive performance, which can be attributed to its superior knowledge learning capabilities. The limited accuracy of RSM arises due to the limitations in the polynomial estimation leading to a poor representation of the optimal parameters [14].

Conclusions
In the present study, an attempt was made to model the FDM process and conduct the multi-objective optimization of FDM-printed PETG parts. A series of experiments were performed using a four-factor central composite rotatable design to study and analyse the effects of print speed, layer thickness, extrusion temperature and raster width on dimensional error in different directions and for different surface roughness values of varied profiles of the built specimen. The statistical models for the responses were developed using RSM and their adequacy was verified using ANOVA. ANFIS models were also constructed for the prediction of output responses and multi-objective optimization was conducted using an integrated RSM and NSGA-II approach.
ANOVA revealed layer thickness and raster width to be significant parameters for all the dimensional deviations. At lower values of layer thickness, the dimensional accuracy improved as the number of layers required for printing the part increased, further limiting the setup of non-uniform thermal gradients within the deposited material. Reduced raster width enabled the deposition of precise rasters and hence resulted in high dimensional accuracy in the built samples. The trend was attributed to two primary reasons. Firstly, fine raster widths ensured that less heat content entered the system environment, leading to reduced thermal stress accumulation at the interface during the solidification of the newly deposited material on the previous layer. Moreover, the radial expansion of polymer melt exiting the nozzle was also curtailed at a lower raster width, thereby reducing the dimensional errors. Print speed was also found to be a significant parameter for dimensional errors introduced along the length, width and thickness of the built parts. Lower print speed values led to improved dimensional accuracy owing to the reduced dynamic effect of the drive system. The effect of increased print speed was further pronounced in the Z direction owing to the drawing phenomenon, wherein the extruded material melt did not adhere to the previously deposited layers but moved with the extruder nozzle because of there being insufficient time available for the bonding to occur. A rise in extrusion temperature was found to enhance the material fluidity, causing excessive material spreading which led to marked dimensional errors along the X and Y directions. With the same process parameters settings, the dimensional error introduced in the hole geometry was found to be about four times higher than dimensional errors along the part's length, width and thickness. This can be attributed to the tendency of the deposited material to spread, especially when unconstrained by surrounding geometry, as in the case of the hole.
Layer thickness and raster width were also significant parameters for the obtained surface roughness on the flat, inclined and curved surfaces. The direct trend plots showed surface finish to be better at smaller values of layer height and raster width due to the reduced staircase effect owing to the precise layer tessellation and allowing for the deposition of precise rasters, respectively. Moreover, the combined interaction effect of print speed and extrusion temperature was also found to exercise a significant influence on the surface roughness of the flat profile. The surface finish was found to be the poorest (10.75 µm) when the extrusion temperature was at the highest coded level and the print speed was at its lowest value. Furthermore, the surface finish obtained for the flat profile was best, followed by that of the curved and inclined profiles. The staircase effect and the nature of the material deposition are the chief contributors to this trend.
The hybrid RSM and NSGA-II multi-objective optimization approach was utilized to obtain the optimal printing settings for different premises. For the minimization of dimensional error, the optimal printing settings are a print speed of 65 mm/s, layer thickness of 0.2 mm, extrusion temperature of 215 • C and raster width of 0.2 mm. For printing PETG parts with the highest surface quality, the optimal settings are a print speed of 50 mm/s, layer thickness of 0.1 mm, extrusion temperature of 215 • C and raster width of 0.6 mm. Finally, for printing parts with the least dimensional errors and a high surface finish, the optimal settings as given by the approach are a print speed of 50 mm/s, layer thickness of 0.1 mm, extrusion temperature of 230 • C and raster width of 0.6 mm.
Upon validation with experimental runs, the predictive performance of the ANFIS model and RSM were compared, with the mean experimental values and the deviations being represented in the form of error bars. It was observed that, for the ANFIS models, all the predicted values except for DE hole were in ±12% of the mean experimental values, but in the case of RSM, most of the values deviated from the range of faults. The mean error percentage for the predictions made by ANFIS was recorded to be 9.33%, which is lower in comparison to that obtained for RSM (12.31%). The better predictive performance of ANFIS can be attributed to its superior knowledge learning capabilities.