# Embedded Artificial Neuval Network-Based Real-Time Half-Wave Dynamic Resistance Estimation during the A.C. Resistance Spot Welding Process

Authors: Liang Gong; Yan Xi; Chengliang Liu
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

Online monitoring of the instantaneous resistance variation during the A.C. resistance spot welding is of paramount importance for the weld quality control. On the basis of the welding transformer circuit model, a new method is proposed to measure the transformer primary-side signal for estimating the secondary-side resistance in each 1/4 cycle. The tailored computing system ensures that the measuring method possesses a real-time computational capacity with satisfying accuracy. Since the dynamic resistance cannot be represented via an explicit function with respect to measurable parameters from the primary side of the welding transformer, an offline trained embedded artificial neural network (ANN) successfully realizes the real-time implicit function calculation or estimation. A DSP-based resistance spot welding monitoring system is developed to perform ANN computation. Experimental results indicate that the proposed method is applicable for measuring the dynamic resistance in single-phase, half-wave controlled rectifier circuits.


---

## Body

## 1. Introduction

The resistance spot welding (RSW) manufacturing process is one of the most widely used, inexpensive, and efficient material joining processes in the automobile industry. Although MFDC inverter has been proposed for RSW in recent years, Alternating Current (A.C.) spot welding maintains its predominant status in body-in-white (BiW) assembly due to its low-cost installation, sufficient use, and easy integration of the existing infrastructure. However, consistent quality of welds produced by A.C. RSW cannot be guaranteed due to a number of reasons including workpiece thickness and material ingredient variations, surface coatings, assembly structure, workpiece fit-up conditions, and complex electrode abrasion phenomena. Fortunately, the dynamic resistance during the welding process acts as an essential indicator to recognize the working conditions [1], reflect the nugget growth [2–4] and its geometry [5], identify welding splash [6], enhance the control performance [7], and represent the weld quality [8]. It is, therefore, valuable to have an insight into the dynamics of nugget resistance during welding, and the dynamic resistance measurement is a key factor to success, especially in a real-time fashion [9].The dynamic resistance can be obtained by measuring the welding current and electrode tip voltage. The measuring setup normally interferes with the movement of electrode and reduces the system reliability, which is not endurable in the automated welding production line. To avoid these constraints, Cho and Rhee [10, 11] advocated that the dynamic resistance could be calculated according to a conversion model based on the primary side acquired current and voltage signal. The dynamic resistance is monitored in the primary circuit of the A.C. welding machine in each cycle, thus the required measuring apparatus will not interfere with the operation. However, this measuring method lacks the real-time ability due to the fact that the dynamic resistance is obtained each cycle where the control-oriented dynamic resistance measurement is desired in 1/4 cycle.This paper presents an embedded artificial neural network (ANN)-based approach for measuring the half-wave dynamic resistance in 1/4 cycle at the primary side of the welding machine, which paves the way for a high-performance real-time control to track a desired resistance variation curve (reference dynamic resistance) during the welding process to assure uniform quality of the weld joint regardless of welding condition variation.The organization of this paper is as follows. Section2 develops an electrical model for the subsequent analysis and calculation, in which the dynamic resistance is modeled in the primary circuit. Section 3 presents an embedded ANN-based method to calculate the dynamic resistance parameter. Section 4 introduces a sensing device which is particularly suitable for the application of measurement, describes the experimental setup, and provides the analysis of the experimental results. Section 5 concludes the paper.


## 2. Electrical Modeling for the RSW Process

The single-phase A.C. welding machine has an A.C. voltage source, which is connected in series with a pair of antiphase Silicon Controlled Rectifier (SCRs) to the primary circuit of a step-down welding transformer. Each SCR is a diode whose firing angleα (i.e., the phase difference between the line voltage zero-crossing and the SCR turn-on) can be controlled by applying a trigger pulse of a sufficient duration to achieve a suitable welding current.


### 2.1. Electrical Model for the Welding Circuit

Ignoring the SCR forward resistance and variations of transformer permeability, Figures1 and 2 present a simplified circuit schematic diagram of the welding machine and its equivalent circuit via an impedance conversion from the secondary side of the transformer to the primary side [10, 12].Figure 1
Equivalent welding circuit including a practical transformer.Figure 2
Equivalent welding machine circuit via impedance conversion.Assume that the SCR is to be on at the timet=0 and the corresponding firing angle is to be α. Thus, the loop equation can be written as
(1)u(t)=Ledi(t)dt+Rei(t)=2Usin(ωt+α),
where u denotes the instantaneous voltage applied on the load, i denotes the instantaneous current, and U is effective value of the main voltage; Le is the equivalent inductive reactance; Re is the equivalent resistance.A general solution to (1) is obtained as
(2)i(t)=2UZ[sin(ωt+α-φ)-e-ωt/tanφsin(α-φ)],
where Z=Re2+(ωLe)2,φ=arctan(ωLe/Re).Equation (2) illustrates that the current going through the SCR consists of the forced component i1 and the free component i2 as following:
(3)i1=2UZsin(ωt+α-φ),i2=2UZe-(ωt/tanφ)sin(α-φ),
where i1 is the steady-state term per sinusoidal waveform, and i2 is a transient term per exponential form with the decay time constant τ=Le/Re=tanφ/ω. i1 and i2 constitute the actual current passing through the SCR.According to (2), we can obtain (4) given below for ωt=γ when the welding current reaches its maximum value and its derivative is equal to zero.
(4)tan(α-φ)=cosγtanφsinγtanφ-exp(-γ/tanφ).


### 2.2. Dynamic Resistance Measuring Model from the Primary Circuit

According to (2), the equivalent resistance in both primary and secondary circuits can be obtained as
(5)Re=ωLetanφ.For real application, short circuit test (welding operation without workpiece) can be performed with the firing angle preset as zero, in this case the measured firing angle is equal to the power factor angle. Hereby, the power factor angle is recognized asφ0, and the visual equivalent resistance is denoted as R0. 								(6)R0=ωLetanφ0.When theR0 under the short circuit condition is directly measured from the secondary side by the acquired tip voltage and secondary welding current, the dynamic resistance for the subsequent welding operation is calibrated. And the relationship between the short circuit resistance and the arbitrary welding resistance is given by
(7)Re=ωLetanφ=R0·tanφ0tanφ=K0·ctanφ,
where K0=R0tanφ0 is a premeasured and calculated constant before online computing Re.According to (7), the dynamic resistance measuvement is converted into that of the power factor angle. From (4), we can also obtain the relationship between α, γ, and φ which may be denoted in the form of (8), even though φ cannot be expressed analytically in terms of α and γ.
(8)ctanφ=Φ(α,γ).In this work, it is valid to construct an ANN mapping fromα,γ onto ctanφ since it can approximate the implicit surfaces. In fact, we may assign incremental values for φ ranging from 25° to 85° with 5° interval and γ ranging from 10° to 89.5° with 0.5° interval in (4) and get the corresponding α array, which can be presented in Figure 3.Figure 3
Relation amongα, γ, and φ.Furthmover, we have all the parametersα, γ, and ctanφ to form a tuplet. As such, we finally obtain α, λ, and ctanφ arrays with 13 × 160 elements, respectively, as shown in Figure 4.Figure 4
Relation amongα, γ, and ctanφ.


## 2.1. Electrical Model for the Welding Circuit

Ignoring the SCR forward resistance and variations of transformer permeability, Figures1 and 2 present a simplified circuit schematic diagram of the welding machine and its equivalent circuit via an impedance conversion from the secondary side of the transformer to the primary side [10, 12].Figure 1
Equivalent welding circuit including a practical transformer.Figure 2
Equivalent welding machine circuit via impedance conversion.Assume that the SCR is to be on at the timet=0 and the corresponding firing angle is to be α. Thus, the loop equation can be written as
(1)u(t)=Ledi(t)dt+Rei(t)=2Usin(ωt+α),
where u denotes the instantaneous voltage applied on the load, i denotes the instantaneous current, and U is effective value of the main voltage; Le is the equivalent inductive reactance; Re is the equivalent resistance.A general solution to (1) is obtained as
(2)i(t)=2UZ[sin(ωt+α-φ)-e-ωt/tanφsin(α-φ)],
where Z=Re2+(ωLe)2,φ=arctan(ωLe/Re).Equation (2) illustrates that the current going through the SCR consists of the forced component i1 and the free component i2 as following:
(3)i1=2UZsin(ωt+α-φ),i2=2UZe-(ωt/tanφ)sin(α-φ),
where i1 is the steady-state term per sinusoidal waveform, and i2 is a transient term per exponential form with the decay time constant τ=Le/Re=tanφ/ω. i1 and i2 constitute the actual current passing through the SCR.According to (2), we can obtain (4) given below for ωt=γ when the welding current reaches its maximum value and its derivative is equal to zero.
(4)tan(α-φ)=cosγtanφsinγtanφ-exp(-γ/tanφ).


## 2.2. Dynamic Resistance Measuring Model from the Primary Circuit

According to (2), the equivalent resistance in both primary and secondary circuits can be obtained as
(5)Re=ωLetanφ.For real application, short circuit test (welding operation without workpiece) can be performed with the firing angle preset as zero, in this case the measured firing angle is equal to the power factor angle. Hereby, the power factor angle is recognized asφ0, and the visual equivalent resistance is denoted as R0. 								(6)R0=ωLetanφ0.When theR0 under the short circuit condition is directly measured from the secondary side by the acquired tip voltage and secondary welding current, the dynamic resistance for the subsequent welding operation is calibrated. And the relationship between the short circuit resistance and the arbitrary welding resistance is given by
(7)Re=ωLetanφ=R0·tanφ0tanφ=K0·ctanφ,
where K0=R0tanφ0 is a premeasured and calculated constant before online computing Re.According to (7), the dynamic resistance measuvement is converted into that of the power factor angle. From (4), we can also obtain the relationship between α, γ, and φ which may be denoted in the form of (8), even though φ cannot be expressed analytically in terms of α and γ.
(8)ctanφ=Φ(α,γ).In this work, it is valid to construct an ANN mapping fromα,γ onto ctanφ since it can approximate the implicit surfaces. In fact, we may assign incremental values for φ ranging from 25° to 85° with 5° interval and γ ranging from 10° to 89.5° with 0.5° interval in (4) and get the corresponding α array, which can be presented in Figure 3.Figure 3
Relation amongα, γ, and φ.Furthmover, we have all the parametersα, γ, and ctanφ to form a tuplet. As such, we finally obtain α, λ, and ctanφ arrays with 13 × 160 elements, respectively, as shown in Figure 4.Figure 4
Relation amongα, γ, and ctanφ.


## 3. ctanφ Calculation with an Embedded ANN

An ANN is a collection of simple processing units, mutually interconnected with weights assigned to the connections. By modifying the connecting weights according to certain learning rules, the ANN can be trained to recognize any pattern given the training data. With the data set generated from the simulation in Section2, the training process of ANN model will cover almost the entire sample space to ensure the model’s generalization capability. The well-trained network can be employed for online calculation.A three-layer BP network could be trained to approximate any continuous nonlinear functions with arbitrary precision. Hence, a BP NN is constructed to effectively fit the function represented by (8). Parameters α and γ are selected as the network inputs and ctanφ as the network output and two hidden layers containing 20 and 30 neural nodes, respectively, are employed to form a 2×20×30×1 network topology, as shown in Figure 5. This structure ensures a trade-off between the ANN model precision and computational complexity. Subsequently, a high-performance Error Back Propagation (EBP) training algorithm [13] is employed for fitting the function (8).Figure 5
The BP NN topology architecture.The simulation data generated in part B, Section2 are used to train and validate the ANN. The data set consists of 2080 (13 × 160) network input-output pairs and can be divided into two parts. Part one includes 1500 randomly selected pairs used to train the neural network. Part two includes the remaining 580 pairs which are employed to validate the generalization of the network. The network converges when trained by the proposed training algorithm. The generalization test results indicate that the mean square error of ctanφ is less than 0.001 and the maximum error of ctanφ is about 0.004. These two indexes guarantee that the network can satisfy the application requirement perfectly.Also, it is worth mentioning that the ANN need not be re-trained for different types of welding machines and different welding materials. These differences just lead to various impedances in the electrical circuit; for example, the welding machine with larger arm length has a relatively larger inductive reactance and the aluminum weldment has a lower resistance than the low-carbon steel. However, there exists a fixed relationship betweenα, γ, and ctanφ. Therefore, it is reasonable to bring up that the network can succeed with all scenarios.


## 4. Implementation and Experimental Results

Sincectanφ is time-variant during the whole RSW process, we calculate it in each half-wave so as to reveal its dynamic feature. The real-time calculation of ctanφ requires the following information: the preset firing angle α of each half-wave and the current peak angle γ. Viewed from each half-wave, the firing angle may be regarded as a controllable parameter. Hence, we can focus on the measurement of the peak angle γ.


### 4.1. Experimental Setup

A resistance spot welding monitoring and control system has been developed to conduct experiments on the welding machine platform of OBARA (ST21). Figures6 and 7 show the primary and secondary measuring apparatus, respectively. Note that the secondary side dynamic resistance measuring apparatus is just for the verification purpose and will be removed before putting it into real application.Figure 6
Primary measuring apparatus.Figure 7
Secondary measuring apparatus.The training results of the network mentioned in Section3, matrices of the neuron connection weights, and biases can be programmatically embedded into the digital signal processor (DSP) to perform online calculation of the ctanφ. The TMS320LF2407 DSP is selected to execute the ANN computation because of its low cost and unique structure. The DSP controller has separate buses for instructions and data which allow simultaneous access of the program and data, and overlapping of some operations for an increased process performance. The DSP pipeline’s operation can accelerate its instruction executions, and thus it caters for rapidly multiplying/accumulating operations of the neural network computation. Therefore, when implemented in hardware, the ANN runs orders of magnitude faster than software simulations. The processor adaptive calculation has a superior behavior.


### 4.2. Measurement of the Current Peak Angleγ

The Rogowski loop has a much lower cost and better performance compared to the traditional sensing system like Hall-effect current sensor and current transformer. It can generate and output the current derivative signal whose zero-crossing points correspond to the current peak points [14]. A Rogowski loop sensor is adopted in our experimental setup to acquire the current peak angle. The schematic view of the resistance spot welding monitoring and control system is shown in Figure 8. And Figure 9 shows the phase relation of the acquired signals, where channel 1 is the original welding current waveform and channel 2 is the current derivative signal from the Rogowski loop. Actually, the phase difference between the two signals is nothing more than the current peak angle. Hence, we can obtain the current peak angle easily if the current zero-crossing point and the current derivative point in each half-wave are recorded.Figure 8
Schematic diagram of the experimental system for the RSW.Figure 9
Phase relation between the welding current and its derivative.


### 4.3. Experimental Results

The experiment has two steps. The first step is to measure and calibrate the measuring system with a short circuit welding experiment. The second step is to validate the proposed algorithm via comparing the actual measured secondary dynamic resistance and that calculated from the primary side.Preset a constant firing angleα=90∘ for 16 cycles, and then measure the values of φ (and ctanφ) and dynamic resistance, respectively, denoted as R0 and φ0 for future use.The single-overlap shear samples, 1 mm + 1 mm low-carbon steel plates, are prepared for 16-cycle (32 half-cycles) welding with a constant 7500 A effective welding current. Figure10 shows that when the correlation effect is taken into consideration, the dynamic resistance R1 estimated by the proposed algorithm is almost identical to the measurement R2 from the secondary side, which indicates that the proposed ANN-based method is feasible. The comparison shows that the average deviation between R1 and R2 is 9.5% and the difference could be minimized via a filtering technique to achieve a satisfactory accuracy requirement.Figure 10
Comparasion between the primary- and secondary dynamic resistances.


## 4.1. Experimental Setup

A resistance spot welding monitoring and control system has been developed to conduct experiments on the welding machine platform of OBARA (ST21). Figures6 and 7 show the primary and secondary measuring apparatus, respectively. Note that the secondary side dynamic resistance measuring apparatus is just for the verification purpose and will be removed before putting it into real application.Figure 6
Primary measuring apparatus.Figure 7
Secondary measuring apparatus.The training results of the network mentioned in Section3, matrices of the neuron connection weights, and biases can be programmatically embedded into the digital signal processor (DSP) to perform online calculation of the ctanφ. The TMS320LF2407 DSP is selected to execute the ANN computation because of its low cost and unique structure. The DSP controller has separate buses for instructions and data which allow simultaneous access of the program and data, and overlapping of some operations for an increased process performance. The DSP pipeline’s operation can accelerate its instruction executions, and thus it caters for rapidly multiplying/accumulating operations of the neural network computation. Therefore, when implemented in hardware, the ANN runs orders of magnitude faster than software simulations. The processor adaptive calculation has a superior behavior.


## 4.2. Measurement of the Current Peak Angleγ

The Rogowski loop has a much lower cost and better performance compared to the traditional sensing system like Hall-effect current sensor and current transformer. It can generate and output the current derivative signal whose zero-crossing points correspond to the current peak points [14]. A Rogowski loop sensor is adopted in our experimental setup to acquire the current peak angle. The schematic view of the resistance spot welding monitoring and control system is shown in Figure 8. And Figure 9 shows the phase relation of the acquired signals, where channel 1 is the original welding current waveform and channel 2 is the current derivative signal from the Rogowski loop. Actually, the phase difference between the two signals is nothing more than the current peak angle. Hence, we can obtain the current peak angle easily if the current zero-crossing point and the current derivative point in each half-wave are recorded.Figure 8
Schematic diagram of the experimental system for the RSW.Figure 9
Phase relation between the welding current and its derivative.


## 4.3. Experimental Results

The experiment has two steps. The first step is to measure and calibrate the measuring system with a short circuit welding experiment. The second step is to validate the proposed algorithm via comparing the actual measured secondary dynamic resistance and that calculated from the primary side.Preset a constant firing angleα=90∘ for 16 cycles, and then measure the values of φ (and ctanφ) and dynamic resistance, respectively, denoted as R0 and φ0 for future use.The single-overlap shear samples, 1 mm + 1 mm low-carbon steel plates, are prepared for 16-cycle (32 half-cycles) welding with a constant 7500 A effective welding current. Figure10 shows that when the correlation effect is taken into consideration, the dynamic resistance R1 estimated by the proposed algorithm is almost identical to the measurement R2 from the secondary side, which indicates that the proposed ANN-based method is feasible. The comparison shows that the average deviation between R1 and R2 is 9.5% and the difference could be minimized via a filtering technique to achieve a satisfactory accuracy requirement.Figure 10
Comparasion between the primary- and secondary dynamic resistances.


## 5. Conclusion

Conventional measuring technique fails to detect the dynamic resistance at the primary side with a high real-time performance. In this paper, the ANN-based dynamic resistance measuring method was proposed to achieve better real-time performance during the resistance spot welding process. In conclusion, we have the following.(1)
The proposed method has a high real-time performance because it can calculate the dynamic resistance within each 1/4 cycle (5 ms) via a processor adaptive computational method.(2)
The proposed method is easy to use because its physical parameters are easy to acquire and sensitive to measure and the offline trained ANN can be embedded into the program as a matrix constant. The memory space for the proposed algorithm is less than 800 Bytes.(3)
Experimental results show that the general measurement error, including the modeling, computation, and parameter-measuring errors, is endurable. And it could be further reduced by using some filtering techniques, which implies that the method can be applied in resistance spot welding process for real-time fine control.



---

*Source: 862076-2013-09-04.xml*