Development of control systems for laser powder bed fusion

This article aims to highlight the development of an intermittent controller designed to compensate and rectify the lack of fusion (LoF) zones that are induced during the LPBF process. The initial step involved the usage of the self-organizing map (SOM) algorithm to identify the location of LoF defects. Subsequently, the identified defects undergo clustering through the K-means algorithm to form a matrix of cells on the build plate. The center of each cell that encompasses the defective area is then selected as the optimal position for increasing laser power during the subsequence printed layer. To identify the optimum laser power value, various artificial voids, mimicking actual defects, are embedded in the coupons. The capping layer that closes the artificial void is then fabricated with different laser powers to heal the underlying defects. Based on the optimum laser power and defect size, several controlling rules are defined to change the laser power in situ in the targeted cells located within the capping layer of defects. The change in laser power is transferred as a laser correction file (LCF) to the actuator via the Message Queuing Telemetry Transport (MQTT) broker. Finally, the performance of the controller is evaluated by designing and fabricating two new sets of experiments, including artificial and randomized defects. The results are validated by performing a micro CT scan, in which the density of defects is analyzed on parts produced with and without the controller. The results suggest that the use of the controller increased the density of the sample with randomized defects by up to 1%.


Introduction
Additive manufacturing (AM) is an advanced technology that has revolutionized the manufacturing industry in recent years, providing increased design flexibility.One of the popular AM processes is laser powder bed fusion (LPBF), which employs a laser beam to selectively fuse regions of a powder bed, layer by layer.Despite significant advancements in LPBF, achieving high-quality printed parts at a mass production level remains a challenging task [1].
Enhancing the quality of LPBF parts requires a thorough understanding of the process, which can be achieved through the real-time collection of data using in situ sensing devices.These devices can be categorized into radiative and nonradiative sensors, which are defined as follows.
1) Radiative sensors measure the emitted rays from the meltpool and surrounding area.They are classified based on their working principles, which include cameras, photodiodes, pyrometers, inline coherent imaging (ICI), X-ray imaging, etc. 2) Non-radiative sensors measure the physical behavior of the process and convert it to an electrical signal.They can be further classified as thermocouples, acoustic sensors, strain gauges, and displacement sensors.
After the in situ dataset has been collected, the data must be analyzed to detect any potential anomalies [1].For analysis, different statistical and machine-learning algorithms were applied.In terms of statistical method, various thresholds [41][42][43][44], filters [45][46][47], linear regression models [48], image processing techniques [49], etc., were applied to identify porosity, material ejection, geometry dimension, and temperature.For instance, the MTU Aero Engines team [45][46][47] used a band-pass filter to capture thermal radiations.Then, the thermal signal was analyzed to identify its deviation, which could be interpreted as a defect in the final part.Grasso et al. [44] discussed using a bi-level thresholding method to extract plume and spatter information.Lott et al. [50] showed the use of fast Fourier transformation (FFT) methods to report information about meltpool and temperature.
Despite valuable improvements in identifying defects, some challenges persist, particularly when it comes to analyzing large amounts of real-time data.To tackle mentioned challenges, the application of machine learning methods has been introduced in LPBF.Three types of machine learning techniques applied to the in situ LPBF dataset are (1) supervised learning, (2) unsupervised learning, and (3) reinforcement learning.
Many types of supervised learning were used for labels predicting output based on the previous observation of the dataset.The most common types of supervised learning applied to the data of LPBF are shallow and deep neural networks, support vector machine (SVM), Gaussian process (GP), and adaptive neuro-fuzzy inference system (ANFIS).As an illustration, Kwon et al. [51], Caggiano et al. [52], Shevchik et al. [53], and Snow [54] applied a deep neural network to predict porosity, whereas Zhang et al. [55] and Gaikwad et al. [56] used it to identify cracks.Scime et al. [57], Ye et al. [58], Petrich et al. [59], Gobert et al. [60], and Yadav et al. [61] showed the application of SVM to identify porosity.Scime et al. [57] also addressed balling effect and spatter detection.The GP was used to detect melt pool geometry and porosity in the study of Tapia et al. [62,63] and Meng et al. [64].Only one study was conducted based on the ANFIS method in LPBF by M. Zhang et al. [65].The model was trained to predict the fatigue life cycle of horizontal and vertical blocks printed by stainless steel 316L using the EOS M290.
Besides, unsupervised learning techniques, including clustering and data reduction, were applied to predict flaws and extract features in the LPBF process.Clustering techniques are used to identify clusters in a feature space without any labeled information.Some popular methods of clustering are K-means, self-organizing map (SOM), and agglomerative hierarchy.K-means was applied by Scime et al. [66] to detect anomalies corresponding to the powder spreading process and by Colosimo et al. [67] to show the effect of the hot spot and heated features.SOM was used in the authors' previous study to identify the lack of fusion porosity by clustering the photodiode's dataset into nine dimensions [68].The agglomerative hierarchy was used in the study of Fathizadan et al. [69] to tag the anomalies and normal processes.According to data reduction techniques, some types of principal component analysis (PCA) and singular value decomposition (SVD) were mainly used to extract significant features in LPBF.For example, Zhang et al. [70] discussed the application of PCA to improve SVM accuracy.The study showed using PCA with 33 input features could increase the SVM accuracy from 89.7 to 90.1%, whereas using PCA with 17 input features could reduce the accuracy from 89.2 to 88.3%.The study discussed that PCA might negatively influence performance when valuable features are removed from the dataset.Also, more complex types of PCA were proposed by Colosimo et al. [67] and Yan et al. [71].SVD was used in the study of Okaro et al. [23] to reduce the data of 25 ultimate tensile strength (UTS) tests, and then, two Gaussian mixture models were trained by the extracted data to identify fault, resulting in 77% success detection.
Although reinforcement learning is commonly applied in many engineering fields, such as game theory and swarm intelligence, only limited studies were conducted based on the RL in LPBF by Knaak et al. [72] and Wasmer et al. [37].Knaak et al. [72] conducted a study to measure surface roughness by using CNN and model-based RL (MB-RL) algorithms, while Wasmer et al. [37] investigated the part quality by choosing CNN and model-free RL (MF-RL) algorithms.
As mentioned above, machine developers and researchers have addressed some of the LPBF issues by developing quality assurance algorithms; however, a closed-loop controller is required to automatically control and fully adjust the process to fabricate high-resolution and high-quality complex structures at a mass production level.Since full control of the LPBF process is too difficult due to the speed of the process, only a limited number of reports focusing on the closed-loop controller in LPBF have been published, and all of them have controlled the in-house developed LPBF machine in their study.For instance, Kruth et al. [73] designed a proportional-integral-derivative (PID) controller to stabilize the melt pool dynamics by controlling the laser power.In the following work of Kruth's team, Craeghs et al. [74] implemented a PI controller by correlating the laser power and photodiode signal.First, the photodiode captured a light-intensity signal with a sampling frequency of 20 kHz.Then, the collected signal was fitted to the 2nd-order model in the Fourier domain.Then, three PI controllers were developed with bandwidths of 95, 660, and 3600 rad/s to alter the laser power.Craeghs et al. [74] discussed the effectiveness of the intermediate controller (660 rad/s) and showed an improvement in the geometrical accuracy of overhang regions and surface roughness.
This research article is a complementary study of the author's previous publications.In previous studies, three statistical (absolute limits, signal dynamics, and short-term fluctuation) [42] and machine learning (self-organizing map) [68] algorithms were applied to the in-situ photodiode datasets for predicting the lack of fusion porosities.To embed lack of fusion (LoF) pores in the printed parts, two approaches were considered: 1) Artificially seeded flaws/defects were created by embedding artificial voids in the coupon samples, and 2) Randomized defects were created by reducing energy input.
After collecting photodiode data, the effectiveness of algorithms (AL, SD, STF, and SOM) was investigated, which will be reviewed in Sect.3.2.1,confirming the use of the SOM algorithm for the next phase of this study for a real-time defect detection method.This new work aims to use the SOM prediction for developing and implementing an intermittent closedloop controller for the EOS M290 LPBF system, by which a lack of fusion defects was removed in the consecutive layer of detection in a specific zone.To do that, Sect. 3 explains a detailed methodology of designed algorithms.Also, for testing the controller efficiency, two new sets of the experiment are designed and explained in Sect.3.Then, the CT scan analysis and the controller's performance to heal artificial and randomized defects are correlated and discussed in Sect. 4. Finally, conclusions are outlined in Sect. 5.

In situ measurement/monitoring
The commercial co-axial photodiode sensor of the EOS M290 system was used to capture the meltpool light intensity signal in the wavelength range of 750-900 (nm) and with a sampling frequency of 60 (kHz), similar to previous studies of authors [42,68].In addition, besides light intensity signals, the X/Y scanner position was also captured and documented during the process (please refer to [42,75] for more information).

Review of defect detection algorithms from previous
studies of authors [42,68,76] After collecting an in situ intensity signal using a co-axial photodiode, the in situ dataset was corrected to avoid any distortion, which was provided by EOS.Then, the corrected dataset was analyzed by three statistical algorithms (absolute limits, signal dynamics, and short-term fluctuation) [42] and one machine learning (self-organizing map) algorithm [68] for predicting the LoF porosities.To embed LoF pores in the printed parts, two approaches were considered: 3) Artificially seeded flaws/defects: This type of defect was created by embedding artificial voids in different geometries, sizes, and distributions in the samples, and 4) Randomized defects: This type was created by reducing energy input which were reducing laser power, increasing hatching distance, and increasing scanning speed.
After collecting photodiode data, the effectiveness of algorithms (AL, SD, STF, and SOM) was investigated.First, artificial defects were used as a reference to customize the algorithms by comparing the result with the design and computed tomography (CT) scanning.Then, the customized model was applied to detect randomized defects.Additionally, the actual defects were detected using the CT scan.Then, to examine the correlation between the results of the defect detection algorithm and CT scan, the segmentation method and volumetric approach were used.The final results of statistical algorithms (AL, SD, and STF) disclosed that AL has higher accuracy than SD and STF algorithms [42].As a result, AL was chosen from the statistical algorithm to compare with the SOM clustering algorithm [68].By comparing the result of AL and SOM [42,68], the following conclusions were drawn.
1) For artificial defects, voids with a size of down to 120 μm were predicted by AL [42], while SOM could detect voids larger than 100 μm [68].2) For randomized defects (including relatively low laser powers of 175, 150, 125, and 100 W, high hatching distances of 110, 130, and 150 μm, and high process speeds of 1100, 1300, and 1500 mm/s), the result showed that the voids induced due to relative low laser power were detected with the true positive rate of > 75% by SOM [68] and < 30% by AL [42].Although SOM exhibited true positive (TP) rate results similar to AL for detecting voids created by relatively high scanning speeds and high hatching distances, the SOM was able to improve true negative rates up to 20% and 31% for those process parameters, respectively.According to the computational time, the SOM algorithm resulted in higher computational time, so the SOM algorithm analyzed one layer of the print 86% faster than AL [68].
Since the SOM algorithm was chosen as a real-time defect detection method, the procedure to detect defects is shown in Fig. 1. Figure 1 displays the result of defect detection and some definitions after applying the SOM method on part incorporating intentional defects.It should be noted that the similar procedure was used for the entire process.The procedure is as follows: 1) Applying SOM on the intensity signal of consecutive layers of defects (Fig. 1d) and optimizing SOM parameters using a CT scan validation test, 2) Mapping the intensity signal of each cluster calculated by SOM to the geometry of the part (Fig. 1e), showing the lower cluster (last image from the left) is corresponding to the location of defects in Fig. 1a, 3) Using the result of the lower cluster from Fig. 1e to identify defect indicator (Fig. 1f) for the next step of the analysis which will be discussed in the next sections.It should be noted that the defect indicator refers to each point/pixel corresponding to an anomaly predicted by applying the SOM algorithm.

Numbers and area of indicators based on the defect size
After applying the SOM algorithm to the captured intensity signal, the predicted defect indicators (defined in Sect.3.2.1)were analyzed in terms of their numbers and the area that they cover.
For mimicking the lack of fusion porosity, various scenarios of artificial defects were discussed previously (refer to a supplementary document or [42]) in which the cubical samples named R2, R3, and R4 samples were designed with a size of 8 × 8 × 10 (W × L × H) mm and printed by embedding Fig. 1 The procedure to predict defect indicators using the SOM algorithm (source: redrawn and adapted from [68]) artificial voids.These samples were then analyzed using the self-organizing map (SOM) unsupervised machine learning method [68].After applying the SOM algorithm for detecting defects' location, the number of indicators on the top area (equal to defect size) of the capping layer of each defect was calculated.Figure 2 demonstrates one example of the process.Figure 2a shows the 2D image of the last layer (layer n) incorporating artificial defects (geometry: cylinder and size: Ø, H = 200 µm) from the R2 sample (please refer to the supplementary document or [42]).After applying a defect detection algorithm to the capping layer of artificial defects (layer n + 1), Fig. 2b represents the positions of defects in layer n + 1.Then, in a corresponding area of each defect, the numbers of identified indicators were calculated in the abovementioned area.
To increase the repeatability of the dataset, all sizes of defects in samples R2, R3, and R4 (please refer to a supplementary document or [42]) were analyzed.Thus, as calculated in Table 1, the following numbers of defects were analyzed: The capping layer of these defects was analyzed by the SOM method to find the defect indicators, as shown in After that, the calculated value was counted and analyzed by average and standard deviations for each size and type of defect, and the results are listed in Table 2.
Table 2 confirms that by increasing the size of artificial defects, the number of identified indicators also increased.For instance, in sample R2, 30 ± 2 indicators were identified for the defect size of Ø, H = 200 (µm), while 24 ± 3 indicators were detected for the defect size of Ø, H = 100 (µm).But, according to Table 2, the number of indicators in sample R4 was less than its corresponding number in other samples which could be due to its defect geometry.For example, the indicators' number in sample R4 with the size of Ø = 200 µm was approximately 25; however, in sample R2, a similar size of defects resulted in 30 indicators.Therefore, according to the shape of lack of fusion defects, which is more similar to a cylinder, the results of samples R2 and R3 were used for the next step of this study.Based on Table 2, detecting any cluster of indicators with more than 20 points (considering standard deviation) could be corresponding to a defect larger than 100 µm.The number of indicators and defect size were correlated and listed in Table 3.
After detecting the indicators, they were clustered by the K-means algorithm as one defect in each 1 mm × 1 mm.For instance, Fig. 4 demonstrates one example of applying the SOM algorithm on layer n + 1 for detecting defect positions (Fig. 4a), gridding the part into 1 mm × 1 mm (Fig. 4b), and applying the K-means algorithm (Fig. 4c).It should be noted that 1 mm × 1 mm was chosen based on the distance between defects considered in the CAD model.
After calculating the center of each cluster by K-means (as shown in Fig. 4c) and finding the number of indicators in each cluster, the 100 (µm) size was chosen as a threshold, since it is the smallest size of the defect identified by SOM [68].Then, two scenarios should be considered based on Table 3: In the abnormal case, the number of indicators within each cluster specified the actual size of defects based on Table 3.For instance, 26 indicators translated that the size of its corresponding defects was between 100 and 200 (µm).
Besides the number of indicators discussed above, the area covered by each cluster was another factor to analyze.
As observed in Fig. 4, the geometry of the cluster of indicators was not symmetric, which might be due to the hatching direction.Thus, the maximum distance of each cluster (called the radius) from X (left to right) and Y (top to bottom) directions to the center was measured, as displayed for one cluster in Fig. 5.After calculating these radii for all the clusters, their average and standard deviation are calculated and listed in Table 4 based on the size of defects in samples R2 and R3.
Table 4 indicates that even by changing the defect size, areas covered by the cluster of indicators had approximately similar radius.For example, in sample R2 for defect size of Ø, H = 200 µm and Ø, H = 150 µm, the maximum radius of clusters in the X direction was approximately 0.29 mm.Thus, by considering the standard deviation, the maximum radius of indicators' clusters was almost in the same range and between 0.21 and 0.31 (mm) in the X-direction and between 0.11 and 0.29 (mm) in the Y-direction.Thus, the maximum radius of 0.3 mm was assumed for the next step in which a 0.6 × 0.6 (mm 2 ) square (0.3 from the center to each direction) was considered around the center of each  Figure 6 visualizes that a square with a side length of 0.6 (mm) around the cluster's center could cover a defective area.Thus, a 0.6 × 0.6 (mm 2 ) square was chosen as an area where the laser power will be increased.In the next phase, the optimum laser power should be identified which will be explored in the next section (Sect.3.2.3).

Identifying the optimum amount of laser power to heal defects by designing and analyzing N-series sample
The N-series sample was designed and fabricated to enhance the knowledge about what amount of laser power could heal different sizes of defects.Four cubical-shaped coupon samples (N1, N2, N3, and N4) incorporating artificial lack of fusion defects were designed (Fig. 7) with the following dimension: • N1: W × L × H = 5 × 5 × 10 mm.All of the samples were 3D-printed with a material of Hastelloy-X, stripe scan strategy with 67° rotation after each layer, and laser spot size of 100 µm.Also, vertical and horizontal rectangle-shaped grooves were considered in the design of coupon samples to ease identifying the pores' location in the CT scan analysis.
• As shown in Fig. 7 with different colors, each sample was segmented into four parts (P1, P2, P3, and P4).In each part, three sizes of cylindrical defects were embedded.
Each coupon sample was printed in four locations in the build plate, as represented in Figure 9. Figure 9a demonstrates the sample layout on the build plate, and Figure 9b displays the final printed parts of the build.
All parts were fabricated with standard print parameters (scanning speed = 1000 mm/s, hatching distance = 90 µm, power = 200 W, and layer thickness = 40 µm) used to obtain high-quality Hastelloy-X parts [42,68]; however, the consecutive layer of artificial defects was printed by varying the laser power listed in Table 6.

Gridding the build plate into cells
Depending on the size of the build plate, it needs to be gridded into cells with an appropriate size that would be a function of system capabilities.Grids can be considered As a result, each cell of LCF included the change in laser power value, which could vary from cell to cell.

Communicating between the data acquisition, defect detection algorithm, and controller
To collect real-time data, apply the defect detection   the Message Queuing Telemetry Transport (MQTT) broker was used.The MQTT broker is a publish-subscribe network protocol that transports messages between devices [77].The below procedure was used in this study: 1-. EOS-Controller published the layer number; simultaneously, MATLAB subscribed to the message, and MATLAB started collecting data from the current layer of the print, 2-.As soon as EOS-Controller published another notification message which showed a layer of print was finished, MATLAB stopped the data acquisition of the current layer and started applying geometry and intensity corrections and defect detection algorithm on the collected data (discussed in [68]); then, MATLAB calculated and published the LCF to the MQTT broker before exposure of the next layer, and 3-.EOS-Controller subscribed to the LCF and changed the laser power of the next layer based on the new LCF file.

Design of experiments for validating the performance of the controller
Two sets of experiments were designed with the size of 15 × 15 × 25 (W × L × H) mm 3 and labeled as X-series and Y-series.All of the X-series and Y-series were fabricated with Hastelloy-X.Also, vertical rectangle-shaped grooves were considered in the design of the X-series and Y-series to facilitate mapping the pores' location in the analysis.

X-series coupon sample incorporating artificial defects
X-series included two cubical-shaped coupon samples (X1 and X2) with similar distribution and size of artificial defects (Fig. 10a and b).In their design, seven sizes of cylindrical artificial defects were considered ranging from Ø, H = 100 to Ø, H = 400 µm.Then, two repetitions of each size were randomly distributed inside the samples.Figure 10c and d represent the locations, ids, and sizes of defects.Also, sample X1 was printed with the optimum process parameters for Hastelloy-X parts (power = 200 W, layer thickness = 40 µm, hatching distance = 90 µm, and speed = 1000 mm/s), meaning the print parameters of sample X1 were fixed during the print.Sample X2 was fabricated with the hatching distance, layer thickness, and scan speed of what was used for the fabrication of sample X1.Although its power was initially set to 200 W, it could change based on the conclusion of the N-series analysis (Sect.4.1.1).
Figure 11a and b show the location of X-series samples in the build plate.As demonstrated in Fig. 11, X2 was fabricated in the center of the build plate, and sample X1 was printed close to X2 (2 mm distance) to reduce the effect of locations on detection quality which could affect the prediction [42,68].

Y-series coupon sample incorporating randomized defects
Y-series also included two cubical-shaped coupon samples (Y1 and Y2) with randomized defects, as shown in Fig. 12.To mimic the randomized defects and create a lowdense part, energy density was reduced in Y-series parts by decreasing the laser power to 150 W. Thus, the following parameters were considered: • Power = 150 W, • Layer thickness = 40 µm, • Hatching distance = 90 µm, and • Speed = 1000 mm/s.
The Y1 print parameters were fixed during the print.In addition, the layer thickness, hatching distance, and speed of sample Y2 were set similarly to the corresponding   arrangement in the build was similar to the X-series to reduce the effect of location.

N-series
N1, N2, N3, and N4 samples were analyzed by CT scan to detect their actual defects using X-ray μCT on the Zeiss Xradia Versa 520 system.Then, the CT-scanned data were analyzed by Dragonfly Pro v4.0 (software).
As discussed earlier, five sizes of cylindrical defects were embedded in N samples.To find a more precise result, the total number of 89 defects for each size of Ø, H = 100 μm, 150 μm, 300 μm, and 400 μm and 178 defects for Ø, H = 200 μm were embedded in N-series samples.The next consecutive layer of these defects was fabricated using sixteen various laser powers from 200 to 275 W with a step size of 5. First, all samples were CT scanned (Fig. 14), and then, the percentage of healing for each size of the artificial defect was analyzed and demonstrated in Fig. 15.
Based on Fig. 15, defects with the height and diameter of 100 μm, 150 μm, and 200 μm completely disappeared with the laser power of 210 W, 225 W, and 260 W, respectively.It should be noted that increasing the power to 260 W might result in the keyhole porosity and also change the desired microstructure.On the other hand, Ø, H = 300 μm and Ø, H = 400 μm defects were not healed even under exposure to 270 W laser power.As a result, for defects with the size of Ø, H = 100 μm and Ø, H = 150 μm, 210 W and 225 W were set for the next step of this research, respectively; however, for the other three sizes of defects (Ø, H = 200 μm, 300 μm, and 400 μm), the radius size of remaining un-healed defects was calculated and averaged as demonstrated in Fig. 16.
Figure 16 indicates that the size of the remaining defects slightly decreased by increasing the laser power, although none of the defects in Fig. 16a and b healed completely.As a result, instead of finding the laser power by which defects were healed completely, the laser power was selected when it could heal defects up to 50% of their original size to avoid creating any keyhole defects.Thus, 240 W and 250 W were selected for healing defects with the size of Ø, H = 300 μm and Ø, H = 400 μm, respectively.With a similar approach, 230 W was chosen for the defects size of Ø, H = 200 μm.Also, for the defect size of (Ø, H = 200 μm), there are limited numbers of unhealed defects when the laser power is more than 230 W. As shown in Fig. 16c, only one defect was not healed under the exposure of 235 W, 240 W, 250 W, and 255 W, whereas two defects were not healed by 245 W, their sizes were approximately 20% of its designed size (~ 40 μm).As a result, the following amount of laser power was selected: • 210 W for defect size of Ø, H = 100 μm, • 225 W for defect size of Ø, H = 150 μm, • 230 W for defect size of Ø, H = 200 μm, • 240 W for defect size of Ø, H = 300 μm, and • 250 W for defect size of Ø, H = 400 μm.
Then, the optimum laser powers were selected to be automatically changed based on the size of identified defects in a square area of 0.6 × 0.6 mm 2 (discussed in Sect.3.2.2).

X-series coupon sample incorporating artificial defects
Samples X1 and X2 were analyzed using CT scan (CT) to detect their actual defects with similar hardware and software used for the N-series, as discussed in Sect.3.2.3.The pores' diameter and location of X1 and X2 were calculated through the μCT.The front view of samples (X1 and X2) is depicted in Fig. 17 in which pores are labelled as shown in Fig. 10c.

Y-series coupon sample incorporating randomized defects
Y-series samples were also CT scanned.The identified pores through µCT have filtered out pores smaller than 100 µm since the defect detection algorithm was only capable of detecting porosity larger than 100 µm [68].The front view of samples Y1 and Y2 are depicted in Fig. 18a and b, respectively.

The intermittent controller
After fabricating the X-series and Y-series, the LCF tables of both prints were checked, and all samples were analyzed by CT scan.The results of applying the controller on samples X2 and Y2 will be presented and compared with the result of standard samples (X1 and Y1) and CT scan in Sects.4.2.1 and 4.2.2, respectively.

Performance of the controller on the X-series coupon sample incorporating artificial defects
X-series samples (X1 and X2) were fabricated to evaluate the performance of the controller for healing artificial lack of fusion defects.Sample X1 was fabricated when the controller was inactive, and sample X2 was printed when the controller was active.In other words, sample X1 was printed with the standard print parameters, fixed during the print, while the laser power of sample X2 was changed during the fabrication based on the LCF table, which was transferred via the MQTT broker to the laser.The LCFs created during the fabrication of X2 were examined for the layer printed on top of artificial defects, and the result demonstrated that the control system worked properly and laser power was changed during the process; however, based on the result of Sect.4.1.1,the increase of laser power for each size of defect should be as follows (Table 7): whereas the created LCF tables showed that the change in laser power was less than expected, which is listed below in Table 8: The potential reason for this mismatch could be detecting fewer numbers of indicators in X2 than in R-series samples.Therefore, one level decrease in changing the laser power was observed.On the other hand, Table 9 represents the actual radius of defects based on the CT scan results in which comparisons between sizes of porosities in X1 and X2 are listed.
As shown in Fig. 17 and listed in Table 9, the following results are drawn:  • Defects 6 and 7 were completely healed during the process for both X1 and X2, due to the self-healing nature of the process • One of defects, 5, was shrunk in both samples.In contrast, another one was shrunk by 25 (μm) in X2 and less than 1 (μm) in X1.Although one of the defects, 5, was shrunk in samples X1 and X2, another one remained in X1 with approximately similar size as the design but another one in sample X2 was healed 25 (μm), showing the potential of the control system.• The radius of defect 4 showed that their shrinkage was 3 (μm) and 11 (μm) in X1; however, the shrinkage of these defects embedded in sample X2 was approximately 50 (μm) and 53 (μm).• One of the defects, 3, was completely healed in X2, whereas the shrinkage of the similar defect in sample X1 was only 8.5 (μm).Additionally, another position of defect 3 showed that its shrinkage was limited to 70 (μm) in X2, while the size of a similar one in X1 was unchanged (no shrinkage).• The radiuses of defect 2 showed that X1 defects were shrunk 19 (μm) and 29 (μm), whereas defects of X2 were healed up to 112 (μm) and 120 (μm).• Finally, the shrinkage of defect 1 was approximately 6 (μm) and 17 (μm) in X1, and the corresponding ones in sample X2 showed a shrinkage of 56 (μm) and 126 (μm).
The above results confirmed that the shrinkage of defects embedded in sample X2 was more than the corresponding defects of X1 which showed the functionality of the controller.However, the laser power should increase to heal at least half the sizes of defects (as discussed in Sect.4.1.1).
For example, for the defect with sizes of Ø, H = 400 (μm), it was supposed to the laser power would increase to 250 W (Table 7) to shrink the defects to 200 μm, whereas the power was changed to 240 W (Table 8) and the shrinkage limited to 126 μm.Thus, the laser power should be increased by one level to obtain better and more promising results.

Performance of the controller on the Y-series coupon sample incorporating randomized defects
Samples Y1 and Y2 were manufactured by low energy density to create randomized defects.These two samples were used to evaluate the performance of the developed controller.As observed in Fig. 18, the identified porosities in Y1 were more than the detected pores in sample Y2.To confirm this claim, the density of both samples was measured and resulted in 97.96% and 98.90% for Y1 and Y2, respectively.Also, the histogram of pores revealed that the numbers and size of the lack of fusion pores in sample Y2 are less than their corresponding amounts in sample Y1 (Fig. 19).For instance, the largest size of defect identified in samples Y1 and Y2 was 487 (μm) and 280 (μm), respectively.The CT scan analysis also revealed that 32380 and 26978 pores were detected in samples Y1 and Y2, respectively.Thus, all of the abovementioned results confirmed that using the controller increased the density of the part printed when the controller was active compared to the printed parts when the controller was inactive.Although this methodology has not been able to heal porosities completely, it resulted in a 0.94% increase in the density of sample Y2 compared to sample Y1, confirming the potential of the proposed methodology for the control system.Even though the robustness of the control system should be further analyzed by more parts/prints, it showed a great achievement to develop the intermittent closed-loop controller for the commercial EOS M290 LPBF-AM system.However, more experimental analyses are required to heal defects completely which will be discussed in a future study.Also, the proposed algorithm will be applied to different materials to identify the increase in laser power.This allows the development of an adaptive algorithm to adjust and change the power based on the material type.

Conclusions
In this study, the defects identified by the SOM algorithm were clustered by the K-means algorithm.An optimized square area of 0.6 × 0.6 mm 2 was selected around the center of each cluster as the targeted zone for increasing the laser power in the next deposition layer to heal or minimize the induced defects.Rules were defined based on the defect size and optimum laser power to calculate the new laser power, which was stored as a laser correction file.The closed-loop approach was established by connecting different components through the MQTT broker for collecting and correcting data, detecting defects, calculating the LCF, and sending the new LCF to the actuator.Lastly, the proposed controller was applied to two sets of prints that included artificial and randomized defects to validate its performance.The application of the intermittent controller to heal the lack of fusion defects demonstrated the proper functioning of the control system.CT scan analysis of the part printed when the controller was active showed a shrinkage of 25 (μm)-120 (μm) more than the corresponding defects in the part printed when the controller was inactive.Additionally, CT scan analysis of parts incorporating randomized defects revealed that the controller could increase the density of the part by up to approximately 1% compared to the parts printed when the controller was inactive.This suggests a significant improvement that is highly beneficial for the industry.

Fig. 2 Fig
Fig. 2 One example of a defect detection process in which a the last layer, including artificial defects (geometry: cylinder and size: Ø, H = 200 µm) and b the positions of defect indicators identified by the SOM algorithm on the capping layer of artificial defects in sample R2

Fig. 3 2
Fig. 3 An area of interest (calculated based on the size of the underneath defect) considered to find the number of indicators

Fig. 4 Fig. 5
Fig. 4 One example of (a) applying the SOM algorithm on the capping layer of artificial defects to highlight the positions of defects shown by red color, (b) gridding the part into 1 mm × 1 mm shown

Fig. 6
Fig. 6 Considering a square with a size of 0.6 × 0.6 mm 2 around the center of clusters in layer n + 1 printed on top of layer n with a defect size of Ø, H = 200 µm

Fig. 9 aTable 6
Fig. 9 a Sample layout and b printed samples on the build plate

Fig. 10 a
Fig. 10 a 3D view of sample X1, b 3D view of sample X2, c x-z coordinate of X-series samples, and d x-y coordinate of X-series samples showing the distribution of the artificial defects

Figure
Figure 13a and b show the location of Y-series samples in the build plate.As demonstrated in Fig. 13, Y2 and Y1

Fig. 11 a
Fig. 11 a Sample layout of X-series and b printed X-series samples on the build plate (all units are millimetres)

Fig. 13 a
Fig. 13 a Sample layout of Y-series and b printed Y-series samples on the build plate (all units are millimetres)

Fig. 14 Fig. 15 Fig. 16
Fig. 14 CT scan result of N-series sample in all four locations

Fig. 18 Table 7
Fig. 18 CT scan result of samples a Y1 and b Y2

Fig. 19
Fig. 19 The histogram of pores identified in samples (a) Y1 and (b) Y2

Table 3
The potential size of defects based on the identified indicators

Table 4
The average and standard deviations of maximum radius of X and Y directions of clusters with indicators in R2 and R3 samples in the capping area of defective zones based on defect size in the table named laser correction file (LCF).The LCF is defined to contain information about the laser powers.

Table 5
The

Table 9
The actual radius of defects embedded in samples X1 and X2 based on the CT scan results