A new method for improving the forming quality in laser additive manufacturing process

The melt pool temperature plays a very important role in the laser additive manufacturing (LAM) process which has been widely used in different industries. In this process, simple laser scan strategies and constant laser power levels are usually used, which will elicit variations in the melt pool temperature and ultimately affect the forming quality such as the cracks and pores. In this paper, a new method for improving the forming quality was presented, which calculates the local thermal distribution dynamically by analyzing the laser scanning path included in a G-code file. A factor called the thermal distribution factor (TDF) was used to adjust the laser power. By inserting the adjusted laser power into a modified G-code file, the melt pool temperature can be controlled indirectly. This method can help to control the melt pool temperature and improve the forming quality at the lowest cost. An experimental set-up was designed to verify this method and the results were analyzed. Results indicated that the cracks and pores of the part were significantly reduced by using the modified G-code file. Besides, the drawbacks and the future potential improvements of this method were discussed.


Introduction
In recent years, laser additive manufacturing (LAM) has developed rapidly due to its remarkable advantages in manufacturability, materials, part quality, production and economy, and it is stepping towards industrialization [1]. In LAM process, thermal behavior is a critical factor that limits the quality of the part [2]. The LAM process fuses metal, ceramic or other powders together to form a complex part layer by layer, and the melt pool is the smallest forming unit [3]. The temperature and geometry of melt pool will affect the solidified morphology, grain size and solidification direction [4][5][6].
Many studies hope to improve the precision and metallurgical quality of the formed part by detecting the temperature of the melt pool and establishing a control system to control the melt pool temperature. Tan et al [4] developed a temperature measurement system of melt pool by using a two-color infrared thermometer. The results showed that when the laser power and scanning speed were constant, the thickness of the cladding layer only corresponds to the temperature of the melt pool, so the thickness of the coating could be precisely controlled by adjusting the powder feeding speed in situ according to the temperature of the melt pool. Salehi [7] developed an on-line temperature control system during Nd:YAG laser cladding by using a LabVIEW program with a real-time proportional, integral and derivative (PID) controller which was used to control the temperature of the melt pool. Bi et al [8] used a Charge-Coupled Device (CCD) camera to capture the size of the melt pool and compared different measuring systems including photodiode and quotient pyrometer of detecting the temperature signal. They found that the detected IR-temperature signal had clear dependence on the main process parameters.
Due to the high temperature, high brightness and small size of the melt pool, it is difficult to detect the temperature of the melt pool [9]. In addition, there is a lack of standard control protocols of laser power in LAM systems [10], and due to the complex laser scanning path and the heat accumulation effect, the melt pool temperature controller cannot always achieve the desired results. Although there are many researches on the melt pool temperature control, they do not take the influence of laser scanning path or part shape into account, which will affect the accuracy of melt pool temperature control. Besides, the control methods of current researches require that the LAM machines are equipped with temperature sensor or control board, this is very unfriendly for some old or low-end machines and the transformation cost will be very expensive. Different from these methods, which mainly focus on the research of melt pool temperature control in the process of LAM, the method proposed in this paper preprocesses the G-code file which contains the laser scanning path, laser power and speed information in LAM. In this method, the laser power control was achieved by inserting laser power control commands into G-code file. A factor called the Thermal Distribution Factor (TDF) was used to adjust the laser power which was given by a rapid thermal distribution method. And an experimental set-up was designed to verify this method.

Models and methods
In LAM processes, laser control is usually achieved by laser position commands and laser power commands [11]. The laser position commands are given by the digital interpolation algorithm which read the G-code file line by line. The laser power commands are also included in the G-code file, and the command is usually a single line with a header of G-code command and a content of the laser power value. Figure 1 shows how the modified G-code file is generated. At the first, the 3D CAD part is designed and export to the STereoLithography (STL) file which is composed of triangular patches [12]. And then, the STL file is sliced into 2D layers by the slicing software. The laser scanning path, speed and power are generated based on the predefined scan strategy and the other parameters, and then save to the G-code file. The next steps are to interpolate the G-code to get the laser position information and analysis the thermal distribution to calculate the value of TDF. Finally, insert the optimized laser power value into the G-code. Since the interpolation algorithm has been very mature, this paper will not introduce it in detail. Hence, the key problems are to find a fast and effective method to calculate the thermal distribution and to calculate TDF to adjust the laser power.

G-code interpreter
The STL file plays a crucial role in the additive manufacturing (AM) and is the most widely accepted file format [13]. The G-code file used in this paper is automatically generated by the slicing software. Since the STL file is composed of triangular patches as the figure 2 shows, the laser path will be composed of line segments which indicates that the G-code file will only have two types of movement commands: 'G00' and 'G01'. This will simplify our programming work. In this paper, we assume that the G-code file has no grammar errors and the expression is uniform. First, the program reads a line of G-code. A G-code line is separated by spaces such as 'G91 G00 X10.000 Y10.000', through the split function it can be divided by a space into a one-column array such as array E['G91', 'G00', 'X10.000', 'Y10.000']. Then, extract an element from the array E and judge the type of the element based on keyword table, such as 'G91' means incremental mode of dimensioning. Next, obtain the laser position coordinates through digital interpolation as shown in figure 2. There are two types of position coordinates, one is interpolated from the 'G00' command G-code line and the other is interpolated from the 'G01' command G-code line. They should be stored in different arrays, because 'G00' is the rapid travel command in G-code and the laser is off when it works. Figure 3(a) is the model to be processed drawn by CAD software, and the gray part is the substrate. Figure 3(b) is the laser scanning path of the model. As mentioned in section 2.1.1, two types of position coordinates were stored in different arrays, in this section, only the array of laser position coordinates is used. As shown in figure 3(c), if the laser scanning path was divided by the cubes, the model would be represented by the cubes. In figure 3(c), the yellow lines are the laser scanning path (actually, they should be inside the cubes), for the convenience of subsequent calculation, the substrate is also represented by a layer of cubes.

The representation of the model
It should be noted that in LAM processes, the height of the metal deposition layer is usually relatively low, it is somewhat unreasonable to express the height of the metal deposition layer by the height of the cubes. To solve  this problem, this paper proposed two calculation methods. One method is that the cubes contain multiple laser scanning path layers (i.e. metal deposition layers), as shown in figure 4(a). The other method is that lower height cuboids to compose the part, each cuboid contains only one laser scanning path layer, as shown in figure 4(b). In the second method, the height of the cuboid is determined by the height of the metal deposition layer which was preset as one of the processing parameters. In this paper, the first method was adopted, and for the convenience of expression, the multi-layer laser scanning path in the cube is expressed as one layer.

The strategy of path division
In section 2.1.1, the valid laser position coordinates were stored in a one-column array, and in this section, we will describe how to divide the coordinates into different cubes. Suppose the time step of the machine is Dt (in every Dt time the laser moves from x y z , , ( )) and the laser power of current processing is P. i Typically, a line of G-code can contain the laser power command, so if two coordinates were interpolated from a same line of G-code, their laser power values were equal. Splitting the G-code line can provide more sophisticated control of laser power. The first step is to judge whether the coordinate x y z , , where l is the side length of the cube, and function floor x ( ) means get the greatest integer that is less than or equal to x. If the coordinate x y z , ,   figure 5, the yellow line is the laser scanning path, the green line is the laser output power, Dt is the time step of machine, the total laser output energy can be expressed by: where n is the number of points in a cube, E is the theoretical total energy output of the laser in a cube. The absorbed energy is composed of two parts, one is the energy absorbed by the powder in flight which comes out of the powder feeding nozzle and the other is the energy absorbed by the growing layer [14]. The total laser energy absorbed by the growing layer and powder, E , a can be given by: where E is the theoretical total laser output energy in a cube, h l is the fraction of the energy absorbed by the growing layer, h p is the fraction of the laser absorbed by the flying powder.
When it comes to computing the temperature distribution, using exact differential equations [15] will consume a lot of time which is obviously unsuitable for the reason that most people want the modified G-code file to be completed as soon as possible. Therefore, as mentioned before, when calculating the temperature distribution, each cube is considered as the basic unit. The finite-difference equations were used in the calculation of the cube temperature. Although this is an approximate calculation, the calculation speed of the program can be greatly improved. As shown in figure 6 the energy exchange is influenced by conduction between m n , ( ) and its four adjoining nodes. By using the energy balance method, the conduction between nodes can be expressed as follows [16]: m n m n m n m n m n , 1 where i refers to the neighboring nodes,  q i mn , ) is the conduction rate between nodes, q is internally distributed source of energy, T is temperature, and k is thermal conductivity. In order to calculate the heat interaction between the cube and the air, the air around the cube was divided into cubes. The initial temperature of the air cubes and the substrate cubes is set to the environment temperature. The temperature difference DT can be given by: where ΔQ, c and m are energy transfer, specific heat and mass, respectively.

TDF calculation and laser power control
After finishing calculating the temperature of each cube, the value of TDF can be computed by: ) is the coordinate of the current cube, x y z , , ) and T i are the coordinate and temperature of the cube around the current cube, l is the side length of the cube, T m represents the most reasonable temperature value that the current cube should have and N is the number of the cubes that satisfies the distance from themself to the current cube is less than l 2 . Suppose that the initial value of laser power was set as P , 0 the adjusted laser power P i can be given by: where w is a weight which is related to T m and l, P a is used to control the range of laser power.

Part and experiment design
The detailed dimensions of the part to be processed are shown in figure 7. Two C45 carbon steel plates with dimension of 120 mm×120 mm×10 mm were used as substrates. Fe104 alloy powder (XY-26F-104) with the particle size varying from 100 μm to 270 μm and chemical composition of 0.24 wt% C, 15.31 wt% Cr, 1.2 wt% B, 0.55 wt% Mn, 1.45 wt% Mo, 1.9 wt% Ni, 1.23 wt% Si, and balanced Fe was used in this experiment. It should be noted that in order to better compare the method proposed in this paper, we chose the powder particles with larger size. The LAM system was shown in figure 8, which consisted of an IPG YSL-4000 ytterbium fiber laser system whose maximum output laser power was 4kW and the emission wavelength was 980 nm, a KUKA robot with a laser head, an infrared thermometer (SA-D60200) with a 980 nm filter (FU-980ZDLGP-Y10), a thermal camera (MAG62-HT) and an industrial PC. The feeding speed of powder was 8-9 g min −1 . Pure argon gas was selected as the protective gas with a flow rate of 30 l min −1 . The laser scanning speed was set at 240 mm min −1 .
For verifying the efficiency of our method, we made two Specimens (Specimens A and B) for comparison. The processing parameters of the two Specimens were the same, except the laser power and G-code file. The initial power of these two Specimens was set to 1.4 kW. These two G-code files were generated by slicing software (3dAM-PP-Planer V5.3.2). The difference was that the G-code file of Specimen B had been modified by the method proposed in this paper. The Python programming language (Python 3.7.2) [17] was selected to modify the G-code file and the PyQT library (PyQt5 v5.14.0) was used to visualize the temperature of the cubes.

The temperature distribution
The temperature distributions of different positions during the dealing of the G-code file are shown in figure 9. It seems that our method works well and the temperature distribution of the substrate looks good. Figure 9(a) shows the temperature distribution of the first layer of the cubes. From figure 9(a), we can deduce the laser scanning path strategy, that is, the laser first scans the external contour, then scans the internal contour, and finally fills the remaining part. Figures 9(a) to (g) show the temperature distribution changes of the base part of the part. Figures 9(h) to (l) show the temperature distribution changes of the upper cylindrical part of the model. Comparing figure 9(a) with (l), it can be concluded that the shorter and more concentrated the laser scanning path was, the more concentrated the heat of the part was. Figure 10 shows the pictures captured by the thermal camera. It should be noted that, the minimum temperature of (a) and (b) in figure 10 is 250 ℃, which is due to the minimum temperature that the thermal cameral can obtain is 250 ℃. Figure 10(a) corresponds to figures 9(g) and 10(b) corresponds to figure 9(l). Comparing figure 9 with figure 10, we can see that the temperature distribution calculated by the program is consistent with the actual temperature distribution.

Local temperature distribution and melt pool temperature
The temperature of the cubes around the current cube during processing can be seen in figure 11. The cube shown by the green wireframe in this figure is the current cube and the blue line is the laser scanning path which was simplified as mentioned in section 2.1.2. In figure 11(a), the temperature difference between the lower cubes  and the current cube is large, which may be due to the long laser scanning path of the current layer. From figures 11(a) to (d), the laser scanning path becomes shorter and more concentrated, and it can be seen that the temperature around the current cube is getting higher and higher, which indicate that the temperature distribution has a certain relationship with the laser scanning path, and this trend proves that the control method proposed in this paper is reasonable. Figure 12 shows the melt pool temperature changes of Specimen A at the four positions in figure 11 measured by the infrared thermometer. In figures 12(a)-(d), the changes of all the melt pool temperatures show an upward trend, but the rising speeds of temperature are different, that is, from (a) to (d), the temperature rises faster and faster. There is good agreement between the results shown in figure 12 and the conclusions drawn in figure 11. Figure 13 shows the real time temperature records of melt pool during forming the Specimens A and B. From figure 13, it can be found that the melt pool temperature rose slowly before about 60% of the processing progress, and increased sharply after that. It is due to that, firstly, the original temperature of the substrate was relatively low, with the forming process the temperature of the part and substrate gradually rise. Secondly, due to the constant laser power was used for forming Specimen A, the influence of input energy is greater than that of output energy. After 60% of the progress, the upper cylindrical part of the part was forming. In this process, the scanning path of each layer is short and concentrated, which lead to the influence of input energy was much greater than that of output energy, hence the temperature rise speed of melt pool was accelerated.

Results comparisons
The results shown in figure 13 indicate that the method proposed in this paper is effective and feasible. Although the melt pool temperature of Specimen B was also increased slightly, but compared with constant power control (Specimen A), the results were acceptable. In order to improve the accuracy of melt pool temperature control, the feasible methods are to use the cube with smaller side length and subdivide the G-code path to insert more adjusted laser power values. But the drawbacks of this method are also obvious, that is, due to the lack of closed-loop control, the laser power can only be adjusted in a very careful range, which may cause insufficient control of melt pool temperature. Figure 14 shows the typical OM images of Specimen A and B of the top area of the specimens. As shown in figure 14(a), a large number of penetrating cracks with a length of approximately 200-500 μm occur in the top area of the Specimen A. It can be seen from the image of figure 14(b), the top area of Specimen B exhibits a sound microstructure without the cracks. Figure 15 shows the typical SEM images of Specimen A and B of the bottom area of the specimens. Compared with figure 15(B), there are many pores with a size of approximately 10-25 μm. Figures 14 and 15 both indicate the modified G-code file

Conclusions
This paper detailed a method for improving the forming quality by controlling the melt pool temperature in LAM process. A rapid method for calculating thermal distribution was proposed based on analyzing G-code file. A factor called the Thermal Distribution Factor (TDF) was presented, which was used to calculate the laser power to be adjusted. By inserting the commands of adjusting the laser power into a modified G-code file, the melt pool temperature can be controlled. This method was verified by experiment. Some conclusions can be reached as below: (1) The melt pool temperature is related to the laser scanning path in LAM process and different scanning strategies will lead to different temperature distribution.
(2) The temperature distributions given by the method which divides the scanning path into cubes and uses the energy balance method to calculate the temperature are in good agreement with the experimental results. The modified G-code file can effectively control the melt pool temperature and this indicates that the TDF values were useful.
(3) The typical OM and SEM images of the experimental specimens show that the method proposed in this paper has a certain effect of improving the forming quality.