Optimizing MAG Welding Input Variables to Maximize Penetration Depth Using Particle Swarm Optimization Algorithm "2279

Systems based on artificial intelligence, such as particle swarm optimization and genetic algorithm have received increased attention in many research areas. One of the main objectives in the gas metal arc welding (GMAW) process is to achieve maximum depth of penetration (DP) as a characteristic of quality and stiffness. This article has examined the application of particle swarm optimization algorithm to obtain a better DP in a GMAW and compare the results obtained with the technique of genetic algorithms. The effect of four main welding variables in GMAW process which are the welding voltage, the welding speed, the wire feed speed and the nozzle-to-plate distance on the DP have been studied. For the implementation of optimization, a source code has been developed in MATLAB 8.3. The results showed that, in order to obtain the upper penetration depth, it is necessary that: the welding voltage, the welding speed and the nozzle-to-plate distance must be at their lowest levels; the wire feed speed at its highest level.

Welding) is one of the most commonly used processes for joining metal. The basis behind heat production in this process is Joule's law of heating, where an applied electric current produces heat due to resistance across an electric arc, which heats the filler metal and base metal to form a weld pool. This molten metal is protected from oxidation of the surrounding atmosphere by inert shielding gas coverage [1].
Weld quality plays an important role as it improves the material strength, toughness and hardness of the product. The quality of a welded product is evaluated by various parameters like deposition rate, weld bead geometry and hardness. These characteristics are controlled by a number of welding parameters like welding speed, welding current and welding voltage. Therefore, to obtain good quality, it is important to define the appropriate welding process parameters [2].
To solve an optimization problem, metaheuristics (artificial intelligences) were used to find the optimal solution. The main advantage of metaheuristics lies in their efficiency and applicability. A wide variety of metaheuristics exists as well as several approaches used to classify them. One approach characterizes the type of search strategy, for example, one type of search strategy is to improve simple local search algorithms, and the other type of search strategy contains a learning component in research [3].
One of the approaches of artificial intelligence such as Particle Swarm Optimization (abbreviated as PSO) has received a lot of attention in combinatorial optimization. PSO is a part of the swarm intelligence family [4], it is based on swarm behavior in nature, like fish and bird schooling. In actuality, PSO has become one of the most widely used algorithms due to its flexibility and simplicity [5].
PSO is based on the principle that each possible solution can be represented as a particle in a swarm. Each particle has a position, which is updated at each step of iteration, by adding the current position of the particle to its velocity term [6].
The objective of the optimization phase was to maximize the depth of penetration through the use of a specially developed PSO. In our work, five levels and four input process parameters are selected. These input parameters chosen are welding voltage (V), welding speed (S), wire feed speed (W) and nozzle-to-plate distance (N). The output parameter was depth of penetration (DP).
The penetration of weld bead is illustrated in Figure 1, with the lightest gray representing the base metal, and the darkest gray being the weld metal. Eng. Proc. 2022, 14, 5 2of 9 example, one type of search strategy is to improve simple local search algorithms, and the other type of search strategy contains a learning component in research [3]. One of the approaches of artificial intelligence such as Particle Swarm Optimization (abbreviated as PSO) has received a lot of attention in combinatorial optimization. PSO is a part of the swarm intelligence family [4], it is based on swarm behavior in nature, like fish and bird schooling. In actuality, PSO has become one of the most widely used algorithms due to its flexibility and simplicity [5].
PSO is based on the principle that each possible solution can be represented as a particle in a swarm. Each particle has a position, which is updated at each step of iteration, by adding the current position of the particle to its velocity term [6].
The objective of the optimization phase was to maximize the depth of penetration through the use of a specially developed PSO. In our work, five levels and four input process parameters are selected. These input parameters chosen are welding voltage (V), welding speed (S), wire feed speed (W) and nozzle-to-plate distance (N). The output parameter was depth of penetration (DP).
The penetration of weld bead is illustrated in Figure 1, with the lightest gray representing the base metal, and the darkest gray being the weld metal.

Experimental Procedure
The experimental procedure used for this work is briefly explained below.

Description
The experiments were performed by means of a GMAW machine using a direct current electrode positive. Test pieces of dimensions (200 mm × 100 mm × 6 mm) were cut from steel plates. Filler wire (class ER70S-6) in the form of a coil of 0.8 mm diameter was used to deposit the weld beads. The experimental setup consisted of three parts: wire feed unit, welding power source and welding manipulator, where the welding gun was held in a frame mounted directly above the work table, and it was provided with an attachment on the manipulator for both up and down movement to adjust the required nozzle-to-plate distance. The bead-on-plate technique was adopted for welding the test pieces. The spray transfer mode has been used in this process. The composition of the shielding gas was argon (75%) and carbon dioxide (25%). The gas flow rate used was 14 liters/min.
The chemical composition of the base metal and the filler metal are given in Table 1 and Table 2, respectively [7].

Experimental Procedure
The experimental procedure used for this work is briefly explained below.

Description
The experiments were performed by means of a GMAW machine using a direct current electrode positive. Test pieces of dimensions (200 mm × 100 mm × 6 mm) were cut from steel plates. Filler wire (class ER70S-6) in the form of a coil of 0.8 mm diameter was used to deposit the weld beads. The experimental setup consisted of three parts: wire feed unit, welding power source and welding manipulator, where the welding gun was held in a frame mounted directly above the work table, and it was provided with an attachment on the manipulator for both up and down movement to adjust the required nozzle-to-plate distance. The bead-on-plate technique was adopted for welding the test pieces. The spray transfer mode has been used in this process. The composition of the shielding gas was argon (75%) and carbon dioxide (25%). The gas flow rate used was 14 liters/min.
The chemical composition of the base metal and the filler metal are given in Tables 1 and 2, respectively [7].

Identification of Input Process Parameters
The limits of input process parameters with their notations and units are presented in Table 3.

Recording the Response Variables
Depth of penetration was measured according to the following steps: cutting the test piece, mechanical polishing, revealing the structure by a chemical attack and finally macro-graphic observation.
For this study, the observed experimental input and output values are shown in Table 4. Table 4. Optimal experimental input and output values obtained.

Obtaining the Mathematical Models
The regression procedure was used to develop a mathematical model to predict penetration depth. The response function representing any depth of penetration dimensions can be expressed using the equation DP = f (V, S, W, N), where DP is the output parameter and V, S, W, N are the input variables.
The second-order polynomial representing the response surface for four factors is given by [8,9]: The final mathematical model, being a second-degree response surface, is expressed as follows: Eng. Proc. 2022, 14, 5 4 of 9

Overview of the Proposed Algorithm (PSO)
Particle Swarm Optimization (PSO) is an optimization metaheuristic, invented by Russel Eberhart and James Kennedy in 1995 [10], as an alternative to Genetic Algorithm (GA) [11].
PSO is inspired by the observation of the social behavior of bird flocks. It initializes the population with random potential solutions of the problem. Individuals in the population are called particles; everyone has their own position and velocity [12].
Using the last two parameters, the fitness function of the particle has been calculated, and each particle in the problem space would have its best solution. That personal best experience of each particle is called "Pbest". When a particle completes its population, the best value of all particles is global best experience "Gbest". After finding the two best values, the particle updates its velocity "V i (t + 1)" and position "X i (t + 1)" according to the following equations [13]: where i-th is the particle, N is the number of particles in the swarm, so i = 1, 2, . . . , N particles; the index t denotes the iteration counter; V i (t + 1), and X i (t + 1) are, respectively, the particle's velocity and position at the new iteration (t + 1); V i (t), and X i (t) represent the velocity value and position at the current iteration (t), respectively; W is the inertia weight; C 1 and C 2 are positive constants, referred to as cognitive and social parameters respectively; R 1 and R 2 are two separate random numbers distributed in the range [0, 1]; Pbest i (t) is the personal best position of the ith particle at the t th iteration; Gbest (t) is the global best position of particles at t iteration [14][15][16]. Figure 2 illustrates the position and velocity update of PSO:

Overview of the Proposed Algorithm (PSO)
Particle Swarm Optimization (PSO) is an optimization metaheuristic, invented by Russel Eberhart and James Kennedy in 1995 [10], as an alternative to Genetic Algorithm (GA) [11].
PSO is inspired by the observation of the social behavior of bird flocks. It initializes the population with random potential solutions of the problem. Individuals in the population are called particles; everyone has their own position and velocity [12].
Using the last two parameters, the fitness function of the particle has been calculated, and each particle in the problem space would have its best solution. That personal best experience of each particle is called "Pbest". When a particle completes its population, the best value of all particles is global best experience "Gbest". After finding the two best values, the particle updates its velocity "Vi (t+1)" and position "Xi (t+1)" according to the following equations [13]: where i-th is the particle, N is the number of particles in the swarm, so i = 1, 2, …, N particles; the index t denotes the iteration counter; Vi(t+1), and Xi(t+1) are, respectively, the particle's velocity and position at the new iteration (t+1); Vi(t), and Xi(t) represent the velocity value and position at the current iteration (t), respectively; W is the inertia weight; C1 and C2 are positive constants, referred to as cognitive and social parameters respectively; R1 and R2 are two separate random numbers distributed in the range [0, 1]; Pbesti (t) is the personal best position of the ith particle at the tth iteration; Gbest (t) is the global best position of particles at t iteration [14][15][16]. Figure 2 illustrates the position and velocity update of PSO: The flow chart of the basic optimization process of particles is shown in Figure 3.

Pbesti(t)
Xi The flow chart of the basic optimization process of particles is shown in Figure 3.

Confirmation test
After collecting data, and applying the least squares method, the regression equation of Depth of Penetration "DP" was obtained as below: After that, the regression equation was maximized by the PSO and GA methods. In PSO algorithm, number of populations, learning factors (C1 = C2), inertia weight (W) and maximum iteration were 35, 2, 0.7, 300, respectively. The operators of GA are: number of populations was 50, type of selection was a tournament, the crossover type was heuristic, the type of mutation was uniform, probability of crossover was 0.85, probability of mutation was 0.02, and maximum iteration was 300.

Confirmation Test
After collecting data, and applying the least squares method, the regression equation of Depth of Penetration "DP" was obtained as below: After that, the regression equation was maximized by the PSO and GA methods. In PSO algorithm, number of populations, learning factors (C 1 = C 2 ), inertia weight (W) and maximum iteration were 35, 2, 0.7, 300, respectively. The operators of GA are: number of populations was 50, type of selection was a tournament, the crossover type was heuristic, the type of mutation was uniform, probability of crossover was 0.85, probability of mutation was 0.02, and maximum iteration was 300. In order to show the effectiveness of the proposed methods, programs developed in a MATLAB are used. The optimal values of the process variables obtained from PSO and GA are presented in Table 5. It should be noted that the value "4.6096 mm" obtained with the PSO technique for penetration depth is better than the value obtained with GA "4.5952 mm". The results show that the two optimization algorithms proposed to make it possible to effectively maximize the objective function.

Effect of Inputs on Depth of Penetration
Getting deeper penetration or at least adequate penetration is very important in welding. Many variables affect penetration, some more than others, but in general we always want good penetration. It is important to know how each variable affects the deposited weld metal. The optimized direct effects of the four input parameters on the depth of penetration are shown in Figures 4-7. Eng. Proc. 2022, 14, 5 6of 9 In order to show the effectiveness of the proposed methods, programs developed in a MATLAB are used. The optimal values of the process variables obtained from PSO and GA are presented in Table 5. It should be noted that the value "4.6096 mm" obtained with the PSO technique for penetration depth is better than the value obtained with GA "4.5952 mm". The results show that the two optimization algorithms proposed to make it possible to effectively maximize the objective function.

Effect of Inputs on Depth of Penetration
Getting deeper penetration or at least adequate penetration is very important in welding. Many variables affect penetration, some more than others, but in general we always want good penetration. It is important to know how each variable affects the deposited weld metal. The optimized direct effects of the four input parameters on the depth of penetration are shown in Figures 4-7. From Figure 4, increasing the arc welding voltage resulted in a slow decrease in penetration depth. If the welding voltage was increased from 28 V to 32 V the depth of penetration decreased from 1.143 mm to 1.044 mm.
Higher voltage spreads the arc out and drops a wider bead. Less energy density is exhibited as the voltage goes up, so penetration drops. If the voltage is too low and you get an erratic arc, you will begin to lose some penetration [17].  In order to show the effectiveness of the proposed methods, programs developed in a MATLAB are used. The optimal values of the process variables obtained from PSO and GA are presented in Table 5. It should be noted that the value "4.6096 mm" obtained with the PSO technique for penetration depth is better than the value obtained with GA "4.5952 mm". The results show that the two optimization algorithms proposed to make it possible to effectively maximize the objective function.

Effect of Inputs on Depth of Penetration
Getting deeper penetration or at least adequate penetration is very important in welding. Many variables affect penetration, some more than others, but in general we always want good penetration. It is important to know how each variable affects the deposited weld metal. The optimized direct effects of the four input parameters on the depth of penetration are shown in Figures 4-7. From Figure 4, increasing the arc welding voltage resulted in a slow decrease in penetration depth. If the welding voltage was increased from 28 V to 32 V the depth of penetration decreased from 1.143 mm to 1.044 mm.
Higher voltage spreads the arc out and drops a wider bead. Less energy density is exhibited as the voltage goes up, so penetration drops. If the voltage is too low and you get an erratic arc, you will begin to lose some penetration [17]. If the welding speed was increased from 0.23 m/min to 0.34 m/min the depth of penetration decreased from 1.176 mm to 0.873 mm. Increasing the welding speed results in a gradual decrease in the penetration depth. This can be attributed to a lower heat input at higher speeds per unit length of the weld bead, resulting in a decrease in weld pool and a decrease in penetration depth [18]. In Figure 6, it can be noted that the depth of penetration increases progressively with the wire feed speed. If the wire feed speed was increased from 8 m/min to 11 m/min the depth of penetration increased from 0.919 mm to 1.209 mm.
Wire feed speed controls the amperage as well as the amount of weld penetration. A speed that is too high can lead to burn-through. The voltage needs to be balanced with wire feed speed for an efficient metal transfer. If W/amperage is too high setting the wire feed speed or amperage too high may cause improper starting of the arc, and lead to an excessively large weld bead, burn-through, excessive spatter and poor penetration. If W/amperage is too low a narrow cord, oftentimes convex bead with poor tie-in at the toes of the weld, indicates insufficient amperage [19]. In Figure 7, it should be noted that the depth of penetration decreases gradually with the nozzle-to-plate distance (N). If N was increased from 14 mm to 20 mm the depth of penetration decreased from 1.224 mm to 0.898 mm. As N increases, more resistance to the flow of electricity through the electrode occurs; this increase causes a decrease in current, resulting in a decrease in the level of penetration. Conversely, when N decreases, resistance also decreases. As a result, current increases and thus penetration increases.  In Figure 6, it can be noted that the depth of penetration increases progressively with the wire feed speed. If the wire feed speed was increased from 8 m/min to 11 m/min the depth of penetration increased from 0.919 mm to 1.209 mm.

Conclusions
Wire feed speed controls the amperage as well as the amount of weld penetration. A speed that is too high can lead to burn-through. The voltage needs to be balanced with wire feed speed for an efficient metal transfer. If W/amperage is too high setting the wire feed speed or amperage too high may cause improper starting of the arc, and lead to an excessively large weld bead, burn-through, excessive spatter and poor penetration. If W/amperage is too low a narrow cord, oftentimes convex bead with poor tie-in at the toes of the weld, indicates insufficient amperage [19]. In Figure 7, it should be noted that the depth of penetration decreases gradually with the nozzle-to-plate distance (N). If N was increased from 14 mm to 20 mm the depth of penetration decreased from 1.224 mm to 0.898 mm. As N increases, more resistance to the flow of electricity through the electrode occurs; this increase causes a decrease in current, resulting in a decrease in the level of penetration. Conversely, when N decreases, resistance also decreases. As a result, current increases and thus penetration increases. From Figure 4, increasing the arc welding voltage resulted in a slow decrease in penetration depth. If the welding voltage was increased from 28 V to 32 V the depth of penetration decreased from 1.143 mm to 1.044 mm.

Conclusions
Higher voltage spreads the arc out and drops a wider bead. Less energy density is exhibited as the voltage goes up, so penetration drops. If the voltage is too low and you get an erratic arc, you will begin to lose some penetration [17].
If the welding speed was increased from 0.23 m/min to 0.34 m/min the depth of penetration decreased from 1.176 mm to 0.873 mm. Increasing the welding speed results in a gradual decrease in the penetration depth. This can be attributed to a lower heat input at higher speeds per unit length of the weld bead, resulting in a decrease in weld pool and a decrease in penetration depth [18].
In Figure 6, it can be noted that the depth of penetration increases progressively with the wire feed speed. If the wire feed speed was increased from 8 m/min to 11 m/min the depth of penetration increased from 0.919 mm to 1.209 mm.
Wire feed speed controls the amperage as well as the amount of weld penetration. A speed that is too high can lead to burn-through. The voltage needs to be balanced with wire feed speed for an efficient metal transfer. If W/amperage is too high setting the wire feed speed or amperage too high may cause improper starting of the arc, and lead to an excessively large weld bead, burn-through, excessive spatter and poor penetration. If W/amperage is too low a narrow cord, oftentimes convex bead with poor tie-in at the toes of the weld, indicates insufficient amperage [19].
In Figure 7, it should be noted that the depth of penetration decreases gradually with the nozzle-to-plate distance (N). If N was increased from 14 mm to 20 mm the depth of penetration decreased from 1.224 mm to 0.898 mm. As N increases, more resistance to the flow of electricity through the electrode occurs; this increase causes a decrease in current, resulting in a decrease in the level of penetration. Conversely, when N decreases, resistance also decreases. As a result, current increases and thus penetration increases.

Conclusions
In this research, an attempt was made to obtain the best set of values for welding voltage (V), welding speed (S), wire feed speed (W) and nozzle-to-plate distance (N) to produce the best quality of weld in terms of penetration depth.
Based on this investigation, it can be concluded that the optimization method (PSO) can be used to find optimum welding conditions for maximum weld bead penetration within the specified limits of the process parameters.
Optimization results indicate that to reach the maximum depth penetration, the three factors V, S and N should be at their minimum values and the factor W must be at its maximum value. There are many other variables that can affect penetration such as gas flow rate and variables include base: like material surface condition (rust, presence of oil . . . ), base material thickness, base material type, and electrode diameter [18].