Dual Active Bridge Converter
Overview
This RT Box demo model features a dual active bridge (DAB) DC/DC converter for battery charging applications. The following sections describe in detail the implementation of the power stage and controls using the PLECS Electrical and Control domains. This demo model has the following features:
The DAB delivers up to 50 kW from an 800 V DC input to a 200 V, 100 kWh battery pack. The DAB power stage has been implemented using the Dual Active Bridge component available in the Nanostep section of the PLECS library. The RT Box’s Nanostep solver simulates the converter with time steps in the single-digit nanosecond range. The small step size is critical to accurately model high-frequency DC/DC converters with an inductive AC link, such as the DAB, where the power transfer is very sensitive to the phase shift between the current and PWM signals.
The closed-loop current controller is a PI regulator with a non-linear feedforward action based on the DAB current-phase shift angle relation. The controller has been designed to achieve a 400 Hz closed-loop current control bandwidth. The output of the PI regulator sets the phase shift of the transformer primary and secondary PWM signals.
DAB current oversampling and a Moving Average Filter (MAF) have been implemented for the closed-loop current control. Oversampling and filtering are used since the PWM frequency is 40 kHz and the controller is executed at 400 kHz.
The plant and controller models are implemented in separate subsystems. This allows the same model to be used in an offline simulation in PLECS and for real-time simulations on the RT Box. In this demo, the plant model runs on one RT Box and another RT Box is used to simulate the digital control system in a virtual prototyping configuration. The two RT Boxes are connected for a complete closed-loop simulation.
This document discusses both the plant model and the current control design, with a special focus on modelling the phase shift modulation technique and the technical solutions for implementing oversampling.
The step size of the Nanostep solver is fixed based upon the RT Box hardware. In addition to the numerical algorithms running on the FPGA, the RT Box also uses the CPU core for electric circuit simulation and executing control algorithms. The CPU core’s discretization step size must be set appropriately for the dynamics of circuit and controller. In this particular model, the following discretization steps and execution times are achieved:
Fig. 1 Performance overview for the execution on two RT Boxes
Requirements
To run this demo model, the following items are needed (available at www.plexim.com):
Two PLECS RT Boxes and one PLECS and PLECS Coder license
Follow the step-by-step instructions on configuring PLECS and the RT Box in the Quick Start guide of the RT Box Target Support Package Documentation.
Two 37 pin Sub-D cables to connect the boxes front-to-front.
Note
Model
The top level schematic of the demo model is depicted in Fig. 2. The model is split into two subsystems: “DAB Plant” and “Controller”. Both subsystems are enabled for code generation by right-clicking on the component and selecting Enable code generation check box from the Subsystem + Execution settings… menu. The “DAB Plant” subsystem will run on one RT Box and the “Controller” subsystem will run on a second RT Box.
The inherit delays of the closed-loop control are modelled in the offline simulation. Therefore, a Delay block (\(z^{-1}\)), with sample time equal to one Controller acquisition step (Tdisc.Acq), is added to the offline simulation.
Fig. 2 Top level schematic of the DAB plant and controller model
Plant Model
Fig. 3 shows the circuit model of the “DAB Plant”, which comprises a DAB connected to a 200 Vdc battery pack on the low-voltage (LV) side and an 800 Vdc source on the high-voltage (HV) side. Tab. 1 shows the physical parameter used in this demo model.
\(V_{\mathrm{LV,nom}}\) |
\(V_{\mathrm{HV,nom}}\) |
\(C_{\mathrm{LV}}\) |
\(I_{\mathrm{LV,nom}}\) |
\(P_{\mathrm{nom}}\) |
\(R_{\mathrm{lk}}\) |
\(L_{\mathrm{lk}}\) |
\(f_{\mathrm{sw}}\) |
\(E_{ESS,nom}\) |
|---|---|---|---|---|---|---|---|---|
\(200 \,\mathrm{V}\) |
\(800\,\mathrm{V}\) |
\(10\,\mathrm{mF}\) |
\(250\,\mathrm{A}\) |
\(50\,\mathrm{kW}\) |
\(100 \,\mathrm{m}\Omega\) |
\(1.75\,\mathrm{\mu H}\) |
\(40\,\mathrm{kHz}\) |
\(100\,\mathrm{kWh}\) |
Fig. 3 Schematic of the DAB plant model
The plant model uses the following blocks from the RT Box Target Support Library to access the physical input and output ports of the RT Box:
The PWM Capture block samples incoming switching signals at the Nanostep solver execution interval. The sampling interval is 7.5 nanoseconds on the RT Box 1 and CE and 4 nanoseconds on the RT Box 2, 3 and 4. The sampled switching signals are mapped to the “Dual Active Bridge” component found in the “Electrical” section of the PLECS library under the “Nanostep” sub-library. The DAB’s “Configuration” parameter and PWM Capture block’s “Offline behavior” are both set to the
Nanostepoption.Analog Out blocks provide the analog signals required by the controller subsystem such as battery current, input voltage, and output voltage. The Analog Out component contains scale and offset parameters that are set to avoid saturating the analog outputs of the RT Box and to match IO requirements of connected hardware or controller. Appropriate scaling factors can be determined with an offline simulation in PLECS. In the case of the grid-side voltage, the nominal voltage value is \(800\,\mathrm{V}\). An extra 50% voltage margin is added in order to allow for voltage deviations and transients on the voltage signals. The RT Box analog input voltage range for the controller is \(\pm10\,\mathrm{V}\), as specified by the user in the Target tab of the Coder Options window. Therefore, the Analog Out parameters were set as:
\[V_{\mathrm{HV,scale}} = V_{\mathrm{Range-AO}}/V_{\mathrm{HV,max}} = 20/1200,\]\[V_{HV,\mathrm{offset}} = -V_{\mathrm{Range-AO}}/2 = -10 \ \mathrm{V},\]\[V_{\mathrm{LV,scale}} = V_{\mathrm{Range-AO}}/V_{\mathrm{LV,max}} = 20/300,\]\[V_{\mathrm{LV,offset}} = V_{\mathrm{Range-AO}}/2 = -10 \ \mathrm{V},\]\[I_{\mathrm{LV,scale}} = V_{\mathrm{Range-AO}}/(I_{\mathrm{LV,max}}\cdot2) = 20/(750\cdot2),\]and,
\[I_{\mathrm{LV,offset}} =0.\]
Note that in this virtual prototyping setup it does not matter which IO channels are configured, but the channel IDs must match between the “Controller” and “DAB Plant” subsystems.
The battery pack model has been built based on the Panasonic UR18650A cell, which has the following characteristics:
Rated Capacity |
Nominal Voltage |
Charging: CC-CV, Std. 1505 mA, 4.20V |
|---|---|---|
\(2250 \ \mathrm{mAh}\) |
\(3.6 \ \mathrm{V}\) |
\(3\ \mathrm{h}\) |
The charge and discharge characteristic of the cell are shown in Fig. 4. A battery pack of 200 V, 50 kW, and 100 kWh, has been modelled with 239 parallel cell branches, with 56 cells in series in each branch.
Fig. 4 Charging and discharging characteristics of a Panasonic UR18650A battery cell
The DAB converter is formed by two full bridges (FBs) interconnected by a medium frequency transformer (MFT). The MFT has been modeled with an ideal transformer in series with a resistive-inductive impedance representing the transformer winding resistance and leakage inductance, as shown in Fig. 3.
There are several different approaches to control a DAB, however a common approach is to use phase shift modulation. The DAB is operated with a constant duty cycle for both the HV and LV FBs and the phase shift between the HV and LV PWM carriers is used to control the current. Fig. 5 shows the typical waveforms of a DAB operated under phase shift modulation.
Fig. 5 DAB voltage and current waveform during operation, in an RT Box 1, at 10 kHz and \(1.25\,\mu s\) simulation step size.
For an average carrier period, the current drawn from the low voltage terminal is given by:
where \(V_{\mathrm{HV}}\) is the voltage at the HV DAB terminal, \(f_{\mathrm{sw}}\) is the switching frequency, \(L\) is the leakage inductance of the MFT, \(n\) is the MFT’s turn ratio, \(T_\mathrm{c} = 1/f_{\mathrm{sw}}\) is the carrier period, and \(\Phi\) is the relative phase-shift angle between the PWMs applied to the switches of the LV and HV FBs.
For \(\Phi = 0\) the output is zero, then current increases non-linearly with \(\Phi\), until a maximum is reached for \(\Phi = \pi/2\). If the phase shift angle is further increased, the output decreases until it reaches zero at \(\Phi = \pi\). Fig. 6 shows the expression of the battery-side current (\(I_{\mathrm{LV}}\)) as function of the phase shift angle (\(\Phi\)). By analyzing Eq. (1), it can be seen that, the battery current (\(I_{\mathrm{LV}}\)) is not dependent on \(V_{\mathrm{LV}}\).
Fig. 6 Non-linear \(I_{\mathrm{LV}}\) expression as function of the phase shift angle \(\Phi\)
Controller
Fig. 7 shows the PLECS schematic with the controller implementation. The main controller features are summarized as follows:
Oversampling implementation of input signal \(I_{\mathrm{LV}}\).
Calculation of averaged \(I_{\mathrm{LV}}\) per switching cycle.
Look-up table based feedforward + PI current regulator.
400 Hz designed control bandwidth for PI tuning.
Fig. 7 Schematic of the controller model
The “Controller” subsystem contains the following components from the RT Box Target Support Library:
Analog In blocks provide the analog signals from the “DAB Plant” subsystem. The input signals can be scaled and offset, similar to the Analog Out block. In this model, the Analog In scaling factors are set to the inverse of the Analog Out scaling factors. The current and voltage values in the “Control” subsystem will then correspond to unscaled voltage and current measurements in the power stage.
The PWM Out block is used to generate the appropriate PWM signals at the digital out connector. In this model duty cycle and frequency modulations are not used, therefore all PWM signal are given a constant duty cycle value of 0.5, and frequency of 40 kHz. The intention of the phase shift angle command (\(\Phi^*\)) is described below.
Oversampling implementation and Filtering
In order to avoid the introduction of high-order/complex physical filters in the DAB plant, the switching DC current at the FB input, before the filter capacitor, has been used as feedback for the control. This approach requires the use of oversampling methods in order to accurately calculate the average converter current over a switching period. This implementation allows for a faster execution of the converter model at the expense of a more complex controller structure.
\(I_{\mathrm{LV}}\) is sampled 10 times per switching cycle, every \(2.5\,\mu s\) (\(T_{\mathrm{disc.Acq}}\)), for a 40 kHz switching frequency (\(f_{\mathrm{sw}}\)). A MAF is used to obtain the average \(I_{\mathrm{LV}}\) during the switching period. The averaged \(I_{\mathrm{LV}}\) current is sampled once per switching cycle, synchronizing with the control execution time step.
The MAF is implemented with a discrete transfer function, given by:
where \(N\) is the number of samples for every switching period. The output of the MAF is then given once every \(25\,\mu s\) (\(T_{\mathrm{disc.Control}}\)), in order to synchronize the DAB current measurement with the control execution.
Fig. 8 Oversampling and averaging of \(I_{\mathrm{LV}}\) current
PWM generation
The control calculates the phase shift angle that needs to be applied to the FBs to regulate the current. A PWM Out (Variable) block from the RT Box Target Support Library is used, since it allows the phase shift between the PWM carriers to be dynamically adjusted. The block accepts carrier phase shift values for each PWM channel from 0 to 1 in p.u. (i.e. 0 means \({0}^{\circ}\) phase shift and 1 means \({360}^{\circ}\) phase shift). The first channel defined in the PWM block acts as master, therefore, the phase shift specified for the rest of the channels sets the phase shift with respect to the master channel. It is important to remark that the block does not accept negative phase shift values.
In order to adapt the phase shift angle from radians to p.u. and account for negative values, the following implementation is provided in this demo model:
For the DAB implementation four different PWM signals need to be generated, two for each FB. The two PWM signals for the same FB are phase-shifted \({180}^\circ\). An additional phase shift is applied to the PWM signals of the HV FB with respect the PWM signals of the LV FB. In total 4 phase shift angles need to be provided.
For implementations where the sampling and switching periods are equal, the phase shift provided for the first (master) PWM channel is commonly set to zero. However, with oversampling, the first PWM has to be shifted. The reason for this is the following: the counters configured with the “PWM Out (Variable)” block, are restarted every time the blocks are executed, every \(T_{\mathrm{disc.Acq}}\) in this particular case. Since \(T_{\mathrm{disc.Acq}}\) is significantly smaller than the switching period, \(T_{\mathrm{disc.Control}}\), the PWM output signal are not generated properly. In order to account for this behavior, the master PWM is shifted. A simple Triangular Wave Generator is used with Minimum signal value 0, Maximum signal value 1, Frequency \(f_{\mathrm{sw}}\), duty cycle 0, and Phase delay 0. This generates a ramp, which is 1 at the switching instant and reaches 0 at the next switching instant.
Fig. 9 shows the “phase shift generator” implementation.
Fig. 9 Schematic of the phase shift generator subsystem
Plant Linearization
As shown in Fig. 6, the \(\Phi-I_{\mathrm{LV}}\) expression has been linearized for the controller design. The small signal expression, derived from Eq. (1), between the perturbation of current (\(\Delta I_{\mathrm{LV}}\)) and phase shift angle (\(\Delta \Phi\)) is given by:
Fig. 10 shows the \(K_{\mathrm{DAB_I}}\) values for different operating points, where \(K_{\mathrm{DAB_I}}\) is the current gain as a linear function of phase angle. For the PI regulator tuning purposes it has been found that the use of a linear approximation of \(K_{\mathrm{DAB_I}}\) is sufficiently accurate to model the closed-loop dynamics of the system with relatively low closed-loop control bandwidths [2].
Fig. 10 \(K_{\mathrm{DAB_I}}\) values for different phase shift angles
Feedforward controller
Frequency modulated or phase shift modulated power converters are well suited for controllers with feedforward control. In this particular example, the relation between the battery current (\(I_{\mathrm{LV}}\)) and the control action (\(\Phi\)) is given in Eq. (1). The required control action can be pre-computed for different operating conditions (e.g. different values of \(V_{\mathrm{HV}}\)). The expression to calculate the control action is the following:
with,
The feedforward control action provides a good approximation of the required phase shift angle to provide the required battery current. The PI regulator resolves the difference between estimated phase shift from the feedforward function and the measured variable \(I_{\mathrm{LV}}\). The differences between the calculated and measured values originate from parameter variations (e.g. \(L\) variation with temperature), unaccounted losses in the DAB model, and interpolation approximations between two pre-computed feedforward values. In this demo model a look-up table has been used to implement the \(\Phi_{\mathrm{FF}}\) pre-computed values, as a function of \(I_{\mathrm{LV}}\) and \(V_{\mathrm{HV}}\).
Fig. 11 Data points for feedforward look-up table
Measured signals used in the feedforward control path are filtered using a discrete Low Pass Filter (LPF) in order to avoid instability problems due to high frequency disturbances.
PI controller tuning
The tuning methodology shown in [2] has been used to tune the PI regulator in this work. In order to derive the closed-loop transfer function, MAF is approximated as a simple LPF. A comparison of the frequency responses of both LPF and MAF are shown in Fig. 12.
Fig. 12 Frequency response of implemented Moving Average Filter and Low Pass Filter approximation
The expression of the LPF is obtained from a first-order Padé approximation of the MAF expression in the s-domain. Both expressions are as follows:
and
where \(T_\mathrm{s}\) is the MAF window length, which in this model is equal to the switching period.
Once the MAF approximation has been obtained, the open-loop transfer function is shown in Eq. (8). It is important to remark that the feedforward control path has not been taken into account for the PI regulator tuning procedure.
Re-arranging the PI regulator transfer function (\(PI(s) = k_\mathrm{p} + k_\mathrm{i}/s\)), and using the \(\omega_{LPF}=2/T_\mathrm{s}\) as the LPF cut-off frequency, the open-loop transfer function is as follows:
A zero-pole cancellation technique is employed by selecting \(k_\mathrm{p}/k_\mathrm{i} = \omega_{LPF}\), and the closed-loop transfer function is calculated:
The zero-pole cancellation simplifies the system to a first-order transfer function. In this scenario, \(k_\mathrm{p}\) can be selected to achieve the desired current control closed-loop bandwidth, \(\omega_{\mathrm{CL}}\). The selection of the PI regulator gains are calculated with the following expressions:
and
Simulation
This model can run both, in offline mode on a computer or in real-time mode on the PLECS RT Box. For the real-time operation, two RT Boxes (referred to as “Plant” and “Controller”) need to be set up as demonstrated in Fig. 13. The figure shows a RT Box 1 in the setup but other versions of the RT Box are also possible.
Fig. 13 Hardware configuration for the real-time operation of the demo model (example), runs with all versions of the RT Box
Please follow the instructions below to run a real-time model on two RT Boxes:
Connect the Analog Out interface of the “Plant” RT Box to the Analog In interface of the “Controller” RT Box, and the Digital In interface of the “Plant” RT Box to the Digital Out interface of the “Controller” RT Box (e.g. using two DB37 cables shown in Fig. 13).
From the System tab of the Coder options… window, select the “DAB Plant” and Build it onto the “Plant” RT Box. Then, select “Controller” and Build it onto the “Controller” RT Box.
Once the models are uploaded, from the External Mode tab of the Coder options… window, Connect to the “Controller” RT Box and Activate autotriggering.
Note
As shown below, the Manual Signal Switch in the “Controller” subsystem in its default “up” position enables switching, once both the “Plant” and the “Controller” Box are up and running.
Changing it to the “down” position trips all PWMs into the safe state, and resets the PI Controller integral part to its initial condition.
The safe state is configured in the Protection tab of the PWM Out block.
Now, the DAB current reference is toggled between two values, which may be changed between a maximum (\(250\,\mathrm{A}\)) and minimum (\(-250\,\mathrm{A}\)) value, depending on whether the battery is intended to be charged or discharged, by modifying the value of the “\(IL_{\mathrm{refmax}}\)” and “\(IL_{\mathrm{refmin}}\)” blocks within the “Reference Generator” block of the “Controller” subsystem. The step responses of the closed-loop current control loop are shown in Fig. 14. It can be seen that the controller tracks the current with the designed \(400\,\mathrm{Hz}\) bandwidth, when the feed forward action is disabled. The feed forward controller allows for a faster reference tracking.
Fig. 14 Reference current step test with feedforward enabled/disabled.
Conclusion
This RT Box demo model demonstrates a dual active bridge DC/DC converter with closed-loop current control, based on phase shift modulation, for battery charging applications. The demo model can run as an offline simulation or in real-time for hardware-in-the-loop or rapid control prototyping testing. The “Controller” subsystem runs with a discretization step size of \(2.5\,\mu s\), which is 10 times smaller than the switching period, allowing for the implementation of an oversampling technique for pulsating currents. The “DAB Plant” subsystem runs with a discretization step size of \(2.5\,\mu s\). The actual execution time on a RT Box 1 is \(1.2\,\mu s\) for the controller, while the plant model runs in \(2.3\,\mu s\).
Bibliography
[1]
J. Allmeling, and N. Felderer, “Sub-cycle average models with integrated diodes for real-time simulation of power converters,” IEEE Southern Power Electronics Conference (SPEC), 2017.
[2]
F. D. Freijedo, E. Rodriguez, and D. Dujic, “Stable and Passive High-Power Dual Active Bridge Converters Interfacing MVDC Grids,” IEEE Trans. Ind. Electron., vol. 65, no. 12, pp. 9561-9570, Dec. 2018.