PREDICTION OF SPOT WELDING PARAMETERS USING FUZZY LOGIC CONTROLLING

There are different methods used for Spot Welding (SW), one of the most important used methods is the RSW, which is considered as an efficient joining process widely used for the fabrication of sheet metal assemblies [1]. Various materials are used extensively for resistance spot welding, like low carbon steel, stainless steels, and galvanized steel components due to their wide applications [2–4]. RSW is commonly used for joining materials in the manufacturing process, especially for automobile industries through heating for the required pieces by applying high current at a specific time where the nugget will be obtained from this process [5]. In RSW, the two metal sheets that are to be welded must hold together using the pressure of the electrode and the electrical current for a period of time. Power source in resistance welding is the heat, which is generated by passing electric current through a conductor offering any resistance. The energy provided to the welding operation relies on current flow, resistance of the circuit, and length of time when the current is applied. This can be seen obviously by equation (1), which is shown belowProcesses, and Systems is designed for a first course or two-course sequence in manufacturing at the junior level in mechanical, industrial, and manufacturing engineering curricula. Given its coverage of engineering materials, it is also suitable for materials science and engineering courses that emphasize materials processing. Finally, it may be appropriate for technology programs related to the preceding engineering disciplines. Most of the book\u2019s content is concerned with manufacturing processes (about 65 % of the text [6, 7]:


Introduction
There are different methods used for Spot Welding (SW), one of the most important used methods is the RSW, which is considered as an efficient joining process widely used for the fabrication of sheet metal assemblies [1]. Various materials are used extensively for resistance spot welding, like low carbon steel, stainless steels, and galvanized steel components due to their wide applications [2][3][4].
RSW is commonly used for joining materials in the manufacturing process, especially for automobile industries through heating for the required pieces by applying high current at a specific time where the nugget will be obtained from this process [5].
In RSW, the two metal sheets that are to be welded must hold together using the pressure of the electrode and the electrical current for a period of time. Power source in resistance welding is the heat, which is generated by passing electric current through a conductor offering any resistance. The energy provided to the welding operation relies on current flow, resistance of the circuit, and length of time when the current is applied. This can be seen obviously by equation (1), which is shown belowProcesses, and Systems is designed for a first course or two-course sequence in manufacturing at the junior level in mechanical, industrial, and manufacturing engineering curricula. Given its coverage of engineering materials, it is also suitable for materials science and engineering courses that emphasize materials processing. Finally, it may be appropriate for technology programs related to the preceding engineering disciplines. Most of the book\u2019s content is concerned with manufacturing processes (about 65 % of the text [6,7]: 2 , where H -heat generated, in Joules; I -current in Amperes; R -resistance in Ohms; t -time of current flow, in cycle (60 cycle=1 second). The parameters affecting RSW (applied force, welding time, welding current, and frequency) can be controlled, while the non-controlled parameters such as environmental temperature with surface conditions will affect the contact resistance [8].
Therefore, a number of studies were devoted to showing and predicting the RSW parameters effect on the welded metal properties using miscellaneous methods as will be clarified next.

Literature review and problem statement
Many researchers take the resistance spot welding process in consideration, where miscellaneous studies went deeply in knowing all the effected parameters of this process, in addition to the continuing striving to enhance this process by different methods.
The paper [9] investigates the effected control of process parameters (applied load, arc intensity and, welding duration) on the austenitic stainless steel 304L mechanical property during the welding process for the joint. The results reveal that the most important factor on the mechanical property of weld joint is the applied load compared to the current intensity and welding duration, but there was no prediction for the optimized factor and for the welding process performance by this study, which concentrated on allocating the most influential factor of this process.
Also, the study [10] has explored a mathematical model for forecasting the tensile shear strength and nugget diameter of galvanized steel. The selected parameters are preheating current, welding time, welding current and welding pressure. In fact, the complexity of welding for the Galvanized sheet was shown by a nonlinear regression model needed to be integrated with a simulation model for predicting the welding process behavior as in the previously mentioned paper.
On the other hand, some researchers started to use methods in their studies to enhance the overall RSW process, like the study [11], which investigates resistance spot welding experimentally using L-9 Taguchi orthogonal array, through combinations of nine standard input parameters, the results were near optimal input process parameters. But Taguchi method does not exactly indicate, which parameter has the optimum effect on the performance besides failing in knowing the interactions between welding parameters [12].
The obstacles mentioned in previous studies may gave the chance of new generation of researches to be appeared as in using the Artificial intelligent (A. I.) that had appeared to be applied for simulation and modeling in RSW. Neural network and fuzzy logic as examples of (A. I.) were used in many studies to deal with the optimization of the welding process parameters.
The paper [13] uses a Neural Network-based resistance spot welding quality assessment system where good results were obtained in spite of taking long time for neural network training.
As mentioned in [14], the fuzzy logic is very helpful and fast in controlling and optimization methods since one can predict the system behavior as what was presented by the study [15] that had used FLC to reduce the thermal stresses and as a result the wear in the electrodes.
Very good results were obtained in the study [15], the matter that gives the inducement to deal with other welding process factors in this study to notice their effect on the welding process performance, besides predicting the failure situations before they occur.
By previous studies, some depend on the classical method of exploring the complex mathematical model in defining the output welding parameters in terms of the input changeable welding parameters, but no previous prediction for the results is available. On the other side, the studies that had used artificial intelligence, like neural network, take long time for training.
And those researchers who used the FLC had studied parameters that are different from the parameters that are used in this study.
In the next part, the aim of this study will be explained obviously.

The aim and objectives of the study
The aim of this study is to present a prediction for the welded metal sheets characteristics as a result of varying parameters of resistance spot welding, also to predict the optimal welded material property for any given resistance spot welding parameters, besides, to foresee the probability of failure in the welding process before happening using simulation.
To achieve this aim, the following objectives are accomplished by two main points: -to explore the resistance spot welding process and its parameters via the experimental part; -to reveal the effect of the welding input parameters (current and time) on the welding output variables (Maximum shear load and Nugget zone) at specified values; -to develop a simple and reliable method, which is the fuzzy logic model to predict the resistance spot welding response in terms of nugget diameter and maximum shear load as reactions to changes in welding current and time; -to improve this prediction, which is intended to preserve the welded part and the electrodes used and prolong the life of electrodes.

Material and method of the experimental part
Two sheets of stainless steel (AISI 304) will be welded using RSW, where the first step of experimental work will deal with the material selection and preparation by applying the important mechanical tests. Besides the chemical composition of the metal will be obtained.
The next major step is the resistance spot welding process where a set of experiments will be applied to the specimens of the two metal sheets. The controllable welding variables are the current and time, while the maximum shear load and the nugget zone diameter are the two parameters that will be studied for their varying according to this controlling. These experimental results will be the base input for the FLC, where the latter will give its simulation results. These two results will be compared and validated. This study work plan will be abbreviated in the following flow chart in Fig. 1.
The flow chart in Fig. 1 illustrates the layout that is considered to achieve the aim of this paper. It shows the stages of experimental work obtained and then validated by the Fuzzy Logic control simulation, where the Fuzzy Logic control will be used later for predicting the results for new data with a very acceptable percentage of accuracy.

1. Material selection and preparation
The experimental work deals with the preparation of the selected material to conduct the mechanical tests. It also deals with the tensile test to achieve the aim of the present work. The chemical composition of austenitic stainless steel AISI 304L is given in Table 1. The specimen of the tensile test has been prepared according to the American Society for Testing and Materials specifications (ASTM E8) standard for thin specimens [16]. They were machined by a milling machine, using a suitable cutter to achieve the profile shown in Fig. 2, which explains the details of tensile specimen dimensions. The results of the tensile test are given in Table 2 for the used stainless steel 304L and the standard ASTM A240 AISI304L. Table 2 includes the most important mechanical properties, which are represented by ultimate strength, Young's modulus and percentage of elongation.
Specimens for the spot welding tensile shear test that had been used in this investigation were prepared according to EN ISO 14329 standard. Before starting with the resistance spot welding process, sheets' surfaces were cleaned chemically by using acetone to eliminate surface contamination.

2. Resistance spot welding process
Austenitic stainless steel sheets (AISI 304) of 0.8 mm thickness were welded with an electrode force of 2.5 KN. These sheets were cut parallel to the rolling direction, they consist of two-sheet samples, with 100 mm length (L) and 30 mm width (w), and 0.8 mm thickness (t), then the welding process will occur in the overlap region 25 mm in single spot welding nugget as shown in Fig. 3. The tests were carried out using an electric spot welding machine, which is shown in Fig. 4, a, where the current and time were controlled. The electrodes were copper alloy, which has high thermal and electrical conductivity. Welding was performed by employing an electrode of 45° truncated cone with a flat face of 5 mm dieameter. A major concern was to maintain symmetrical loading in the middle of the overlapping distance, to prevent any moment's effect around the weld nugget in the lap shear specime Two input process parameters (welding current and cycle time) were selected as given in Table 3. The constant parameter (electrode force) was preserved. The output parameters were Maximum shear load (N) and Welding Nugget diameter (mm).
The number of experiments that are selected to be done for the study would be calculated depending on the product of the levels of each variable [17], where each of the variables (current and time) consists of three levels 1, 2 and 3, where this leads to 3×3 to be nine experiments for studying the spot welding process variables' changing and investigating the effect of changing operating parameters on Maximum shear load and Nugget diameter [18]. The three levels of each welding process variable will be used later to give a similar representation but in linguistic ranges of the variables (low, medium and high) with tolerances for each one besides overlapping between them as explained in fuzzy logic part.
After completing the spot welding tests, the tensile shear test for specimens was carried out using a tensile testing device where the tensile shear tests were accomplished at a cross-head speed of 2 mm/min with 250 kN load of the test specimens of (AISI 304) Specimens for spot welding tensile as shown in Fig. 4, b.  To find the best parameter setting of the machine that meets best results, a set of experiments have been made, on several specimens of steel were spot welded using different parameter setting for samples of tensile shear as shown in Fig. 5. The failure mode of spot welded steel of one specimen before and after the tensile shear test is shown in Fig. 6. Besides the welding or contacting point between the two steel sheets, which is the nugget zone was measured for its diameter for each case of the study. The results are given in Table 4 below.  Fig. 6, a shown above illustrates the spot welded specimen before the tensile -shear test while Fig. 6, b shows the pullout, failure mode of spot welded steel of one specimen after the tensile shear test.

3. Fuzzy Logic control (FLC)
As one of the most important Artificial Intelligence techniques, fuzzy logic becomes widely used in various areas in Engineering and Science [19]. The fuzzy prediction gives the ability to use mathematical logic in a manner and sense so close to human thinking and judgment. In other words, fuzzy logic will soften the transition between crisp ranges of data [20]. The three main fuzzy logic stages are Fuzzification, Fuzzy Inference, DefFuzzification [21].

Fuzzy Logic Control Model and its Simulation Results
In this study, the fuzzy logic toolbox in MATLAB will be used, which facilitates dealing with fuzzy logic modeling, controlling, besides results estimation and optimization, Fig. 7 shows the presented model Graphical User Interface (GUI ) of the fuzzy logic toolbox in MATLAB version.
Where a MIMO (Multi Input Multi Output) fuzzy inference system will be used with two inputs (Time, Current) and two outputs (Max. shear load, Nugget diameter).
In the fuzzification stage, the chosen input data will be collected, then converted to fuzzy logic sets using the fuzzy linguistic variables as shown in Tables 5, 6.  The Input membership Function plots are shown below in Fig. 8, 9. While the output values are divided into three equal intervals' groups just like the input values, as shown in Table 6.
And here are the output membership function plots in Fig. 10, 11.
The next stage will be the Fuzzy Inference System, which is made by the created rules according to expert notes. The most known Mamdani fuzzy inference system will be used.
The fuzzy logic rules will be expressed as conditional statements as in Table 7 below. Where Max. L. is the Maximum Load and Nugg. D. is the Nugget Diameter. For example, if the welding current is low and the welding time is low too, then the nugget diameter is low and the maximum shear load is low too. In establishing the rule base, there was a dependence on the observation of the experimental values, by collecting numerous experiments' data. Some expectable changes were noticed in the welded material characteristics "the maximum shear load" supporting and "the nugget diameter" of the welded area due to the changes in welding process parameters "weld current" and "weld time". These expectable changes guide to build the FLC rule base, which will be useful then to estimate the output parameters for any input values even if they were not expected experimentally. Now in Fig. 12, the rule viewer will give sufficient information of the whole fuzzy logic inference process, the first two columns present the two input spot welding parameters (current, time), whereas the last two columns present the output spot-welding parameters (max. shear load, nugget diameter). By changing the inputs' values (using the red vertical line), the expected max. load and nugget's diameter will be obtained directly. In fact, this represents the Defuzzification stage where the values transform from the linguistic mode to the crisp or numerical mode.
The COA (Centre Of Area) method is used in defuzzification. Thus, by giving any values for the inputs (current and time), the output values (maximum shear load and nugget diameter) would be obtained. Fig. 12 shows the fuzzy logic ruler viewer in MATLAB. According to the surface viewer, a three-dimensional curve shows in Fig. 13 the mapping from welding current, welding time, and nugget diameter.
While the three-dimensional curve in Fig. 14 shows the mapping from welding time, welding current and expected maximum shear load that the welded plate could be subjected to.
The next Fig. 15-18 show the relations between each two parameters separately.
With a constant Electrode force of 2,500 N.

Discussion of experimental results
It is clear that the Maximum shear force and the Maximum Nugget diameter occur at welding current 8 KA and welding time cycle of 20.
The Minimum shear force and the Minimum Nugget diameter occur at welding current 6 KA and welding time cycle of 10.
The noticed results pointed that there is an obvious effect of the welding current and welding time on the shear force and nugget area as follows: 1

. Welding Current Effect
The increase in welding current beyond maximum ranges causes an increase in the maximum shear force of the weld joint. An increase in welding current values results in greater heat generation at the faying interface, which results in forming a larger weld zone, also increases the overall area of bonding, which accords to the heating law of Joule mentioned before.
In fact, there is a positive relationship between the nugget zone and weld penetration.
The increase in welding current causes a rapid increase in the area of welded (nugget) zone because of the heat input, which increases the melting area, which leads also to an increase in the melting area, which also increases the joint shear force.

Welding Time Effect
Welding time has an important effect on the joint strength and the quality of welding, where a maximum shear force of the joint is increased by increasing the welding time. It is noticeable that the increase in maximum shear force caused by welding time is smaller than the increase in maximum shear force caused by welding current, where this is compatible with Joule law mentioned before, which indicates that welding current has a square effect than welding time.
On the other side, the increase in welding time causes an increase in the nugget zone because of the heat increment, which is accumulated in the welded area of the two faying sheets of metal. Table 8 below shows the experimental and simulated results of all the selected specimens, besides the error per- Moreover, the obtained results from the fuzzy logic simulation pointed that the expected values were matched closely with the actual experimental results as shown in Table 8 above.
The Fuzzy Logic is distinguished by features that encourage its employment in this system managing, it is fast, simple, cheap, flexible, does not require accurate quantitative model, able to permit the decision making using estimated values even with uncertain or incomplete information.
Thus, using the FLC model in predicting metal behavior after the spot welding process represents a useful decision support system's tool for managing the RSW process. By FLC, it will be easier and faster to make a decision about the acceptable range of the selected values of welding current and time, the values that do not hurt the system hardware of the RSW process.
FLC will slacken the effort for the experimental implementation of every single case of varying welding parameters. FLC prediction will be a sufficient replacement. FLC is a recent supporter in various welding processes.
In comparison with similar studies, especially those that use Artificial Intelligence with RSW [13] and [15], this study based on the FLC model is less cumbersome in programming than a neural network based system in [13]. Besides, training is unneeded with fuzzy. This FLC based system is faster than the neural network dependent one.
In addition, the same mentioned study has 10 % as an error percentage in estimating the RSW quality indicators by means of varying welding parameters. On the other hand, our study reached the error percentage of 0.2 % in some cases of predicting the RSW characteristics.
Another study that used A. I. especially FLC is [15], which considered different types of metals (mild and zinc coated steel) than the metal used in our study (Austenitic Stainless Steels (AISI 304). Besides, a different FLC model is concerned, which is MISO Multi Input (welding resistance, electrode displacement and welding force) Single Output (expulsion) , while in our study, the FLC model is MIMO Multi Input (welding current and welding time) Multi Output (maximum load and nugget diameter).
Using FLC in this study may not give the opportunity for the system to be self-learned like neural network systems, in addition to the requirement of fuzzy membership tuning. And according to the vagueness of the fuzzy logic (but not uncertainty), FLC usage will be where the precision is not as important as warning, this is compatible with this study where the FLC first role is to warn about the damage that either the electrodes or the welded metal may be imposed to.
As a development for this study, other welding parameters can be studied (like electrode force, squeeze time, electrode diameter and thickness of metal sheets) in order to observe the behavior of other properties (like hardness, nugget penetration and indentation depth ) to have better impression about the RSW parameters and their effect on welded metal. More cases of study will be more reliable and give a good database for the FLC model. Also another A.I. method may be used or a combination of them like neuro -fuzzy for better results. Nevertheless, more modern machines of RSW may open the door for easily studying new parameters of welding and higher efficiency in performance, these machines will have the obstacles of cost and expertness.

Conclusions
1. The increment in welding time and welding current leads to an analogous increment in tensile shear load and diameter of the nugget zone. Welding current has an influential effect on the metal parameters, rather than welding time (the matter that agrees with the double squared effect of current in the heat generation equation 1).
2. The optimum value of maximum shear load for RSW is found at (welding time=20 cycle, welding current=8 KА), while the optimum value of the Nugget Diameter for RSW is found at (welding time=20 cycle, welding current=8 KА).
3. The optimum value of maximum shear load and nugnget zone diameter is successfully predicted using fuzzy logic where the FLC results were compatible with the optimum results that were obtained experimentally. The obtained error in predicting the maximum shear load output for the given current and time input data is found within very acceptable limits, where the error percentage reaches 0.199 % in welding time 10 cycle and welding current 7 KA. While the error percentage in predicting the nugget zone diameter output for the given current and time input data reaches 1.234 % in welding time10 cycle and welding current 8 KA. 4. The presented FLC model results indicated its adeaquacy to be used in complex processes like resistance spot welding, FLC made its duty in process controlling, parameters prediction and optimization, which leads to welding process enhancement totally in addition to preserving the metal parts and electrodes from excessive generated heat by virtue of the prior knowledge and expectation of FLC.