
CODE EXAMPLES
FOR B-Box RCP and B-Board PRO
This page introduces useful code examples for the B-Box RCP and B-Board PRO controllers. Most of them now directly link to our knowledge base, which gathers numerous technical articles as well as product-related documentation.
For those who are working with the good old BoomBox, hardware rev. 2.0, code examples can be found on the dedicated page.
Three-phase voltage source inverter

This example generates three-phase alternating currents from a voltage source inverter in an open-loop manner. It can serve as an introduction to imperix control and power products, but also as a reference model for performing a first set of tests on new equipment, or simply as a control code for a grid-forming inverter. The example provides reference files using the ACG SDK library for Simulink.
AN002: Three-phase voltage source inverter
Related notes:
- Getting started with the imperix ACG SDK
- ADC: Analog data acquisition
- CB-PWM: Carrier-based PWM


Three-phase voltage source inverter

This example generates three-phase alternating currents from a voltage source inverter in an open-loop manner. It can serve as an introduction to imperix control and power products, but also as a reference model for performing a first set of tests on new equipment, or simply as a control code for a grid-forming inverter. The example provides reference files using the ACG SDK library for Simulink.
AN002: Three-phase voltage source inverter
Related notes:
- Getting started with the imperix ACG SDK
- ADC: Analog data acquisition
- CB-PWM: Carrier-based PWM

Single-phase PV Inverter with Fictive-Axis Emulation

This example implements the control for a single-phase PV inverter. It uses a rotating reference frame and Fictive Axis Emulation (FAE), thanks to its excellent capability to decouple the active and reactive power flows.
AN003: Single-phase PV inverter
Related notes:

Single-phase PV Inverter with Fictive-Axis Emulation

This example implements the control for a single-phase PV inverter. It uses a rotating reference frame and Fictive Axis Emulation (FAE), thanks to its excellent capability to decouple the active and reactive power flows.
AN003: Single-phase PV inverter
Related notes:
Direct Torque Control (DTC) of a PMSM

This example shows the Direct Torque Control (DTC) of an electric drive using a Permanent Magnet Synchronous Machine (PMSM). The presented control strategy relies on the direct output capabilities of the B-Box RCP or B-Board PRO. Alternative techniques are also linked in the related notes, such as implementing customized firmware within the FPGA.
Related notes:


Direct Torque Control (DTC) of a PMSM

This example shows the Direct Torque Control (DTC) of an electric drive using a Permanent Magnet Synchronous Machine (PMSM). The presented control strategy relies on the direct output capabilities of the B-Box RCP or B-Board PRO. Alternative techniques are also linked in the related notes, such as implementing customized firmware within the FPGA.
Related notes:

Grid-tied converter with LCL filter

This example shows a possible control implementation for a three-phase grid-tied converter. The considered system is a back-to-back configuration, tied to the grid using a LCL-type filter. The example uses various control techniques and implements the active damping of the LCL filter. It can be fully implemented using imperix power modules and passive filters.
AN005: Three-phase grid-tied converter
Related notes:

Grid-tied converter with LCL filter

This example shows a possible control implementation for a three-phase grid-tied converter. The considered system is a back-to-back configuration, tied to the grid using a LCL-type filter. The example uses various control techniques and implements the active damping of the LCL filter. It can be fully implemented using imperix power modules and passive filters.
AN005: Three-phase grid-tied converter
Related notes:
Central PV inverter with boost

This example implements the control of a central inverter with a boost converter. The DC side is modeled as a non-ideal voltage source, representing an energy source such as a battery or photovoltaic panel. The grid is simply modeled by a three-phase AC source. The example provides reference files usable with both Simulink and PLECS.
Related notes:


Central PV inverter with boost

This example implements the control of a central inverter with a boost converter. The DC side is modeled as a non-ideal voltage source, representing an energy source such as a battery or photovoltaic panel. The grid is simply modeled by a three-phase AC source. The example provides reference files usable with both Simulink and PLECS.
Related notes:

Fast EV charger with intermediate energy storage

This example shows a possible control implementation for an electric vehicle charger with intermediate energy storage. This allows buffering the energy taken from the electric grid, so that such charging stations can be installed at weak grid locations. The presented charger relies on an isolated DC/DC stage using a medium-frequency transformer to guarantee galvanic isolation as well as to combine energy flows.
AN007: Fast EV charger with intermediate energy storage
Related notes:

Fast EV charger with intermediate energy storage

This example shows a possible control implementation for an electric vehicle charger with intermediate energy storage. This allows buffering the energy taken from the electric grid, so that such charging stations can be installed at weak grid locations. The presented charger relies on an isolated DC/DC stage using a medium-frequency transformer to guarantee galvanic isolation as well as to combine energy flows.
AN007: Fast EV charger with intermediate energy storage
Related notes:
Modular Multilevel Converter

This example shows the essential elements of a possible control implementation for a three-phase nine-level Modular Multilevel Converter with 24 submodules. The control is meant to be implemented using 3 B-Box RCP units, using the automated code generation SDK (ACG). The selected control approach is one of the simplest possible full closed-loop control scheme. The related Simulink files can be simultaneously used for simulation and automated code generation purposes.
AN009: Three-phase nine-level MMC
Related notes:
- TN106: Vector current control


Modular Multilevel Converter

This example shows the essential elements of a possible control implementation for a three-phase nine-level Modular Multilevel Converter with 24 submodules. The control is meant to be implemented using 3 B-Box RCP units, using the automated code generation SDK (ACG). The selected control approach is one of the simplest possible full closed-loop control scheme. The related Simulink files can be simultaneously used for simulation and automated code generation purposes.
AN009: Three-phase nine-level MMC
Related notes:
- TN106: Vector current control

Motor control for an Electric Vehicle

This example covers the control of an electric vehicle motor and its inverter, following a standardized WLTP speed profile. The control algorithm is tested in a back-to-back motor testbench with dynamic load emulation.
The control code is developed using ACG SDK for Simulink and executed on a B-Box RCP controller. Experimental results exhibit the total energy consumption during the test and the energy recovered by regenerative braking.
AN011: Motor control for an Electric Vehicle
Related notes:

Motor control for an Electric Vehicle

This example covers the control of an electric vehicle motor and its inverter, following a standardized WLTP speed profile. The control algorithm is tested in a back-to-back motor testbench with dynamic load emulation.
The control code is developed using ACG SDK for Simulink and executed on a B-Box RCP controller. Experimental results exhibit the total energy consumption during the test and the energy recovered by regenerative braking.
AN011: Motor control for an Electric Vehicle
Related notes:
Sensorless control of a wind turbine generator

This example covers the variable-speed sensorless control of a wind turbine generator with MPPT algorithm, and the emulation of the wind turbine by means of a motor drive running a physical model of the turbine.
The sensorless algorithm is based on a sliding-mode observer and implements an I-f startup strategy. The control code is developed using ACG SDK for Simulink and executed on a B-Box RCP controller.
AN012: Sensorless control of a wind turbine generator
Related notes:


Sensorless control of a wind turbine generator

This example covers the variable-speed sensorless control of a wind turbine generator with MPPT algorithm, and the emulation of the wind turbine by means of a motor drive running a physical model of the turbine.
The sensorless algorithm is based on a sliding-mode observer and implements an I-f startup strategy. The control code is developed using ACG SDK for Simulink and executed on a B-Box RCP controller.
AN012: Sensorless control of a wind turbine generator
Related notes: