Documentation Home Page ◇ eHS Toolbox Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
Three-level NPC Converter - OP5707 - SPS
Description
This model illustrates the use of the eHS solver to compute the outputs of a three-phase three-level Neutral Point Clamped converter with a RLE load. It is intended to demonstrate the interconnection of the eHS solver with advanced I/O capabilities enabling the direct control of the eHS solver with an external device.
The typical application is the connection of voltage and current measurements computed in eHS to an external controller through a certain number of analog output channels. The circuit switches are controlled by this external devices and are connected to the solver through the digital input interface.
sim power systems OP5607 OP5707
Requirements
The RT-LAB, RT-EVENTS, SimPowerSystem and eFPGASIM toolboxes must be installed on the host and target computers in order to run this example model properly. Please refer to the product documentation for details on version compatibility.
The eHS solver requires an FPGA-based hardware board. This board will be configured with the attached binary file automatically when the model is loaded in the RT-LAB interface. This model uses a OP5607 as its active carrier board.
Setup and Connections
This model must be run with the Hardware Synchronized option, with the XHP mode enabled. The I/O interfaces for this model are as follows:
IO Group 1 Section A | OP5330-3 Analog Output board (16 channels) |
IO Group 1 Section B | OP5340 Analog Input board (16 channels) |
IO Group 2 Section A | OP5353 Digital Input board (32 channels) |
IO Group 2 Section B | OP5360-2 Digital Output board (32 channels) |
IO Group 3 Section A | OP5330-3 Analog Output board (16 channels) |
IO Group 3 Section B | OP5340 Analog Input board (16 channels) |
IO Group 4 Section A | OP5353 Digital Input board (32 channels) |
IO Group 4 Section B | OP5360-2 Digital Output board (32 channels) |
The Simulink simulation step time is set to 30 microseconds with the variable Ts defined in the ParametersInitialization.m file. The InitFcn callback calls this m-file to set different parameters of the simulation.
Procedure
Simulation with RT-LAB-based controller:
The following procedure will help the developer understand how to work with the eHS solver.
Click on "Run this demo" on the top of this page (if this page is displayed in the Matlab demo browser). The RT-LAB model using the eHS solver will open automatically, as well as the SimPowerSystem model describing the circuit to be solved.
Verify that the VC707 board ID is set correctly in the OpCtrl block in the RT-LAB model SM_Controller_eHS_IOs subsystem. In the "OpCtrl" block parameter panel, select the "Board ID" corresponding to the hardware on which eHS is executed. To get this information, select "Tools > Get I/O infos" on the target context menu in RT-LAB and find the index of your hardware.
Observe the SimPowerSystem model. You will find in it a three-phase NPC converter. This converter has twelve IGBT/Diode switches and six diodes, and can implement either a DC/AC converter (inverter mode) or AC/DC converter (rectifier mode). You will also see an LC filter and a RL + Back-EMF load on each phase, and various voltage and current measurement blocks.
The voltage of the DC source in input (Vdc) will be controlled from the RT-LAB console during the real-time simulation. The console also controls the PWM modulator reference frequency, as well as the PWM carrier frequency and the Back-EMF amplitude and phase (relative to the PWM modulator phase). Similarly, all fourteen voltage and current measurements will be sent back to the RT-LAB model console. Open both the RT-LAB console and master subsystem to see how the twelve switch control signals are generated from parameters in the console.
When the model is compiled in Simulink, the configuration of the eHS solver will be generated according to the SimPowerSystem circuit characteristics. Elements will be put into matrices and stored into .mat files that will be transferred into the solver when the model is run from the RT-LAB interface. This step is not mandatory, as matrices are regenerated during model compilation in RT-LAB.
To run a simulation including the eHS solver in real time, create a RT-LAB project and add the RT-LAB model of this example into the project. The SimPowerSystem model should not be added to the RT-LAB project, as it does not need to be transferred to the target computer for execution. Compile the model, then assign a target node to run it in real time, then load the model onto it.
Execute the real-time simulation and enjoy the results, changing the PWM modulator and carrier characteristics, and the voltage of the DC input and Back-EMF characteristics to suit your interests. The following results has been obtained with the original model by setting the RT-LAB Probe control to acquire 2500 samples per signal for acquisition group #1.
The RT-EVENT blocks in the model have a maximum number of events per time step per channel set to 4. This is adequate for any simulation step size up to twice of the PWM carrier period. If the PWM carrier runs faster than twice the simulation rate, more events per simulation steps are needed (twice the number of PWM periods that can be present in one single simulation step). All RT-EVENTS blocks and the eHS controller block have to be configured accordingly.
Note: The eHS outputs that are saved in the file NPCResults.mat by the OpWriteFile block during execution (for a limited duration - see the block parameters) , and are transferred to the folder .\Converter3Phase3LevelNPC_OP5607_rtlab_SM_Controller_eHS_IOs\OpREDHAWKtarget upon model reset. This .mat file can be used to visualize more accurately the outputs, or to compare the results of several simulations together.
Simulation with external controller:
The NPC converter can be used in a HIL simulation environment with an external controller. This controller uses some Current/Voltage measurements in the circuit and controls the circuit gating signals. Hence, a typical application uses the Analog Output interface of the simulator for the measurements in the circuit and Digital input interface for the switch control feedback.
Configure the Analog Output interface to sent the voltage and current measurements with a scale appropriate to the external controller. This is done through the Analog Output Mapping and Rescaling block Control Panel, located in the RT-LAB model console. An typical example of this is already included in the model, providing these signal mapping and scaling:
IO Group 1 Section A ch00 | Y05 Ia | 0.1 V/A |
IO Group 1 Section A ch01 | Y06 Ib | 0.1 V/A |
IO Group 1 Section A ch02 | Y07 Vab | 0.05 V/V |
IO Group 1 Section A ch03 | Y08 Vbc | 0.05 V/V |
In the RT-LAB model, click Configure Switch Gates button to map first 12 gating signals to DI. This will open the eHS Gate Control Selection dialog window where each switch can be configured with a Switch Control Type and Index.
Connect the Analog Output DB37 interface (IO Group 1A ch 0 to ch 15) to the external controller inputs.
Connect the Digital Input DB37 interface (IO Group 2B ch 0 to ch 15) to the external controller outputs.
Build and load the model from the RT-LAB interface.
Note: As the eHS circuit gate control signals are also sent to the Digital Output interface "IO Group 2B", the Gates control parameter "From Internal FPGA Signal (all)" can be tested by connecting a loopback DB37 cable between IO Groups 2A and 2B. Also, to visualize the rescaled analog output signals in the RT-LAB model console during the simulation, connect a loopback DB37 cable between IOGroups 1A and 1B.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter