2.1. Extension of SmartScan Thermal Model and Optimization to Multiple Layers
This section provides an overview of SmartScan and how its underlying thermal model and optimization approach are generalized to handle 3D geometries with multiple layers. As in our prior work on SmartScan (Ramani et al., 2022), we adopt a model that considers only conductive and convective heat transfer between the part being printed and its surroundings (See
Figure 2). Radiative heat transfer, latent heat effects, Marangoni convection, and other melt pool phenomena, are ignored. These assumptions are reasonable because SmartScan focuses on part-scale temperature distribution. The model parameters are assumed to be temperature-independent to keep the model linear, which is critical for efficient optimization. In our prior work (Ramani et al., 2022), we have demonstrated that this simplification does not significantly diminish the effectiveness of SmartScan. Accordingly, heat transfer within the printed part with conductivity
kt and diffusivity
α can be described using the equation:
where
T is the temperature,
x,
y and
z are the spatial coordinates,
t is time and
u is the power per unit volume. The finite differences method (FDM) can be used to discretize Eq.(1) to obtain
where Δ
x, Δ
y and Δ
z are the dimensions of each element (see
Figure 2),
i,
j and
k are the spatial indices of the elements,
l is the temporal index (i.e.,
t =
lΔ
t), Δ
t is the time step and
T(
i,
j,
k,
l) is the temperature of the element located at (
i,
j,
k) at time
l. Without loss of generality, the element height Δ
z is assumed to be equal to the layer height of the LPBF process, such that
k serves as an index for deposited layers (referenced to the topmost layer where
k = 1).
Two main factors must be considered in extending the 2D Smartscan model used in our prior work (Ramani et al., 2022) to 3D, namely: (1) a powder layer and (2) multiple printed layers underneath the powder layer. The powder can be considered as an insulator since its conductivity is roughly an order of magnitude lower than that of solid metal (Wei et al., 2018). However, during printing, the conductivity of the powder layer changes continuously as portions of it are converted from powder into solid metal. This means that some conductive heat transfer is bound to occur within the powder layer, resulting in a time-varying thermal model. However, the intra-layer heat conduction of the powder layer is negligible since the powder layer is very thin (typically 20 to 100 μm in thickness (Mahmoodkhani et al., 2019)). Hence, most of the heat transfer that affects temperature distribution occurs due to conduction into the layers below rather than within the powder layer.
Therefore, for the sake of simplicity, we neglect the powder layer in our model and apply the laser power directly to the layer beneath the powder, as depicted in
Figure 3. Moreover, the substrate (base plate) is assumed to be a heat sink held at a constant uniform temperature
Tb. The sides of the part are insulated by the low-conductivity powder and heat is lost by convection through the top layer. As layers are built during the printing process, the heat from the laser is conducted down into the substrate. Therefore, it can be expected that the heat distribution becomes reasonably uniform at some layer
k =
k* from the top surface. Since SmartScan is focused on maintaining uniform temperature distribution and not on modelling the absolute temperature, the model can be simplified by replacing the layers
k >
k* with a heat sink at a uniform temperature
Tsink. One benefit of this approximation is that the model size can be reduced to only consider 1 ≤
k ≤ k*, as shown in
Figure 3(b).
To determine
k* and
Tsink, the temperature uniformity metric
R(
k,
l) presented in (Ramani et al., 2022) is used:
where
Tavg(
k,l) denotes the mean of the temperatures
T(
i,
j,
k,
l) of a layer
k at time
l,
s signifies the number of elements of the corresponding layer
k, and
Tm represents the melting point of the material used to normalize
R. As layers are built, the value of
R is computed at the beginning of each new layer (i.e., at time
l =
l0) for all layers
k ≥ 1. Accordingly,
k* can be determined as the value of
k for which
R(
k*,
l0)/
R(1,
l0) <
ε, where
ε is a predetermined uniformity criterion (e.g., 5%) such that
Tsink =
Tavg(
k*,
l0) can be used as the Dirichlet boundary condition at the bottom of the simplified model in
Figure 3(b). Note that
R(1,
l0) is used to normalize
R(
k*,
l0) because it typically represents the layer with the worst thermal uniformity, since it lies just below the powder layer. Also note that the value of
k* cannot exceed the total number of layers in the part at any given time.
Based on the simplifications to the 3D thermal model discussed above, Eq. (2) can be rearranged into a state space equation
Here, T(l) refers to the state vector, encapsulating the thermal information T(i,j,k,l) for all elements in the region 1 ≤ k ≤ k* at time l. The state matrix is denoted by A, while B is the input matrix. The sparse vector u(l) denotes the power input; its non-zero elements coincide with the application location of the laser. The influence of heat transfer through convection to the ambient temperature Ta, with the convection coefficient h, and conduction to the layers below k* with a temperature of Tsink are incorporated into the model following the heat sink approach described in (Ning et al., 2019). Also, the laser beam’s heat flux is characterized by a Gaussian distribution (Ramos et al., 2019).
Assuming that it takes
np time steps to scan each feature, as discussed in (Ramani et al., 2022), the corresponding representation of the state-space at the feature level with the time index,
lp, can then be expressed as follows
The objective of SmartScan is to minimize temperature inhomogeneity for each printed layer, which is achieved by minimizing the temperature uniformity metric
R(1,
lp) of the topmost layer of our model (i.e., the layer just below the powder layer) which can be written as
where
1 represents a column vector of length
s whose all elements are equal to 1,
I is an identity matrix, and the
0 (null) matrix in the
matrix indicates that the elements of
T beyond the first layer, T
sink and the ambient temperature T
a do not contribute to the calculation of
R. The optimization problem can therefore be expressed as
where
 =
Ap, the columns of
B̂ represent the corresponding
b vectors as in Eq. (5) for each feature, and
û(
lp) is a vector with only one element equal to 1 and all other elements equal to 0. The location of 1 in
û(
lp) represents the column of
B̂ corresponding to the feature to be scanned.
The objective function expressed in Eq. (7) can be reformulated as follows:
Subsequently, the optimization problem for the topmost layer can be reformulated in the following manner:
where
, with
nf denoting the number of features in the topmost layer. Furthermore, the
rth diagonal element of the
Γ matrix is denoted as
Γ(
r,
r), and the
rth row of the
Λ matrix is referred to as
Λ(
r,:).
2.2. Providing SmartScan with Global Foresight
A critical problem with the SmartScan optimization algorithm, as described in
Section 2.1 above (and in our prior work (He et al., 2023; Ramani et al., 2022)) is that it is myopic. It minimizes
R(1,
lp) for any given feature without a global foresight of the impact of its current actions on future outcomes. This limits its effectiveness for complex 3D shapes. To illustrate the problem, consider a part with an overhang whose cross-section is shown in
Figure 4(a). The part has a uniform depth into the page. At the print stage shown in the figure, the part can be divided into two regions – Region 1 supported by high-conductivity solid metal and Region 2 supported by low-conductivity powder. On the active layer of the print shown in
Figure 4(b), Region 1 has two times the number of scan vectors as Region 2. In optimizing the sequence of the stripes in the active layer, the myopic SmartScan algorithm would prioritize scanning the stripes in Region 1 because they yield lower
R(1,
lp) values by conducting heat quickly to the bottom layers. Therefore, at the end, the algorithm is left with most of the stripes from Region 2 to scan, leading to extremely inhomogeneous thermal distribution and overheating of Region 2 toward the end of the scanning process.
In this Section, we address this limitation of SmartScan by providing it with global foresight of the heat transfer of the layer whose scan sequence it is optimizing. At a high level, our solution consists of two steps. Firstly, we demarcate the features into clusters based on their relative heat transfer behavior (e.g., features in Region 1 and Region 2 in
Figure 4). Secondly, we constrain the SmartScan optimization so that no cluster is left behind in the scanning. In the context of the simple example in
Figure 4(b), this means that for every two stripes scanned in Region 1, one stripe must be scanned in Region 2. These two steps are detailed and generalized below.
2.2.1. Demarcation of the Features into Clusters based on Heat Transfer
The challenge addressed here is how to demarcate the features of any arbitrary geometry into clusters based on heat transfer. We make use of the fact that the diagonal elements of the matrix
 in Eq. (7) contain information about the relative heat transfer characteristics of each element of our FDM model because their magnitude is inversely proportional to the element’s rate of heat dissipation to the surrounding elements. Therefore, we extract the diagonal elements of
 as:
where
sa represents the number of elements in the active layer where
k=1. Then we apply the K-means method (Ahmed et al., 2020) to
D (which represents the dataset) as follows:
Divide the dataset into nc clusters Gv, where v = 1, 2, …, nc, by iteratively assigning each data point di to the cluster with the nearest centroid and then updating the centroid of each cluster until convergence is achieved.
Compute the sum of squared errors (
SSE) for increasing values of
nc, starting from
nc = 1, using the formula given by
where
mv refers to the centroid (mean) of the cluster
Gv.
Determine the optimal number of clusters (
nc*) using the “elbow method” (F. Liu & Deng, 2021) which indicates the value of
nc at which the SSE vs.
nc graph exhibits an inflection. Approximate the elbow point by calculating the second derivative of the
SSE vs.
nc curve, and choose the point where the second derivative is highest (i.e., where the rate of change of the gradient is highest) as
where
SSE’’(
nc) represents the second derivative of the
SSE as a function of
nc.
Using nc*, determine the optimal clustering of the dataset D. The number of clusters represents the number of regions in a layer based on heat transfer.
The clustering described in Step 4 is at the finite difference method (FDM) element level. The features are assigned to the nc* clusters based on the cluster v to which most of their elements belong. For example, if 100 elements in a feature belong to G1 and 20 elements belong to G2, then the feature will be assigned to G1.
2.2.2. Proportional Scanning of Features in Every Cluster with Global Foresight
One way of providing global foresight to the SmartScan optimization algorithm is to force it to scan each cluster in proportion to the number of features it contains. In other words, it ensures that no cluster is left behind as it optimizes the sequences. To do this, we define nv as the number of features in cluster Gv, as well as a completion index Hv = nscanned,v/nv, where nscanned,v represents the number of features scanned in cluster Gv at any given time.
2.3. Incorporation of Ability to Handle Arbitrary Part Geometries and Scan Patterns
The SmartScan algorithm discussed so far cannot handle arbitrary part geometries and scan patterns because of the following assumptions that have been made in our prior work (Ramani et al., 2022): (1) the FDM model is customized for the geometry and scan pattern of each layer (e.g., the scan vectors always align with the x or y directions of the FDM model with a hatch spacing that is equal to the grid spacing of the FDM model); and (2) all features have the same size and are scanned at the same speed such that they take an equal number of time steps np to be scanned as described in Eq. (5). In this section, we relax these assumptions, allowing SmartScan to apply to arbitrary part geometries and scan patterns.
To relax the first assumption, the FDM model is decoupled from the geometric shape of the 3D part to be optimized by designing the FDM grid to envelop the entire part as shown in
Figure 5 using a pyramid as an example. This allows arbitrary shapes to be captured by the envelop model of size
nenv =
Nx x
Nyx
Nz elements as shown in
Figure 5. Accordingly, the state space equation representing the envelop model can be written as
where
Tenv,
Aenv,
Benv and
uenv retain their definitions given in the context of Eq. (4) except that they are applied to the envelop model. To extract the part-level state space model of Eq. (4) from Eq. (13) above, we recognize that only
ne elements of the
nenv elements of the envelop model are active (i.e., occupied by the part). Therefore, we define the occupancy matrix
O ∈ ℝ
n_e× n_env, in which each row has only one element that is 1 and the rest are 0.
O(
i,
j) = 1 indicates that the
jth element in the envelop model is active and its new index in the part-level state-space model is
i. Accordingly, the part-level the
T vector and
A matrix in Eq. (4) can be derived as:
where sum(
Φ,
i) refers to the sum of the
ith row of matrix
Φ which is used to adjust for active elements in the envelop model that might lose their neighboring inactive elements after reduction to the part-level model.
B and
u highly depend on the scan pattern. The vector
u can be obtained by overlaying the scan vectors for each layer on the grid corresponding to the layer as shown in
Figure 6. Without loss of generality, we assume that the laser beam has a Gaussian profile that can be traced along each vector. As the beam moves along the vector, its location at any time step
l is determined from the laser speed for the vector as
where (
xl,
yl) represents the coordinates of the laser in the x and y directions at the time
l in the powder layer,
xstart and
ystart represent the coordinates of the starting point of the scanning vector, likewise,
xend and
yend represents the coordinates of the ending point. Δ
t represents the sampling time, and
vscan represents the laser scan speed.
Each grid it affects at time step
l receives a value
Pd(
l) ∈ [0, 1] in proportion to the intensity of the beam power it experiences. All inactive elements always have
Pd(
l) = 0. Accordingly,
u(
l) and
B in Eq. (4) can be derived as
where
P refers to the laser power and
σ represents the absorptivity.
With the part-level state-space model in Eq. (14) derived for any arbitrary geometry and scan pattern, the second assumption discussed at the beginning of this section needs to be relaxed to derive a feature level state-space model similar to Eq. (5). To do this, let the features be labeled 1, 2, …,
nf, and let them respectively take
g1,
g2, …,
gnf time steps, respectively, to be traced by the laser. After the
ith feature is scanned (
i∈{1,2, ⋯,
nf}), the corresponding feature-level state-space representation can be written as:
where
lq is feature-level time index which can be unique for each feature. SF(
lq) refers to the scanned features set at time step
lq. Based on the relaxation of the fixed time step assumption for the feature-level model, the optimization problem in Eq. (7) can be rewritten as:
This optimization problem is further written as:
Eventually, the optimization problem including global foresight as described in
Section 2.2 and complex geometry can be expressed in the following way:
The flowchart below summarizes the generalized SmartScan strategy.