Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01515// Views: AA-01515// Created: 2018-07-19 14:09:40// Last Updated: 2021-08-20 08:45:37
HowTo
How to Convert an Existing eHS Model to Run Offline in Simulink

How To Convert an Existing eHS Model to Run Offline in Simulink

The eHS Solver block does not enable offline simulation.  Simulink models containing an eHS Solver block can be run offline without errors, but no signals will be output from the eHS Solver block because the circuit simulation must be run on an FPGA.  To validate the functionality of an eHS model without the use of hardware (an FPGA), we can emulate the functionality of the eHS Solver block using the eHS Offline Simulation block.

  1. Open an existing Simulink model containing one or more eHS Solver blocks and run offline to verify that no errors occur
  2. Double-click the eHS Solver block and make note of the following parameters:
    • Circuit file name
    • Sample time for eHS
    • Switch conductance (Gs) enumeration (note that the Show advanced settings for eHS solver option must be enabled in order to see this parameter)

Figure 1: eHS Solver Block parameters

  1. Remove the eHS Solver block from the model and replace it with the eHS Offline Simulation block, located in the Simulink Library Browser under eFPGAsim >> eHS and Converter Models >> Tools

Note: the library is hidden from RT-LAB 2020.1, it can be found in the eFPGAsim installation folder

Figure 2: eHS Offline simulation block

    1. Rewire the inputs and outputs of the eHS Offline Simulation block as follows:
      • U: Inputs of the electrical circuit
      • C: Gating signals for the switches of the electrical circuit
        • Note that RT-EVENTS signals are not supported with the eHS Offline Simulation block and must be converted to doubles using the RTE Conversion block
      • Y: Output measurements of the electrical circuit
    2. Double-click the eHS Offline Simulation block and configure the Circuit File Name, Switch Conductance (Gs), and Sample Time parameters as they were configured in the original eHS Solver block.  Note that the Sample Time must be an integer multiple of the fixed step size of the overall model.
    3. It is recommended to leave the Enable LCA option enabled.  For more information about the Loss Compensation Algorithm (LCA), please refer to the OPAL-RT eHS User Guide installed at this location: %EFPGASIM_ROOT%\Docs\pdf
    4. Save and run the Simulink model

    Note: Because there is no FPGA, the circuit simulation will be much slower than if it were running on a real-time simulator.  The purpose of the eHS Offline Simulation block is to test the stability of the circuit and validate the model functionality.