Abstract
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 3
The 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,28 Consumers have a direct economic incentive to recycle with DRAM13,28 because they can use their waste to fabricate many consumer products for far less than they can be purchased for from conventional manufacturing.29–32 DRAM thus has the potential to radically impact global value chains. 33 In addition to reducing 3D printing costs by several orders of magnitude, DRAM decreases embodied energy of 3D printing filament by 90% thus radically improving the environmental impact.34–36
Unfortunately, each melt and extrude cycle of a recyclebot impairs the mechanical properties of PLA, 10 HDPE, 21 and even of PET. 23 This 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 wood40,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. 43 Zander 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. Postconsumer waste has a wide variety of contaminants, exact polymer specifications are unknown (even to manufacturers of 3D printing filament for 3D printed waste), the polymer history (e.g., number of cycles) may be unknown, etc. 45
Many novel materials require unique end effectors, 46 and there has been a rise of direct extrusion fused particle fabrication/fused granule fabrication (FPF/FGF)-based systems.25,47–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,50 This 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. 51 CI 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 context—a 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). 55
The 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 Methods
Materials and 3D printer
LDPE pellets (Fig. 1a) were obtained from McDonough Plastics and were 3D printed in a 3-heat-zone Gigabot X (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.

Screen shot of PSO Experimenter during variable entry. PSO, particle swarm optimization.
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 xi is defined as the current position at variable i, U is the random uniform distribution between two given values,
In addition, the particle's velocity is initialized according to Equation (2)52,56:
where vi 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
Main Parameters for Tuning Particle Swarm Optimization Behavior
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:
Literature review: Reviewing studies in academia exploring a process similar to the optimization objective can yield information on commonly used parameter values.24–26
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. 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. Previous optimization experiments24–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 work24–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 general workflow.
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. 57
To 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.
58
Functions 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.
59
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 kv of 0.1, kp of 1, and kg 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.

Experimental Input Parameters for Line Optimization
where Xm is the measured value (or in some cases the averaged measured value), and Xd 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 HL ranging from 0.6 to 1.5 mm, and infill density DI 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).
Results and Discussion
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.

Performance of PSO on Beale function:
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.
Recommended Parameters for Particle Swarm Optimization Tuning of 3D Printing
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.

Performance of PSO on line tests:
Ideal Printing Parameters for Fused Particle Fabrication/Fused Granule Fabrication of Waste Low-Density Polyethylene on a Three Temperature Zone Extruder
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. 60
The 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. 66
This accelerated testing for new materials is particularly useful in the DRAM context as the 3D printing process parameter 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. 1
PSO 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. 64
Future 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. To improve the success of LDPE recycling, methods to gain a better understanding of the composition of the postconsumer plastics are necessary.72–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.
Footnotes
Acknowledgment
The authors thank F. Cruz Sanchez for helpful comments.
Author Disclosure Statement
No competing financial interests exist.
Funding Information
This study was funded by the Witte and Thompson Endowments.
