Finding Ideal Parameters for Recycled Material Fused Particle Fabrication-Based 3D Printing Using an Open Source Software Implementation of Particle Swarm Optimization

As additive manufacturing rapidly expands the number of materials including waste plastics and composites, there is an urgent need to reduce the experimental time needed to identify optimized printing parameters for novel materials. Computational intelligence (CI) in general and particle swarm optimization (PSO) algorithms in particular have been shown to accelerate finding optimal printing parameters. Unfortunately, the implementation of CI has been prohibitively complex for noncomputer scientists. To overcome these limitations, this article develops, tests, and validates PSO Experimenter, an easy-to-use open-source platform based around the PSO algorithm and applies it to optimizing recycled materials. Specifically, PSO Experimenter is used to find optimal printing parameters for a relatively unexplored potential distributed recycling and additive manufacturing (DRAM) material that is widely available: low-density polyethylene (LDPE). LDPE has been used to make filament, but in this study for the first time it was used in the open source fused particle fabrication/fused granular fabrication system. PSO Experimenter successfully identified functional printing parameters for this challenging-to-print waste plastic. The results indicate that PSO Experimenter can provide 97% reduction in research time for 3D printing parameter optimization. It is concluded that the PSO Experimenter is a user-friendly and effective free software for finding ideal parameters for the burgeoning challenge of DRAM as well as a wide range of other fields and processes.


Introduction
The field of 3D printing is constantly expanding into new materials, such as biofilms, 1 elastomer resins, 2 dental materials, 3 preceramic polymers, 4 ceramics, 5 silicone, 6 and even edible inks. 7In addition, there are many conventional recycled thermoplastics, 8 which are just now being embraced by the 3D printing community.These include not only the two most popular fused filament materials: polylactic acid (PLA) [9][10][11][12] and acrylonitrile butadiene styrene, [13][14][15][16][17] but also common thermoplastics such as high-density polyethylene (HDPE), [18][19][20][21] polypropylene (PP) and polystyrene (PS), 20 thermoplastic polyurethane, 22 polyethylene terephthalate (PET), 23,24 and polycarbonate (PC). 25he creation of recycled plastic filament extruders such as the open source recyclebots, 13,18,26 which upcycle postconsumer plastic waste into 3D printing filament, also allows for the further democratization of distributed recycling and additive manufacturing (DRAM). 13,27,28Consumers have a direct economic incentive to recycle with DRAM 13,28 because they can use their waste to fabricate many consumer products for far less than they can be purchased for from 1 Department of Electrical and Computer Engineering, Michigan Technological University, Houghton, Michigan, USA. 2 Department of Electrical and Computer Engineering, Ivey School of Business, Western University, London, Canada.
ª Shane Oberloier et al. 2022; Published by Mary Ann Liebert, Inc.This Open Access article is distributed under the terms of the Creative Commons License [CC-BY] (http://creativecommons.org/licenses/by/4.0),which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.0][31][32] DRAM thus has the potential to radically impact global value chains. 33][36] Unfortunately, each melt and extrude cycle of a recyclebot impairs the mechanical properties of PLA, 10 HDPE, 21 and even of PET. 23This limits the recycling cycles to approximately five 10 before reinforcement or blending with virgin materials becomes necessary.Polymer composites using carbon-reinforced plastic, 37 fiber-filled composites, 38,39 and various types of waste wood 40,41 have been used in recyclebot systems, and more complex DRAM systems can use 3D-printed PC as molds for intrusion molding 25 for windshield wiper composites 42 as well as acrylonitrile styrene acrylate and stamp sand waste composites. 43Zander et al. 44 have studied PET, PP, and PS blends with styrene ethylene butylene styrene and maleic anhydride compatibilizers that were able to increase tensile strength.
DRAM presents a significant challenge to 3D printing operators.8][49] A conventional method for finding idealized printing parameters is to print a consistent model using a matrix of parameters, effectively sweeping through every possible permutation. 47,50This is time consuming and inefficient, however and does not scale well across the myriad numbers of potentially recyclable waste plastic streams.
Computational intelligence (CI) can be leveraged to minimize the time it takes to optimize for process parameters experimentally. 51CI methods such as hierarchical machine learning, 6 symbiotic organism search algorithms, and particle swarm optimization (PSO) 52 have been proven as effective methods to find optimal printing parameters.In this contexta particle refers to a ''candidate solution'' that must be tested and will evolve over each iteration.
Typically, the implementation of the CI algorithm is prohibitively complex for noncomputer scientists, or in some cases the implementation of the algorithms is not open source.In this article, ''PSO Experimenter,'' 53 an easy-to-use open-source platform based around the PSO algorithm, is introduced.Though PSO Experimenter is made for general implementations, the application of 3D printing is explored specifically.
In this study, PSO Experimenter is evaluated for the first time by applying it to known test functions, which have similar responses to 3D printing parameter sweeps.Then, PSO Experimenter is used to find optimal printing parameters for a relatively unexplored potential DRAM material that is widely available: low-density polyethylene (LDPE).Thus, this study makes contributions on both the open source development of PSO software and finding optimal printing parameters for recycled LDPE.
LDPE has been used to make filament, 54 but in this study for the first time it is used in the open source FPF/FGF system of the Gigabot X. 55 The GigabotX is used because it exemplifies a complex 3D printer by printing from pellets, shards, particles, or granules (as opposed to filament), has multiple (3) heat zones in the extruder, and prints on a large scale (570 • 595 • 470 mm). 55he optimization is carried out in three steps.First the particles (tests) are defined as 200 mm long singular extrusion lines.Second, the particles are defined as 100 • 100 mm single-layer planes.Third, the particles are defined as 40 • 40 • 40 solid cubes.Each test has pertinent parameters dictated by PSO Experimenter for each particle.To optimize parameters, a fitness function and test set are also proposed.This fitness method is generalizable to all other 3D printing applications.

Materials and 3D printer
LDPE pellets (Fig. 1a (re:3D, Texas) (Fig. 1b).The Gigabot X is a direct pellet material extrusion-based 3D printer with the nozzle arranged vertically in which a compression screw and three hot zones (demonstrated in Fig. 1c) enable a relatively constant flow of recycled material through the print nozzle.

Software
PSO Experimenter is an easy-to-use minimalist optimization platform shown in Figure 2 that utilizes the PSO and is licensed under GPL3.0.PSO consists of a list of particles that have a personal optimum configuration, current position, and a velocity.In the context of PSO, position refers to a certain set of parameters to be experimentally tested.In addition, the group optimum (best of all the personal optimums across all iterations) is known by each particle.PSO is an iterative method, after each iteration the algorithm works to minimize the fitness of each particle.
PSO Experimenter allows users to create an unlimited number of variables, allowing for exploration in n-dimensional space.Each variable must have a name, minimum value, maximum value, and an initial guess.In addition, the variable can be constrained to integer values only (input 1 for integer only, 0 for floating point).PSO Experimenter does not allow for addition of new variables after the first iteration is generated, however, variables that may come in to play later in optimization can be constrained by entering a value to constrain at in the constrain column.
Before the first iteration, each particle's position is initialized with a position being a uniformly distributed random vector.PSO Experimenter allows for the input of an initial guess for each variable, and a proximity to that guess.Specifically, the initial position for each particle is generated using Equation (1). 52 where x i is defined as the current position at variable i, U is the random uniform distribution between two given values, x gi is the guess value for variable i, x mini is the minimum allowable value for variable i, x maxi is the maximum allowable value for variable i, r is the range between x mini and x maxi , and p defines the proximity to x gi .
In addition, the particle's velocity is initialized according to Equation (2) 52,56 : where v i is the velocity for variable i.
For each iteration of the algorithm, the particle's position must be tested and then assigned a resultant fitness.When a new iteration is generated, the particle's velocity is updated by Equation (3) 52,56 : where x gbi is the position in variable i for the particle's current personal best and x pbi is the position for the swarm's current group best.The weight parameters are defined in Table 1.
Finally, the particles new position at variable i is updated in Equation (4) 52,56 : The workflow in PSO Experimenter starts with variable entry.The ranges and initial guesses for each variable can be acquired in four different ways: 1. Literature review: Reviewing studies in academia exploring a process similar to the optimization objective can yield information on commonly used parameter values. 24 The emphasis given to a particle's personal best position k g The emphasis given to the swarm's group best position 3. Initial experimentation: Arbitrary, but guided, experimentation can show some parameters that work, and some that do not.These experiments can provide insight into what ranges to search in.4. Previous optimization experiments [24][25][26] : The output of a previous PSO experiment can be used as a starting point for further optimizations.
In this study, the first trial's variable parameters are found through literature review on previous GigabotX work [24][25][26] and initial experimentation.The two following tests use the values from the previous optimization experiment.
In addition to variable information, the optimization parameters must be entered.These weights can be found in either the literature review, or through experimentation with a test function that has a similar response to the system being optimized.After all variables and parameters are entered, the first iteration can be generated.
The first iteration has a fixed number of particles, each with a unique set of variable values that must be used in the process or experiment.Either during or after (or both) the experiment, measurements must be taken to quantify the success of that particular combination.A fitness function must be established that is a function of the measurements, and trends downward as measurements become more desirable.The simplest fitness function can be a normalized sum of accuracy measurements.The resulting fitness for each particle can be entered into PSO Experimenter, and the next iteration is generated.The optimization process can either be run for a fixed number of iterations, or until the fitness is below a desirable threshold.The general workflow for PSO Experimenter is shown in Figure 3.
PSO Experimenter also allows for saving and loading particle and experiment data.The data are saved in clearly formatted comma-separated values so that historical data can be viewed for further analysis.In addition, this open format allows the user to intervene and change parameters as needed (though this is not always recommended, since errors in alteration can render the file unusable, it can be useful for specialized corrections)

Parameter acquisition
In this study, the process being optimized is printing recycled waste LDPE pellets using a Gigabot • 3D printer.PSO typically uses thousands of particles in the swarm, but since this experiment requires physical processes and measurements, 57 only five particles were used to minimize experimental time.Since this number is low, the experimental parameters must be chosen such that the particles are more explorative (rather than exploitive) to prevent early convergence on a local minimum.More explorative particles spend  more iterations exploring the sample space, and their velocity slowly decays as they begin to converge. 57o find the ideal experimental parameters, PSO Experimenter is used to optimize test functions that have trends similar to the response of a 3D printer.3D printing is assumed to be a hypervalley-many minima that are very close in fitness to the global minima, stretched out across the sample space. 58Functions such as the Beale function [Equation ( 5)] and the Goldstein-Price function [Equation ( 6)] are valley like and are used as benchmarks to set expectations for the physical experiments. 59x, y ð Þ¼ The Beale function has a minimum of 0 at f(3, 0.5), and the Goldstein-Price function has a minimum of 3 at (0,-1).Their respective plots are shown in Figure 4 and represent trends observed in 3D printing material explorations.
Each function is built into a spreadsheet such that the fitness is defined by the X and Y input values.First PSO Experimenter is configured with a k v of 0.1, k p of 1, and k g of 2. It should be noted that the k values are varied for the algorithm dictates how particles navigate the X -Y space and are not correlated with the input parameters.The group best is   exploitive toward current global minima and personal best favors its personal best.The higher the velocity weight, the more explorative.Each function is tested for 20 iterations to generate a baseline, and then the velocity weight (which alters how explorative the particles are) is set to 0.5.The responses are compared, and the parameter set that yields the highest accuracy is used in the physical experiments.

LDPE optimization on Gigabot X experiment design
For the first optimization experiment, single 200 mm lines are extruded (Fig. 5a).For this trial, physical dimensions that were measured for the optimization included length (l) accuracy, width (w) accuracy, width constancy, and mass (m) accuracy.Accuracy is defined in Equation (7).Consistency is defined in Equation (8), where the measurements are evenly distributed along the length of the extrusion.The initial variable parameters are listed in Table 2.
where X m is the measured value (or in some cases the averaged measured value), and X d is the desired value.
The fitness function is defined by the weighted sum of the measurements [Equation ( 9 )].The weights are assigned according to expert knowledge.The experiment uses optimization parameters found from the test functions in the previous step, and is run for either 20 iterations, or until the fitness is <0.1.
where the physical dimensions are length (l) accuracy, width (w) accuracy, width constancy, and mass (m) accuracy, where the subscript m is measured and the average is already described.The second trial is optimizing the length accuracy, width accuracy, height consistency, height accuracy, and mass accuracy of 100 by 100 mm planes (Fig. 5b).The optimization input parameters remains the same with the addition of E, the edge overlap of the infill percentage (with a range of 10-20%, and initial guess of 15%).The initial guess values are selected as the optimum parameters from the previous trial (with a proximity value of 0.25).For this trial, additional factors including layer height (h) and print time (t) are also considered.The fitness function is defined in Equation (10).
The final trail optimizes the height, width, length, and mass accuracy of a 40 by 40 by 40 mm cube (Fig. 5c).The optimization parameters once again remain the same with the inclusion of the layer height H L ranging from 0.6 to 1.5 mm, and infill density D I ranging from 100% to 250%.The initial guess is selected as the optimum parameters from the plane trial (with a proximity of 0.25).The fitness function for this trial is given in Equation (11).

Parameter acquisition
Twenty iterations of optimization on the Beale function were run on the waste LDPE on the Gigabot X.The individual experiment fitnesses (particles) and group best fitness are shown in Figure 6.The Best Fitness on the left (Fig. 6 a, c, e) is the fitness of the group best, where Figure 6b, d, and f is (right ones) the fitness of the personal bests.
Next, 20 iterations of optimization on the Golstein-Price function were run on the same material and process system.The individual particle fitnesses and group best fitness are shown in Figure 6.Then optimization is run with a velocity weight of 0.5.The group fitnesses between both trials can be compared.The hypothesis that a higher velocity weight will cause more exploration has been confirmed, and in addition enabled particles to converge on a more desirable fitness value.This indicates that the parameters listed in Table 3 should be used for 3D print optimization.
In addition, from Figure 6a, the physical experiment should expect to see a convergence around six iterations.This experiment set successfully demonstrated that PSO Experimenter should be attempted for 3D printer optimization.

LDPE optimization on Gigabot X results
The line trial was able to reach a fitness of <0.1 after six iterations.The optimization performance is shown in Figure 7.The ideal parameters for printing lines are listed in column 3 of Table 4.
The plane trial was able to reach a fitness of <0.1 after one iteration.The optimization performance is shown in Figure 8.The ideal parameters for printing planes are listed in column 4 of Table 4.
The cube trial was not able to reach a fitness of 0.1 after six iterations.Due to machine limitations (inability to make perfectly square corners causes the volume estimate to be imprecise) the goal fitness may not be achievable.The optimization performance is shown in Figure 7.The ideal parameters for printing lines are listed in column 5 of Table 4, and these parameters are accepted as ideal parameters for general use in printing with LDPE.An additional result of this experimentation is the finding that the print surface should be covered in clear PP packaging tape for optimum adhesion.The optimization improved the print quality as shown in Figure 7, an optimized test cube, which can be compared directly with Figure 5f.The print is not a complete digital replication of the design as there still is some deformation at the base and not quite perfect final layer print.This is somewhat expected because LDPE is a known challenging 3D printing material with only a few vendors offering it. 60e printing quality, however, is high enough to be used for large (human)-scale functional objects as this stool is as shown in Figure 8b.The device has a mass of 0.56 lb, which at a cost of $1/lb and 0.28 lb of glycol modified polyethylene terephthalate (PETG) used for the legs at $9.50 per pound 61 results in a cost for the stool of $3.22.This is an 87% savings from commercial devices that can cost >$24, 62 and could be further reduced using reclaimed materials for legs.These results agree with past work, 63 which found substantial economic potential for DRAM, 61 including specific investigations on the potential for large-scale 3D printing of athletic equipment from plastic waste. 49

Impact and applications
The goal of this study was to reduce the time to obtain optimal 3D printing parameters from waste plastic feedstocks.The new methodology and open source software were able to accomplish this goal.The time for preparation, printing, and measurement of a line sample takes *10 min.With the first physical trial settling below a fitness of 0.1 after six iterations, the total time elapsed is 5 h.If this same experiment were to be run as a conservative matrix test, (where temperature zones are all kept at the same temperature and tested across 10 increments, bed temperature is kept at a constant, and feed rate and print speed's range was cut into 10 increments) it would require over 166 h.
This indicates that PSO experiment can provide 97% reduction in research time for 3D printing optimization.Because of this, PSO experiment is recommended for all future material parameter acquisition, as it can explore the sample space with self-adjusting granularity and can substantially reduce time, money, and material usage.This is in line with past work that showed PSO utility for build orientation 64 support structures 65 and fused filament 3D printing. 66his accelerated testing for new materials is particularly useful in the DRAM context as the 3D printing process pa-rameter optimization may need to be completed for each new waste material source, even if the primary polymer is the same.This is because past results have shown that not only do additives and processing matter but so do color, 30 number of cycles, 9 water absorption, and thus storage and thermal history as well as source 24 can impact 3D printing parameter optimization and final properties of the manufactured part.
PSO Experimenter could be used to optimize not only waste materials but also various other materials such as PP or HDPE, which are not yet commonly used in commercial fused filament-based 3D printing because of their challenging thermal expansion coefficients.In addition, the software could be used to take the guess work out of tuning and calibrating machines such as circuit mills, 67 metal 3D printers, 68 and bioprinters. 1O versus random selection PSO is not a random walk, 52 it has a directed search that lowers optimization time.As a comparison, if the optimization process was defined such that there are 1000 combinations of variables, the probability of randomly selecting the optimum is 0.1%.Considering an equal number of trials to the PSO (30 per experiment) as Bernoulli trials with a success probability of 0.1%, the probability of successfully identifying a global optimum can be modeled as a binomial random variable.69 This model shows that arbitrary guessing of combinations yields a 2.91% chance of successfully arriving at the optimum.
Clearly each optimization run performed in this article has arrived at acceptable optimums, indicating that the PSO algorithm is aiding in the process and it is not pure randomness.This is in agreement with past research that has applied PSO to 3D printing parameter optimization such as Shirke et al.'s analysis of maximizing tensile strength 70 and Shen et al.'s analysis of build orientation. 64ture study PSO Experimenter can be further improved by being integrated directly into a printer control software, 71 to directly control the machine for experiments.In addition, PSO Experimenter can be applied to a myriad of diverse applications such as custom filament extrusion, circuit board milling, recipes, and farming.3][74] It should be pointed out that the material properties or recycled materials and composites may impact the appropriateness of 3D printed parts for some applications.Thus, even if the PSO Experimenter provides optimal printing parameters, the recycled material may not have adequate properties (e.g., tensile strength is reduced with each recycling cycle) and the thermomechanical environment in the extrusion process also can impact the strength even if the physical dimensions are correct.Future study is needed to look carefully at the degradation effect of DRAM.Future study is also needed to improve slicing and other means to overcome the warping observed with large LDPE prints.Lastly, there has been progress on development of custom screws for DRAM, 75 and information from Justino et al., 76 which reported a systematic review of screw-assisted 3D printing equipment, could be used for optimizing additive manufacturing (AM) of LDPE with screw extrusion technology.

Conclusions
PSO Experimenter was created to expedite the acquisition of ideal process parameters.As a case study, the free and open software was used to find ideal parameters for recycled waste LDPE direct extrusion 3D printing using an open source AM system.The results showed that the algorithm was able to find ideal parameters in six iterations, taking a time of 5 h.This is a substantially less amount of time to get functional printing parameters.Overall, there is a 97% reduction in time used compared to matrix-based process parameter testing.
It can be concluded that the PSO Experimenter was able to find the optimum parameters setting for recycle LDPE materials.Overall the results of the study demonstrated that the PSO Experimenter is a user-friendly and effective free software for finding ideal parameters for DRAM and it could be used as well in a wide range of other fields and processes.

FIG. 5 .
FIG. 5. (a) A rendering of the line test.(b) A rendering of the plane test.(c) A rendering of the cube test.(d) An image of a resulting line test.(e) An image of a resulting plane test.(f) An image of a resulting cube test.It should be noted these test examples are before any optimization.

FIG. 6 .
FIG. 6. Performance of PSO on Beale function: (a) Total best fitness.(b) Particle fitness over time performance of PSO on Goldstein-Price function.(c) Total best fitness with k v = 0.1.(d).Particle fitness over time k v = 0.1.(e) Total best fitness with k v = 0.5.(f) Particle fitness over time k v = 0.5.

Table 3 . 2 FIG. 7 .
FIG. 7. Performance of PSO on line tests: (a) Total best fitness.(b) Particle fitness over time.Performance of PSO on plane tests: (c) Total best fitness.(d) Particle fitness over time.Performance of PSO on cube tests: (e) Total best fitness and (f) particle fitness over time.

Table 1 .
-26 2. Expert consultation: In cases when the process is completely novel, a subject-matter expert may have intuition on what ranges to search for each given variable.FIG. 2. Screen shot of PSO Experimenter during variable entry.PSO, particle swarm optimization.Main Parameters for Tuning Particle Swarm Optimization Behavior

Table 2 .
Experimental Input Parameters for Line Optimization

Table 4 .
Ideal Printing Parameters for Fused Particle Fabrication/Fused Granule Fabrication of Waste Low-Density Polyethylene on a Three Temperature Zone Extruder FIG. 8. (a) Optimized print setting results of LDPE waste printed into a test cube and (b) an LDPE 3D printed stool base on PETG legs.PETG, glycol modified polyethylene terephthalate.3DPRINTING USING PARTICLE SWARM OPTIMIZATION