Optimization of Friction Welding Parameters to Maximize the Tensile Strength of Magnesium Alloy with Aluminum Alloy Dissimilar Joints Using Genetic Algorithm

: The friction rotary welding (FRW) of magnesium alloy to aluminum alloy was presented in a paper due to signiﬁcant interest in the manufacturing industry. A genetic algorithm (GA) method for optimizing FRW process parameters of dissimilar light alloys was presented. After obtaining the welding parameters by GA method, it was possible to determine the best tensile strength of the friction joint. The obtained joints were subjected to tensile strength. The highest tensile strength TS = 178 MPa was found using a genetic algorithm for the following friction welding parameters: friction force FF = 16 kN, friction time FT = 4 s, and upsetting force UF = 44 kN. The optimized values were compared with the experimental results. The application of the genetic algorithm method allowed increasing the tensile strength joint from 88 to 180 MPa. The maximum tensile strength of the friction welded magnesium alloy-aluminum alloy joints was 73% of the base AZ31B metal. The relationship between welding parameters and strenght of welds was also demonstrated in this study.


Introduction
Magnesium alloys are ideal for reducing vehicle weight, as they have a lower mass density than aluminum [1]. Hong and Shin [2] draw attention to the need to develop welding technology to apply magnesium alloys in mass production. Due to the wide use of magnesium alloys in various industries, such as aviation or automotive, there is a need for welding them with other metals like aluminum, copper, or steel [3].
Friction welding is a solid-state welding process used to weld heat-resisting materials for similar structural and dissimilar components [4,5]. Friction welding of Mg alloy to Al alloy has important application in the manufacturing industry, so the welding of these alloys was studied in the last papers. It is important to realize the joining of solid magnesium and aluminum bars by friction method [6]. In this welding method, the formation of IMCs can be controlled effectively with lower heat input and less welding time, as suggested authors [7]. Additionally, the welding parameters such as friction and upsetting pressure, rotational speed, and welding time play a significant role in determining the joint strength [6]. Kato and Toksiue [7] have received tensile strength of 90 MPa during welding magnesium alloy. According to the authors [8], with increasing axial pressure, the thickness of the intermetallic layer and microcracks decreased. The tensile strength was comparable to the parent material received in friction welding pure magnesium to pure aluminum with post-heat-treatment [9]. The maximum tensile strength of 138 MPa received during continuous drive friction welding of 5A33 alloy to AZ31B magnesium alloy in a paper [10]. Moreover, the mechanical study of inertia friction welding of AA7A04 Processes 2021, 9,1550 2 of 11 to AZ31B Mg alloy was conducted [11]. The maximum tensile strength of 96 MPa was achieved under the friction pressure of 124 MPa.
From the literature review [1][2][3][4][5][6][7][8][9][10][11], it is noticed that to estimate a good strength weld, it is vital to predic the best process parameters combination using an appropriate optimization method. In the previous works, selecting parameters for welding usually was carried out by trial and error. The traditional optimization techniques do not work effectively when the search space is large. In such cases, non-traditional optimizing techniques are preferred. Such optimization methods include genetic algorithms.
In many works, genetic algorithms (GAs) were used for the precise selection of welding parameters. A design of experiments (DOE) model in friction welding of austenitic stainless steel to low alloy steel was established by Murti et al. [12]. Paventhan et al. [13] successfully predicted the tensile strength of aluminum alloy and stainless steel joints. Sathiya [14] has conducted the optimization of welding parameters using neural networks and GAs. Kumaran et al. [15] optimized a pure aluminum tube plate using an external tool by GA and Taguchi method. Canyurt estimated welded joint strength and fatigue strength using the GA approach in the papers [16,17]. Meran [18] developed the GA model to improve the tensile strength of the welded joint for brass material. Padmanaban et al. [19] predicted the mechanical properties of the magnesium AZ31B welds. Additionally, the above authors determined the optimal parameters of the FSW process. Winiczenko et al. [20] optimized welding parameters of ductile cast iron joints using a support vector machine (SVM), imperialist competitive algorithm (ICA), and GA. The same author successfully developed a hybrid response surface methodology and GA techniques to modeling, simulate, and optimize welding parameters for ductile iron/low carbon steel joints [21]. Combined RSM and Modified Differential Evolution for parameter optimization of FSW of aluminum alloy were proposed in paper [22].
From the literature, it is found that GA optimization technique was not used to optimize the process parameter settings for dissimilar Al/Mg friction welded joints. Therefore, the aim of this study is to find the optimal process parameters that maximize the ultimate tensile strength of dissimilar AZ31B/AA7075 friction welded joints. It may be possible to improve joint efficiency by using a genetic algorithm. Moreover, the empirical relationships concerning welding parameters and tensile strength were determined.

Materials
The magnesium and aluminum rods prepared on the abrasive cut-off machine were 100 mm in length and 20 mm in diameter. The mechanical properties and alloying elements of materials are shown in Table 1. Before welding, the surfaces were polished by grit silicon carbide papers to remove the effect of oxide films and surface roughness and then cleaned in acetone to remove dirt and grease, as suggested [10,11].  Figure 1 shows a continuous drive friction machine (ZT4-13 type, ASPA, Wrocław, Poland) with the samples. During the welding process, the magnesium alloy bar is rotated with the spindle, and the aluminum bar is moved axially under the axial pressure. When the appropriate rotational speed is reached, the specimens are brought together under axial force. Abrasion at the weld interface heats specimens locally and upsetting starts. Finally, the rotation of the workpiece stops, and upset pressure is applied to consolidate the joint (see Figure 1).  Figure 1 shows a continuous drive friction machine (ZT4-13 type, ASPA, Wrocław, Poland) with the samples. During the welding process, the magnesium alloy bar is rotated with the spindle, and the aluminum bar is moved axially under the axial pressure. When the appropriate rotational speed is reached, the specimens are brought together under axial force. Abrasion at the weld interface heats specimens locally and upsetting starts. Finally, the rotation of the workpiece stops, and upset pressure is applied to consolidate the joint (see Figure 1). The choice of welding parameters was based on the previous reports [9][10][11]. The upsetting time (UT) was 6 s for all samples. The ranges of parameters were established by the capabilities of the welding machine. For this welder, the rotational speed (RS) of 1450 rpm was constant. Also, the maximum axial force was limited to 50 kN. Table 2 shows the welding parameters used in the experiment.

Tensile Test
A tensile test was carried out on a 100-kN servo-controlled universal testing machine (Instron 1115 type) at a constant displacement rate of 1 mm/min at room temperature (see Figure 2) according to the ASTM:E8/E8M-13a standard specimen configuration [5]. For each group of welding parameters, three samples were made. The mean results from the tensile tests are presented in Table 2. The choice of welding parameters was based on the previous reports [9][10][11]. The upsetting time (UT) was 6 s for all samples. The ranges of parameters were established by the capabilities of the welding machine. For this welder, the rotational speed (RS) of 1450 rpm was constant. Also, the maximum axial force was limited to 50 kN. Table 2 shows the welding parameters used in the experiment.

Tensile Test
A tensile test was carried out on a 100-kN servo-controlled universal testing machine (Instron 1115 type) at a constant displacement rate of 1 mm/min at room temperature (see Figure 2) according to the ASTM:E8/E8M-13a standard specimen configuration [5]. For each group of welding parameters, three samples were made. The mean results from the tensile tests are presented in Table 2.

Mathematical Models
Two mathematical models were considered to represent the ultimate welding strength (UTS) of the AZ31B/AA7075 joints. The quadratic and cubic models were written in terms of design parameters of the friction force, friction time, and the upsetting

Mathematical Models
Two mathematical models were considered to represent the ultimate welding strength (UTS) of the AZ31B/AA7075 joints. The quadratic and cubic models were written in terms of design parameters of the friction force, friction time, and the upsetting force shown as where X 1 , X 2 , and X 3 are the friction force (FF), friction time (FT), and upsetting force (UF), respectively, and β i are the weights for decision variables. The quadratic model describing the dependence of the welding parameters on the joint strength, developed by genetic algorithm procedure, are given below

Fitness Function
The goal function is the minimum mean absolute percentage error (MAPE), and it is shown below, where σ j exp and σ j pred represent the experimental and predicted strength of the j-th joint, and m is the number of observations. After each algorithm generation, the individuals with the best fitness function proceed to the next generation.
The objective function f(x) has the form: The welding parameters such as FF, FT, and UF were used as input in the model. Table 3 presents the ranges of process parameters for which the best UTS can be predicted. The model is a best-fitted structure with these measured in the tests.

Optimization
A genetic algorithm was chosen to found the best process parameters because it is a powerful optimization tool. GA performs exceptionally well in nonlinear regions. In the welding process, complex and highly nonlinear phenomena take place [23]. Therefore, it was easy to estimate relationships between the input and the output of this complex system using the GA method. The main characteristic of GA over the other optimization techniques is that they operate simultaneously with a huge set of searching points to find optimal architecture instead of a single point [24].
The main steps of the genetic algorithm are shown in Figure 3. The main GA operators, such as type of selection, crossover, and mutation were used in the algorithm. The size of the initial population identifies how many chromosomes there are in each generation. With a large population size, the genetic algorithm searches the solution space more thoroughly, Processes 2021, 9, 1550 5 of 11 thereby reducing the chance of returning a local minimum that is not a global minimum. Moreover, too large a population extends the duration of the simulation, as reported [25].
The main steps of the genetic algorithm are shown in Figure 3. The main GA operators, such as type of selection, crossover, and mutation were used in the algorithm. The size of the initial population identifies how many chromosomes there are in each generation. With a large population size, the genetic algorithm searches the solution space more thoroughly, thereby reducing the chance of returning a local minimum that is not a global minimum. Moreover, too large a population extends the duration of the simulation, as reported [25].
Selection is the choice of parents for the next generation. The selection is made using the objective function. Four selection types such as uniform, roulette, remainder, and tournament, were included in this study. Uniform selection chooses parents using the expectations and number of parents. Un is useful for debugging and testing but is not a very effective search strategy.
Roulette election chooses parents by simulating a roulette wheel, in which the area of the section of the wheel corresponding to an individual is proportional to the individual's expectation. The algorithm uses a random number to select one of the sections with a probability equal to its area.  Selection is the choice of parents for the next generation. The selection is made using the objective function. Four selection types such as uniform, roulette, remainder, and tournament, were included in this study.
Uniform selection chooses parents using the expectations and number of parents. Un is useful for debugging and testing but is not a very effective search strategy.
Roulette election chooses parents by simulating a roulette wheel, in which the area of the section of the wheel corresponding to an individual is proportional to the individual's expectation. The algorithm uses a random number to select one of the sections with a probability equal to its area.
Remainder selection assigns parents deterministically from the integer part of each individual's scaled value and then uses roulette selection on the remaining fractional part.
Tournament selection chooses each parent by choosing 'Tournament size' players at random and then selecting the best individual out of that set to be a parent. 'Tournament size' must be at least 2 [25,26].
Crossover is the genetic operator that creates new individuals from the parents. These individuals pass to the next generation. Five types of crossover operators like scattered, single point, two-point, intermediate, and heuristic, were defined.
Scattered crossover creates a random binary vector and selects the genes where the vector is a 1 from the z1, and the genes where the vector is a 0 from the z2. Sc combines the genes to form the child.

f g h]
Intermediate creates children by taking a weighted average of the parents (z7 and z8). You can specify the weights by a single parameter, R, a scalar or a row vector of length number of variables. The default is a vector of all 1's. The function creates the child (ch4) from z7 and z8 using the following formula. ch4 = z7 + rand·R·(z8 − z7) Heuristic returns a child that lies on the line containing the two parents, a small distance away from the parent with the better fitness value in the direction away from the parent with the worse fitness value. The default value of R is 1.2. If z9 and z10 are the parents, and z9 has the better objective value, the function returns the child (ch5) ch5 = z10 + R·(z9 − z10) The mutation operator makes small random changes in the individuals in the population, which provide genetic diversity and enable the GA to search a broader space. Specify the function that performs the mutation function field. Three types of mutation, like a uniform, Gaussian, and adaptive feasible, were described in GA.
Uniform mutation is a two-step process. First, the algorithm selects a fraction of the vector entries of an individual for mutation, where each entry has a probability 'rate' of being mutated. The default value of 'rate' is 0.01. In the second step, the algorithm replaces each selected entry with a random number chosen uniformly from the range for that entry.
Gaussian mutation adds a random number taken from a Gaussian distribution with a mean 0 to each entry of the parent vector.
Adaptive Feasible mutation randomly generates adaptive directions concerning the last successful or unsuccessful iteration. The mutation chooses a path and step length that satisfies bounds and linear constraints.
The model parameters in Equations (1) and (2) have been optimized using GA that minimizes MAPE (Equation (4)). The genetic algorithm settings for process optimization are shown in Table 4. The numerical simulation was done on a computer Intel Core i5-10310U CPU processor 2.21 GHz speed, with the 16 GB memory. Coding with the use of a genetic algorithm was performed in the Matlab environment, version 7.0 (R2008a) [26].

Results of Modeling
The results of the modeling are shown in Table 5. In this study, four types of Selection: Uniform (Un), Roulette (Ro) and Tournament (To), five types of Crossover: Heuristic (He), Scattered (Sc), Intermediate (In), Single-point (Sp), Two-point (Tp), and three types of Mutation: Uniform (Um), Gaussian (Ga), and Adaptive feasible (Af), were processed. In  The modeling results show that quadratic model No.9 in Table 5 was the best GA model among all simulation models. The minimum MAPE value for the No.9 quadratic model is 0.00093. It can be seen that for heuristic crossover, uniform mutation and uniform selection types determined the best MAPE. Therefore, the 9th GA quadratic model was selected to compute the UTS of the joints. Figure 4 shows the results of the genetic algorithm optimization. The course of the objective function for the 500 generations is shown in Figure 4a. It can be observed that the function reached its mean value of 177 MPa in the 45-th generation. The graph also shows the results of the best process parameters. Therefore, the highest tensile strength can be obtained for the welding parameters: FF = 16 kN, UF = 44 kN, and FT = 4 s ( Figure 4). As shown in Figure 4b, the optimization was successful, and the maximum number of generations has been reached. The "final points" are the optimum process parameters. shows the results of the best process parameters. Therefore, the highest tensile strength can be obtained for the welding parameters: FF = 16 kN, UF = 44 kN, and FT = 4 s ( Figure  4). As shown in Figure 4b, the optimization was successful, and the maximum number of generations has been reached. The "final points" are the optimum process parameters.

Validation of Experiment
For optimal process parameters, FF = 12 kN, UF = 44 kN, and FT = 4 s an additional experiment was carried out. The highest tensile strength was 180 MPa. The tensile results of the investigation were close to the optimization results and confirmed compliance with the assumed model. The largest relative error was 1.69 % (see Table 6). Despite the improvement in TS results, all samples were broken at the line boundary. Comparison of the experimental with predicted values of tensile strength is shown in Figure 5. The model compliance tests were carried out for various process parameters. The new results, which are presented in Figure 5, confirmed the fit of the model at the level of 95%.

Validation of Experiment
For optimal process parameters, FF = 12 kN, UF = 44 kN, and FT = 4 s an additional experiment was carried out. The highest tensile strength was 180 MPa. The tensile results of the investigation were close to the optimization results and confirmed compliance with the assumed model. The largest relative error was 1.69 % (see Table 6). Despite the improvement in TS results, all samples were broken at the line boundary. Comparison of the experimental with predicted values of tensile strength is shown in Figure 5.

Effect of the Welding Parameters on the TS
The key parameters of the conventional friction welding method are friction time, friction force, upsetting force, and rotational speed [4,5]. The quality and tensile strength of the welds depend on the correct choice of these parameters [6]. The authors in paper [22] suggest that the reason for the formation of unbonded regions may be the use of short welding times. On the other hand, too long welding times and slow cooling rates may lead to deterioration of the joint strength. The influence of the welding parameters on TS of friction welding is presented in Figure 6. It can be seen that the upsetting force has a positive effect on the tensile strength of welds. With increasing upsetting force from 34 kN to 44 kN, the tensile strength increased rapidly (see Figure 6a). According to the authors [9], the higher upsetting force removes a significant portion of the intermetallic layers beyond the weld interface. However, the higher force during the upsetting stage would lead to a higher axial shortening of material (material loss). A similar trend was observed during FRW of AZ31B magnesium metal matrix composite by Srinivasan et al. [27].
As can be seen from Figure 6a, the use of a short welding time FT = 4 s and the highest bonding force UF = 44 kN led to the best strength of the joint. According to the author [9], short welding times prevent the formation of brittle phases on welded surfaces. Application of high upsetting forces leads to high plastic deformation, resulting in which the oxide layers are removed beyond the bonding zone. The model compliance tests were carried out for various process parameters. The new results, which are presented in Figure 5, confirmed the fit of the model at the level of 95%.

Effect of the Welding Parameters on the TS
The key parameters of the conventional friction welding method are friction time, friction force, upsetting force, and rotational speed [4,5]. The quality and tensile strength of the welds depend on the correct choice of these parameters [6]. The authors in paper [22] suggest that the reason for the formation of unbonded regions may be the use of short welding times. On the other hand, too long welding times and slow cooling rates may lead to deterioration of the joint strength. The influence of the welding parameters on TS of friction welding is presented in Figure 6.

Effect of the Welding Parameters on the TS
The key parameters of the conventional friction welding method are friction time, friction force, upsetting force, and rotational speed [4,5]. The quality and tensile strength of the welds depend on the correct choice of these parameters [6]. The authors in paper [22] suggest that the reason for the formation of unbonded regions may be the use of short welding times. On the other hand, too long welding times and slow cooling rates may lead to deterioration of the joint strength. The influence of the welding parameters on TS of friction welding is presented in Figure 6. It can be seen that the upsetting force has a positive effect on the tensile strength of welds. With increasing upsetting force from 34 kN to 44 kN, the tensile strength increased rapidly (see Figure 6a). According to the authors [9], the higher upsetting force removes a significant portion of the intermetallic layers beyond the weld interface. However, the higher force during the upsetting stage would lead to a higher axial shortening of material (material loss). A similar trend was observed during FRW of AZ31B magnesium metal matrix composite by Srinivasan et al. [27].
As can be seen from Figure 6a, the use of a short welding time FT = 4 s and the highest bonding force UF = 44 kN led to the best strength of the joint. According to the author [9], short welding times prevent the formation of brittle phases on welded surfaces. Application of high upsetting forces leads to high plastic deformation, resulting in which the oxide layers are removed beyond the bonding zone. It can be seen that the upsetting force has a positive effect on the tensile strength of welds. With increasing upsetting force from 34 kN to 44 kN, the tensile strength increased rapidly (see Figure 6a). According to the authors [9], the higher upsetting force removes a significant portion of the intermetallic layers beyond the weld interface. However, the higher force during the upsetting stage would lead to a higher axial shortening of material (material loss). A similar trend was observed during FRW of AZ31B magnesium metal matrix composite by Srinivasan et al. [27].
As can be seen from Figure 6a, the use of a short welding time FT = 4 s and the highest bonding force UF = 44 kN led to the best strength of the joint. According to the author [9], short welding times prevent the formation of brittle phases on welded surfaces.
Application of high upsetting forces leads to high plastic deformation, resulting in which the oxide layers are removed beyond the bonding zone. Figure 6b shows the effect of the friction time on the ultimatum tensile strength for the various upsetting forces. As the welding time increases in the range from 5 s to 10 s, the tensile strength of the joint decreases for all cases of the upsetting forces (see Figure 6b). The longer friction times could see the excess creation of an intermetallic layer. The brittle phases development in the reaction layer may be responsible for the deterioration of UTS, as suggested by the authors [9,10].

Conclusions
The ultimate tensile strength of the friction welding process was studied both numerically and experimentally. The main conclusions are found from this work.
(1). Mathematical models were developed to determine the best strength for joining AZ31B with AA7075 using genetic algorithms.
(2). The highest tensile strength of 180 MPa was obtained for the welding parameters of 16 kN friction force and 4 s of friction time, and 44 kN of upsetting force. The application of the genetic algorithm method allowed increasing the tensile strength joint from 88 to 180 MPa using the friction welder ZT-13 type.
(3). The upsetting force has a positive effect on the UTS of the friction joints. With increasing upsetting force, the tensile strength increased rapidly. As the welding time increases, the UTS decreases for all cases of the upsetting force.