How to build a 3 phase inverter

This page is a quick-start guide to build a 3 phase inverter using imperix’s high-end control hardware for power electronics. It is specifically made to accompany users who want to get familiar with imperix’s solutions and build their first converter with the B-Box RCP using the Simulink blockset. The converter is built using an imperix power electronic bundle, but other equipment configurations can also be used. For details on how to assemble a power converter in an open rack, please refer to How to build a buck converter (PN119).

3 phase inverter implementation

This guide will focus on the implementation of a 3 phase inverter with open-loop generation of 3 phase sinusoidal currents in a resistive load. The topology of this converter is shown in the following diagram. It is simply made of three half-bridge modules, each connected to an inductor in series with a resistor.

3 phase inverter schematic
3 phase inverter schematic

Required hardware equipment

The power electronic bundle contains all the required imperix hardware to build a 3 phase inverter. Alternatively, the individual components are listed below. The list comprises imperix products as well as additional components commonly available in power electronic research laboratories:

Passive components sizing

The circuit is built with 2.36 mH inductors from the passive filter box and 8.5 Ω resistors. Considering the operating conditions of the inverter, a DC bus voltage of 200 V guarantees a maximum output current of 8.3 A with a modulation index of 1. This is confirmed by the formula for the load current from the TN152 : $$I_{RMS}(M = 1) = \frac{\sqrt{2}}{4} \frac{V_{dc}}{\sqrt{R^2 + (2\pi fL)^2}} = 8.3\,\text{A}$$ The output current is therefore well below the 13.5 [A] rating of the load resistors. The table below shows the values and a suggested range for the passive components used in this system.

Chosen valuesSuggested range
DC Bus200 V50-800 V (cf note below)
Inductors2.36 mH1-5 mH
Resistors8.5 Ω5-100 Ω (cf note below)

Note that Vdc, R, L must be selected to guarantee that Irms is always smaller than the current ratings of the resistors, inductors, and power modules.

Building the 3 phase inverter

The schematic below serves as a reference for the wiring of the power converter and the B-Box RCP controller.

3 phase inverter wiring scheme
3 phase inverter electrical connections schematic

Starting on the front face of the bundle, the first step is to connect the ethernet port of the B-Box RCP to the computer’s local network or directly to the PC, to later be able to upload code to the B-Box. Then, as shown in the schematic below, one needs to connect the optical fibers, for PWM signals, from the B-Box RCP to the three modules. The sensors’ measurements are retrieved by connecting RJ45 cables from the modules to the analog inputs of the B-Box RCP. In this case, the DC bus voltage, as well as the three leg currents, are measured.

On the back of the bundle, the power supply is connected to the modules’ DC+ and DC- power terminals. Then, the middle point of each module is wired to an inductor which is then connected to one of the resistors. The three resistors are then connected together in a star configuration.

Converter’s wiring scheme

Configuration of the B-Box front panel

To be able to properly retrieve the measurements, the analog input channels of the B-Box RCP need to be configured properly (more information on the analog front-end configuration of the B-Box RCP can be found here: Analog front-end configuration on B-Box RCP). The following parameters need to be configured:

  • The impedance type (low or high)
  • The programmable gain
  • The desired filter
  • The protection tresholds (limit high and low)

The following schematic illustrates the fully configurable front-end of the B-Box RCP.

Analog front-end schematic
Analog front-end schematic

Note that the impedance type depends on the type of sensor used and the programmable gain needs to match the one that will be later configured in the ADC block in software.

Before doing any experiments, it is essential to always properly configure the protection thresholds of the B-Box analog input for safety reasons. Their purpose is to block the PWM outputs which immediately stops the operation of the converter in case of unexpected high voltages or currents.

The LCD screen and rotary-push button of the B-Box allow to read and write all configuration parameters of the analog front-end. To access the related menu:

  1. Push once, select ANALOG INPUTS and push again to confirm.
  2. Select the desired input channel and confirm.

The equation: \(l = s*G*m\) is used to compute the analog input threshold, with l being the input’s limit high/low, s the sensor’s sensitivity, G the analog gain, and m the maximum/minimum real current or voltage value. The following table summarizes the measurement ranges (according to the previously defined operating point) and the sensor’s sensitivity.

SignalChosen min/maxSensorSensitivity
\(I_{a,b,c}\)-10 – 10 [A] Module’s embedded current sensor50 [mV/A]
\(V_{in}\)0 – 200 [V]Module’s embedded voltage sensor4.99 [mV/V]
Measurement parameters

The measuring ranges involved allow for an analog input gain of x4 on all of the controller’s channels. Using the aforementioned formula the analog input limits are computed with some margin to avoid unwanted trippings. The chosen maximum output current is then set for 15A meaning a front panel limit of 3V. The DC bus voltage is chosen to be limited to 250V which gives 5V for the front panel limit. The configuration of the four analog input channels is summed up in the table below.

Measured signalInput channel numberLow impedanceGainFilterLimit high [V]Limit low [V]Disable safetySave
\(I_a\)0nox4no3-3noyes
\(I_b\)1nox4no3-3noyes
\(I_c\)2nox4no3-3noyes
\(V_{DC}\)3nox4no5-0.2noyes
Analog input configuration

Software

Two pieces of software are required to develop the B-Box control code. The imperix Automated Code Generation Software Development Kit (ACG SDK) can be downloaded here. Besides, a compatible version of Matlab (2016 and newer) is required as well as the following toolboxes:

  • Matlab Simulink
  • Embedded coder
  • Matlab coder
  • Simulink coder
  • The Simscape Power Systems blockset

For a detailed guide on how to set up the software solution, please refer to the Installation guide for imperix ACG SDK (PN133).

The control model to implement a simple open-loop control of the output current is given below as well as step-by-step instructions on how to create it. To go further and implement closed-loop current control of the inverter, please refer to TN106.

User template

The following steps show how to build a 3 phase inverter control algorithm. The user can code, as aforementioned, using Simulink or PLECS. This guide will focus on Simulink, however, both programming options are introduced in the following two pages:

To start working with Simulink, one can find a project template in:

C:\imperix\BB3_ACG_SDK\simulink\user_template\imperix_template.slx

This template is preconfigured for code generation for imperix controllers. It should then be copied in the desired working directory and renamed. When opening this file, a controller and a plant block are displayed as shown below.

The plant block contains the simulation model of the circuit and will not be detailed here. Further information can be found in Simulation essentials with Simulink (PN135). The controller block is the one of interest since it is the model of the actual real-time code.

The CONFIG block

The CONFIG block, already present inside of the controller block, performs the basic configurations of the model. It is by default set to simulation. This parameter needs to be changed to code generation to program the B-Box RCP.

The ADC block

Then, the 3 phase inverter requires several blocks to work properly. First, three ADC blocks configure the ADC peripheral. The measurements are retrieved in software from raw 16 bits ADC values. The ADC block, therefore, gives the sensitivity and analog gain information required to properly compute the measured value. A configuration example is given below:

ADC BLOCK
ADC block mask

The PWM block

The PWM signals are generated by three carrier-based PWM blocks (CB PWM) and drive the three modules’ power transistors. A configuration example for these blocks is shown below.

PWM block
PWM block

Since both of the modules’ transistors are switched, the Output mode is set to Dual. The Carrier type is set to triangle and the Update rate is set to single (one update instant happening at the zero of the carrier).

The tunable parameter and probe blocks

The last two blocks used are the tunable parameter and the probe block. The tunable parameter is used to let the user set the voltage reference while the probe is used to watch the desired signal in real-time in the BB Control utility software.

Generation and real-time execution of the controller code

At last, the user can build the code by pressing Ctrl + B on Simulink (Ctrl + Alt + B on PLECS). This will automatically generate and compile the C code that will be uploaded on the B-Box RCP. Pressing Ctrl + B also launches the Cockpit monitoring software. Its purpose is mainly to operate the target using tunable parameters and to monitor the converter through probe variables. Please refer to the Cockpit – User guide for additional details on how to use Cockpit.

At this point, one can add the control variables, as well as the probes from the list of variables in the scope and rolling plot modules of Cockpit. In this case, the user can add the three measured current as well as the DC bus voltage: \(I_{a}\), \(I_{b}\), \(I_{c}\), \(V_{dc}\) and modulation index \(M\).

Note that since the sensors are designed for higher current and voltage measurements (50 [A] and 800 [V]), they might be a small offset, which can be compensated, when measuring smaller values.

The power supply can now be turned on and the voltage slowly increased to 200 [V]. To make sure that the input voltage measurement is correct, the user could verify that \(V_{dc}\) is indeed close to 200 [V] on Cockpit. The last step is then to set a value for the amplitude of the modulation signals, 0.8 for instance, and press the enable output button. A sinusoidal output currents of around 6 [A] RMS should be measured.

The following experimental currents show the expected results:

3 phase inverter experimental settings
Experimental phase currents

To go further…

A next step could be to connect the 3 phase inverter to the grid and replace the DC power supply with a photovoltaic panel with a boost stage, to form a Three-phase PV inverter for grid-tied applications and showcase the great potential of imperix’s solution for modular power converters.