AN 973: Three-phase Boost Bidirectional AC/DC Converter for Electric Vehicle (EV) Charging

ID 733436
Date 6/23/2022
Public

6.1. Generating HDL and QPF Using MATLAB Scripts

The Three-phase Boost Bidirectional AC/DC Converter for EV Charging design example provides MATLAB* files and scripts necessary to generate an Intel® Quartus® Prime software project and HDL code for the three-phase bidirectional AC/DC converter for an electric vehicle charging station. Under the matlab/Simulink directory, bidir_rectifier.slx and bidir_rectifier_2models.slx MATLAB files contain MATLAB models. The bidir_rectifier.slx file compares fixed-point and floating-point Simulink* models. The bidir_rectifier_2models.slx file compares the Simscape Electronics and Simulink floating-point models.

The model to generate HDL code for FPGA used in this design example is the Simulink fixed-point model contained in the bidir_rectifier.slx, named bidir_rectifier_fixed.

Follow these instructions to generate an Intel® Quartus® Prime software project and HDL using HDL coder for Intel® MAX® 10 FPGA Development Kit or Cyclone® V SoC Development Kit:

  1. Navigate to the matlab/Simulink directory and open one of the following files:
    • Cyclone® V SoC Development Kit: hdlworkflow_c5.m to generate an Intel® Quartus® Prime software project and VHDL code for the three-phase boost bidirectional AC/DC converter for EV charging.
    • Intel® MAX® 10 Development Kit: hdlworkflow_m10.m to generate an Intel® Quartus® Prime software project and VHDL code for the three-phase boost bidirectional AC/DC converter for EV charging.
  2. Click Run to execute the script in the MATLAB interface.
    Figure 19. Run MATLAB Script to Generate a Project
    Running the HDL workflow script generates the hdl_prj_c5/quartus_prj for Cyclone® V or hdl_prj_m10/quartus_prj (for Intel® MAX® 10) inside the matlab/Simulink directory. These newly created directories contain a full Intel® Quartus® Prime software project similar to the one delivered in this design example. This flow helps regenerate the HDL if you want to modify the model. The directory named hdl_prj_x/hdlscr is the newly generated HDL for the three-phase boost bidirectional AC/DC converter for EV charging based on the fixed-point Simulink model.