Derivation of Analytical Expressions for Fast Calculation of Resistance Spot Welding System Currents

: The paper deals with the dynamics of a resistance spot welding system. At the core of this system is a transformer, which is powered on the primary side by a pulse-width modulated inverter and has a full-wave output recti ﬁ er on the secondary side that provides a direct welding current. The entire system is nonlinear, due to magnetic hysteresis and electronics. The electronics prevent the current from ﬂ owing in all parts of the welding transformer at separate time intervals during the voltage supply period; therefore, not all the parameters a ﬀ ect the dynamic of currents and voltages all the time so the system is also time-variant. To design a high-performance welding system and to predict the maximum possible welding current at a speci ﬁ c load, it is necessary to know the welding and primary currents. The leakage inductances of the system can reduce the maximum welding current signi ﬁ cantly at higher frequencies and the same load. There are several methods to determine these currents, each with its drawbacks. Measurements are time-consuming, using professional software is expensive and requires time to learn and free open-source software has many limitations and does not guarantee the correctness of the results. The article presents a new, fourth option—a theoretical derivation of analytical expressions that facilitate straightforward and rapid calculation of the welding and primary currents of the resistance spot welding system with symmetrical secondary branches. The derivation of the mathematical expressions is based on the equivalent circuits that describe the system in di ﬀ erent operating states. The results of the numerical simulations con ﬁ rmed the derived expressions completely.


Introduction
Resistance spot welding (RSW) systems are essential in metal joining processes in many industries, including the automotive [1], aerospace, train industry, and manufacturing sectors.It provides a reliable and efficient method for joining sheet metals, which is crucial for product structural integrity and safety.The RSW is a vital welding technique that has been considered the dominant process for joining sheet metals in many industries, due to its high production efficiency and adequacy for automated realization.Traditional RSW also has limitations when joining different materials is needed [2,3].Therefore, new variants of spot welding have been developed [4], such as laser spot welding, friction stir spot welding, and ultrasonic spot welding [5].The RSW for different materials such as aluminum, titanium, steel, and various alloys requires appropriate current control, welding time [6], clamp forces, and temperature [7][8][9] to ensure the adequate quality of the weld nugget.Zinc-coated steels can also impact the weld quality negatively [10].In the automotive industry, welding quality control is a critical topic.As a result, many new technologies have been developed for real-time quality control of the welding process [11][12][13][14][15][16].Some methods also consider welding electrode displacement [17,18].The welding electrodes are exposed to high temperatures and forces, which causes them to degrade over time; therefore, they must be replaced at specific intervals to prevent a negative impact on welding quality [19][20][21][22].
The RSW systems can be divided into two groups [23,24]: the systems in the first group provide an alternating welding current (AC) and the systems in the second group provide a direct welding current (DC).The welding systems with an AC current can provide only low welding currents due to low frequency (50 or 60 Hz), and, therefore, large and heavy welding transformers.The large and heavy transformer is inappropriate for mounting on a moving robot's arm in the automotive industry, and, therefore, can be used only in stationary applications.Another weakness of RSW systems with AC welding current is the low power factor due to high inductance and harmonic distortion [25].The high leakage inductances of the welding guns demand a DC welding current for high current applications, where the welding transformer with a full-wave rectifier mounted at the secondary is attached to the moving robot's arm.The welding transformer mounted on a robot's arm must be as light as possible to reduce the robot's power consumption and increase movement dynamics.The dimensions and weight of the transformer's iron core can be reduced drastically with a higher frequency of voltage supply.The standard middle-frequency RSW systems operate with a pulse width modulated (PWM) voltage supply with a switching frequency of 1 kHz.The transformer's iron core can be additionally reduced if, instead of diodes, a synchronous rectifier [26,27] is used to operate at high switching frequencies of 25 kHz.On the other hand, the high switching frequency also has a negative impact, due to high power losses on semiconductors and windings [28,29].Additionally, the higher switching frequency of the voltage supply decreases the maximum possible welding current at the same load, due to the leakage inductances and correspondent time constants of the RSW system [30].To design a high-performance welding system and to predict the maximum possible welding current at a specific load, it is necessary to know the welding and transformer's primary currents and their dynamics.These currents can be determined in several ways, each with its drawbacks.Measurements are time-consuming and require expensive measuring devices, which must be able to measure very high currents over 30 kA with a fast dynamic.Using professional software is also expensive and requires time to learn.The numerical calculations with software require appropriate solver settings to reduce numerical errors and achieve convergence.The free, open-source software has many limitations and does not guarantee the correctness of the results.The fourth, new option provided by this article is a theoretical derivation of analytical expressions that facilitate straightforward and rapid calculation of the welding and primary currents of the resistance spot welding system with symmetrical secondary branches.This is also the main goal and focus of this article.The derived analytical expressions for welding and primary current calculations can be implemented in any programming language.Moreover, the analytical expressions of welding and primary currents also provide a deep understanding of their dynamic behavior and the influence of the RSW system parameters on them; therefore, this article is very significant and important.
The high-power RSW systems used with a moving robot's arm consist of three main parts.The first part is the H-bridge inverter, with an integrated three-phase full-wave input rectifier that provides DC voltage to the inverter.The second part is a welding transformer, with an integrated full-wave rectifier mounted on the robot's arm.The welding transformer is separated from the inverter.Therefore, a long connecting cable is used to connect them, and its resistance and leakage inductance must be considered.The third part is the welding clamp or gun mounted on the end of the robot's arm, which delivers a high welding current from the output rectifier to the weld.All three parts of the RSW system can be represented as an equivalent circuit containing the voltage sources, ideal transformer model, equivalent resistances, and leakage inductances; the capacitances can be neglected.The diodes of the output rectifier can also be modeled as series-connected resistance and voltage sources.The entire RSW system is nonlinear, due to magnetic hysteresis and electronics (the transistors and diodes).The electronics prevent the current from flowing in all parts of the welding transformer at separate time intervals during the voltage supply period.Therefore, all the parameters do not always affect the dynamic behavior of the currents and voltages; for that reason, the RSW system is also time-variant, and three different equivalent circuits describe the dynamic of the welding and primary current in separate intervals of the voltage supply period.These three simplified equivalent circuits can be represented as series connected resistance and inductance with a step voltage supply; therefore, their currents can be described analytically as a step voltage response of a first-order system.These three relatively simple equations define the dynamic behavior of welding and primary currents of the RSW system in each time interval of the PWM voltage supply, as well as their time series.
This article is split into 5 sections.Section 2 describes the analyzed RSW system; all three main parts of the system are presented in detail.The modeling of the RSW system is presented in Section 3, where three equivalent circuits are shown, and the values are presented of the parameters for the analyzed RSW system.The PWM voltage supply of the inverter is explained, and analytical equations for welding and primary current are derived for each time interval of the one-and-a-half voltage supply period.Section 4 contains the obtained results.The analytically calculated time series of the welding and primary currents are compared with the numerically calculated time series in Simulink, and the differences are shown.Finally, in Section 5, the concluding remarks are presented, and suggestions are provided for implementing the analytical solution.

Description of the Resistance Spot Welding System
This article analyzes a 130 kVA resistance spot welding transformer, which is suitable for mounting on a moving robot arm.The industrial name of the transformer is PSG6130, and it can achieve a maximum continuous DC welding current of up to 6.5 kA at a 100% duty cycle or up to 30 kA for shorter welding times.The maximum welding DC current depends on many parameters, such as welding resistance, welding time, duty cycle, and coolant temperature.The primary voltage and frequency of the transformer are 530 V and 1000 Hz.The no-load output DC voltage is 8.9 V, and the transformer's turn ratio is 55:1.The weight of the welding transformer with an integrated full-wave rectifier is 15.1 kg.The water-cooling system of the transformer requires a nominal flow of 6 l/min and causes 0.6 bar differential pressure.
The iron core of the transformer has a nonlinear core saturation function, as shown in Figure 1.To calculate the welding and transformer's primary current analytically, it is essential to prevent the transformer's iron core from saturating.A linear iron core model of the transformer is considered in the circuit model.Therefore, all leakage inductances are constant, and not dependent on the transformer's primary and secondary currents.The saturation of the iron core is also not acceptable in real RSW transformers, due to its high primary current, which can trigger over-current protection during the welding process.The iron core losses are frequency-dependent, but relatively small compared to the copper losses in the transformer's primary and secondary windings and losses in the output rectifier.The iron core losses are reduced by selecting the appropriate material and lamination.The iron core is made of grain-oriented silicon steel (EILOR) with a thickness of 0.23 mm for operation at a frequency of 1 kHz.The iron core losses can be decreased further with thinner lamination of 0.1 mm thickness, which is typically used for operation at higher frequencies than 1 kHz.The iron core losses are not considered in the modeling of the welding transformer.The secondary winding of the welding transformer has only two turns; each is active in one-half period and is connected to a high-power diode.Both high-power diodes have the same characteristics and provide a high DC welding current at the output of the welding transformer.
A schematic presentation of the analyzed RSW system is shown in Figure 2  .The PWM supply voltage  is connected to the transformer's primary winding with a relatively long connection cable, whose resistance and leakage inductance cannot be neglected.In industry, the Hbridge inverter is located separately from the welding transformer mounted on the moving robot arm; therefore, the connection cable can be up to 30 m long.The welding transformer has a full-wave rectifier mounted on the secondary, providing high DC welding current to the welding clamps.

Modeling of the RSW System
To calculate the welding and transformer's primary current of the RSW system analytically, the system's separate parts need to be modeled as equivalent circuits.Individual parts can be modeled as equivalent circuits with ideal resistance, inductance, and capacitance, but high-power RSW systems are physically larger and heavier.Therefore, the resistances and leakage inductances prevail over capacitances, which can be neglected.Not considering the capacitances of the RSW system is an important simplification that allows the RSW system to be described as a series of connected resistances and leakage inductances, presenting a first-order system that can be described analytically.
The circuit model of the RSW system is shown in Figure 3 and represents a series connection of the cable, transformer with rectifier, and load.The connection cable is modeled as series-connected leakage inductance  and resistance  .The transformer's primary winding is modeled as series-connected leakage inductance  and resistance  .The transformer is modeled as an ideal linear transformer with neglected iron core losses and a magnetizing current.The primary winding has  55 turns, and the secondary winding has two turns with a central tap; each turn is active only in one-half period; therefore   1.Each secondary turn is modeled as a series-connected leakage inductance  ,  and resistance  ,  , that is connected to the rectifier diodes  and  .Both diodes have the same characteristics and can be modeled as series-connected resistance  and backward voltage source  .The diode's voltage source always works as a load and never as a generator.Some parts of the rectifier are common to both secondary windings and the common welding current, which causes voltage drops.Therefore, these parts of the rectifier are modeled as a series-connected leakage inductance  and resistance  .The load is modeled as a series-connected leakage inductance  and resistance  , considering the leakage inductance and resistance of the welding clamps (welding gun) and welding nugget.Usually, some authors [24,31,32] combine the leakage inductance and resistance of the connection cable ( and  ) with the primary winding ( and  ) for simplicity or neglect them altogether.They also combine the leakage inductance and resistance of the common parts of the output rectifier ( and  ) with the load ( and  ).In this article, an extended circuit model of RSW is used, because the parameters of a specific welding transformer remain the same, although the parameter values of the connection cable or the load can change significantly if the cable or load is replaced.The separation of the parameters also allows for the analysis of the influence of each part of the RSW system on the equivalent circuit time constants and the dynamic behavior of the system.

Dynamic Model of RSW
A dynamic model of the analyzed RSW system in Figure 3 can be described in implicit form by Equations ( 1)-(4).Equation (1) describes the voltage balance in the primary coil of the transformer.The state variable  is a time-dependent primary current,  is the cross-section of the iron core,  is the flux density in the iron core, and  is the PWM voltage of the H-bridge; all the other parameters have been described already.

𝑢 𝑖
In (4),  is the magnetic field strength that is a function of the magnetic flux density ,  is the permeability of the vacuum  4π10 ,  is an iron core air gap, and  is the average length of a magnetic flux line in the iron core.
The welding transformer in Figure 3 is taken as ideal, with linear magnetizing characteristics without iron core losses, as described already.Some authors [24,31] model iron core losses as a parallel connected resistance  to the primary winding, which causes additional current flow into a transformer and voltage drops on the primary parameters.Such modeling of iron core losses comes from modeling classical transformers supplied with AC voltage, where all the transformer parameters can be referred from primary to secondary or vice versa.In the case of RSW systems, the voltage supply is not AC, but DC (PWM), and, in a certain time period, the primary current  is zero, but the secondary currents  and  are not zero.When  is zero, the power losses would also be zero if the  is connected parallel to the primary winding, but, at the same time, the secondary currents are not zero, and the main magnetic flux in the iron core is decreasing which still causes iron core losses.From that point of view, it is difficult to model iron core losses in an RSW system properly only with the parallel connected resistance  with a fixed value to the primary winding.That way of modeling iron core losses is possible only for one setting of voltage, frequency, and duty cycle; for different values, the resistance  should be changed, and that is not easy to achieve properly.For that reason, in this article, the resistance  is not used for modeling the iron core losses and can be neglected, as already mentioned, due to much higher copper losses in the transformer's windings and output rectifier.The measurements on the analyzed RSW system show that the iron core losses are less than 1 kW at a nominal output power of 130 kVA and a PWM frequency of 1 kHz, which is less than 0.8% of the nominal output power.

The Parameters of the Circuit Model of the RSW System
The parameter values of the extended circuit model of the RSW system in Figure 3 need to be determined according to the time series of currents and voltages measured in the real system.Determination of parameter values is a challenging task since the RSW system is a nonlinear time-variant system with relatively low resistances and leakage inductances that cannot be measured directly.The inductances that cannot be measured directly are the leakage inductance of the primary winding  , both secondary windings ( ,  ) and the output rectifier  .Many papers deal with the topic of determining the parameter values of a resistance spot welding system using different optimization algorithms [31,32].The main goal of the optimization algorithm is to find values for the model's parameters such that the difference between measured and numerically calculated time series of currents and voltages is minimal.As this paper focuses on the analytical determination of the welding current and transformer's primary current, it is, in principle, irrelevant what values are used for the model parameters.The values of the model parameters for the analyzed RSW system have already been determined [30] and are shown in Table 1.The only difference between the parameter values in the article [30] and Table 1 are the resistance and leakage inductance values of the secondary windings ( ,  ,  , and  ), because, in Table 1, the average values are calculated and set equally for both secondary branches.In reality, the resistance and leakage inductance of secondary windings are slightly different ( 27.7 μΩ ,  32.76 μΩ ,  12 nH ,  14 nH); for analytically calculated welding and the transformer's primary current, both branches must be symmetrical with the same resistance and leakage inductance values.In Table 1, the values of all parameters are given, whereas, in the fourth column, the values are referred to the secondary side of the transformer.The per unit values are given in the fifth column; the basis for per unit calculation is the resistance and inductance of the load due to the highest value.In Table 1 are also the values of the output rectifier diode's parameters, the equivalent resistance  , and voltage source  , which is negative because it always works as a load and never as a generator.

PWM Generation of Primary Voltage
It is known that the steady state of the welding current of the RSW system depends on the switching frequency , the duty cycle  (from 0 to 1 or 0% to 100%), the H-bridge voltage  , and all model parameters of the RSW system.The voltage supply for welding transformer  is provided by the H-bridge, where the diagonal transistors ( ,  ) and ( ,  ) in Figure 2   The pulse voltage  closes the switches  and  between the time  and  that can be determined by Equations ( 5) and ( 6).Therefore, in this time interval, the voltage   .
The pulse voltage  closes the switches  and  between the time  and  , that can be determined by Equations ( 7) and (8).Therefore, in this time interval, the voltage   , as is shown in Figure 4. From the comparison of Equations ( 5) and ( 7) and also (6) and ( 8), it can be seen that the difference is only /2, so both half periods of the voltage  are the same, only the sign of the voltage  is changing between  and  .
In Figure 4, it can be seen that the time interval between  and  and also between  and  is denoted by  , and represents the time interval when the voltage  or  is applied to the transformer.The time interval  is defined with the time of a half period and duty cycle , by Equation ( 9) In one one-half period outside of the time interval  , there is a time interval  , when all the switches   are open, and the voltage  0. One-half of the time interval  is left of the time interval  and one-half is right of it; it is the same in the second half of the period.Time interval  can be defined by Equation ( 10) In Figure 4, the times  ,  ,  , and  are defined by Equations ( 5)-( 8) only for the first period of the time series.For each subsequent time period, the times  ,  ,  , and  can be defined by adding  •  1 to each of them, where  is the time period of interest, as it is shown, for example, by Equation (11) for the time  and the same applies for  ,  and The voltage supply for the welding transformer shown in Figure 4 has the same time interval  in both half periods.In real applications, this is true for all time periods except the first one.The first period is usually exceptionally different, with only half of the time interval  in the first half period, due to the nonlinear magnetic characteristics of the iron core.Assuming the remanent magnetic flux density  0 and the time interval  is the same in both half periods, then, in the first half periods, the magnetic core is magnetized from the  0 to  1 T, for example, in the second half periods the magnetic core is demagnetized from  1 T back to  0, and so on.In this example, only the positive part of the nonlinear magnetic characteristic is used; if the  is too long ( is too high), the magnetic core can become very saturated, and a high transformer's primary current can trigger an over current protection.To prevent the magnetic core from being magnetized only in a positive or only in a negative direction, the time interval  in the first half period must be only half of it.In this example, if assuming the remanent magnetic flux density  0 , half of the time interval  causes magnetization from  0 to  0.5 T, for example, but, in the second half period with the full-time interval  , the iron core is magnetized from  0.5 T to  0.5 T, and so on.In this example, the positive and negative parts of the nonlinear magnetic core are used, the iron core saturation is prevented, and the overcurrent protection is not triggered.The shorter time interval  in the first half period can be achieved if the start of the pulse voltage  begins at the time instead of  in Figure 4.

Analytical Calculation of Welding and the Transformer's Primary Current of the RSW System
According to the H-bridge inverter model in Figure 2 and the welding transformer with output rectifier model in Figure 3, the Matlab/Simulink model of the RSW system can be made, as shown in Figure 5.The model of the RSW system can be made using any other appropriate software that allows time-dependent simulations of electrical circuits.On the left side of Figure 5 is the model of an H-bridge inverter with a constant DC link voltage  560 V , the three-phase input rectifier is not modeled.The transistors or switches are modeled as voltage-controlled switches with a neglected resistance in a closed state (1 nΩ) and very high resistance in an open state (1 GΩ).Each switch has a backward diode that protects it against large, induced voltages when switching off inductive loads.The parameters of the backward diode model are set on neutral values, due to the neglected impact on the currents and voltages in the model.The forward voltage is set to 1 mV, the on-resistance is 1 nΩ, and the off-resistance is 1 GΩ.The welding transformer with the central tape on secondary winding is in Simulink (Figure 5), modeled as two separate ideal one-phase transformers, with primary windings connected in parallel and secondary windings connected in series.The only parameter of both transformers is the turn ratio, set to 55.All the other parameters of the RSW model in Figure 5, the resistances, leakage inductances, and diodes are set according to the values in Table 1.To solve the equations of the circuit model, a separate solver is used, which is connected to the circuit and can be seen as a block in the left bottom part in Figure 5 According to the Simulink model in Figure 5 and the parameters set, the numerical calculations were made at the PWM frequency  1 kHz and the duty cycle  0.8, for example.The numerically calculated time series for 20 periods are shown in Figure 6.In the first graph, the time series of the PWM voltage  is shown in the second graph, the time series of welding current  and both secondary windings ( ,  ) are shown, and, in the last, third graph, the time series is shown of the primary current.In Figure 6, the welding current  reaches the steady state value in approximately 20 time periods.Due to the relatively long time series of the transformer's voltages and currents in Figure 6, their analysis is difficult, so, in Figure 7, the same time series is shown for only one period of time for more straightforward observation.In Figure 7, the RSW voltage and currents are shown, where it can be seen that the welding current increases relatively slowly when the positive or negative voltage  is applied and decreases relatively slowly when the voltage  0. The welding current  is changing according to two different time constants.The primary current  in the third graph in Figure 7 increases relatively slowly when the positive or negative voltage  is applied but when the voltage  changes its value, the primary current increases or decreases relatively fast.The primary current  is changing according to two very different time constants.The time intervals when the primary current increases or decreases very fast are relatively short, but significantly impact the steady-state welding current.The time series of welding  and primary current  in separate time intervals look like straight lines define them and can be described analytically with linear equations; that is not true.The currents in each time interval can be described analytically as a step response of a first-order system, as explained below.
In Figure 7, some of the time intervals are very short, so it is not easy to mark the beginnings and ends of these intervals.For that reason, in Figure 8, the time series are sketched again with intentionally longer time intervals, and denotations are added at the beginning and end of each time interval for a more straightforward explanation.The time series in Figure 8 are shown for one and a half of the periods, due to the aforementioned exceptionally shorter  time interval in the first half period to prevent iron core saturation.If the analytical solution of the welding and primary current is described for one and a half of the periods, the description for all subsequent periods is the same.Figure 8 provides a basis for the interpretation of the individual time intervals and for the analytical determination of the dynamic behavior of the welding current and the transformer's primary winding current.The RSW system is a nonlinear time-varying system due to the diodes in the output rectifier.Therefore, not all equivalent circuit parameters influence the welding  and primary current  in each time interval.Each time interval in Figure 8 is described in the following subsections, and an analytical solution is given for the welding  and primary current  .6).Due to the applied voltage,   , the primary  and welding current  starts to increase, and the energy from an inverter is delivered to the weld.According to the induced voltages on the transformer's secondary, the diode  in Figure 3 prevents the current  from flowing.Therefore, the equivalent circuit can be simplified, as shown in Figure 9.The diode  is modeled as a serial connected resistance  and voltage source  in the simplified equivalent circuit.In an equivalent circuit, in Figure 9, all resistances and leakage inductances are connected in series; therefore, the equivalent inductance  by Equation ( 12) and resistance  by Equation (13), can be calculated to define the time constant  , defined by Equation (14).
Serial-connected equivalent resistance  , inductance  , and the diode's voltage source  define the first-order system supplied by a step voltage ′.Therefore, the timedependent welding current  can be described analytically by Equation (15).In Equation (15) the voltage step is the H-bridge voltage   referred as secondary ′ , is reduced by the diode's voltage source  0.66 V.The initial value of the welding current in Equation ( 15) is zero, because the welding current at the time   0. The variable  in Equation ( 15) is general, but to calculate the welding current  for any time in the interval  to  , the variable  can be only between  0 and     , where time  is denoted in Figure 8.
At the end of this interval,    is also the beginning of the next time interval    .Therefore, it is essential to calculate the initial value of welding and primary current at the time  .The initial value of welding current   is defined by Equation ( 15) if considering   , as it is defined by Equation (16).
In Figure 9, all three currents are equal    .Therefore, Equation ( 15) also defines the primary current  , and Equation ( 16) also defines the initial value of the primary current   , if they are referred to as primary (    ).

Time Interval 𝑡 𝑡 𝑡 , Fast Decreasing Primary Current
In this time interval, the inverter is in the  stage, so all the switches (  ) are open.The welding current  decreases from the initial value   , the secondary current  decreases fast from the initial value     , the secondary current  increases fast from the initial value 0. The primary current decreases fast from the initial value   to zero.Although all the switches (  ) are open, the primary current  cannot fall to zero instantly, due to the accumulated magnetic energy in the leakage inductances.The primary current now flows through the integrated antiparallel diodes of the inverter ( and  ) in Figure 2. Therefore, the H-bridge voltage is opposite   .If the beginning of this time interval   is defined by Equation ( 6), the end of this interval  is not so trivial to determine.The end of this interval  is defined by the primary current  , and how long it is decreasing from the initial value   to the zero   0; this time interval is denoted by  in Figure 8.To derive an analytical solution for primary current  , the equivalent circuit must be defined, that describes the fast decreasing primary current in this time interval.The analysis shows that the equivalent circuit in Figure 10 defines the dynamic behavior of the primary current, where only specific resistances and leakage inductances have influence.The circuit parameters  ,  ,  ,  , and diode's voltage source  do not influence the dynamic behavior of the primary current in this interval.In Figure 10 it can be seen that the inductances  and  are connected in parallel and then connected in series with  and  .Therefore, the equivalent inductance  can be defined by Equation (17).The equivalent resistance  of the circuit can also be defined by Equation (18) The serial-connected  and  present the first-order system with the step voltage supply   in this time interval.Therefore, the analytical solution for primary current can be defined by Equation (20): The end of the time interval  can now be derived by Equation (20).Previously, it has been mentioned that the time interval    is over when the primary current  decreases from the initial value   to zero.After substituting the primary current value    0,   , and   into Equation ( 20), we obtain a new expression from which the time interval  can be derived as: The end of the analyzed time interval  can now be defined by Equation ( 22) Equation ( 20) is an analytical solution for the dynamic behavior of the primary current  in time interval    , where the starting time  0 is at the beginning of the time interval  .The initial condition   for the next time interval    is zero   0 but is defined by Equation ( 23), where considering   and voltage step   : The welding current  is decreasing from the initial value   to   in the analyzed time interval    , according to the equivalent circuit in Figure 11.From the circuit, only the parameters from the secondary define the dynamic behavior of the welding current  .At the same time, the primary current  is also flowing, and voltage is induced at the secondary, but it does not influence the welding current  , due to the symmetrical secondary branches.The secondary current  is decreasing from the initial value     and  is increasing from the initial value   0 (see Figure 8).Both currents are equal at the end of this time interval  , and their values are half of the welding current     .According to the circuit in Figure 11 the equivalent inductance  and resistance  can be determined by Equations ( 24) and (25), that define the time constant  by Equation (26).
Serial-connected equivalent resistance  and inductance  present the first-order system with the step voltage supply  .Therefore, an analytical solution for welding current can be defined by Equation (27).In Equation ( 27)  0.66 V is the voltage source of the diode, which always works as a load; therefore, the welding current decreases a little faster, and the initial value of the welding current   is defined by Equation (16).
Equation ( 27) is an analytical solution for the dynamic behavior of the welding current  in time interval   , where the starting time  0 is at the beginning of the time interval  .The initial condition   for the next time interval    is defined by Equation ( 28 are open, and the primary current does not flow anymore  0. The welding current  still decreases according to the time constant  and Equation (27).The only difference is the initial value of the welding current   defined by Equation (28), and the starting time  0 is at the beginning of the time interval  .
The initial condition   for the next time interval    is defined by Equation (29), where considering    and voltage step is still the diode's voltage source  0.66 V, so we get Equation (30).The time   defines the beginning of the voltage pulse  , when the negative   is applied to the welding transformer, the time  is defined by Equation ( 7) and  by Equation (22).

Time Interval 𝑡 𝑡 𝑡 , Fast Increasing Primary Current
In this time interval, the inverter is in the  stage, so the switches  and  are closed, the negative voltage   is applied to the welding transformer, and the primary current increases fast from the initial value   0 to the welding current     .The secondary currents are the same at the time  with the value     , the current  decreases fast to zero   0, and the current  increases fast to the value of the welding current     .Although the voltage   is applied to the transformer, the welding current still decreases, as is shown in Figure 8.The beginning   of this time interval    is defined by Equation ( 7), the end time  depends on the time that the primary current needs to increase from the initial value   0 to the value of the welding current     .This time interval is, in Figure 8, denoted by      .The welding current in this interval is defined by Equations ( 27) or (29).The only difference is the initial welding current   , and the starting time  0 is at the beginning of the time interval  , so we get Equation (31): The primary current increases from the initial value   0 according to Equation (20), if the initial value   0 and step voltage source   are taken into account to get Equation (32): The time interval    is over when the primary current from the initial value   0 reaches the value of the welding current     , which is still decreasing in this time interval  .Therefore, Equations ( 31) and ( 32) must be equal, and   must be considered to get Equation (33): The time interval  appears on the left and right sides of Equation ( 33) and should be derived from it, but it is not possible, because this equation represents a transcendental equation and an analytical solution does not exist for  .A solution for a time interval  in Equation ( 33) can be found only numerically.When the  is a known value, the time  can be defined by Equation (34): The initial value of the welding current   for the next time interval    is defined by Equation (31)  In this time interval, the inverter is still in the  state, so the switches  and  are closed, the negative voltage   is still applied to the welding transformer.The primary current  , welding current  and  are equal    , the current of the first secondary branch is zero  0. This time interval is like the interval    .The difference is that the voltage supply is now negative   and the initial condition is not zero.The analytical solution for the primary and welding currents can be defined based on the equivalent circuits in Figure 9, due to the symmetrical secondary branches   and the same diode parameters  and  .Equation ( 15) is the analytical solution for increasing the welding current  in time period    , where the initial current is zero.
Based on Equation ( 15) the analytical solution for the primary current in this time interval (   ) can be defined by Equation (37), if the negative voltage supply   and the initial current condition   defined by (36) are considered: Due to the negative voltage supply   in Equation (37), the initial condition   and the current  are negative values.The welding current is always positive, due to the output rectifier.Therefore, the analytical solution for the welding current is   | |.In Equation (37), the diode's negative voltage  0.66 V always works as a load, therefore, it must be subtracted from the negative voltage supply   .Equation (37) is the analytical solution for the dynamic behavior of the welding and primary current in time interval    , where the starting time  0 is at the beginning of the time interval  .The initial condition     for the next time interval    is defined by Equation (37), where, considering    to get Equation (38).The time  is defined by Equation ( 8) and time  is defined by Equation (34).

.7. Time Interval 𝑡 𝑡 𝑡 , Fast Decreasing Primary Current
This time interval is like the interval    , therefore, a detailed explanation is not necessary.The difference is that the voltage supply is positive   because, with all the switches   open, the primary current flows through the integrated antiparallel diodes of the inverter ( and  ).The primary current decreases fast from the negative initial value   to zero   0, the welding current decreases from the initial value   to a new value   , the secondary current  decreases fast from the initial value   to a new value   , the secondary current  increases fast from the initial value   0 to a new value   .At the end of this time interval  , both secondary currents are half of the welding current     .The beginning of this time interval   is defined by Equation ( 8), the end time  depends on the time period    denoted in Figure 8.The time period  is, like the time period  , defined by the primary current, i.e., how long does it take to fall from the negative initial value   to zero?To define the time period  , the analytical solution for the falling primary current must be defined first.The primary current is falling according to the equivalent circuit in Figure 10 and Equation (20), where the voltage supply   and the initial value of the primary current   , defined by Equation (38), are considered to get Equation (39): The end of the time interval  can now be derived by Equation (39).Previously, it has been mentioned that the time interval    is over when the primary current  decreases from the initial value   to zero.If, in Equation (39), the primary current value at  is zero    0,   and   , Equation (40) can be derived that defines the time interval The end of the analyzed time interval  can now be defined by Equation (41): Equation ( 39) is an analytical solution for the dynamic behavior of the primary current  in the time interval    , where the starting time  0 is at the beginning of the time interval  .The initial condition   for the next time interval    is zero   0, but is defined by Equation (42), where, considering   and voltage step   : The welding current  is decreasing in this time interval, although   and the primary current  is also flowing, and voltage is induced at the secondary, but it does not influence the welding current due to the symmetrical secondary branches.The welding current is decreasing according to the same Equation (43) as in all previous time intervals between the time  and  , only the initial welding current is different   , defined by Equation (38).
Equation ( 43) is an analytical solution for the dynamic behavior of the primary current  in the time interval    , where the starting time  0 is at the beginning of the time interval  .The initial condition   for the next time interval    is defined by Equation ( 43 This time interval starts at time   when the positive voltage supply   is applied to the transformer in the second period due to the closed switches  and  , like in the first half of the first period.The difference between the start of the positive voltage supply   in the first and second periods is the initial condition of welding current at   and   .In the first period, the initial value of the welding current at time  is zero   0. Therefore, there is no time interval for the fast-increasing primary current  .In the second period at the time  , the welding current  is not zero   0; therefore, the primary current  increases fast from zero   0 to the value of the welding current     .The fast increase of the primary current  is the difference between the first and second periods at the beginning of the positive voltage supply   .Therefore, the explanation and analytical solutions for the welding  and primary current  are given for one and a half periods instead of only one period. The time interval    is like    .The only difference is the positive voltage supply   and the initial value of the welding current at the time  ; therefore, a detailed explanation is unnecessary.This analyzed time interval    ends when the primary current from the initial value zero   0 reaches the value of the welding current     in time    , denoted in Figure 8.To define the  the analytical solution for the decreasing welding current  and fast increasing primary current  must be defined first.The welding current decreases according to Equation (31)

Results
The analytical solution for welding and the transformer's primary current of the RSW system is given in previous subsections.The analytical solution is provided as equations that describe the time response of the welding and primary current in separate time intervals of the voltage-supplied period.In these time intervals, the RSW system is linear and the currents change according to the step voltage response of the first-order system.If the time series of the currents in the individual intervals are connected, the time series of the welding  and primary currents  are obtained, which should be the same as the numerically calculated time series using the Simulink model in Figure 5.The comparison of analytically and numerically (Simulink) calculated time series of the welding  and the primary currents  are shown in Figure 12, for the same example and parameter settings as in Figure 6.The comparison of time series in Figure 12 shows that the analytically calculated welding and primary currents are practically the same; it is not possible to see any difference between them.The time series in the red color overlaps the blue time series, so it cannot be seen.For a more precise comparison of the analytically and numerically calculated time series of currents, the differences are calculated and shown in Figure 13.From the calculated differences in welding current Δ it can be seen that the maximum difference does not exceed 1 A. The maximum welding current in the steady state in Figure 12a is more than 20 kA , so, the maximum difference 1 A presents less than 0.005% of the maximum welding current.From the calculated difference of the primary current Δ in Figure 13b, it can be seen that the maximum difference is around 2 A in only six-time intervals that step out; in all other cases, the difference is less than 0.1 A. The maximum primary current in a steady state in Figure 12b is around 378 A, so, the maximum difference 2 A presents around 0.53%, and 0.1 A presents less than 0.03% of the maximum primary current.The reason for the differences between the analytically and numerically calculated welding and primary currents is the numerical errors of the solvers in Simulink.In Simulink settings, the fixed time step of both solvers is used (0.1 μs) to calculate the time series of the currents and voltages.If the times,  ,  ,  ,  in the first and all subsequent periods in Figure 4 are not precisely a multiple of the fixed time step, the numerical error can cause the differences in time intervals  in Figure 4, when the voltage   or   is applied to the welding transformer.The different time intervals  in each period of PWM voltage supply causes different time intervals ( ,  ,  in Figure 8).When the welding current increases, it influences the time series of the welding and primary currents.To minimize the numerical errors in Simulink, the fixed time step must be short enough; if not, the numerical errors increase, and so do the differences between the analytically and numerically calculated time series of the welding and primary currents.The analytical approach to calculate the time series of the welding and secondary currents does not have such numerical problems depending on the fixed time step size.The times,  ,  ,  ,  , in the first and all subsequent periods are determined precisely independent of the fixed step size, so the start and end times of each time interval in Figure 8 are not affected by the fixed step size as they are in Simulink.
The time intervals in Figure 8 are not always present in the same sequence; for example, the welding current in Figure 8 is, from the time  forward, always greater than zero.That is true if the duty cycle  is greater than the minimal duty cycle  , which assures a continuous steady state welding current without time interval with  0 in the period of the PWM voltage supply.At the duty cycle  , the welding current decreases in the  time interval, and only touches the value  0 and immediately starts to increase in the next half period, as is shown in Figure 14.If the duty cycle  is less than  , the welding current in a steady state is not continuous anymore, and there are time intervals with the  0. Such discontinuous conduction mode of welding current  is not usable in practice but can also be calculated analytically.If the duty cycle   , the time intervals with fast-increasing primary current ( ,  in Figure 8) do not exist, as is shown in Figure 14.Like the minimal duty cycle  , there is also the maximal duty cycle  .The increase of the duty cycle  from 0 to  causes an increase in the steady state welding current's root mean square (RMS)  .If the duty cycle increases further from  to  1, the steady state welding current  does not increase anymore but stays the same.At the maximal duty cycle  , the steady state primary current decreases fast in the time intervals  ,  , and  in Figure 8, but crosses the value  0, and starts to increase fast immediately in the opposite direction in time intervals  and  in Figure 8, without the time intervals when  0. The comparison of analytically and numerically (Simulink) calculated time series of the welding  and primary currents  is shown in Figure 15, where the duty cycle is   0.9619, and there is no time interval with  0 in the steady-state welding current  .According to Figures 14 and 15, the analytical approach can be used to calculate the time series of the welding  and primary currents  , even when the duty cycle  is smaller than  or greater than  , and some time intervals are not present in each voltage supply period.

Conclusions
In this paper, a 130 kVA resistance spot welding system is analyzed in terms of the possibility of describing the time series of the welding and the primary current of the transformer analytically.The resistance spot welding systems are used mainly in the automotive industry for welding car bodies, where the welding transformer is attached to a moving robotic arm.The RSW system consists of an inverter, a welding transformer, an output diode rectifier, and welding clamps with electrodes.The PWM controls the welding current with centrally positioned pulses.The weight of the iron core of the welding transformer mounted on the robotic arm can be reduced with a higher frequency of voltage supply, but leakage inductances of the welding transformer reduce the maximum welding current that can be achieved at the same load.To predict the maximum possible welding current at a specific load and to design a high-performance welding system, it is necessary to know the dynamics of the welding and the primary currents of the RSW system.The design of the welding transformer with the output rectifier defines the equivalent resistances and leakage inductances of the RSW system that determine the dynamics of the currents and the maximum welding current at a specific load.
The current and voltage dynamics of the RSW system can be analyzed by expensive and time-consuming measurements or by expensive and complex software tools that are not easy to use.Free software tools usually have several limitations, and do not guarantee the correctness of the results; therefore, they are not used in commercial projects.This paper presents a fourth, new possibility to determine the dynamic responses of the welding and primary current of a welding transformer analytically.In high-power resistance spot welding systems, resistances and leakage inductances are dominant, while capacitances can be neglected.For this reason, an RSW can be modeled with an equivalent circuit, with equivalent resistances and leakage inductances, and the diodes of a diode rectifier can be modeled as serially connected resistances and a voltage source.Due to the output diode rectifier, RSW systems are nonlinear and time-varying systems, so all equivalent circuit parameters do not affect the dynamics of the currents and voltages in all the time intervals of the voltage supply period.In the one-half period of the voltage supply, only one secondary branch is active, and, in the second-half period, only the second secondary branch of the transformer is active.Due to the time-varying system, three different equivalent circuits can be determined at individual intervals of the voltage supply period, which determine the dynamics of the welding and primary currents of the transformer.These three equivalent circuits can be determined as serially connected equivalent resistance and inductance, that present a first-order system supplied by a step voltage; therefore, the analytical solution can be determined for the current response.These three relatively simple analytical solutions for step responses of the first-order system allow analytical determination of the time series of welding and the transformer's primary current.The presented analytical solution is limited to symmetrical secondary branches of the welding transformer.Therefore, the resistance and leakage inductance of both secondary branches must be the same, and the DC voltage supply of the inverter must be constant in each separate time interval of the voltage supply period.The values of the RSW system equivalent circuit parameters can change with time but must stay constant in separate time intervals.Therefore, the temperature-dependent resistance of the weld nugget or the voltage drop of the H-bridge DC link can be considered.
The analytical solution has many advantages compared to numerical calculations with Simulink, where the solver selection and fixed time step size cause numerical errors in the time series of welding and primary currents, or even cause the numerical calculation not to converge to a solution.The derived analytical equations allow calculations of welding and primary currents of the RSW system but also give a thorough understanding of how its parameters influence the current dynamic.The analytical solution can be implemented in any programming language and benefits from multi-core processors.When the initial conditions and the equations for currents in each time interval of the time series of welding and primary currents are determined, the values of the currents inside each time interval can be calculated simultaneously on different cores of processors for fast computation.
In future work, the derived analytical solutions can be extended to include phenomena not considered in this manuscript.The voltage drops on the switching transistors of the H-bridge can be easily considered with an additional equivalent resistance of the transistors in conduction mode.The same is true for the antiparallel diodes of the inverter; the equivalent resistance and the backward voltage source of the diodes can be considered with their actual values.In this example, the time constant is not the same anymore if the primary current is flowing from the inverter to the transformer or from the transformer to the inverter due to the different resistances of the transistors and antiparallel diodes.The iron core losses could be considered in the analytical solutions as additional equivalent resistance or with the more sophisticated method.The non-linear magnetic curve of the iron core could also be considered in the calculations if the time intervals are divided into smaller intervals and some values of the parameters are changed according to the iron core saturation in each interval.
. A threephase input rectifier is shown on the left side of Figure with AC voltages  ,  , and  , which are rectified and filtered to get a DC bus voltage  .The bus voltage  is connected to the H-bridge inverter.The welding transformer's supply voltage  is PWMcontrolled by the H-bridge inverter, composed of transistors denoted by   .The IGBT transistors are used with antiparallel diodes

Figure 2 .
Figure 2. Schematic presentation of the analyzed RSW system.

Figure 3 .
Figure 3. Extended circuit model of the RSW system.
are opened and closed adequately with the PWM voltages  and  .The PWM has centrally positioned pulses, as is shown in Figure 4. Therefore, the start time  and the end time  of voltage  ( and  ), and the start time  and the end time  of voltage  ( and  ) can be calculated if the time period  1/ and the duty cycle  are determined.

Figure 4 .
Figure 4. Time series of (a) transistor control voltage  and  , (b) H-bridge voltage .

Figure 5 .
Figure 5.The Matlab/Simulink model of the RSW system.The solver settings of the Simulink model in Figure 5 are as follows:  Fixed-step solver: ode14× (extrapolation),  Fixed-step size: 0.1 μs, (depends on the selected PWM frequency )  Solver Jacobian method: auto,  Extrapolation order: 4,  Number of Newton's iterations: 3.

Figure 6 .
Figure 6.Time series for 20 periods of (a) H-bridge voltage , (b) welding current  and both secondary currents ( ,  ), and (c) primary current  .

Figure 7 .
Figure 7. Time series for one period of (a) H-bridge voltage , (b) welding current  and both secondary currents ( ,  ), and (c) primary current  .

Figure 8 .
Figure 8.One and a half period of (a) transistor control voltage  and  , (b) H-bridge voltage , (c) welding current  and both secondary currents ( ,  ), and (d) primary current  .

3. 4 . 1 . 3 . 4 . 2 .
Time Interval    This time interval presents the first quarter of the period , therefore,  0 is the beginning of the time series and  .All four switches (  ) are open in this time interval, and the PWM voltage is  0. If we assume that the initial values of the welding and primary currents are zero     0, both currents remain zero at the end of the interval     0. Time Interval    , Increasing Welding and Primary Current In this time interval, the switches  and  are closed, and the PWM voltage   is applied to the welding transformer.The time   /4 is the beginning of the voltage pulse   , the time   is the end of the voltage pulse defined by Equation (

Figure 9 .
Figure 9. Simplified equivalent circuit with only one secondary branch.

Figure 10 .
Figure 10.Equivalent circuit model defining the fast-changing primary current  .

Figure 11 .
Figure 11.Equivalent circuit model defining decreasing welding current  .

Figure 12 .
Figure 12.The comparison of analytically and numerically (Simulink) calculated (a) welding  and (b) primary currents  .

Figure 13 .
Figure 13.The difference between the analytically and numerically (Simulink) calculated (a) welding, and (b) primary currents.

Figure 14 .
Figure 14.The comparison of analytically and numerically (Simulink) calculated (a) welding  and (b) primary currents  at the minimal duty cycle  0.06889.

Figure 15 .
Figure 15.The comparison of analytically and numerically (Simulink) calculated (a) welding  and (b) primary currents  at the maximal duty cycle  0.9619.Due to minimal differences, the red time series (Simulink) overlaps the blue time series (Analytical).
The state variables  and  are time-dependent currents of the secondary branches,  and  are the voltages of both secondary diodes and are functions of the corresponding currents  and  .The nonlinear characteristic of the diodes is defined as serial connected diode resistance  and voltage source  , which acts as a load and never as a generator.The welding current  is defined as the sum of the cur-

Table 1 .
Circuit parameters of the RSW system. .
The equivalent inductance  and resistance  define the time constant  by Equation (19): if the initial value of the welding current   is considered to get Equation (47)