> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/examples/transmission/fpga-based-multirate-stubline-for-hypersim-ehs.md).

# FPGA-Based Multirate stubline for HYPERSIM/eHS

## Description

The **FPGA-Based Half-Line (CPU–eHS)** example, located in **File > Open an Example File > Transmission**, demonstrates how a multirate half-line can decouple two discretized subsystems—one running on the FPGA/eHS solver and the other on the CPU/HYPERSIM solver.

The objective is to split the network into two sections using a configurable transmission half-line to enable parallel computation, introduce a controlled decoupling delay, and, when used with transformers, substitute for leakage reactance.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-e89ebd9740af4030ed9056916f31bfe10117630e%2Fimage%20(521).png?alt=media" alt=""><figcaption></figcaption></figure>

## Requirements

This example requires a real-time simulator equipped with FPGA capability and Digital I/O modules.

The minimal time step in this example is 10 µs.

{% hint style="info" %}
If a different sampling time is used, update the half-line parameters accordingly.
{% endhint %}

## Detailed explanation

In this model, a rectifier is fed by a three-winding transformer configured as star–star–delta (Y–Y–Δ). The two secondary windings supply six phase-shifted AC inputs to the rectifier, increasing the pulse number, reducing ripple, and improving harmonic cancellation at the DC output. A multirate half-line with a three-time-step propagation delay is used with the transformers to provide decoupling in the global system of equations.

The multirate half-line is a transmission-line-inspired element that decouples two discretized systems through a selected inductance or capacitance and a defined round-trip latency. By introducing a delay between the state-space systems on each side, it enables parallel execution across CPU cores and between CPU and FPGA. Even on a single core or in offline simulation, the half-line can improve performance by creating a decoupling delay. When combined with transformers, the half-line can often replace leakage inductance while preserving desired dynamics.

### Half-line block configurations

| Name                    | Description                                                                                                                           | Unit |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---- |
| **Half stubline model** | Select *Use inductance only* or *Use capacitance only* to model the half-line as a pure inductance or a pure capacitance.             |      |
| **Inductance**          | Inductance value when “Use inductance only” is chosen.                                                                                |      |
| **Capacitance**         | Capacitance value when “Use capacitance only” is chosen.                                                                              |      |
| **Round trip latency**  | Communication latency for the round trip from HYPERSIM to eHS and back to HYPERSIM. Typically three times the HYPERSIM sampling time. |      |

### Schematic Editor configurations

In Schematic Editor, configure the simulator and solver as follows:

1. Click the firmware configuration in the bottom-left corner of Schematic Editor.
2. Select or create the simulation setup. All FPGA firmware supports the Half-Line model.
3. Click the Solver Settings button next to the firmware configuration.
4. Define the solver settings for the simulation.

The HYPERSIM example is reproduced in Schematic Editor. Configure the half-line parameters identically on both sides.

### I/O configuration

Because part of the simulation runs on eHS, connect HYPERSIM to the FPGA as follows:

1. Open the I/O Interface Configuration.
2. Add an OPAL-RT Board.
3. Select the correct Chassis ID. This example uses an OP4610XG (Kintex-7) simulator.
4. Select Optical as the generated synchronization signal type.
5. Select Standard repositories for the bitstream configuration location, then choose the bitstream configuration file:TE0741\_41\_4-EX-0001-eHSx128\_Gen4MachinesIOConfig2.opalBitstream name:TE0741\_4-EX-0001-3\_5\_0\_817-eHSx128\_Gen4\_Machines\_IOConfig2-3C-17.bin

## Simulation and results

The simulation results include source currents to each line and the DC voltage after the rectifier for three cases: Reference (no decoupling), CPU, and eHS. The Reference case is used as a baseline to assess the impact of the half-line decoupling.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-ce49c503d9e5bf651326eda9e7dea27dabb7f90b%2Fimage%20(522).png?alt=media" alt=""><figcaption><p>Comparison of results obtained in HYPERSIM vs eHS during the opening of a switch on the line at t = 0.5 s</p></figcaption></figure>

A comparison of HYPERSIM and eHS results during a line switch opening at t = 0.5 s shows the system is balanced in steady state before the event. A small discrepancy appears due to CPU/FPGA decoupling. This limitation can be reduced by increasing the inductance value or choosing a decoupling location with slower dynamics.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/examples/transmission/fpga-based-multirate-stubline-for-hypersim-ehs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
