This workflow supports the OP45XX and OP56XX targets
Table of Contents |
---|
Creating a new RT-LAB Project
Open RT-LAB and follow these steps to create a new RT-LAB project:
...
The eHS_examples project will be created, and the corresponding RT-LAB model will be imported into the project workspace (in this example, the model is named Converter3Phase3LevelNPC_OP4510_rtlab).
Editing the model
Before building the model, verify that you can access and edit the model.
Click on Edit the model in the Preparing and Compiling pane. The model file will be opened in a new MATLAB/Simulink window.
Model description
The model is composed of two main subsystems:
- SC_Console: Subsystem executed by the host computer during the simulation to monitor and control the simulation.
- SM_Controller_eHS_IOs: Subsystem executed by the target simulator, in real-time, on the system CPU that communicates with the FPGA board and the physical system I/Os.
SC_Console
Double click on the SC_Console to open the SC_Console details window.
SM_Controller_eHS_IOs
Click on the SM_Controller_eHS_IOs to open the SM details window. This window provides a detailed diagram of the master subsystem.
eHS Gen4 CommBlk
The eHS Gen4 CommBlk communicates with the FPGA board to initialize the eHS core. During real-time operation, it provides eHS inputs (the circuit Sources / Gates control signals) and reads the eHS outputs (current and voltage measurements) at the RT-LAB model rate.
...
The user must provide a circuit file (SimPowerSystems SPS Simulink model) to declare the circuit that will be simulated inside the eHS core.
In this example, the circuit file is a model named Converter3Phase3LevelNPC.mdl.
Circuit File
The circuit file models an NPC converter. The eHS solver will extract the components netlist from this file and calculate the system equations before running them on the FPGA board.
Validating the Model
Run an offline simulation from the RT-LAB model to ensure that all the library links are resolved using your MATLAB instance.
...
- Click on the License tab to display the list of software licenses and make sure that XSG_EHS, RTLAB_RT, RTLAB_DEV, RTLAB_XHP and RTE_RT licenses are enabled. You must also have at least
- RTLAB_NUM_CORES >= 1
- RTE_NUM_CORES >= 1
- EHS_TOTAL_PERFORMANCE >= 1
- One of the following EHS: x128, x64, x32
Building the Model
- In the Preparing and Compiling window, click Build the model. The Building Model window appears.
- Verify that the model was successfully built by clicking Consult result in Compilation View.
...
3. Assign a target to the master subsystem simulation from the Assignment page. XHP must be ON.
Execution Properties
In the Execution tab, you must set the real time simulation mode to Hardware Synchronized.
Click the arrow in the field next to Real-time simulation mode and select Hardware synchronized from the drop down menu.
Loading the Model
In the Overview tab, click on Load the model. The console will open, and the real-time code will be uploaded to the simulator. The Loading model window appears briefly during the loading process.
The Display tab in the lower portion of the window will show load progress and details.
Executing the Simulation
Click on Execute the model to start the simulation. At the beginning of the simulation, eHS will initialize (it takes about 10,000 simulation steps). During this time the eHS outputs will remain at 0.
Clicking on the Display tab shows execution details.
|
Monitoring the Simulation
As soon as you load and execute the model, the Simulink console opens (behind RT-LAB) and you should be able to see the simulation running in the console window. The following example shows the three-phase load current of the converter.
...
Simulation operating conditions can be modified directly from the console. Simply click the desired signal in the console to open its Block Parameters window.
Stopping the simulation
Click on Reset the model to stop the simulation.