Buck-boost DC/DC converter
Table of Contents
This technical note deals with the implementation of the buck-boost DC/DC converter topology, the most basic bidirectional DC/DC converter.
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
The zip file contains the control implementations presented on the page, for both Simulink and PLECS environments.
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

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
Modulation
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 \(I_b\) 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]: \(V_b = d \cdot V_{DC}\)
- For the boost converter [2]: \(V_b = (1-d) \cdot V_{DC}\)
Control
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 \(I_b\), detailed in Basic PI control implementation (TN105) ;
- PI-based cascaded control of the voltage \(V_b\) or \(V_{dc}\), detailed in Cascaded voltage control (TN108).
References
[1] “Buck converter”, Wikipedia
[2] “Boost converter”, Wikipedia
B-Box / B-Board implementations
ACG SDK for Simulink

ACG SDK for PLECS

C++ SDK
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.
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);
CbPwm_Activate(PWM_CHANNEL_0);
//... 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;
}
Code language: C++ (cpp)
Circuit examples
Basic buck or boost converter
An example can be found in the central PV inverter example.
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 groups 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 note Identifying the discrete control delay (PN142).
The total time delay (control + modulator delays) is:
- \(T_s + T_s/2 = 1.5 T_s\) for leg N° 1 and 3,
- \(T_s/2 + T_s/2 = T_s\) for leg N° 2 and 4.
This delay is used to compute the proper \(K_p\) and \(K_i\) 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 Fast EV charger with intermediate energy storage (AN007).