# Quality Prediction and Parameter Optimisation of Resistance Spot Welding Using Machine Learning
## 4 Results and Discussion  
### Copper-Nickel Single-Sided Double-Joint Welding Orthogonal Test Results Analysis  
Commonly used evaluation indicators of weld quality are nugget diameter, tensile shear load, depth of melt, and maximum displacement [29]. In this study, the commonly used nugget diameter and tensile shear load (TSL) for resistance welding were selected as evaluation indicators of weld quality, where the nugget diameter contains the positive electrode nugget diameter (PEND) and the negative electrode nugget diameter (NEND), determined by the average of the longest and shortest diameters of the fractured joint surfaces of the welded joint. Using the combination of process parameters shown in Table 3, the copper-nickel sheet was employed in the single-sided double-joint spot-welding test, to obtain the welded joint nugget diameters, tensile loads, and other indicator parameters. The results are shown in Table 3. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**NO.** & **Process Parameter** & **Symbol** & **Units** \\ \hline \(1,5\) & Slow rise time & SRT & ms \\ \(2\) & Welding time 1 & WT1 & ms \\ \(3,7\) & Slow drop time & SDT & ms \\ \(4\) & Cooling time & CT & ms \\ \(6\) & Welding time 2 & WT2 & ms \\ \(8\) & Welding voltage 1 & WV1 & V \\ \(9\) & Welding voltage 2 & WV2 & V \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Meaning of voltage waveform segmentation. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Process Parameter** & **Level 1** & **Level 2** & **Level 3** & **Level 4** \\ \hline Welding voltage 1 & 2100 & 2200 & 2300 & 2400 \\ Welding time 1 & 2 & 2.5 & 3 & 3.5 \\ Cooling time & 0.2 & 0.5 & 1 & 2 \\ Welding voltage 2 & 2100 & 2200 & 2300 & 2400 \\ Welding time 2 & 2 & 2.5 & 3 & 3.5 \\ Slow rise time & 0.2 & 0.4 & 0.6 & 0.8 \\ Slow drop time & 0.2 & 0.4 & 0.6 & 0.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Copper-nickel single-sided double-joint welding orthogonal experimental factor level table. The Pearson correlation coefficient is a linear correlation coefficient, used to reflect the linear correlation of two normal continuous variables. A set of small sample data sets based on Table 3 are used. The input vector \(\mathbf{X}\) contains 32 sample observations of 7 dimensions (WV1, WT1, CT, WV2, WT2, SRT, and SDT) and the output vector \(\mathbf{Y}\) contains 32 sample observations of 3 dimensions (PEND, NEND, and TSL). The Pearson correlation coefficient is defined as follows [30]:  
\[\mathrm{r}=\frac{\sum{(X_{i}-\overline{X})(y_{i}-\overline{y})}}{\sqrt{\sum{(X _{i}-\overline{X})^{2}(y_{i}-\overline{y})^{2}}}} \tag{8}\]  
In this paper, SPSSAU analysis software was used to quickly calculate the Pearson correlation coefficient; the obtained Pearson's correlation coefficients are shown in Figure 5.  
Figure 5: Pearson correlation coefficients. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**NO. **} & \multicolumn{8}{c}{**Process Parameters**} & \multicolumn{8}{c}{**Experimental Results**} \\ \cline{2-10}  & **WV1 (V)** & **WT1 (ms)** & **CT (ms)** & **WV2 (V)** & **WT2 (ms)** & **SRT (ms)** & **SDT (ms)** & **PEND (mm)** & **NEND (mm)** & **TSL (N)** \\ \hline
2 &  
The value of r is in the interval [1, 2, 3, 4, 5]. When r = 1, **X** and **Y** have a completely positive correlation. When r = 0, the linear correlation between **X** and **Y** is not obvious. When r = \(-\)1, **X** and **Y** have a completely negative correlation. Combining Table 3 and Figure 5, the correlation between the welding process parameters and welding quality can be seen. Tensile shear load and welding voltage 1, welding time 1, and welding time 2 are positively correlated with correlation coefficients of 0.41, 0.37, 0.51, and tensile shear load increases with the increase in welding voltage and welding time. Positive electrode nugget diameter and welding voltage 2 have a significant correlation, the correlation coefficient being 0.4.