FPGA development on imperix controllers
Usually, the user programs the B-Box RCP or the B-Board PRO CPU using imperix ACG SDK or C++ SDK, and simply uses the pre-implemented FPGA peripherals such as the ADC drivers or PWM generators. Nevertheless, advanced users can also directly program the FPGA to implement high-performance algorithms or specialized peripherals.
This page summarizes the documentation pages relating to FPGA development on imperix controllers.
Executing power converter control algorithms on an FPGA
For control frequencies of 250 kHz or less, the CPU of the B-Box RCP is usually more than fast enough. Controlling a power converter using the FPGA instead of the CPU allows for even higher execution rates and lower computation latency. Our FPGA-based control of a grid-tied inverter example shows how an entire control algorithm can be ported to the FPGA and reach a control frequency above 650 kHz.
TN147: FPGA-based control of a grid-tied inverter
This example also demonstrates how High-Level Synthesis tools can be leveraged to generate complex FPGA modules such as a grid synchronization module with dq-PLL or a dq current control.
TN143: FPGA implementation of a PLL for grid synchronization
TN144: DQ current control using FPGA-based PI controllers
Starting an FPGA development project
Imperix offers the possibility to customize its FPGA firmware by instantiating the imperix firmware IP in Xilinx Vivado and editing programmable logic around it. The first step to start editing the FPGA consists of installing Xilinx Vivado Design Suite, which is available for free as the ML Standard (or WebPACK) edition.
PN168: Xilinx Vivado Design Suite installation
The user should familiarise himself with the imperix firmware IP for Xilinx Vivado. It contains the logic operating the FPGA part of the B-Box and B-Board controllers. The IP also provides user interfaces to exchange data with the CPU, retrieve conversion results of the analog inputs, drive the PWM outputs, and more.
PN116: Imperix firmware IP product guide
PN117: Download and update imperix IP for FPGA sandbox
The user can then create the FPGA development template by following the instruction in the product note below. This product note also explains how the template facilitates the retrieval of the sampled analog inputs and data exchange with the CPU, by using the AXI4-Stream protocol. Finally, it provides a “hello-world” example explaining step-by-step how to add custom logic, synthesize the design and load it into the FPGA.
PN159: Getting started with FPGA control development
Implementing closed-loop control of a buck converter in FPGA
The following notes show a step-by-step example of how to implement the closed-loop control of a buck converter in FPGA.
The first page presents three ways of implementing a custom triangular carrier PWM modulator, using VHDL or code generation tools such as System Generator or MATLAB HDL Coder.
TN141: Custom FPGA PWM modulator implementation
The second page explains how to create a PI-based current controller for a buck converter using high-level synthesis (HLS) tools such as Model Composer and Vitis HLS.
TN142: PI-based current controller for a buck converter
Learning about automated generation tools for FPGA
Traditionally, FPGA designs are implemented using HDL languages such as VHDL or Verilog. However, the user can use automated code generation tools to design FPGA modules without writing any line of any HDL language.
These tools can be separated into two main categories:
- HDL-level tools, such as System Generator and HDL Coder, in which the user can describe its design down to the flip-flop register. These tools are much closer to HDL languages (VHDL or Verilog).
- High-Level Synthesis (HLS) tools, such as Xilinx Model Composer and Vitis HLS, are particularly adapted to describe control algorithms using complex data types and math functions.
To implement peripherals, such as custom PWM modulators or communication interfaces, the HDL approach is recommended. The following pages deal with HDL code generation tools:
TN141: Custom FPGA PWM modulator implementation
PN161: Xilinx System Generator introduction
PN162: MATLAB HDL Coder introduction
To implement control algorithms, HLS tools are better suited. The following pages deal with HLS tools:
TN142: PI-based current controller for a buck converter
PN163: Xilinx Model Composer introduction
PN164: Xilinx Vitis HLS introduction
Additional examples
FPGA-based SPI communication IP for A/D converter
FPGA-based Direct Torque Control using Vivado HLS
FPGA-based hysteresis controller for three-phase inverter using HDL Coder
FPGA-based hysteresis current controller for three-phase inverter