Switching and Averaging Models of a Bidirectional, Half-Bridge Based DC-DC converter with Load Distribution

Bidirectional DC-DC converters are vital for the integration of batteries, for the power conversion during (dis)charge and the battery management. Modeling of these is helpful, especially for the design of larger, more complex systems consisting of multiple DC-DC converters in parallel. Due to the high switching frequencies, the simulation of DC-DC converters is associated with increased computational time and effort. In this paper, three models of different complexity and accuracy are proposed for a bidirectional DC-DC converter consisting of two phase-shifted half-bridges. Two switching models, which differ mainly in the way the MOSFET s are driven, account for the individual switching operations and exhibit high accuracy. An averaging model replaces the switching elements with current and voltage sources providing the mean values. The dynamic behavior of the models is analyzed using the step responses of the load current. For validation, these are compared with the theoretical transfer function. The three models are analyzed comparatively in terms of computational time and effort. The calculation time of the averaging model has been reduced by two thirds compared to the strictly complementary switching model and by 96% relative to the model with diode emulation mode. Recommendations for the use of the models are given and a possible use case is shown. Two parallel connected DC-DC converters with load current sharing between them are simulated using the averaging model.


Introduction
Heterogeneous battery systems combine batteries with differences in cell chemistry, nominal capacity, state of health, state of charge, safe operating area and terminal voltage.They offer advantages such as increased energy density, improved efficiency, enhanced safety and flexibility compared to homogeneous systems.Furthermore, they provide second life batteries a further application with lower requirements regarding dynamics, remaining useful capacity and internal resistance.Due to the heterogeneity, it is challenging to ensure reliability, robustness and safety of the system.Specific requirements arise for the control of the DC-DC converters: Adjustable current limits are required and the different input voltages have to be converted to a common DC output voltage and vice versa.The (dis)charge current has to be limited according to the battery state and the safe operating area in order to realize reliable simultaneous operation of varying batteries.The total current is divided among the batteries depending on their state, which reduces the burden and enables additional possibilities such as state of charge balancing in active operation without recharging or state of health balancing with the goal of achieving a common end of life.
The model of the bidirectional DC-DC converter is valuable for the analysis of its behavior and performance.It is the basis for the development of suitable control strategies and enables initial tests of these in parallel operation of several DC-DC converters.The robustness, safety and reliability of the system can be investigated.Robustness is defined as the stability in the presence of disturbances, safety as the behavior in the event of a fault and reliability as the system availability in the event of breakdown of individual components.
In order to consider varying time scales, different abstraction levels are required.Three models of a bidirectional, multiphase DC-DC converter based on two halfbridges are presented (Fig. 1).The behavior of the DC-DC converter is thereby primarily determined by the power semiconductors and the passive components.Two switching models of the DC-DC converter are proposed for de-tailed analysis of the switching behavior and are suitable for relatively short simulation duration.For the system simulation, an averaging model is proposed which neglects the individual switching processes.The different models are described and compared with the calculated transfer function of the bidirectional DC-DC converter.They are compared in terms of computational effort and time.Two averaging models are subsequently connected in parallel as an exemplary use case and the load current sharing between two DC-DC converters is simulated.

Related Work
Existing works on the simulation of DC-DC converters also propose averaging models, while concentrating on other aspects, i. e. parameterization of the electrical components, reduction of the simulation time, temperature dependency and losses or testing of control strategies.The paper (Baumann, Weissinger, and Herzog 2019) focuses on the system identification of inverters and proposes a novel model of a bidirectional DC-DC converter which is valid for different frequency ranges.Special focus is given to the identification and parameterization of the electrical components.In article (Navarro et al. 2020), a continuous-time linearized model of a non-isolated bidirectional half-bridge DC-DC converter corresponding to the state-space averaging method is proposed.The key contribution hereby is the reduction of the time complexity.In the paper (Spiliotis et al. 2019) an electrical-thermal model of a DC-DC boost converter is developed.It focuses on the analysis of the temperature dependence on the losses of the converter.In contribution (Winter et al. 2015), a simplified averaging model of a synchronous half-bridge converter is presented, which shows the losses and the dynamic behavior without the need to simulate every switching process of the power semiconductors.An averaging model of a half-bridge converter, more precisely a two-stage DC-AC voltage source converter, is proposed in (Laera et al. 2020).The key topic is the test of different control strategies and their effects on the model behavior.It demonstrates that averaging models can lead to control parameters which cannot be successfully transferred to real power electronic components.

Main contributions
Two switching models with different accuracy levels and varying control of the MOSFETs and an averaging model of a half-bridge based, multiphase DC-DC converter are proposed.A novel model with diode emulation is developed.The averaging model is based on the circuit averaging technique and uses equivalent circuits.Another novelty is the possibility of efficient switching between the three proposed models.Thus, the diverse behavior of the models according to the simulation objective, e.g.testing of control strategies, can be taken into account.The simulation especially focuses on testing the control strategies and load sharing between DC-DC converters connected in parallel.

Bidirectional DC-DC Converter
A bidirectional, multiphase DC-DC converter is used for the implementation of the power flow in (dis)charge direction.Depending on the direction of the current flow, it operates in boost or buck mode.The utilized DC-DC converter consists of two half-bridges (Fig. 2) connected in parallel, between which the current is symmetrically divided.This decreases conduction losses, which in turn has a positive effect on the thermal behavior of the components.Additionally, it allows a larger power range with significantly smaller devices.The two signals for driving the half-bridges are phase-shifted by 180 • .This considerably lowers the current ripple that has to be smoothed by the output capacitance (Alharbi et al. 2019;Schuck and Pilawa-Podgurski 2013).The LM5170 module is used for current control, which implements the gate drivers, operational amplifiers for current control, current measurement, and a sawtooth generator for average current mode control.The frequency response of the current controller can be determined by the external circuitry.The magnitude of the setpoint current value is specified for digital setting via a pulse width modulated signal to the pin ISETD or for analog adjustment via a reference voltage at the pin ISETA.The direction of the current flow is defined by a voltage reference at the direction pin DIR.At voltages above 2 V at the DIR pin, the converter operates in buck mode and the current flows from the High Voltage (HV) port to the Low Voltage (LV) side.At voltages below 1 V, the converter operates in boost mode and the current flows in the opposite direction.In case of any other voltage level, the LM5170 detects an invalid command and switches off the gate drivers for both channels.According to the two function modes buck and boost, one of the two MOSFETs works as the main and one as the sync MOSFET.In boost mode, the main one is the High Side (HS) MOSFET T HS , whereas in buck mode the main one is the Low Side (LS) MOSFET T LS .The other one, in each case, is the sync MOSFET.
They are switched complementary: When the main MOS-FET is on, the sync one is off and vice versa.While the   main MOSFET is driven, the current across the inductor increases.The instantaneous value of the inductor current is measured by a shunt resistor.Each channel has a realtime zero-crossing detector to monitor the instantaneous shunt voltage V CS .When a zero crossing of V CS is detected, the gate drive of the sync MOSFET is turned off.In this way, negative currents are prevented and the efficiency is improved at low load.Figure 3 shows the main waveforms of the described switching behavior as a function of the inductor current.The red dashed curve shows the diode emulated mode.
The models given in the following are compared with the theoretically determined s-transfer function (Eq.( 1)) according to the data sheet (Texas Instruments Incorporated 2016b).This is a generalized, approximated transfer function which neglects the high frequency behavior.For a first validation, this transfer function is sufficient.For future comparisons, the defined transfer functions for the different operating modes from a previous work (Reindl et al. 2023 -under review[a]; Reindl et al. 2023 -under review[b]) will be used.This previous work compared the theoretical transfer functions with hardware measurements and showed that, except for the neglection of the high-frequency behavior, the theoretical approximations agree with the measurements.

Strictly Complementary Switching Model
The strictly complementary model reproduces the switching behavior of the MOSFET without diode emulation.It allows a detailed analysis of the operating principle of the circuit, taking into account the individual switching steps.
Figure 4 shows an overview of the hierarchically structured classes.The ControlledBuckBoost model forms the top level and unites all submodels to simulate the currentcontrolled, bidirectional DC-DC converter with strictly complementary switching of the MOSFETs.Furthermore, the overall model can be subdivided into the physical, electrical simulation of the circuit (TwoCHBuckBoost) and its control (TwoCHController).

Electrical Simulation
There are used two models ChopperBuckBoost and TwoCHBuckBoost to represent the behavior of the circuit of the bidirectional DC-DC converter.The innermost level is the ChopperBuckBoost model for the simulation of one half-bridge (Fig. 5).The HS and LS MOSFET are substituted by a combination of a transistor and a diode to simulate the switching behavior.

ChopperBuckBoost: Description of the Half-Bridge Model
The model has nine interfaces: The electrical connections for the power flow are realized by the four interfaces dc_p1, dc_p2, dc_n1 and dc_n2.With the heatPort the thermal behavior can be observed and first conclusions about losses can be drawn.The three logic ports are used to control the transistors.With fire_p and fire_n the transistors are switched.The interfaces are logically and connected with the parameter enable, so that the DC-DC converter can be switched on and off.The blocks logicDelayLV and logicDelayHV are cus-  tom developed.The block is used to delay a signal by a selectable time by setting the parameter delayTime.When an event occurs at the input port u, the variable tSwitch is set to the actual time.The switching edge is transmitted to the output y as soon as the actual time is greater than tSwitch + delayTime.The parameter enable allows (de)activation of the half bridge.External control of the model is possible with the parameter extenable.
It overwrites the local settings for enable.The current through the inductor, dimensioned according to Table 1, is measured by the current sensor currentSensor.Using the zeroOrderHold block, the signal is sampled with half of the switching frequency.Thus only the average value is obtained.The measured current value is passed on to the real interface ILV.
Between the inductor and the electrical interface dc_p1 there is a resistor.It combines the shunt resistance and the ohmic resistance of the inductor.The thermal connection of the resistor is connected together with the other ones to the heatPort.The capacitor CHV connecting the HV side to ground is used for voltage smoothing.

TwoCHBuckBoost: Electrical Model of the bidirectional DC-DC Converter
The model TwoCHBuckBoost on the next higher hierarchy level simulates the bidirectional DC-DC converter and combines two half bridges, i.e. two instances of the model class ChopperBuckBoost, which replicate the two channels and are labeled as CH1 and CH2 (Fig. 6).
The electrical connection is analogous to the one of the half-bridge and consists of four interfaces dc_p1, dc_p2, dc_n1 and dc_n2.At Channel 2 (CH2) only the pin dc_n1 is connected to the other n-pins.A connection of dc_n2 would form a loop of the ground which in turn cannot be calculated by the simulator and would lead to an abort of the simulation.On the LV side there is used a capacitor CLV for voltage smoothing.The interfaces ILV of the two channels which contain the averaged current measurement values of the inductance current are passed to ILVCH1 and ILVCH2.
The two half bridges are controlled by phase-shifted PWM signals: The duty cycle of the Channel 1 is defined by the interface dutyCycleCH1.The real value is limited between the values 0 and 1 and the signal is transferred to the block pwmCH1.This block compares a voltage level with a sawtooth signal or a triangle signal and generates a complementary PWM signal from it according to Table 2.The same model blocks are used for Channel 2. These are identically constructed, with the only difference that the switching signal is shifted by half a period.

Simulation of the Control
The control of the bidirectional DC-DC converter is simulated by the model TwoCHController (Fig. 7).The model consists of the controller implemented by the model controllerAlgorithm and the specification of the operating mode (buck or boost) simulated by the model Direction.In this case a PID controller with a constant gain setting of 40 and an output limiter is used (Fig. 8).The parameter DirectedISETA is controlled considering the feedback of the actual current measurements provided via measuredCurrentCHx, x ∈ 1 . . .n.If the parameter Enable is false, the voltage output VLV/VHV is set to a fixed value.The fixed value is only required using the averaging model, but does not interfere with the switching model as the MOSFETs only switch if Enable equals true.The direction pin of the LM5170 which determines if the DC-DC converter operates in buck or boost mode is simulated by the model Direction.The model checks if Direction is either less than the value 1 or greater than 2 and adjusts the ISETA signal accordingly.If the value of Direction is less than 1, ISETA is not changed.If Direction is greater than 2, ISETA is multiplied by -1 in order to change its sign.The corrected value is set in the output parameter DirectedISETA which is further processed in the controller.If one of the two valid conditions (Direction <1 or >2) is fulfilled the parameter Enable is set to the value true.

Validation of the Strictly Complementary Switching Model
The model ControlledBuckBoost simulates the behavior of the current-controlled DC-DC converter with strictly complementary switching behavior (Fig. 9).The aim of this model is to achieve a high degree of accuracy in simulating the functionality, taking into account the individual switching processes of the MOSFETs.The channels of the bidirectional DC-DC converter can be activated individually.For an accurate current control with two active channels, the required setpoint current is halved ( Fig. 9).
Figure 10 shows the test setup for the validation of the models.For validation, the DC-DC converter model is connected via a 0.01 Ω resistor to an ideal voltage source of 12V at the LV side and via a 0.02 Ω resistor to an ideal voltage source of 24V at the HV side.
Initially, a voltage of 2V is supplied to the ISETA pin.Between 0.01 s and 0.02 s the DC-DC converter operates in boost mode and between 0.03 s and 0.04 s in buck mode.The curve of the current through the inductor and the averaging of it over one period (mean PWM) are compared with the theoretical transfer function (Eq.( 1)) (Fig. 11).Only small deviations between the modeled and the theoretical transfer function occur.Therefore, the first jump is analyzed in more detail (Fig. 12).The theoretical transfer function exhibits an overshoot, but it is below the targeted 80 A and corresponds to a second order behavior.The transfer function of the model also has an overshoot and reaches the 80 A faster than the theoretical one.The averaged transfer function over two periods is similar to the original data.Only minor deviations occur and they are within an acceptable range.The model has been successfully validated.

Switching Model with Diode Emulated Mode
The switching model with diode emulation mode differs from the strictly complementary model only slightly in the control mode of the MOSFETs (Fig. 3). Figure 13 shows a hierarchical overview of the submodels and can also be divided into the simulation of the physical components and the control.

Additional Control Models
In CurrentDirectionCorrection, the current through the inductor is compared with the set direction.If the current is positive or zero in relation to the mode of the DC-DC converter, the output value is one, otherwise it is zero.The output is further processed in DiodeModeGen.
The model DiodeModeGen uses the duty cycle, the direction and the measured current through the inductor as inputs to define the switching signals for the two MOSFETs.The real signal dutyCycle is sampled over one period in zeroOrderHold and compared to a triangle signal.The compared signal is passed to the switches logicSwitch and logicSwitch1 as an input.The inverse signal from the comparison between the PWM and the rectangular signal is passed to a logical-and block.The output signal from currentDirectionCorrection is the second input.The output signal of the logical-and block is one of the inputs of the switches.The direction is a further input of the switches in order to change between primary and

Validation of the Switching Model with Diode Emulation
The comparison with the theoretical transfer function shows only minor deviations (Fig. 16).A more detailed analysis of the step response shows that the model responds faster and with a higher accuracy compared to the transfer function (Fig. 17). Figure 18   deviation caused by the zeroOrderHold element.This delays the measured current by a hundredth of the period of the switching frequency.Due to this delay, a zero crossing is detected too late and consequently the Sync-MOSFET is also switched off late.The deviation can be reduced by increasing the sampling frequency.This, however, increases the computational effort significantly.The jump at 0.025 s (Fig. 18) is caused by a change at the direction pin.As the measured current is multiplied by -1 due to the differing polarity of the direction, the sign of the deviation changes.
Changing the switching threshold of the Sync-MOSFET from 0 A to 0.4 A shows only a minor deviation and the desired value of 0 A is maintained over the entire range (Fig. 19).

Averaging Model
Time-invariant devices, such as switching transistors, are very complex to simulate.They lead to a significant increase in computational effort and thus limit the number of components to be simulated simultaneously as well as the performance.To realize, e.g. a simulation of the behavior of a battery connected to the bidirectional DC-DC converter over several charging processes in order to make statements about aging processes, a suitable model is required (Sure- waard, Karden, and Tiller 2003).In the following, a model is designed which neglects the single switching processes but still reproduces the behavior of the switching model as accurately as possible.
The accuracy is lower compared to the switching models, but allows longer simulation duration with several components to be simulated simultaneously.
Without taking losses into account, the averaged output voltage in buck mode is given by: D describes the duty cycle.The following applies to the output current: I L is the current through the inductor.In order to consider the ohmic losses of the MOSFETs, the voltage required by them is subtracted from the generated voltage.This results in:  Assuming that the two MOSFETs are identical, the equation can be simplified to: The averaging model is also hierarchical and is divided accordingly into physical and control simulation (Fig. 20).

Physical Simulation
At the lowest level of the physical simulation, the averaged output currents and voltages are determined in the model DutyCycleWithLosses as a function of the input voltage or inductor current, the set duty cycle and the power losses of the MOSFETs (Fig. 21).The block add exchanges the DutyCycle so that the behavior of the averaging model corresponds to the one of the switching model.The corrected duty cycle is used together with the measured current and voltage to determine the averaged values, which are passed by the pins DutyVoltage and DutyCurrent to the model CHBuckBoostAveraged.In this model, the MOSFETs are replaced by current and voltage sources which provide the average values (outputs DutyCycleWithLosses). Consequently, the inductor is charged by the voltage source signalVoltage and discharged via the current source signalCurrent.Since there are no ripples in the circuit, no smoothing capacitors are required.Another significant difference to the switching models (Fig. 5) is that the measured current is delayed via a first order proportional time element instead of a zeroOrderHold element.The reason for this is that it is interpreted as a switching element and thus delays the measured value used in the control algorithm.

Simulation of the Control
The controller blocks are almost identical to those of the switching variants, only the operating mode of the DC-DC converter via the Direction pin is not determined.The additional model CHCompensation adjust the ISETA signal depending of the activated channels.The parameters EnableCH1 and EnableCH2 are the boolean inputs.If both channels are activated, the signal ISETA is halved other it is passed on without change.

Validation of the Averaging Model
A first comparison between the transfer function and the averaging model shows barely any deviations (Fig. 23).A more detailed comparison shows that the averaging model reacts faster to the jump, but takes longer to compensate the control deviation (Fig. 24).After 0.013 s (Fig. 24) the averaging model reaches the set point of 80 A, while the transfer function has a permanent control deviation of 0.0075 A. One possible reason for the remaining deviation could be that the theoretical transfer function is also an approximation.For the comparison between the models, the simulation processes (Fig. 10) are performed and the results are compared in terms of the computational time and effort.The simulations are executed on an Intel i5-4690K with 3.5 GHz.The experiment is performed at the same interval length of 2E-7 s and the tolerance of 1E-7 s in each case.The high resolution is required for the accuracy of the model with diode emulation mode.As expected, the averaging model is the one with the shortest computation time and only requires 3.83 s (Fig. 25).The strictly complementary switching model takes 13.71 s and the one with diode emulation mode 107.91 s.For the latter, a difference can be seen between the test conditions.If no zero crossings occur (Fig. 25: between the simulation time 0.01 s and app.0.02 s) , the performance of the model is significantly better compared to the segments with zero crossings and diode emulation (Fig. 25 This comparison shows, that the averaging model significantly reduces the computational effort and time.As long as individual switching processes are not relevant, the averaging model is the preferred choice.The strictly complementary switching model can be used if only the rippling signal is necessary, If information about the exact switching processes of the MOSFETs is required, the diode emulated model has to be selected.averaging model with a PI controller is used (Fig. 26).The load sharing is realized in this case for a first test via the two gain blocks.These divide the drive signal between the two DC-DC converters by 70% and 30%.The result in Figure 27 shows that the load current is distributed as demanded.The set point of 80 A is reached 1.51 ms later compared to Figure 24.The reason for this is the used PI controller.Parallel connections of the switching models show the same behavior and therefore are not shown.

Conclusion and Outlook
Three different models of varying complexity have been proposed to simulate bidirectional DC-DC converters.Two switching models reproduce the individual switching operations and thus provides high accuracy.They differ essentially in driving mode, one of which switches the MOSFETs in a strictly complementary manner while the other one uses diode mode emulation.The strictly complementary switching model emulates current ripples and is suitable for simulation durations up to a few seconds.The model with diode mode emulation switches off the MOSFETs at currents lower than zero.This model is only suitable for  In future work, a more detailed consideration of the losses is planned.Separate heat ports for the individual components will be added to analyze the individual losses.Another extension is to make the load sharing between the DC-DC converters changeable during the simulation.The transfer functions of the DC-DC converter were defined in previous work.These will also be integrated into the simulation environment and compared with the averaging models in terms of computational effort and accuracy.

Figure 1 .
Figure 1.The bidirectional, half-bridge-based DC-DC converter is emulated by three different models of varying accuracy.

Figure 2 .
Figure 2. One of the two half-bridges of the multiphase DC-DC converter under investigation.Table 1 lists the properties of the components.

Figure 3 .
Figure 3. Switching signals of the MOSFET in diode emulation mode: If the current through the inductor reaches the value zero, the sync MOSFET is switched off and negative currents are avoided.(Texas Instruments Incorporated 2016a)

Figure 4 .Figure 5 .
Figure 4. UML class diagram and overview of the composition of the various subclasses of the strictly complementary switching model ControlledBuckBoost.

Figure 6 .
Figure 6.Overview of the model for the bidirectional DC-DC converter together with the interfaces. 51

Figure 7 .Figure 8 .Figure 9 .
Figure 7. Overview of the model TwoCHController for modeling the entire control of the DC-DC converter.

Figure 10 .Figure 11 .
Figure10.To verify the model, in this case ControlledBuckBoost, the step response is simulated and compared with the theoretical transfer function.

Figure 12 .
Figure 12.Step reponse of the strictly complementary switching model and the theoretical transfer function, Figure 13.UML class diagram and overview of the composition of the various subclasses of the switching model with diode emulated mode ControlledBuckBoost.

Figure 14 .
Figure 14.Overview of the model CurrentDirection-Correction for the diode emulated mode.In this case, the switching threshold for diode emulation is 0.4 A instead of 0 A in order to reduce the deviation.

shows a permanent control 65 Figure 15 .Figure 16 .
Figure 15.The model DiodeModeGen generates the switching signals for the MOSFETs according to the diode emulated mode (Fig. 3).

Figure 17 .
Figure 17.Step response of the switching model with diode emulated mode and the theoretical transfer function.

Figure 18 .
Figure18.Detailed analysis of the step response showing significant deviation of the model using diode emulated mode.There is a deviation of approximately 0.4 V with the sign depending on the PWM phase.
Figure 19.Reduction of the deviation by adjusting the current thresholds.

Figure 21 .
Figure 21.The model DutyCycleWithLosses determines the averaged output current and voltage according to the equations (3) and (4).DutyVoltage corresponds to V av,real and DutyCurrent to I av,ideal

Figure 22 .
Figure 22.The model CHBuckBoostAveraged is the averaging model of one of the two half bridges.The MOSFETs are replaced by current and voltage sources which provide the average values.
Switching and Averaging Models of a Bidirectional, Half-Bridge Based DC-DC converter with : between the simulation time 0 and 0.01 s).The averaging model requires only 3.5% computation time of the duration of the model with diode emulation and less than a third (27.9%) of the computation time of the strictly complementary switching model.The computation time depends on the equations to be calculated.The diode emulated model requires the most equations with 503370 in total.The strictly complementary switching model uses 25963 equations and the averaging one only 7 equations.

7Figure 24 .Figure 25 .
Figure 23.Comparison of the inductor current over time of the averaging model and the theoretical transfer function.

Figure 26 .
Figure 26.Possible use case of the averaging model: simulation of load sharing between two DC-DC converters connected in parallel, where one (controlledBiChopper1) consumes 30 percent of the charging current and the other one (controlledBiChopper) 70 percent.

Table 1 .
Component Table 1 lists the properties of the components.

Table 2 .
Relation between duty cycle and the control signals of the transistors Switching and Averaging Models of a Bidirectional, Half-Bridge Based DC-DC converter with Load Distribution 686 Proceedings of the Modelica Conference 2023 October 9-11, 2023, Aachen, Germany DOI 10.3384/ecp204683