MPI-Based System 2 for Determining LPBF Process Control Thresholds and Parameters

Determining thresholds of the primary control loops (System 1) of an additive manufacturing (AM) process is challenging when realizing System 1 with its fast and intuitive capability for adapting to different metal powers, machine configurations, and process parameters. Based on the convolution neural network and long short-term memory models, this letter presents a secondary tuning loop (System 2) to classify the types of melt-pool images (MPIs) from a coaxial camera online, suggest polishing parameters, and determine the control thresholds of System 1 offline. Case studies indicate that the thresholds and parameters of System 1 including smoke discharging, powder coating, and laser polishing of control loops of a laser powder bed fusion (LPBF) machine can be more deliberatively and logically decided by the proposed MPI-based System 2.

. The advanced layout of a laser powder bed fusion (LPBF) machine with the coaxial CCD and overview CCD. resources will be wasted when quality issues are detected after final inspection.
The AM process depends upon multi-process parameters, which would increase the process complexity in terms of monitoring and controlling. The quality and consistency of parts are the major obstacles in the way of the AM adoption in largescale manufacturing. The highly-complex physical phenomena and variation of process setting, machine setting, and building environment will cause defects in the built part [2]. Defects such as dimension error, porosity, residual stress and cracks can occur due to the lack of in-process monitoring and closed feedback loop system. Using multiple sensor-based systems to monitor the manufacturing process is essential for better part quality, in addition, the high-speed sensors can assist the feedback controller in the desired system. Numerous researchers used high-speed sensors such as complementary metal oxide semiconductor (CMOS) cameras and pyrometer to observe the melt-pool image (MPI) shape and temperature [3], [4].
The advanced layout of the laser power bed fusion (LPBF) machine equipped with high-speed sensors is designed as Fig. 1 [5]. The LPBF machine will melt the powder by the fiber laser on the current layer after coating a layer of powder on the previous layer. The laser power, scan speed, and shape and temperature of melt pools the common measurement items for monitoring and controlling in the AM process. Because the MPI shapes are parts of the significant features used to judge the stability and quality of the AM process, the camera-based in-situ systems are developed to monitor the melt pool and regulate the laser power online and in real time for the stability of the manufacturing process once the system detects some abnormal behaviors [6]. Hence, the chamber image and MPI will be captured by the overview CCD and coaxial CCD, respectively, and the fog or This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ smoke generated during melting would be carried from the chamber by the Nitrogen airflow [7], [8].
However, it is challenging for users to determine the control variables (e.g., control thresholds and process parameters) while performing the novel control functions of the advanced LPBF machine, including smoke discharging, powder spreading, and laser polishing concerning various powder properties and machine characteristics [2]. Inspired by the ways of human thinking [9], this work considers the primary control function as System 1, and the secondary tuning function as System 2; so that System 1 can be fast and intuitive for online control, while System 2 is slow but analytic for the offline tuning of System 1.

A. Literature Review
The microstructure and mechanical features of the AM built part are deeply dependent upon the process parameters such as powder feed rate, laser power, and scan speed. By fine-tuning the process parameters, the mechanical characteristics of the building samples can be enhanced [10]. However, literature shows that not only the given process parameters such as laser power, scan speed, and hatching-space might affect the quality built, the actual process condition determined by the machine-specific architecture (e.g., air-flow rate) can also expressively influence the final quality such as porosity and roughness [11].
Most literature used the term "monitoring" to depict only the in-process data collection and feature extraction. To avoid the dimension accuracy error, it is quite hard to control the shape and size of the deposited layer. Although different organizations provided the road map on metal AM to highlight the challenges for developing the feedback control system in AM, only a few researchers brought up defect detection using reasoning-based instructions and organized approaches for in-process defectrecognition [12]. For example, NIST customized their own open AM testbed to measure the in-process metrology and real-time process control for a better understanding of the overall AM process [13]. To realize the closed-loop systems, diverse kinds of control strategies such as adaptive control, fuzzy control, neural control, predictive control, and AI control algorithm can be utilized [14]. And, a time-based multi-loop architecture was proposed to realize the AM process with internal real-time and near real-time control loops [15].
When discharging smoke in laser fusion, the literature [16] indicated that the decreasing airflow rate will result in increasing process instability and porosity defects which could cause a lack of fusion. It is possible to enhance the overall AM process control and quality by improving the airflow control loop under proper rates. In addition, in powder spreading, the parameters such as the elasticity, height, and speed of the spreading head could affect the solidification morphology of the coated layers [17].
In laser fusion, the laser power is one of the important process parameters in the AM process because it causes pores and cracks during the over and under power conditions. To find out the printing defects, features extracted from the MPI (e.g., width, length, and area) can be used as indicators for quality prediction. The researchers developed different quality prediction algorithms such as porosity, density, etc., via the neural network, partial least square, and convolution neural network (CNN) according to the thermographic-based in-situ images [5], [8]. Based on the MPI shape, the actual melting power is predictable via the CNN model [18]. The researchers even utilized the deep-learning based model to check the quality of the fabricated part of the final AM built products and categorize it into good or crack-existing.
Currently, CNN has shown better performance in many industrial manufacturing tasks such as fault detection, remaininguseful-life estimation and machine disorder situation [19], [20]. In the literature, diverse researchers have used different methods such as support vector machine (SVM) and CNN to find out the defects in the AM process and classify them into multiple types [21]. For defect detection of AM, many scholars have utilized CNN for different kinds of AM process monitoring. To evaluate the performance of the proposed system, the defects identified by the in-situ system are mapped with the ones by the ex-situ metrology [22], [23].
However, it is possible to save the computational cost and increase the accuracy of quality prediction algorithm by classifying the features of spatters and plumes from the melt-pool images. Machine-learning-based algorithms were used to categorize the information as either normal or abnormal. A deeplearning-based model was developed to detect the process variation and find out the defects based on captured images, which could provide the basic information to adjust the parameters for better quality built [24]. The deep-learning-based method was also used in direct energy deposition to detect the defects [25]. Some researchers proposed a deep-learning model for pixel-wise localization to discover the defects on layer-wise images [26].
Currently, most of the research focused on the coaxial powder spreading system with circular laser beam; however, few studies used some statistical-based models to determine the process parameters for laser polishing function according to surface roughness requirement. The effects of laser polishing control on the part surface quality, density, and mechanical properties are observed by changing the process parameters such as power, scan speed, hatching space, etc. It is validated that laser polishing control function considerably improves the density and surface roughness quality and micro-harness of the built part [27], [28]. Although laser polishing parameters significantly affect the quality, it is still challenging to select these parameters robustly for better quality gain.
Due to the multifaceted nature of the AM process as well as software and hardware constraints, each material has its own properties, thus quality approximation is a major challenge many researchers encounter. Even using the same process parameter conditions, the quality results are dissimilar due to different factors such as coating homogeneity, airflow stability, and fusion capability. A data-driven model that can help estimate and analyze mechanical characteristics for AM is still missing in the literature [29]. It is vital for determining the proper control variables of the novel control loops (i.e., smoke discharging, powder spreading, and laser fusion and polishing) of the advanced LPBF machine to adapting for various powder properties and machine characteristics

B. Problems of Threshold and Parameter Decision in LPBF Process
For layer-to-layer (L2L) control in AM, monitoring the MPI shape is essential for reducing the quality variations caused from non-uniformity of powder plating and laser fusion. It is quite hard to estimate the whole AM process quality using the analytical models because of the complexity of physical process. As stated in [5], the MPI shape is one of the important signatures used to estimate and control the quality in the AM process.
The typical types of MPI shapes can be manually classified into three categories, i.e., MPI-0, MPI-1, and MPI-2 as shown in Fig. 2. The images with fog and plume are denoted as MPI-1 and MPI-2, respectively, while the other images are considered as normal and named as MPI-0. Based on the MPI data, this research focuses on a LPBF process to tackle the following questions: r How to automatically classify the MPI types? r Can the MPI classification be used to determine the proper thresholds for compensating the smoke-discharging and powder-coating control loops?
r Can the MPI classification be applied to evaluate the performance of polishing parameters for compensating printing quality? The control loops, i.e., smoke discharge, powder spread, and laser fusion, are primal and essential to realize the L2L control in AM; however, determining the thresholds to compensate the control loops is challenging for different powder properties and machine characteristics. Also, the melting quality can be improved by adopting a polishing method; yet evaluating the performance of the polishing parameters for compensating printing quality is tricky. Hence, how a second tuning loop with MPI-based classification (i.e., System 2) can be developed and used to decide the thresholds or parameters of the primal control loops (i.e., System 1) is a systematic problem here.
After classifying MPIs, the quality built will be increased by detecting and excluding the L2L abnormal issues of LPBF process in the periodic stage. Also, the accuracy of quality prediction will be improved after serving with the features of the normal MPIs for quality estimation. Such monitoring method is preferable to improve the intelligent competencies of the next-generation AM schemes. For the rest of this paper, Section 2 introduces the proposed intelligent MPI-based System 2 architecture; Section 3 explains the results of the proposed method, and then the conclusion is stated in the final section.

II. THE MPI-BASED SYSTEM 2 ARCHITECTURE
To reduce the variation and uncertainty of the LPBF process, this paper develops an LPBF machine with the novel intelligent compensation architecture as shown in Fig. 3. The controlled body (LPBF plant) consists of three major control loops: the airflow circulation module for reducing oxygen and excluding smoke/fog, the powder filling and spreading module for coating, and the laser galvanometer module for fusion. Except for the particle filter, workpiece inspection device, and overview inspection device, which are not in the scope of development, the novel compensation architecture is comprised of the smoke discharging (denoted as discharging), powder coating (denoted as coating), and laser polishing (denoted as polishing) compensation modules. Also, the printing estimation function is enhanced and used to refresh the estimation model based on the previous MPI-based processing method [5].

A. The MPI Classifier
Compared to traditional machine learning techniques, CNN is more capable of automatic feature extraction and it works well in various manufacturing tasks [30]. The traditional architecture of CNN models can extract the static and spatial information from the MPIs. On the other hand, the defects in the AM process are layer-wisely and dynamically formatted in nature such as plume and spatter direction variations. Also, a typical recurrent neural network (RNN) architecture fails in solving the layering problem with better accuracy. Instead, the long short-term memory (LSTM) network has been proven to perform better on various tasks than RNN does [31].
To tackle the dynamic layering issue of the AM process, a hybrid architecture with the CNN and LSTM models is developed to utilize both spatial and temporal information for automatically classifying various MPI types.
The proposed MPI classifier is shown in Fig. 4. The MPIs at time t serve as the inputs of the MPI classifier, in which the features extracted from the flatten layer are integrated with the process parameters (e.g., laser power, scan speed, and scan policy) and coating status of this layer (i.e., homogeneity derived from overview CCD) as the input X t , to estimate the printing state at time t by using the LSTM cell, as shown in Fig. 4(a). By using a memory cell, each LSTM cell can remember the pattern for a lengthy number of time-steps and then forecast the pattern in the next time-step. The cell stores the memory in the form of a vector. The input and output gates are responsible to control the in and out of the information in each memory cell respectively, while the forget gates learns the old useful information and discards the unrelated information from memory cells.
As shown in Fig. 4(b), for time t, the inputs of the LSTM cell include current input X t , previous cell state C t-1 , and previous output h t-1 ; while the outputs of the LSTM cell are current cell state C t and current output h t . The functions in the LSTM cell can be defined as follows.
where σ is the logistic sigmoid function and * belongs to element-wise product. f t , i t , and o t are the results of the forget, input, and output gates, respectively. And g t , C t , and h t are the results of the cell input activation function, cell state vector, and hash function, respectively. In this paper, the MPI classifier is considered as System 2 of the LPBF machine, whose outcomes will be used to determine the values of the thresholds or parameters of System 1.

B. The Discharging Compensation
To reduce the variation of laser power focus in smoke discharge, the flow controller is feedbacked with the flow compensator and MPI classifier (Fig. 5), where the compensation value for flow control C FC (k) is derived from the flow compensator based on the flow sensing data collected from the entrance of the particle filter. Typically, the flow compensator may adopt the PID  controller to maintain the given command X FC (k), with k being the sampling time. The flow compensator can be considered as System 1 due to its fast and intuitive characteristics. However, the flowrate threshold of the flow compensator can be suggested by the MPI classifier, i.e., the MPI classification sets M C with the optimal flowrate by minimizing the following objective function.
where R t is the ratio of the abnormal MPI type t by flowrate, T m is the total abnormal types, f m is the maximum flowrate count, and α is a weighting value. The flow controller is optimized through the discharging compensator belonging to System 1. As the discharging compensator requires the threshold value to regulate the function, System 2 will provide the threshold value to the compensator based on the classifier through a hybrid model. In short, System 1 of discharging compensation adjusts the actual frequency command of the discharging compressor for stabilizing the actual flow in the chamber, while System 2 of flow compensation determines the optimal flowrate of System 1 of the discharging compensation.

C. The Coating Compensation
To reduce the variants in the coating process, the coating compensator and MPI classifier are proposed as in Fig. 6. The overview camera captures the images of coating process and then calculates the C PC (k) index for each coating layer. The coating compensator is a rule-based controller that needs a proper recoating threshold for adapting the variations caused by optics, location, and angle of the overview CCD. The input to the powder coating compensator comes from two sensors, one is the CCD overview and the other is the coaxial CCD. System 2 will provide the threshold based on the MPI classification. In other words, the coating controller takes actions not only based on the  CCD overview but also the coaxial CCD. Finally, the output is the compensation value for powder coating control C PC (k).
Similar to the flow compensation, the MPI classifier (System 2) is used to provide the recoating threshold for coating compensator with the similar objective functions offline. Hence, the coating compensator (acted as System 1) and MPI classifier can work simultaneously to reduce the coating variations in powder spread of the working plate.

D. The Polishing Compensation
To control the printing quality such as roughness, density, or tensile, the polishing function is proposed for adjusting certain factors including laser power, scan speed, flowrate, and coating quality. The polishing compensation with the printing estimator, polishing compensator, and MPI classifier for reducing the variation of manufacturing quality are depicted as in Fig. 7. After acquiring the data of the process parameters, chamber images and MPIs respectively from the printing controller, overview CCD and coaxial CCD, the printing features can be extracted and utilized to estimate the built qualityŶ R (k) at time k. In this work, the polishing compensator will adjust the polishing process parameters (e.g., laser power and scan speed) to perform the polishing function based on Table I [32].
For example, the three-level polishing parameters {P i , v i }, i = 1, 2, 3, can be derived from Table I according to the estimated quality index (e.g., roughness Ra) with parameters L 1 and L 2 determined by the MPI classifier. Then, polishing command c(k+1) will be quickly derived from the polishing compensator (i.e., System 1) if below the polishing thresholds are triggered.
In short, the realized MPI-based System 2 referred as the abnormality detection scheme works to provide different control thresholds of System 1, including the discharging, coating, and polishing control functions. If the number of defects crosses the threshold value, then either the printing process should be stopped immediately by sending the signal to the layer controller or the process parameters should be tuned through the intelligent compensator for better quality in the AM process.

III. CASE STUDIES
This section adopts four cases to present the feasibility of the proposed MPI-based System 2 in the LPBF machine.

A. MPI Classification
The structure of the proposed MPI-based classifier consists of two Conv+Pooling (i.e., convolution and pooling) layers, one flatten layer, and two LSTM cells. Numerous parameters such as weight and biases in each layer and nodes are trained with the labeled MPIs and assessed using the three metrics including precision, recall and F1 score. To check the classification robustness of the proposed MPIbased classifier, different models and scenarios are evaluated. As shown in Table II, Types N, A, F, P, S and O denote the normal, abnormal, fog, plume, spatter and none of MPI, where the abnormal MPI includes the fog, plume, and none of MPI. In other words, types N, F, and P represent MPI-0, MPI-1, and MPI-2, respectively.
The comparison between the CNN and the hybrid (CNN+LSTM) models under the same condition is shown in Table II. For both two and three classification types of MPIs, the hybrid model shows (25.71% and 30%, respectively) higher accuracies as compared to the standard CNN model consisting of four layers. As shown in Table III, after applying the hybrid model, Scenario 1 shows good performance with an F1-score of 98.5% for the classification of two MPI types. Regarding the classification of three MPI types, Scenarios 2 and 4 indicate a similar F1-score of 90%, while Scenario 3 shows a great F1-score up to 96%. The F-1 scores of all four developed models are above 90%.
Still, some windows are out there to improve the model accuracy. The classification results indicate that the MPI-based classifier is robust enough to handle very similar and noisy data and is capable of detecting different types of abnormalities in the AM process; simultaneously, the MPI ratios of MPI-0, MPI-1, and MPI-2 can be used for enhancing the accuracy and integrity of the prediction results.

B. Determining Flow Threshold
To derive the optimal flowrate for the discharging compensator, the three types of MPI classification by the MPI-based offline module (i.e., System 2) with respect to flowrates are compared in Fig. 8. The generated smoke during powder fusion is hard to discharge through low flowrates (i.e., 2-5 m/s), which can be proved from the fact that MPI-0 ratios are less than 75%, while the ratios of MPI-1 and MPI-2 are greater than 12%. The middle flowrates (6-8 m/s) show the highest MPI-0 of nearly 80% and lower MPI-1 and MPI-2 ratios of 20%; in addition, the powder could be moved by the high flowrates (9-11 m/s) due to the MPI-0 rated being reduced. From (7), the optimal flowrate is 8 m/s.
The MPI-2 ratios of cube 1 are high (between 10-30%) when the flowrates are 5-7 m/s, although the MPI-1 ratios are low (less than 10% after layer 30). The threshold of flowrate can be set as 8.5 m/s since the means and variations of MPI-2 ratios are reduced from 17.16% to 12.71% and from 7.27% to 3.87%, respectively, while MPI-1 and MPI-0 maintain 6.78% and 80.50% in average.
It is worth mentioning that there is a cyclic vibration within the ratios of MPI-2, even though the flowrates are changed from 5 to 8.5 m/s. Because the angle of the scan policy is increased by 66°layer-wise, the scan direction of any layer will be the same per 30 layers. The lowest ratio of MPI-2 occurs when the scan direction is in parallel of the airflow direction, while the highest ratio of MPI-2 appears if the two directions are perpendicular to each other. Hence, it indicates that MPI-based System 2 can evaluate the results of smoke discharge and provide a threshold to System 1 for discharging control.

C. Determining Coating Threshold
To derive the proper threshold for the coating compensator, MPI-based System 2 is adopted as shown in Fig. 10, where Fig. 10(a) and Fig. 10(b) respectively illustrate the total layers1-180 and the starting layers 1-24. The homogeneity is the minimum uniformity value of all grid images captured by the overview CCD, in which the working plate (diameter of 160 mm) is divided into grids of 5 × 5 mm 2 .
Comparing the ratios of MPI-1 and MPI-2 of Fig. 10(a), it is clear that the ratios of MPI-2 are higher than those of MPI-1 after layer 20. Furthermore, the homogeneity threshold can be determined as 0.2 by observing Fig. 10(b), in which the ratio of MPI-1 decreases as the homogeneity increases.
Therefore, System 1 for coating compensation will be able to perform the recoating function based on the threshold derived from the MPI-based System 2 offline. It will enhance the overall performance of the proposed architecture for quality assurance and control.

D. Evaluating Polishing Parameters
Selecting the best polishing parameter group is an essential step in the polishing function for compensation. In this experiment, 19 cubes are produced under four different processing conditions of laser power (270, 240, 270, 160 w) and scan speed (600, 700, 850, 660 m/s), to check the performance of the proposed polishing parameter system. The printed cubes are divided into four groups. Each group uses the same processing conditions to print the cubes with or without the polishing function.
The ratios of MPI-1 are increased by 2-5% after polishing, however, the mean ratio of MPI-1 is less than 10% by using the System 2. It is worth noting that the ratios of MPI-2 are reduced from 8-21% to less than 8%, which indicates that polishing leads to better printing quality during manufacturing. The comparison of MPIs before and after the polishing function is shown in Fig. 11. As expected, the roughness values of the built cubes are reduced from 10 to 2.5 μm after using the suggested polishing parameters, which means that the roughness quality is enhanced significantly after executing the polishing function. To check the robustness of the proposed system, another experiment is  performed to build the samples for tensile test with and without polishing function.
The average roughness value of sample is 4.44 μm without polishing and 2.19 μm with polishing function. In other words, roughness quality can be significantly improved by adopting the suggested polishing parameters. Briefly speaking, with the polishing function, it is possible to automatically control the roughness quality based on the suggested polishing parameters from the system. The selection procedure of polishing parameters includes: 1) getting the AVM prediction result, 2) mapping it to Table I if the prediction value is below the threshold, and 3) selecting the best polishing process group. After mapping the prediction value required from the AVM system to Table I, if the total number of building samples is five and three predicted roughness values fall into group A, the system will choose the polishing parameters of group A.
In addition, the tensile experiments indicate that the means of the optimal polishing of the three samples are similar and better than that of the benchmark, where the benchmark, optimal w/o polishing, and optimal & polishing represent the process parameters designed for benchmarking, optimal but no polishing, and optimal with polishing, respectively, as shown in Fig. 12. The experimental values prove that by using the suggested polishing parameters, the quality of roughness and tensile strength can be greatly enhanced after applying the proposed MPI-based System 2 for evaluating the polishing parameters.

IV. SUMMARY AND CONCLUSION
This paper proposes the Systems 1 and 2 structure in the L2L control of an AM system. With the fast and intuitive capabilities, the intelligent compensation architecture (i.e., System 1) is presented for realizing the discharging, coating, and polishing online control loops of the LPBF machine. On the other hand, the MPI-based System 2 with the hybrid model classifier is developed to decide or evaluate the specific thresholds and parameters of System 1 according to the ratios of various MPI classes offline. With the reasonable and quantized MPI ratios from System 2, the intelligent compensators of System 1 can control the quality by setting the robust process parameters for a better quality built. Hence, the cooperation of Systems 1&2 not only monitors the quality of the AM process but also provides the subsystem to handle the quality control challenges of the LPBF machine. Finally, experiments prove that the proposed intelligent compensator architecture can indeed eliminate major barrier for quality control of the AM domain.