P. POTO^NIK et al.: GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH ... 159–163 GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH IN ADDITIVE MANUFACTURING OPTIMIZACIJA POTI LASERSKEGA @ARKA Z GENETSKIM ALGORITMOM V PROIZVODNJI Z DODAJALNO TEHNOLOGIJO Primo` Poto~nik * , Andrej Jeromen, Edvard Govekar University of Ljubljana, Faculty of Mechanical Engineering, A{ker~eva 6, SI-1000 Ljubljana, Slovenia Prejem rokopisa – received: 2023-10-15; sprejem za objavo – accepted for publication: 2024-01-25 doi:10.17222/mit.2023.989 This study presents a methodology of genetic-algorithm-based optimization of the laser-beam path for improving laser-based additive manufacturing (AM). A simple thermal model was developed to simulate the effects of laser-induced heat input on the temperature distribution within the substrate during the fabrication of one layer. The optimization approach aims to find solu- tions with more homogeneous temperature properties that minimize the thermal gradient on the substrate caused by laser-based AM. The laser beam, i.e., the tool-path planning, is formulated as the search for the optimal sequence of cell depositions that minimize the fitness function, which is composed of two components, i.e., the thermal fitness and process fitness. The thermal fitness is expressed as the average thermal gradient, and the process fitness regulates the suitability of the proposed tool path for the implementation of the AM process. Various tool-path generators are proposed to initialize the initial population of tool-path solutions. Genetic-algorithm-based tool-path optimization is proposed, where custom initialization, crossover and mutation op- erators are developed for application in laser-based AM. Simulation studies demonstrate the effectiveness of the genetic-algo- rithm-based optimization in finding solutions that minimize the fitness function and therefore provide both thermally and, for the AM process implementation, more suitable laser-beam-path solutions. Keywords: additive manufacturing, laser beam path, genetic algorithm, optimization Raziskava predstavlja metodologijo optimizacije poti laserskega `arka na podlagi genetskega algoritma za izbolj{anje proizvodnje z lasersko dodajalno tehnologijo (AM; angl.: additive manufacturing). Razvit je bil preprost toplotni model za simulacijo u~inkov lasersko povzro~ene toplote na porazdelitev temperature znotraj substrata (podlage) med postopkom nana{anja ene plasti. Cilj optimizacijskega pristopa je poiskati re{itve z bolj homogenimi temperaturnimi lastnostmi za zmanj{anje toplotnega gradienta na substratu, ki ga povzro~a dodajalna tehnologija na osnovi laserja. Na~rtovanje poti laserskega `arka, to je poti orodja, je formulirano kot iskanje optimalnega zaporedja nanosov celic, ki minimizirajo kriterijsko funkcijo, sestavljeno iz dveh komponent; toplotnega kriterija in kriterija procesa. Toplotna ustreznost je izra`ena kot povpre~ni toplotni gradient, procesni kriterij pa izra`a primernost predlagane poti orodja za izvajanje procesa AM. Za inicializacijo za~etne populacije re{itev poti orodja so predlagani razli~ni generatorji poti orodja. Predlagana je optimizacija poti orodja na podlagi genetskega algoritma, pri ~emer so za uporabo v laserskem AM procesu razviti prilagojeni operatorji inicializacije, kri`anja in mutacije. Simulacijske {tudije ka`ejo u~inkovitost optimizacije na podlagi genetskega algoritma pri iskanju re{itev, ki minimizirajo kriterijsko funkcijo in tako zagotavljajo toplotno ustreznost ter za izvajanje procesa AM primernej{e re{itve poti laserskega `arka. Klju~ne besede: aditivna proizvodnja, pot laserskega `arka, genetski algoritem, optimizacija 1 INTRODUCTION Additive manufacturing (AM) is one of the fast- est-growing industrial techniques, bringing many innova- tive solutions and applications to different industries. 1,2 Laser-based AM has gained a lot of attention due to its ability to process a wide range of materials. In particular, selective laser melting and direct laser deposition are widely adopted AM processes that involve the selective melting and deposition of material layers to build up a three-dimensional (3D) part. 3,4 However, achieving the desired quality, accuracy, and mechanical properties in laser-based AM remains a challenge, primarily due to the complex interplay of process parameters, part geometry and material characteristics. Consequently, various new machine-learning-based approaches have been proposed to address these challenges. 5,6 One of the key challenges in laser-based AM is the control of the temperature distribution in the fabricated part during the deposition. The laser-induced heat input can lead to non-uniform temperature distributions within the build part, resulting in undesirable effects such as re- sidual stresses, deformation, and deterioration of the me- chanical properties of the 3D printed part. 7,8 Achieving a more homogeneous temperature distribution during the deposition process is critical for improving the quality and accuracy of 3D metal printing. Various tool-path planning approaches have been proposed to optimize the temperature properties of the AM process, 9–11 to predict the temperatures with an artificial neural network, 12 and to introduce the optimized tool path to the AM pro- cess. 13–15 Materiali in tehnologije / Materials and technology 58 (2024) 2, 159–163 159 UDK 621.791.725:7.021.5 ISSN 1580-2949 Original scientific article/Izvirni znanstveni ~lanek MTAEC9, 58(2)159(2024) *Corresponding author's e-mail: primoz.potocnik@fs.uni-lj.si (Primo` Poto~nik) This study presents a novel methodology for optimiz- ing the laser-beam path in laser-based AM using a cus- tomized genetic algorithm (GA) approach, which resem- bles and builds upon previous study using an evolutional method in wire-arc additive manufacturing. 16 The ap- proach proposed in this study includes a simple thermal model to simulate the effects of laser-induced heat input on the temperature distribution within the substrate dur- ing the deposition of a single layer. By using genetic al- gorithms for optimization, the limitations of traditional time-consuming trial-and-error tool-path formulations are overcome. The proposed approach provides an auto- mated and efficient solution for finding an optimal la- ser-beam path, leading to an improved temperature dis- tribution and increased suitability for the implementation of the AM process. 2 METHODS 2.1 Overview of the methods and optimization ap- proach This research is focused on 3D metal printing using a direct laser deposition process. The basic simulation setup includes a substrate of various dimensions, on which a layer of the desired design is deposited. Due to the effects of laser-induced heat input, the substrate may be subject to undesirable deformation. Therefore, the fo- cus of this research is to combine the simulation of a thermal model with an evolutionary optimization ap- proach to find solutions with thermally more homoge- neous properties, which in turn presumably result in products with less deformation of the desired geometry. The fitness function is designed to minimize the average thermal gradient on the substrate during the laser-deposi- tion process while regulating the suitability of the tool path for the implementation of the AM process. 2.2 Tool-path formulation The substrate for the laser-based deposition is de- signed as a grid of N s ×N s cells, where each cell repre- sents a small unit as a sub-grid of N c ×N c sub-cells. The physical dimensions of the cells are determined by the parameters of the direct laser-deposition technology used, e.g., in the case of using the selective laser melting method, each sub-cell in the N c ×N c sub-grid has dimen- sions of approximately 0.1 mm × 0.1 mm. The individual cells are covered by one of the standard path-generating methods (e.g., raster or zigzag). By keeping the dimen- sion of intra-cell topology small, the optimization prob- lem can be formulated as the search for the optimal se- quence of cell depositions that minimizes the fitness function. To provide the methodology for arbitrary de- sign shapes, this study also introduces the "mask" opera- tor that defines which cells are to be covered by the di- rect laser deposition and which cells remain uncovered. Path representation The basic format of the tool-path representation is a matrix of the same size as the substrate (N s ×N s ) with the cells of the matrix containing the numbers of subsequent steps of the tool. Eq. 1 presents an example for N s =3of a path p 1 represented by the matrix. However, for the ma- nipulation of the paths in the genetic algorithm, the paths must be represented as strings, so the path p 1 can also be represented as a string s 1 defining the sequence of loca- tions of sequentially visited cells (according to the prede- fined cell order) (Eq. 2). p 1 = 123 894 765 ⎡ ⎣ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ (1) s 1 = [123698745 ] (2) The string representation of a path is then applied in the genetic-algorithm-based operators. Nevertheless, both formats, matrix, and strings, are equal and can be converted from one to the other. 2.3 Thermal model To determine the thermal response of the substrate and the corresponding thermal fitness for the generated tool paths, a two-dimensional, finite-volume thermal conduction model of the substrate was formulated. The volume of the substrate was divided into N s ×N s control volumes. In each control volume, the conservation of en- ergy was satisfied: c T tx k T xy k T y S d d = ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ + ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ + ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ (3) To keep the model simple, adiabatic boundary condi- tions, uniform temperature T in the z direction, and con- stant properties of the AISI 304 substrate were assumed: density = 7900 kg/m 3 , specific heat c = 480 J/(kg K) and thermal conductivity k = 15 W/(m K). 17 To simulate the direct laser-deposition process without material addi- tion, a uniform volumetric heat source S was applied to the control volumes according to the tool path s 1 . The model was solvednumerically using a tri-diagonal matrix algorithm 18 with a fully implicit time scheme resulting in a time-dependent temperature field T(x,y,t). 2.4 Genetic algorithm The genetic algorithm (GA) provides a global optimi- zation solver for smooth or non-smooth optimization problems with any type of constraint. The customized functions of the GA for tool-path optimization are pro- posed in this paper. Initialization For the initial population of tool-path solutions, we propose a set of generators that are designed to imple- ment standardized tool-path generators (raster, zigzag, P. POTO^NIK et al.: GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH ... 160 Materiali in tehnologije / Materials and technology 58 (2024) 2, 159–163 spiral, etc.), a specialized stochastic-based search gener- ator, denoted as 'randworm', and two temperature-opti- mized generators. Examples of two members of the ini- tial population for the substrate of N s = 10 with a non-symmetrical design mask "Y" are shown in Fig- ure 1. Fitness function The fitness function (J) in this study is composed of two components: 1. thermal fitness (J thermal ), 2. process fitness (J process ). The first component denotes the quality of the ther- mal distribution, which is expressed as an average tem- perature gradient across the workpiece and averaged across the deposition time frame: J thermal = mean(grad(T)) (4) The second component of the fitness function evalu- ates the properties of the tool-path solutions with respect to technological and process features and constraints. Usually, the following properties are desirable: a small number of laser stops N up , a small number of single drops N singles , and long deposition segments (expressed through the length of the shortest segment L minSeg and the average length of segments L meanSeg ): J process =( N up + N singles )/( L minSeg + L meanSeg ) (5) Finally, the fitness function is completed as a combi- nation of the thermal and process fitness with weight denoting the ratio between the thermal and process fit- ness (in our study set to = 1): J = J thermal + J process (6) Crossover operator The crossover function performs a crossover opera- tion between two parents, represented as tool-path strings s 1 and s 2 , to generate a new offspring s 3 . The crossover operation involves the following steps: Splitting the tool-path strings s 1 and s 2 at the random crossover point N cross to generate two sub-strings. Composing the initial offspring s 3 from the two sub-strings. Removing the overlapping cells from s 3 and filling removed elements by one of the available tool-path gen- erators. Figure 2 shows an example of the crossover opera- tion between two paths. The first row presents the origi- nal parents (s 1 and s 2 ), and the second row shows the crossover child, which is composed of both parent seg- ments, and the final filled child (s 3 ), which has all the missing cells filled by using a randomly assigned one of the available generators. Mutation operator The mutation operator in this study creates a new off- spring from a parent by removing a randomly chosen de- position sequence from the parent and filling removed cells with one of the available tool-path generators. An example of the mutation operation is shown in Figure 3. 3 SIMULATION AND RESULTS Simulations were performed with various symmetric and non-symmetric mask designs, and with various sub- strate dimensions N s . A simulation example is described below, namely the 'Y' mask on a substrate size N s = 10, based on the following thermal model configuration: P. POTO^NIK et al.: GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH ... Materiali in tehnologije / Materials and technology 58 (2024) 2, 159–163 161 Figure 3: A mutation operation is applied to a parent to obtain the mu- tated child Figure 2: Crossover operation; the segments of the parents are com- bined by crossover into a child Figure 1: Examples of the initial population for the substrate of Ns=10 substrate dimensions 50 mm × 50 mm, substrate thick- ness 3 mm, laser power 200 W, and time for one cell de- position 0.5 s. The GA-based optimization included 500 generations. The result of the simulated evolution is shown in Figure 4. The resulting path improves the over- all fitness, which in this case amounts to J = 30.3. The fitness evaluations for a complete initial population and the optimized result are shown in Figure 5. 4 CONCLUSIONS A novel methodology of the genetic-algorithm-based optimization of tool paths for laser-based additive manu- facturing is described. The method includes custom GA operators (initialization, crossover, mutation) and can be applied to various laser-based AM processes. The study provides a simulated result that demonstrates the possi- bilities of this approach to optimize the composite fitness function, thus finding the best ratio between the optimal thermal properties and the suitability for the implementa- tion of the AM process. The fitness function can be arbi- trarily modified for different laser-based AM processes. Therefore, this study provides a general GA-based opti- mization framework suitable for further research of opti- mal tool-path methods for additive manufacturing. By offering an automated and efficient approach to optimiz- ing laser-beam paths, this research contributes to the ad- vancement of laser-based additive manufacturing and its applications in diverse industrial sectors. Acknowledgments This work was supported by the Slovenian Research and Innovation Agency (ARIS) Research program P2-0241. 5 REFERENCES 1 B. Blakey-Milner, P. Gradl, G. Snedden, M. Brooks, J. Pitot, E. Lopez, M. Leary, F. Berto, A. du Plessis, Metal additive manufactur- ing in aerospace: A review, Mater. Des. 209 (2021) 110008, doi:10.1016/j.matdes.2021.110008 2 V. Madhavadas, D. Srivastava, U. Chadha, S. Aravind Raj, M. T. H. Sultan, F. S. Shahar, A.U.M. Shah, A review on metal additive manu- facturing for intricately shaped aerospace components, CIRP J. Manuf. Sci. Technol. 39 (2022) 18–36, doi:10.1016/j.cirpj.2022. 07.005 3 N. Shamsaei, A. Yadollahi, L. Bian, S. M. Thompson, An overview of Direct Laser Deposition for additive manufacturing; Part II: Me- P. POTO^NIK et al.: GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH ... 162 Materiali in tehnologije / Materials and technology 58 (2024) 2, 159–163 Figure 4: Simulation result of optimizing the tool path for the 'Y' mask on a substrate N s =10 Figure 5: Fitness evaluations ('Y' mask on a substrate N s = 10) for a complete initial population and the simulation result (GA), including the overall fitness (J), thermal fitness (J thermal ) and process fitness (J process ) chanical behavior, process parameter optimization and control, Addit. Manuf. 8 (2015) 12–35, doi:10.1016/j.addma.2015.07.002 4 S. M. Thompson, L. Bian, N. Shamsaei, A. Yadollahi, An overview of Direct Laser Deposition for additive manufacturing; Part I: Trans- port phenomena, modeling and diagnostics, Addit. Manuf. 8 (2015) 36–62, doi:10.1016/j.addma.2015.07.001 5 X. Qi, G. Chen, Y. Li, X. Cheng, C. Li, Applying Neural-Net- work-Based Machine Learning to Additive Manufacturing: Current Applications, Challenges, and Future Perspectives, Engineering. 5 (2019) 721–729. doi:10.1016/j.eng.2019.04.012 6 C. Wang, X.P. Tan, S. B. Tor, C. S. Lim, Machine learning in additive manufacturing: State-of-the-art and perspectives, Addit. Manuf. 36 (2020) 101538, doi:10.1016/j.addma.2020.101538 7 Y. Zheng, F. Liu, J. Gao, F. Liu, C. Huang, H. Zheng, P. Wang, H. Qiu, Effect of different heat input on the microstructure and mechan- ical properties of laser cladding repaired 300M steel, J. Mater. Res. Technol. 22 (2023) 556–568, doi:10.1016/j.jmrt.2022.11.153 8 S. Reda Al-Sayed, H. Elgazzar, A. Nofal, Metallographic investiga- tion of laser-treated ductile iron surface with different laser heat in- puts, Ain Shams Eng. J. 14 (2023) 102189, doi:10.1016/j.asej. 2023.102189 9 D. Ding, Z. Pan, D. Cuiuri, H. Li, A tool-path generation strategy for wire and arc additive manufacturing, Int. J. Adv. Manuf. Technol. 73 (2014) 173–183, doi:10.1007/s00170-014-5808-5 10 K. Ren, Y. Chew, Y. F. Zhang, G. J. Bi, J. Y. H. Fuh, Thermal analy- ses for optimal scanning pattern evaluation in laser aided additive manufacturing, J. Mater. Process. Technol. 271 (2019) 178–188, doi:10.1016/j.jmatprotec.2019.03.029 11 K. Ren, Y. Chew, J. Y. H. Fuh, Y. F. Zhang, G. J. Bi, Thermo-me- chanical analyses for optimized path planning in laser aided additive manufacturing processes, Mater. Des. 162 (2019) 80–93, doi:10.1016/j.matdes.2018.11.014 12 F. W. C. Farias, J. da Cruz Payão Filho, V. H. P. Moraes e Oliveira, Prediction of the interpass temperature of a wire arc additive manu- factured wall: FEM simulations and artificial neural network, Addit. Manuf. 48 (2021), doi:10.1016/j.addma.2021.102387 13 E. Malekipour, H. Valladares, Y. Shin, H. El-Mounayri, Optimization of chessboard scanning strategy using genetic algorithm in multi-la- ser additive manufacturing process, ASME Int. Mech. Eng. Congr. Expo. Proc. 2A-2020 (2020), doi:10.1115/IMECE2020-24581 14 L. Sun, X. Ren, J. He, Z. Zhang, Numerical investigation of a novel pattern for reducing residual stress in metal additive manufacturing, J. Mater. Sci. Technol. 67 (2021) 11–22, doi:10.1016/j.jmst.2020. 05.080 15 K. S. Ramani, C. He, Y. L. Tsai, C. E. Okwudire, SmartScan: An in- telligent scanning approach for uniform thermal distribution, reduced residual stresses and deformations in PBF additive manufacturing, Addit. Manuf. 52 (2022) 102643, doi:10.1016/j.addma.2022.102643 16 Z. Zhou, H. Shen, J. Lin, B. Liu, X. Sheng, Continuous tool-path planning for optimizing thermo-mechanical properties in wire-arc additive manufacturing: An evolutional method, J. Manuf. Process. 83 (2022) 354–373, doi:10.1016/j.jmapro.2022.09.009 17 F. P. Incropera, D.P. Dewitt, Fundamentals of Heat and Mass Trans- fer, 3rd ed., Wiley, 1990 18 S. Patankar, Numerical Heat Transfer and Fluid Flow, CRC Press, Boca Raton, 1980 P. POTO^NIK et al.: GENETIC ALGORITHM-BASED OPTIMIZATION OF THE LASER-BEAM PATH ... Materiali in tehnologije / Materials and technology 58 (2024) 2, 159–163 163