Admin, Vorisek
Admin, Vorisek
Abstract. In this contribution, we present the concept of a 3D printer software emulator facilitating
the creation of a spatial finite element mesh suitable for the printing process simulation.
The concept is based on gradual processing of a native 3D printer input file (in a G-code format).
This file contains a complete description of manufacturing process consisting of series of individual
commands interpreted by a printer. The effect of each command needs to be precisely evaluated to
obtain the position of the printer head and the volume of the deposited material in any given time.
The calculation is performed in the same way as in the Marlin printer firmware using the trapezoidal
motion curves and a command buffer. To represent a computational model, a discrete voxel model with
variable edge length and time discretization is used. The volume of deposited material is calculated for
each voxel as a function of time. The resulting model is suitable for numerical analysis of the printing
process.
Keywords: Additive manufacturing, 3D printing, 3D printer emulator.
1. Introduction
Additive manufacturing emerged as an innovative man-
ufacturing process in the field of rapid prototyping.
It is based on incremental deposition or sintering of
the material in thin layers. Wide range of materials,
including plastic, metal or even concrete, can be used
to produce spatial objects of complex geometries and
shapes (see Figure 1). The objects can be designed
using currently available CAD software.
Printing a prototype is often more affordable than
making one by hand, and certainly less costly than
contracting a manufacturer to do it by conventional Figure 1. Visualization of the geometry of a printed
manufacturing, especially in the fields where low quan- object in CAD.
tities of parts with a high degree of customization
and complexity play the critical role. An extensive
overview of the additive manufacturing methods is
available in [1].
Additive manufacturing consists of several indepen-
dent sub-processes. Everything begins with a 3D
model which, in order to be printed, must be pro-
cessed using specialised software called slicer. The
slicing process produces a sequence of commands to
control the movement and operation of the machine
stored in a G-code file line by line. This file describes
the complete processing (it is directly interpreted by
the printer) and is used as an input for the presented
pre-processing tool. Visualization of the movement
commands can be seen in Figure 2 and Figure 4.
In recent years, there has been an increasing inter- Figure 2. Visualization of the movement commands
contained in the input file (single layer). Moves with
est in the simulation of the additive manufacturing
material extrusion are drawn with blue color, moves
process. Parts produced primarily with extrusion of without extrusion with black color.
molten thermoplastics often do not reach designed di-
mensions due to the cracking and warping induced by
large temperature gradients [2, 3]. Such issues are also
144
vol. 26/2020 Pre-processing of Additive Manufacturing Input Files
present in conventional manufacturing processes like particularly of printer head moves. This step is per-
injection moulding where accurate numerical simula- formed only once and results can be reused to generate
tion allows to mitigate such issues by optimising the simulation inputs with different resolution.
object geometry or the production process itself [4].
Numerical simulation of the manufacturing process 3.1. Duration of moves
is indispensable to produce tailored, defect-free and It is essential to capture the real printing speed in
optimised products. Due to the complexity of the pro- the sequence of point-to-point moves. The target
cess, the coupled transient thermo-mechanical analysis printer speed is defined in the G-code file for each
is needed for reliable predictions. Some research of the move, yet the actual motion profile is to be decided
additive manufacturing has been already conducted by the individual printer.
using the Finite Difference Method [3]. Constant acceleration is the most used planning
In this contribution we assume that the Finite Ele- strategy resulting in a trapezoidal velocity profile due
ment Method (FEM) will be used to solve the problem. to its mathematical simplicity and limited computing
Our goal is to develop a software tool able to auto- power of the 3D printers microprocessors. The printer
matically prepare inputs for the FEM model (domain stores a limited number of moves, usually 16, in a
discretization, boundary conditions, etc.) straight buffer and recalculates the acceleration profile allowing
from the additive manufacturing input files. Not only the printer to be able to stop after the last move, if
should our tool generate a suitable 3D mesh, but it needed. The typical printing speed of one print layer
should also provide the history of the infill percentage can be observed in Figure 3.
of the single mesh elements. By knowing the infill Maximal accelerations and velocities must be re-
percentage, we will be able to consider the two-phase spected in the direction of each axis. These limits
characteristics of the voxels (thermoplastics and air). can be taken from the 3D printer specification or the
The process is, in a sense, an inverse process of slicing source code of the printer controller firmware (Marlin,
as it produces the simplified (voxelized) version of the RepRap).
original object. Duration of the movements can be determined us-
ing the calculated velocity and known distance. By
Several G-code processing utilities are available on-
gradually summing up the duration of individual com-
line [5, 6]. These tools provide print time estima-
mands, we can obtain the current time for any given
tion and filament consumption. However, they only
print head position. This information is essential for
consider the printer moves as vectors, and thus con-
numerical simulation as we can reverse this procedure
structing the voxel model with the material extrusion
to calculate the position of the print head for any
history is not possible. Our solution extends the idea
given time (time step).
of the movement commands into the 3D space consid-
ering each of them as a block of material with a finite
volume.
2. The model
Finite element model can generally consist of elements
of various shapes. We have chosen a discrete voxel
model with variable edge length along each axis due
to its simplicity.
Assuming all the edge lengths equal leaves us with
a simple cube. This simplification will allow the pre-
computation of shape function values and their deriva-
tives as they are same for all the elements. On top of Figure 3. Visualization of the printer head speed
that, such a hexahedral element is commonly used in during processing of a single layer assuming the trape-
the FEM software packages. zoidal velocity profile.
145
Jan Voříšek, Bořek Patzák Acta Polytechnica CTU Proceedings
πD2
wi = ∆E (3)
4hi Li
146
vol. 26/2020 Pre-processing of Additive Manufacturing Input Files
Figure 7. Activation sequence of the individual voxel elements. The colour of each voxel corresponds to its infill
percentage (VOF). The centre of the print consists mostly of filled elements shown in red colour while blue elements
near the surface of the printed part are almost empty.
147
Jan Voříšek, Bořek Patzák Acta Polytechnica CTU Proceedings
148