This technical note deals with the implementation of the most basic bidirectional DC/DC converters, namely the buck or boost topologies.

First, the topology and the theoretical aspects are presented, including a short overview of the modulation technique.

Then, a possible control implementation on the B-Box RCP or B-Board PRO is introduced for both C/C++ and ACG implementations.

Finally, an example of a 4-legs interleaved DC/DC converter derived from AN006 is presented. Simulation and experimental results are also shown.

Software resources

  File Modified
File Boost_converter_PlecsViewer_2015a.slx Boost converter, Matlab 2015a with Plecs Viewer Jul 02, 2020 by Gabriel Fernandez
File Boost_converter.plecs Boost converter, Plecs Jul 02, 2020 by Gabriel Fernandez
File DCDC_4leg_converter_PlecsViewer_2015a.slx 4-legs DC/DC converter, Matlab 2015a with Plecs Viewer Jul 02, 2020 by Gabriel Fernandez
File DCDC_4leg_converter.plecs 4-legs DC/DC converter, Plecs Jul 02, 2020 by Gabriel Fernandez
File parameters.m Matlab file containing all the parameters of the system. Jul 02, 2020 by Gabriel Fernandez

Circuit topology

The topology of the DC/DC converter is shown in the figure below:

The exact converter type depends on the current/voltage blocking capability of the semiconductors. Notably, as a diode can only conduct current in one direction, buck and boost converters are by nature unidirectional.

That said, in case three-segment switches are used - made of a transistor with an antiparallel diode - the same circuit topology can allow bidirectional power flows. This so-called phase-leg structure can hence be seen at the sum of both the buck and boost topologies.

Imperix products

Circuit schematic of PEB8024

Imperix PEB-series modules are based on the same circuit structure, namely a phase-leg. They also provide embedded current and voltage measurements and the necessary gate-drive circuits, so that everything is ready for implementing buck or boost converters.

The three device variants are:

Circuit operation


The most commonly used modulation technique is the Carrier-Based PWM (CB-PWM). The use of a triangular carrier allows getting the average value of the current \begin{array}{l}I_b\end{array} when the sampling occurs at the top or the bottom of the carrier:

For an open-loop control, the relation between the voltages and the duty-cycle are:

  • For the buck and the bidirectional converter [1]: \begin{array}{l}V_b = d \cdot V_{DC}\end{array}

  • For the boost converter [2]: \begin{array}{l}V_b = (1-d) \cdot V_{DC}\end{array}


There are numerous ways to control buck or boost converters. Among closed-loop control techniques, linear control is particularly widespread. The following technical notes give further instruction in this respect:

  • PI-based control of the current \begin{array}{l}I_b\end{array}, detailed in TN105: Basic PI control implementation ;

  • PI-based cascaded control of the voltage \begin{array}{l}V_b\end{array} or \begin{array}{l}V_{DC}\end{array}, detailed in TN108: Cascaded voltage control.


[1] “Buck converter”, Wikipedia
[2] “Boost converter”, Wikipedia

B-Box / B-Board implementations



The imperix IDE provides numerous pre-written and pre-optimized functions for CB-PWM and PI controllers. The necessary parameters are documented within the corresponding .h header file.

See full code
float Ib, Vb, Vdc, VL;
float Ib_ref = 10;
float duty;
PIDController mycontroller;
float Kp = 18.75;
float Ki = 165;

tUserSafe UserInit(void){
//... some code
    Clock_SetFrequency(CLOCK_0, 20e3);
    ConfigureMainInterrupt(UserInterrupt, CLOCK_0, 0.0);
    Adc_ConfigureInput(0, IX_PEB4046_I_GAIN, 0);
    Adc_ConfigureInput(1, IX_DIN800V_GAIN, 0);
    Adc_ConfigureInput(2, IX_PEB4046_V_GAIN, 0);
    ConfigPIDController(&mycontroller, Kp, Ki, 0, 500, -500, 1/20e3, 0); 
    CbPwm_ConfigureClock(PWM_CHANNEL_0, CLOCK_0);
    CbPwm_ConfigureOutputMode(PWM_CHANNEL_0, COMPLEMENTARY);
    CbPwm_ConfigureCarrier(PWM_CHANNEL_0, TRIANGLE);
    CbPwm_ConfigureDeadTime(PWM_CHANNEL_0, 1e-6);
//... some code
    return SAFE;

tUserSafe UserInterrupt(void){
//... some code
    Ib  = Adc_GetValue(0);
    Vb  = Adc_GetValue(1);
    Vdc = Adc_GetValue(2);
    VL = RunPIController(&mycontroller, Ib_ref - Ib);
    duty = (VL + Vb)/Vdc;
    CbPwm_SetDutyCycle(PWM_CHANNEL_0, duty);	
//... some code
return SAFE;

Circuit examples

Basic buck or boost converter

To be completed

Interleaved DC/DC converter (4 legs)

The topology of this example is shown in the figure below:

A DC source is connected as shown. The mid-point of each phase-leg is connected to the battery through an inductor. One current PI current controller is used for each phase-leg. Legs N° 1 and 3 have a phase-shift set to 0, while legs N° 2 and 4 have a phase-shift set to 0.5 (180°): this technique allows reducing the total battery current ripple.

The phase-shifting of two group of legs has an impact on the control delay because the duty cycles are not taken into account at the same time in the PWM generators. More details about this subject can be found in the note PN142: Identifying the discrete control delay.

The total time delay is:

  • \begin{array}{l}T_s/2 + T_s + T_s/3 = 1.83 T_s\end{array} for leg N° 1 and 3;

  • \begin{array}{l}T_s/2 + T_s/2 + T_s/3 = 1.33 T_s\end{array} for leg N° 2 and 4.

This delay is used to compute the proper \begin{array}{l}K_p\end{array} and \begin{array}{l}K_i\end{array} for each leg of the converter.

Simulation and experimental results

A jump of current reference has been performed in both simulation and experimental modes. The following graph shows a comparison between the simulation with Simulink, the simulation with Plecs, and the experimental result:

For the simulation, results are identical between Simulink and Plecs. Regarding the experimental results, the time response is slightly slower than the simulation: this can be explained by the fact that not all the imperfections of the real system are taken into account (modeled) in the simulation, such as internal resistance of components or the tolerance on inductance’s value.

Going further

This 4-legs interleaved bidirectional DC/DC converter is used in the application note AN007: Fast EV charger with intermediate energy storage.

  • No labels