Building your first eHS circuit with SPS Software
If you're anything like me, I love making circuits and connecting components to form a special function of my choice. What's great about eHS is that I get to configure the components and their specific details without being bound to limited off-the-shelf manufactured options, and actually test their performance in real time!
With eHS, you can draw your circuit and run it on an FPGA in real time or run a pure offline simulation with a clean UI and straightforward workflow.
In this tutorial, you'll learn how to:
- Build your circuit using only the blocks eHS supports
- Name your blocks properly so they're easy to identify in RT-LAB
- Avoid a common trap where your diode unexpectedly shows up as an input
Let's get straight into it!
🧰 What you'll need
- RT-LAB
- MATLAB / Simulink
- OPAL-RT SPS Software (formerly known as SimPowerSystems / Simscape Electrical Specialized Power Systems)
Step 1: Build your circuit with supported blocks
When building your circuit model in Simulink, keep in mind that the eHS solver cannot read every standard block. Stick strictly to supported blocks from the SPS libraries so your model translates smoothly:
From Elements:
- Series RLC Branch / Load
- Parallel RLC Branch / Load
- Ground / Neutral
- Breaker
- Pi Section Lines
- Linear Transformers
- Mutual Inductances
- Inductance Matrix Type Transformers
- Saturable Transformers (supported only in specific firmware versions)
From Power Electronics:
- Breaker, Diode, IGBT, IGBT/Diode, Ideal Switch, Thyristor
- Three-Level Bridge, Universal Bridge
Step 2: Name your blocks (order matters!)
The eHS solver identifies your switches, sources, and measurements and lists them in alphabetical order by name. That exact alphabetical order dictates how they are mapped and accessed inside Simulink and RT-LAB.
If you leave default names like Diode3 or AC Voltage Source1, your I/O signal routing quickly becomes confusing!
Follow this recommended naming convention:
| Component Type | Prefix | Description & Example |
|---|---|---|
| Switches | SW + 2 digits |
SW01, SW02_upper (Diode, IGBT, Breaker, Ideal Switch) |
| Sources | U + 2 digits |
U01, U02_Vdc (Controlled or independent current/voltage sources) |
| Measurements | Y + 2 digits |
Y01, Y02_Ia (Voltage or current measurements) |
| R, L, and C | No prefix needed | Handled internally by the passive network equations |
Rules to remember:
- Always use two digits: write
SW01orU01, notSW1orU1(otherwise alphabetical sorting will placeU10beforeU2). - Descriptive suffixes are allowed: e.g.,
SW01_PhaseA_High,Y03_Vload. - Three-phase sources take three indices: label them starting with phase A, e.g.,
U05 U06 U07 Vabc.
Step 3: Check your switches' Forward Voltage (Vf) ⚠️
This one catches a lot of people by surprise!
Many SPS switching blocks (like Diodes, Thyristors, and IGBTs) have a configurable Forward voltage (Vf) parameter (often defaulting to 0.8 V).
Here's the catch:
When the eHS solver analyzes your circuit, any non-zero Forward Voltage (Vf > 0) is treated as an eHS input.
Because of this, your diode or switch will suddenly pop up in your eHS inputs list right alongside your actual power sources (Uxx). This shuffles your expected input indexing and can mess up your control wiring!
💡 Good to know: Universal Bridges and LCA
- If you are using a Universal Bridge or Three-Level Bridge block with the Loss Compensation Algorithm (LCA) enabled, the eHS solver automatically ignores the mask's Forward Voltage parameter during extraction. Setting
Vfin these bridge blocks will not create extra input channels. - LCA is intended for Gen3 eHS blocks on 2-level and 3-level NPC topologies.
- For bridge blocks using LCA, ensure all switch conductance (
Gs) values within the bridge remain identical.
Have you run into other tricky quirks when prepping models for eHS? Drop your questions or tips below!


