Quality Prediction and Parameter Optimisation of Resistance Spot Welding Using Machine Learning

: In a small sample welding test space, and to achieve online prediction and self-optimisation of process parameters for the resistance welding joint quality of power lithium battery packs, this paper proposes a welding quality prediction model. The model combines a chaos game optimisation algorithm (CGO) with the multi-output least-squares support vector regression machine (MLSSVR), and a multi-objective process parameter optimisation method based on a particle swarm algorithm. First, the MLSSVR model was constructed, and a hyperparameter optimisation strategy based on CGO was designed. Next, the welding quality was predicted using the CGO–MLSSVR prediction model. Finally, the particle swarm algorithm (PSO) was used to obtain the optimal welding process parameters. The experimental results show that the CGO–MLSSVR prediction model can effectively predict the positive and negative electrode nugget diameters, and tensile shear loads, with root mean square errors of 0.024, 0.039, and 5.379, respectively, which is better than similar methods. The average relative error in weld quality for the optimal welding process parameters is within 4%, and the proposed method has a good application value in the resistance spot welding of power lithium battery packs.


Introduction
With the rapid development, globally, of the new energy vehicle industry, the demand for power lithium battery packs is growing.To provide more power and a longer driving range, a single battery pack usually consists of thousands of individual lithium cells connected by connecting tabs to form a series-parallel structure [1].The manufacturing process of power lithium battery packs involves a large number of welding processes, such as electrode sheet-ear, ear-electrode, and electrode-connector.Common methods used for lithium battery welding include resistance welding, pulsed TIG spot welding, and ultrasonic metal welding [2].Resistance spot welding uses resistance heating as the welding heat source to produce local heating and material fusion under high current and pressure [3]; this has the advantages of low cost, high efficiency, and good quality controllability, and is particularly suitable for the connection of lithium battery electrodes to the connecting piece.In the context of lightweight automotive manufacturing, the welding quality of power lithium battery packs is particularly important, and its quality directly determines the stability, service life, and safety of the battery pack [4,5].The lithium battery pack contains thousands of welding joints, and welding defects in any position will affect the performance of the battery pack.For example, if the false welding-head contact resistance is too large to form a voltage difference [6], it will result in overheating and reduce the stability of the battery pack.Furthermore, excessive welding easily causes internal battery positive and negative short circuits [7] which, in turn, cause explosion, creating a potential safety hazard.It is necessary to test the quality of each welded joint.
The quality inspection of resistance-welded joints in industrial production mainly uses off-line inspection methods [8], such as manual random sampling destructive experiments, which have high leakage rates, low efficiency, limitations, and high costs.The resistance spot welding nucleation process is fast and closed, is highly nonlinear, has multivariate coupling characteristics, but lacks professional testing equipment that can monitor the nucleus growth process online.The welding process is accompanied by many signals: electrical, thermal, force, displacement, and others, all of which contain a wealth of information on nucleus growth and performance characteristics that can be used for process monitoring and quality prediction.In recent years, resistance welding quality monitoring techniques based on process data became an area of research interest, and considerable progress was made [9].Maalouf and Barsoum [10] investigated the effects of welding parameters, such as electrode force, welding current, and welding time, on resistance spot welding nugget size and failure strength, using the kernel ridge regression (KRR) method; they found that welding current and time had the greatest impact, and that the improved algorithm reduced the mean square error compared with the least-squares method.Zamanzad et al. [11] used a deep neural network (DNN) model to predict the width of the fusion nucleus of a spot-welded joint and found that the DNN prediction ability was superior to models such as KNN, KStar, and SVM-eps.For neural networks, the expression between welding parameters and between weld quality is implicit, the choice of their initialisation parameters affects computational efficiency, and the prediction results are prone to overfitting when small sample data sets are used.
Based on predicted welding quality, and to further achieve its control, the process parameters need to be self-adjusting and self-optimising according to the predicted results.Traditional methods for the optimisation of welding process parameters mainly include response surface methodology [12,13] and analysis of variance [14].Zhao et al. [15] selected the optimal process parameters based on response surface methodology to obtain the required weld quality for small-scale resistance spot welding.Analysis of variance (ANOVA) was used to study the effect of micro resistance welding parameters on the weld quality of titanium alloys, and optimum process parameters were obtained [16].Although the response surface model can guarantee an optimal solution using a quadratic polynomial model and exact methods (such as the simplex method), it may easily become trapped in a local optimum and fail to solve non-deterministic polynomial-time hardness problems within a reasonable time, when it is faced with highly nonlinear processes and complex problems [17,18].
With the rapid development of modern testing technology, intelligent control technology, and artificial intelligence technology, research on welding quality prediction and process parameter optimisation based on process data developed in the direction of information diversification and algorithm intelligence.Based on the Taguchi method of establishing small sample data sets, Dhawale et al. [19] modelled the relationship between welding process parameters (welding current, welding pressure, sample thickness, number of weld joints, and spacing of weld joints) and tensile shear strength using a regression equation and a particle swarm optimisation method.The maximum deviation between the experimental and optimised results was 0.571741%.Yang et al. [20] combined Kriging with the NSGA-II algorithm to predict and optimise the weld quality and process parameters for laser-EM hybrids; the experimental results showed that this method could reduce the generation of weld defects using a small sample data set.
In summary, the method proposed in the above literature is reliable, and the swarm intelligence optimisation algorithm was used to optimise process parameters for a variety of welding types, such as resistance spot welding (RSW), laser-magnetic hybrid welding (LMW), and gas tungsten arc welding (GTAW) [21], to address practical engineering issues such as non-destructive testing of weld quality, enhancement of mechanical properties, and reduction of welding defects, but there are certain limitations.When predicting welding quality, neural network prediction of multiple welding quality indicators is prone to overfitting phenomena, and the regression model requires that multiple welding quality indicators be combined into a single integrated welding quality indicator for prediction; however, it cannot accurately reflect the relationship between the specific process parameters and welding quality.Moreover, there are few reports relating to the use of regression models to predict multiple indicators simultaneously and solve the generalisation problem of small samples.On the other hand, nugget geometry in weld quality is directly related to tensile shear load.When the nugget size is increased, the tensile shear load first rises; however, after reaching the maximum strength, the increase in nugget size then results in a decrease in the tensile shear load, which may lead to welding defects.At the same time, the quality of the weld is related to the welding voltage and time [22].It is a difficult technique to guarantee the diameter consistency of two nuggets and to obtain a sufficiently large tensile shear load in single-sided double-joint welding, but few people studied this.
There are limited published data on the application of RSW in the manufacture of power lithium battery packs.In this paper, to address the above issues, a single-sided double-point welding process experiment is carried out on copper-nickel plate material, commonly used in lithium batteries, and welding quality prediction and process optimisation for multivariable outputs in a small sample welding test space are studied.First, a combination of the chaos game optimisation algorithm (CGO) [23] and the multi-output least-squares support vector regression machine (MLSSVR) model [24,25] is proposed.The MLSSVR model was used to establish the characteristic relationship between the process parameters and the quality of welded joints, and the hyperparameters of MLSSVR were optimally sought using the CGO optimisation algorithm.Next, a particle swarm algorithm was used to study the optimisation method of process parameters under multiobjective conditions, and the predicted values in the objective function of the particle swarm optimisation algorithm were provided by the CGO-MLSSVR model.The reliability of the PSO optimisation algorithm was then demonstrated by experimentally verifying the weld quality under optimal process parameters and, finally, comparing the comprehensive performance of CGO-MLSSVR to the conventional MLSSVR and GRNN neural network models.

Proposed Approach
In this thesis, the CGO-MLSSVR method for solving the welding quality prediction problem and a particle swarm method for optimising the process parameters are proposed; the implementation of the specific methods is described below.

CGO-MLSSVR Prediction Model
Support vector regression, which is widely used in prediction tasks for small sample data, produces a better generalisation ability and can solve the dimensional catastrophe problem.By introducing kernel functions, SVR effectively solves the nonlinearity problem [26].To solve the problem of accurate prediction with multiple inputs and multiple outputs in a small sample, the multi-output least squares support vector regression model was used.The multi-output least squares support vector regression prediction model needs to determine three parameters θ = {γ, λ, ε}; the values of these parameters have a significant impact on the prediction accuracy of the model, where γ and λ are positive real regularisation parameters.The optimal parameter θ for MLSSVR is obtained by the CGO method.The flow chart for the CGO-MLSSVR prediction method is shown in Figure 1.The following set of samples is used: {(X i , y i )} l i=1 with X i ∈ R d and y i ∈ R m .Due to the large difference in the order of magnitude between the welding process parameters X i (welding voltage 1,welding voltage 2,welding time 1,welding time 2,cooling time, slow rise time, and slow drop time) and the welding quality indicators Y i (positive electrode nugget diameter, negative electrode nugget diameter, and tensile shear load), the data are first normalised to map the same dimension to [0, 1] to fit the calculations.Next, the normalised data are divided into training data and test data, and the relevant parameters of the MLSSVR and CGO algorithms are initialised.The CGO algorithm is used to continuously perform the adjustment of various parameter combinations to optimise the training MLSSVR model until the maximum number of iterations is reached.Finally, the MLSSVR model is trained under the optimal hyperparameters θ* and the test data are used to predict the weld quality results and renormalise the predicted results.The regression function for the MLSSVR model is shown in Equation (1), the kernel function of the radial basis function (RBF) is adopted, the formula is Equation (2), and the fitness function for CGO is shown in Equation (3).
where y i is the predicted value of the MLSSVR model, α* is a vector consisting of Lagrange multipliers, b* is the bias amount, ε is the coefficient of the kernel function, y i is the true value of the weld quality, and n is the number of samples.
where i y is the predicted value of the MLSSVR model, α* is a vector consisting of Lagrange multipliers, b* is the bias amount, ε is the coefficient of the kernel function, i y is the true value of the weld quality, and n is the number of samples.

Multi-Objective Particle Swarm Optimisation Algorithm
The basic core of the particle swarm algorithm is to obtain the optimal solution to the problem to be optimised by using information sharing among individuals in the population [27,28].A population of M particles in a D-dimensional search space is defined, with the position of the ith particle denoted by X i = (X i1 , X i2 , • • • , X id ), and the velocity denoted by V i = (V i1 , V i2 , • • • , V id ), where i = 1, 2, • • • , m. Particle i searches the current space based on the position X i and the velocity V i , for each particle.The individual extreme value P i = (p i1 , p i2 , • • • , p id ) and the historical best position P g = (p g1 , p g2 , • • • , p gd ) of the population are searched; the position and velocity of the iterated particles are updated according to Equations ( 4) and (5), and the optimal value after the tth iteration is derived from the fitness formula.
where w is the inertia weight, d = 1, 2, 3, • • • , D denotes the dimension corresponding to the particle, t is the number of current iterations, c 1 ,c 2 are the learning factors, and r 1 ,r 2 are the random numbers within [0, 1].
The first method for optimising the resistance spot welding process parameters is based on the principle that the larger the tensile shear load, the better the spot-welding quality within a reasonable range of nugget diameters.The objective function is shown in Equation ( 6).The second method gives a target value while constraining the nugget size; thus, the smaller the predicted value and the target value, the better the difference between the predicted tensile shear load y p and the actual target tensile shear y obj .The objective function of the particle swarm is shown in Equation (7).
fitness = y − y obj (7) Based on the CGO-MLSSVR model for optimising process parameters, Figure 2 shows the flow chart of the proposed integrated approach.
searched; the position and velocity of the iterated particles are updated according to Equations ( 4) and ( 5), and the optimal value after the tth iteration is derived from the fitness formula.
where w is the inertia weight, d = 1, 2, 3, ⋯, D denotes the dimension corresponding to the particle, t is the number of current iterations, 1 C , 2 C are the learning factors, and 1 r , 2 r are the random numbers within [0, 1].The first method for optimising the resistance spot welding process parameters is based on the principle that the larger the tensile shear load, the better the spot-welding quality within a reasonable range of nugget diameters.The objective function is shown in Equation ( 6).The second method gives a target value while constraining the nugget size; thus, the smaller the predicted value and the target value, the better the difference between the predicted tensile shear load   and the actual target tensile shear   .The objective function of the particle swarm is shown in Equation (7).
fitness max(y) Based on the CGO-MLSSVR model for optimising process parameters, Figure 2 shows the flow chart of the proposed integrated approach.

Materials
In this paper, N6 pure nickel and T2 copper, materials commonly used in lithium batteries, were selected as welding samples.The geometric dimensions and lap forms of the two welding samples are shown in Figure 3.To eliminate the oxide film on the surface of the welded specimen, acetone solvent degreasing and drying treatment are needed before welding.

Materials
In this paper, N6 pure nickel and T2 copper, materials commonly used in lithium batteries, were selected as welding samples.The geometric dimensions and lap forms of the two welding samples are shown in Figure 3.To eliminate the oxide film on the surface of the welded specimen, acetone solvent degreasing and drying treatment are needed before welding.

Experimental and Measurement Equipment
A copper-nickel sheet single-sided double-point resistance welding test schematic is shown in Figure 4a.The welding power supply uses a homemade variable polarity transistor-type resistance welding power supply with constant current, constant voltage, constant power, and mixed control mode.The power supply has a rated output current of 4 kA, a minimum control cycle of 10 μs, a variable polarity pulse output, and an output accuracy of ±1%.The power supply output is calibrated using a MIYACHI (Tokyo, Japan M,) MM410 resistance welding monitor.In this paper, the welding power supply using constant voltage control mode output and welding process power supply output voltage waveform are shown in Figure 4b, and the meaning of each segment is shown in Table 1.The welding head comprised a homemade parallel-gap pneumatic pressurised head, a pressure control range of 5 N-50 N, and a maximum stroke of 30 mm pneumatic pressurised head, with a 3 mm diameter chromium-zirconium-copper electrode.

Experimental and Measurement Equipment
A copper-nickel sheet single-sided double-point resistance welding test schematic is shown in Figure 4a.The welding power supply uses a homemade variable polarity transistor-type resistance welding power supply with constant current, constant voltage, constant power, and mixed control mode.The power supply has a rated output current of 4 kA, a minimum control cycle of 10 µs, a variable polarity pulse output, and an output accuracy of ±1%.The power supply output is calibrated using a MIYACHI (Tokyo, Japan M,) MM410 resistance welding monitor.In this paper, the welding power supply using constant voltage control mode output and welding process power supply output voltage waveform are shown in Figure 4b, and the meaning of each segment is shown in Table 1.The welding head comprised a homemade parallel-gap pneumatic pressurised head, a pressure control range of 5 N-50 N, and a maximum stroke of 30 mm pneumatic pressurised head, with a 3 mm diameter chromium-zirconium-copper electrode.
batteries, were selected as welding samples.The geometric dimensions and lap forms of the two welding samples are shown in Figure 3.To eliminate the oxide film on the surface of the welded specimen, acetone solvent degreasing and drying treatment are needed before welding.

Experimental and Measurement Equipment
A copper-nickel sheet single-sided double-point resistance welding test schematic is shown in Figure 4a.The welding power supply uses a homemade variable polarity transistor-type resistance welding power supply with constant current, constant voltage, constant power, and mixed control mode.The power supply has a rated output current of 4 kA, a minimum control cycle of 10 μs, a variable polarity pulse output, and an output accuracy of ±1%.The power supply output is calibrated using a MIYACHI (Tokyo, Japan M,) MM410 resistance welding monitor.In this paper, the welding power supply using constant voltage control mode output and welding process power supply output voltage waveform are shown in Figure 4b, and the meaning of each segment is shown in Table 1.The welding head comprised a homemade parallel-gap pneumatic pressurised head, a pressure control range of 5 N-50 N, and a maximum stroke of 30 mm pneumatic pressurised head, with a 3 mm diameter chromium-zirconium-copper electrode.In this paper, an AGX-10 kN electronic universal testing machine produced by Shimadzu Corporation of Japan was used to test the tensile shear load of the welded joints.The tester's effective tensile load range was 20 N-10 kN, with a loading speed of 5 mm/min.A WEIMI-322ES micrometer was used to measure the welded joints nugget diameter; its maximum optical magnification was 255 times the measuring instrument and its minimum linear accuracy was less than or equal to 6 µm.

Experimental Method Design
We used the orthogonal test method to optimise the welding process parameters.Using the trial-and-error method and a pre-test, an orthogonal test table of 7 factors and 4 levels of the minimum number of samples, shown in Table 2, was determined based on there being no welding defects, such as virtual welding, porosity, or crack.Table 2 shows parameter intervals; the design of experimental parameter combinations, with a minimum number of experiments; the completion of different combinations of spotwelding experiments; welding process parameters, and welding quality indicators.The results were analysed and processed to obtain the optimal process parameters.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.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 X contains 32 sample observations of 7 dimensions (WV1, WT1, CT, WV2, WT2, SRT, and SDT) and the output vector Y contains 32 sample observations of 3 dimensions (PEND, NEND, and TSL).The Pearson correlation coefficient is defined as follows [30]: 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.The value of r is in the interval [-1, 1].When r = 1, X and Y have a completely pos correlation.When r = 0, the linear correlation between X and Y is not obvious.Whe −1, X and Y have a completely negative correlation.
Combining Table 3 and Figure 5, the correlation between the welding process pa The value of r is in the interval [-1, 1].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.For the negative electrode diameter and welding time 1, the cooling time correlation is greater, the correlation coefficient being 0.31.The slow rise and slow fall times on the welding quality indicators are not correlated.

Weld Quality Prediction Based on the CGO-MLSSVR Model
The 32 sets of experimental data in Table 3 were first randomly sorted; the first 26 sets of data were selected as training data, and the last 6 sets of data were used as test data.The parameters of the initialised CGO-MLSSVR prediction model are shown in Table 4.After several rounds of debugging and training, the CGO-MLSSVR prediction model with the optimal hyperparameters θ = {−8.6925,−10, −3.5112} obtained higher accuracy prediction results.The CGO-MLSSVR training model was constructed with 26 sets of training data, where the relationships between welding voltage, welding time (WT(ms) =WT1 (ms) +WT2(ms)) and tensile shear load, and nugget diameter and tensile shear load, are shown in Figure 6, reflecting the variation of tensile shear load with welding process parameters (WV1, WV2, WT), and the correlation between tensile shear load and nugget diameter in weld quality.However, the welding voltage in Figure 6a in [2100, 2300], with a welding time in the range of [5.5, 6.5], presents a trend of reduced weld tensile shear load.In Figure 6b, the welding voltage in [2300, 2400], with a welding time in the range of [4,5], shows the welding tensile shear load to be significantly reduced.The reason for the reduction in weld tensile shear load is that the two stages of welding voltage and welding time in this range are not equal, and there is a polarity effect, resulting in two welding nugget diameters not of the same size; this, in turn, results in a smaller average nugget diameter and a reduction in tensile shear load.
In terms of the correlation of welding quality, Figure 6c shows that the overall tensile shear load increases with increasing nugget diameter (PEND or NEND), as observed along the X-axis or Y-axis.The nugget diameter required for this study should have been consistent.Combining X-axis and Y-axis analysis, when the positive electrode and negative electrode nugget diameters are within [−0.1, 0.1] of each other, the tensile shear load initially increases with increasing nugget diameter, and after reaching a peak, the tensile shear load decreases with increasing nugget diameter, indicating a complex non-linear relationship between tensile shear load and nugget diameter.The nugget diameter in-  The dependence of the tensile shear load on the input welding voltage parameter is illustrated in Figure 6: the tensile shear load is nonlinear in terms of the welding voltage, characterised by the absence of a consistent flat region and large fluctuations in the tensile shear load value from 130 N to 260 N. In general, the tensile shear load increases with the increase in welding time under the condition of a certain welding voltage.The tensile shear load increases with increasing welding voltage under the condition of a certain welding time.
However, the welding voltage in Figure 6a in [2100, 2300], with a welding time in the range of [5.5, 6.5], presents a trend of reduced weld tensile shear load.In Figure 6b, the welding voltage in [2300, 2400], with a welding time in the range of [4,5], shows the welding tensile shear load to be significantly reduced.The reason for the reduction in weld tensile shear load is that the two stages of welding voltage and welding time in this range are not equal, and there is a polarity effect, resulting in two welding nugget diameters not of the same size; this, in turn, results in a smaller average nugget diameter and a reduction in tensile shear load.
In terms of the correlation of welding quality, Figure 6c shows that the overall tensile shear load increases with increasing nugget diameter (PEND or NEND), as observed along the X-axis or Y-axis.The nugget diameter required for this study should have been consistent.Combining X-axis and Y-axis analysis, when the positive electrode and negative electrode nugget diameters are within [−0.1, 0.1] of each other, the tensile shear load initially increases with increasing nugget diameter, and after reaching a peak, the tensile shear load decreases with increasing nugget diameter, indicating a complex non-linear relationship between tensile shear load and nugget diameter.The nugget diameter increases but the tensile shear load decreases because, with the increase in welding voltage, excessive energy input to the nugget diameter increases, resulting in spatter, weld through, and other welding defects, so that the tensile shear strength decreases.
To verify the accuracy of the CGO-MLSSVR model, four sets of test data were selected for prediction; the relative errors of the prediction results and the experimental results are shown in Table 5, and the comparison of the results is shown in Table 7. From Table 5 and Figure 7, the average relative errors of the positive electrode nugget diameter, negative electrode nugget diameter, and tensile shear load obtained by the CGO-MLSSVR prediction model are 1.72%, 3.51%, and 2.34%, respectively.This indicates that the CGO-MLSSVR prediction model predicts the test samples as very close to the experimental values, and the model has high prediction accuracy and generalisation capability.There are three main reasons for the error.(1) The nugget diameter was measured by the WEIMI-322ES micrometer, and there was a certain measurement error between the measured value and the actual value, thus affecting the accuracy of the model training.(2) The MLSSVR model uses absolute error to represent the sample global error, and there was calculation error in the training model for the output variables.(3) In the small sample experimental space based on the orthogonal experimental method, the data information between the process parameters was ignored due to the large difference in values between the process parameters, thus affecting the training accuracy of the CGO-MLSSVR model.measured value and the actual value, thus affecting the accuracy of the model training.
(2) The MLSSVR model uses absolute error to represent the sample global error, and there was calculation error in the training model for the output variables.(3) In the small sample experimental space based on the orthogonal experimental method, the data information between the process parameters was ignored due to the large difference in values between the process parameters, thus affecting the training accuracy of the CGO-MLSSVR model.

Objective Optimisation Based on the Particle Swarm Algorithm
Based on the prediction model, the particle swarm optimisation algorithm was used to find the best welding process parameters.The objective of the optimisation problem was to set the required tensile shear load, positive electrode nugget diameter, and negative electrode nugget diameter to obtain the optimal process parameters.
The quality of weld joints can be classified according to the following criteria [31,32]: where, D is the critical nugget diameter and t is the thickness of the plate metal-in this paper, t = 0.2 mm; f is the weld porosity factor-f = l.0 means perfect weld quality, free of porosity and irregularity.The value of f was set to 0.8, taking into account the porosity and irregularity of the weld seam under real production conditions.The critical nugget diameter was approximately 0.8 mm.Therefore, the positive electrode nugget diameter and the negative electrode nugget diameter were both greater than or equal to 0.8 mm.
Through experiments, it was found that welding quality performs well when the nugget diameter is in the range of [0.8, 1.1], especially when the nugget diameter is 1 ± 0.1 mm and the maximum tensile shear load reaches 250 N. To reflect the particle swarm optimisation algorithm that can effectively optimise the process parameters, this paper used two methods to verify the effectiveness of the PSO algorithm.The optimisation problems of the two optimisation methods are shown in Table 6.

Objective Optimisation Based on the Particle Swarm Algorithm
Based on the prediction model, the particle swarm optimisation algorithm was used to find the best welding process parameters.The objective of the optimisation problem was to set the required tensile shear load, positive electrode nugget diameter, and negative electrode nugget diameter to obtain the optimal process parameters.
The quality of weld joints can be classified according to the following criteria [31,32]: where, D is the critical nugget diameter and t is the thickness of the plate metal-in this paper, t = 0.2 mm; f is the weld porosity factor-f = l.0 means perfect weld quality, free of porosity and irregularity.The value of f was set to 0.8, taking into account the porosity and irregularity of the weld seam under real production conditions.The critical nugget diameter was approximately 0.8 mm.Therefore, the positive electrode nugget diameter and the negative electrode nugget diameter were both greater than or equal to 0.8 mm.Through experiments, it was found that welding quality performs well when the nugget diameter is in the range of [0.8, 1.1], especially when the nugget diameter is 1 ± 0.1 mm and the maximum tensile shear load reaches 250 N. To reflect the particle swarm optimisation algorithm that can effectively optimise the process parameters, this paper used two methods to verify the effectiveness of the PSO algorithm.The optimisation problems of the two optimisation methods are shown in Table 6.Table 6.Two optimisation methods.

Object
Maximise TSL TSL = 230 N Subject to 0.8 mm ≤ PEN, NEN ≤ 0.9 mm To balance the search capability and computation of the particle swarm algorithm, the initial settings of the particle swarm were as shown in Table 7.In Method I, the maximum tensile shear load for nugget diameters in the ranges of [0.8, 0.9] and [1, 1.1] was proposed.The best process parameters obtained under this method were {2173, 2, 2, 2100, 3.5, 0.2, 0.8} and {2400, 3.5, 0.2, 2300, 3.5, 0.4, 0.5}, corresponding to the predicted weld quality (PEND, NEND, TSL) of {0.8771, 0.8508, 173.2029 } and {1.03, 1.01, 253.287N}.Specific experimental values and predicted values of the relative error are shown in Table 8, and the actual welding nugget diameter is shown in Figure 8.To balance the search capability and computation of the particle swarm algorithm, the initial settings of the particle swarm were as shown in Table 7.In Method I, the maximum tensile shear load for nugget diameters in the ranges of [0.8, 0.9] and [1, 1.1] was proposed.The best process parameters obtained under this method were {2173, 2, 2, 2100, 3.5, 0.2, 0.8} and {2400, 3.In Method II, the proposed tensile shear load was 230 N, and the nugget diameter was 1 mm in the case of the optimal set of parameters {2400, 3.5, 0.6, 2129, 3.5, 0.5, 0.3}.This set of parameters was used in two experiments; the results of each experiment, and their predicted results, are shown in Table 9.The welding results are shown in Figure 9.
From the validation experiments, (1) there is a certain amount of error in the regression model; the experimental value of the welding quality is usually higher than the predicted value but also lower than the predicted value.(2) In the comparison between the experimental value and the target value, the nugget diameter and tensile shear load are within 5% of the target.However, the performance of the nugget diameter is slightly deficient because of the constant voltage control mode of the welding power source.The welding current cannot be constant at a certain value: with the increase in the number of welds, the electrode surface wears, and the nucleus grows by a number of factors, thus affecting the size of the nucleus.(3) For the set welding quality indicators, although the optimal solution has defects in the nugget diameter, its welding effect met the In Method II, the proposed tensile shear load was 230 N, and the nugget diameter was 1 mm in the case of the optimal set of parameters {2400, 3.5, 0.6, 2129, 3.5, 0.5, 0.3}.This set of parameters was used in two experiments; the results of each experiment, and their predicted results, are shown in Table 9.The welding results are shown in Figure 9. From the validation experiments, (1) there is a certain amount of error in the regression model; the experimental value of the welding quality is usually higher than the predicted value but also lower than the predicted value.(2) In the comparison between the experimental value and the target value, the nugget diameter and tensile shear load are within 5% of the target.However, the performance of the nugget diameter is slightly deficient because of the constant voltage control mode of the welding power source.The welding current cannot be constant at a certain value: with the increase in the number of welds, the electrode surface wears, and the nucleus grows by a number of factors, thus affecting the size of the nucleus.(3) For the set welding quality indicators, although the optimal solution has defects in the nugget diameter, its welding effect met the requirements of lithium battery manufacturing.Especially when predicting tensile shear load, the accuracy of tensile shear load is more stringent in actual production.

Comparison of the Impact of Predictive Model Algorithms on Model Performance
To verify whether the introduction of CGO into the MLSSVR prediction model improved the predictive ability of the regression model, it was compared with the traditional MLSSVR model and the GRNN neural network model.For the parameter selection of the model, the traditional MLSSVR model uses the grid search method and the leave-one-out method for the hyperparameter search, the best hyperparameter being θ = {−5, −6, −3}.The GRNN selects the 10-fold cross-validated fitness value of 0.9 as the best fitness value after multiple debugging.In contrast, regression models and neural network models use the same training and test sets to predict the quality of welding.Specific results for the CGO-MLSSSVR, MLSSVR, and GRNN neural network models of the actual values and predicted values are shown in Figures 10 and 11

Comparison of the Impact of Predictive Model Algorithms on Model Performance
To verify whether the introduction of CGO into the MLSSVR prediction model improved the predictive ability of the regression model, it was compared with the traditional MLSSVR model and the GRNN neural network model.For the parameter selection of the model, the traditional MLSSVR model uses the grid search method and the leave-one-out method for the hyperparameter search, the best hyperparameter being θ = {−5, −6, −3}.The GRNN selects the 10-fold cross-validated fitness value of 0.9 as the best fitness value after multiple debugging.In contrast, regression models and neural network models use the same training and test sets to predict the quality of welding.Specific results for the CGO-MLSSSVR, MLSSVR, and GRNN neural network models of the actual values and predicted values are shown in Figures 10 and 11   From Figures 10 and 11, it can be seen that the prediction performance of CGO-MLSSVR is more consistent between the predicted and experimental values and demonstrates the best prediction ability.The average relative errors of CGO-MLSSVR and MLSSVR are 2.6% and 3.6%, respectively, in predicting the nugget diameter, while the From Figures 10 and 11, it can be seen that the prediction performance of CGO-MLSSVR is more consistent between the predicted and experimental values and demonstrates the best prediction ability.The average relative errors of CGO-MLSSVR and MLSSVR are 2.6% and 3.6%, respectively, in predicting the nugget diameter, while the average relative error of GRNN is 7.72%; the prediction performances of CGO-MLSSVR and MLSSVR are, therefore, significantly better than that of the GRNN neural network.In terms of predicting tensile shear load, all three prediction models have different degrees of deviation, but the error of the GRNN prediction model is greater, while those CGO-MLSSVR and MLSSVR are similar to each other.
To accurately analyse and compare the performance of different prediction models, the evaluation criteria for the models were selected as RMSE, MAE, and MAPE; the comparison results are shown in Table 10.From Table 10, it can be seen that the performance of the CGO-MLSSVR prediction model proposed in this paper is higher than that of the traditional MLSSVR and GRNN prediction models in terms of RMSE, MAE, and MAPE.In terms of model analysis, the traditional MLSSVR model uses the grid search method to obtain hyperparameters, but it is affected by the search range and search step, which easily falls into the local optimum, thus reducing the MLSSVR training and prediction ability.The GRNN model itself has a certain error, and the sample data obtained from the welding test are small; this prevents large-scale learning, making the GRNN neural network prediction performance weaker.The CGO-MLSSVR prediction model has a better global search and prediction ability in small-scale sample data to compensate for the lack of large sample data in the grid search method and neural network, meaning that CGO-MLSSVR has the best prediction performance among the three models.
Our results are comparable with the state-of-the-art literature.The literature [33] uses the powerful non-linear mapping capability of the Kriging algorithm to predict nugget diameters.The maximum relative error between the predicted and actual values of this model is about 8.7%, and the maximum relative error of the nugget diameter in this paper is 6.86%.The Bayes-XGBoost algorithm [34] was used to predict the resistance spot welds: the experiments showed that the nugget diameter MAE was 0.0151 and the tensile shear load RMSE was 1.835, slightly better than the method proposed in this paper.The literature [35] used the LLE technique to predict the nugget diameter and the results showed a maximum absolute error of 0.218 mm with RMSE, MAE, and MAPE being 0.0308, 0.078, and 4.6%, respectively.In this thesis, the results show a maximum absolute error of 0.0621 mm, and the average nugget diameter RMSE, MAE, and MAPE are 0.0315, 0.025, and 2.62%, respectively.Therefore, the method proposed in this paper is close to the results of the methods found in the literature above, indicating that CGO-MLSSVR has great predictive performance and generalisation in small sample datasets.

Conclusions
The relationship between the welding process parameters (WV1, WT1, CT, WV2, WT2, SRT, and SDT) and welding quality (PEND, NEND, and TSL) was established through the CGO-MLSSVR model.The experimental results show that the positive electrical and

Figure 2 .
Figure 2. Flow chart of the PSO optimisation process parameters.

Figure 2 .
Figure 2. Flow chart of the PSO optimisation process parameters.

Figure 3 .
Figure 3. Geometry of the welded specimens.

Figure 3 .
Figure 3. Geometry of the welded specimens.

Figure 3 .
Figure 3. Geometry of the welded specimens.

Figure 6 .
Figure 6.Correlation of welding process parameters and nugget diameter with tensile shear load.(a) Relationship between WV1 and WT on TSL; (b) Relationship between WV2 and WT on TSL; (c) Relationship between PEND and NEND on TSL.

Figure 6 .
Figure 6.Correlation of welding process parameters and nugget diameter with tensile shear load.(a) Relationship between WV1 and WT on TSL; (b) Relationship between WV2 and WT on TSL; (c) Relationship between PEND and NEND on TSL.

Figure 7 .
Figure 7.Comparison of predicted values and experimental values.(a) PEND of comparison chart; (b) NEND of comparison chart; (c) TSL of comparison chart.

Figure 7 .
Figure 7.Comparison of predicted values and experimental values.(a) PEND of comparison chart; (b) NEND of comparison chart; (c) TSL of comparison chart.

Figure 10 .
Figure 10.Comparison of the accuracy of the predicted nugget diameter of different models.(a) CGO-MLSSVR prediction model; (b) MLSSVR prediction model; (c) GRNN prediction model.

4. 4 .
Comparison of the Impact of Predictive Model Algorithms on Model PerformanceTo verify whether the introduction of CGO into the MLSSVR prediction model improved the predictive ability of the regression model, it was compared with the traditional MLSSVR model and the GRNN neural network model.For the parameter selection of the model, the traditional MLSSVR model uses the grid search method and the leave-one-out method for the hyperparameter search, the best hyperparameter being θ = {−5, −6, −3}.The GRNN selects the 10-fold cross-validated fitness value of 0.9 as the best fitness value after multiple debugging.In contrast, regression models and neural network models use the same training and test sets to predict the quality of welding.Specific results for the CGO-MLSSSVR, MLSSVR, and GRNN neural network models of the actual values and predicted values are shown in Figures10 and 11 .

Figure 10 .
Figure 10.Comparison of the accuracy of the predicted nugget diameter of different models.(a) CGO-MLSSVR prediction model; (b) MLSSVR prediction model; (c) GRNN prediction model.

Figure 11 .
Figure 11.Comparison of the accuracy of the predicted tensile shear load of different models.(a) CGO-MLSSVR prediction model; (b) MLSSVR prediction model; (c) GRNN prediction model.
first normalised to map the same dimension to [0, 1] to fit the calculations.Next, the nor-malised data are divided into training data and test data, and the relevant parameters of the MLSSVR and CGO algorithms are initialised.The CGO algorithm is used to continuously perform the adjustment of various parameter combinations to optimise the training MLSSVR model until the maximum number of iterations is reached.Finally, the MLSSVR model is trained under the optimal hyperparameters θ* and the test data are used to predict the weld quality results and renormalise the predicted results.The regression function for the MLSSVR model is shown in Equation (1), the kernel function of the radial basis function (RBF) is adopted, the formula is Equation (2), and the fitness function for CGO is shown in Equation (3).

Table 1 .
Meaning of voltage waveform segmentation.

Table 1 .
Meaning of voltage waveform segmentation.

Table 1 .
Meaning of voltage waveform segmentation.

Table 2 .
Copper-nickel single-sided double-joint welding orthogonal experimental factor level table.

Table 3 .
L 32 orthogonal experiments and the corresponding experimental results.

Table 5 .
The accuracy of the established CGO-MLSSVR model.

Table 7 .
Initial value of the PSO.

Table 8 .
Method I verification of relative error.

Table 7 .
Initial value of the PSO.

Table 8 .
Method I verification of relative error.

Table 9 .
Method II verification of relative error.

Table 9 .
Method II verification of relative error. NO.

Table 9 .
Method II verification of relative error.

Table 10 .
Comparison results for different models.