> 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/rt-lab/example-models/ehs-example-models/features-example-models/stubline-transformer.md).

# Stubline Transformer

## Description <a href="#description" id="description"></a>

The **Stubline Transformer** model illustrates the use of the stubline to couple a CPU model to eHS through transformer inductance. In the same model, three circuit, are being simulated. One with the stubline between the CPU and eHS, one with a stubline only on CPU, and one without decoupling. As it can observed, all measurements are superimposed.

## Detailed explanation

The RT-LAB model consists of a master subsystem (i.e. "sm\_computation") and a console subsystem (i.e. "sc\_user\_interface").

* The **master subsystem** has power network interface ("eHS\_SE\_SFunction\_Drivers")
* There is a model using stubline all in CPU
* There is a model without decoupling

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-13886657453f2c5fb8af95cdf1aa571d7d2b5b54%2Fehs-model-stubline-1.png?alt=media" alt=""><figcaption></figcaption></figure>

* The **console subsystem** is used to control the switch to vary the load on the DC side. Results from the three different implementations can be observed as well.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-c9e55aabbf3d33da00668a03cd81d5480d7e673f%2Fehs-model-stubline-2.png?alt=media" alt=""><figcaption></figcaption></figure>

The **"eHS\_SE\_SFunction\_Drivers" solver** solves the power network built using schematic editor software during the real time simulation. The circuit built in schematic editor can be edited or viewed by choosing the edit option available in the solver block. The stubline connection is done through the half-line block. Similar block can be found in sm\_computation, note that the same parameters must be entered in both CPU and eHS model.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-c570b717ffc3c035a495941b44f07133db6d0596%2Fehs-model-stubline-3.png?alt=media" alt=""><figcaption></figcaption></figure>

## Requirements <a href="#requirements" id="requirements"></a>

The RT-LAB, Schematic Editor/Unified Database 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.

## Simulation and results

In order to run the example, follow the procedure below:

1. If eFPGASIM is installed, add the example project to RT-LAB by selecting **File>>New>>RT-LAB Project>>eFPGASIM>Schematic\_Editor\_Workflow>>Features >>Stubline**.
2. Compile the RT Model by clicking on **Build** in RT-LAB.
3. Once the model has been successfully built, **Load** and **Execute** the model in RT-LAB in order to begin the real-time simulation.
4. Once the real-time model and the eHS are running, observe the results of the eHS simulation by opening the **measurements** subsystem in the Simulink Console.

<details>

<summary><strong>S-function Workflow</strong></summary>

The **Mezzanine Option block** is an RT-LAB block used in the **S-Function workflow** to configure the settings of the I/O cards for each mezzanine. The available settings depend on the specific type of I/O card.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-f1b6053e49e0affae24fc2d39f5f8bcc8688cd6f%2Fboost-2levelinverter-exmodel-sfunction.png?alt=media" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>OpalBoard workflow</strong></summary>

[OPAL-RT Board](https://www.opal-rt.com/docs/rt-lab/configure-ios/analog-digital-and-sfp-ios/opal-rt-board-workflow.md) allow the configuration of I/O card settings for each mezzanine.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-2f4eed5a89d21acaca1e8426fce5331e36396a68%2Fboost-2levelinverter-exmodel-opalboard.png?alt=media" alt=""><figcaption></figcaption></figure>

If, for a given I/O mezzanine, this block is not used, then the corresponding settings will be kept at their default values. These default values are dependent on particularities of the bitstream, and they are not guaranteed to be exposed to the user loading their model. Further, the default values populating the Mezzanine Option block do not necessarily correspond to the default settings that will be seen if the Mezzanine Option block is not used.

Note that if a Mezzanine Option block is used, and the choice of mezzanine type is incorrect for the given slot, the model will still load and run. However, there will be errors in the load log in RT-LAB. For example, the following error is observed in the case that slot 1A on the simulator holds an OP5330-3, when we place a Mezzanine Option block that attempts to configure an OP5369 on slot 1A:

{% code overflow="wrap" lineNumbers="true" %}

```
Mezzanine configurator: OP5369 Threshold configuration.
ERROR: OPAL-RT Board: The threshold control register for slot 1A is in an unexpected state. Please reprogram the bitstream.
ERROR: Mezzanine configurator: Threshold configuration failed...
```

{% endcode %}

Further, as documented in the aforementioned RT-LAB page, the block outputs its status: a 0 in the case when the block’s settings have been correctly applied, and a -1 otherwise. For example, in the below model I incorrectly configured one block by giving it the wrong I/O card, and set the other correctly. The result when we load the model reflects this:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-a4fe002fb70685f86d0a022ad92068069ae7264d%2Fehs-opalboard-block-workflow.png?alt=media" alt="" width="188"><figcaption></figcaption></figure>

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-635a0707a1e24ec9979ba91be578dae9fe0d6dac%2Fehs-opalborad-model-blocks.png?alt=media" alt=""><figcaption></figcaption></figure>

</details>

{% hint style="info" %}
In S-Function workflow, example models support any chassis. You can contextualize your example model by selecting the chassis in the Chassis selection block.
{% endhint %}

### Setup and connections <a href="#setup-and-connections" id="setup-and-connections"></a>

This model does not require any IOs, as it is more a demonstrator of the expected results.

It is possible to execute this simulation in different chassis. The "Simulator Selection" block in "stublineTransformer" root allows the user to select the appropriate target and automatically change the configuration and firmware.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-84a44aca7515d56fb833cd97b32cea2ea7f63b83%2Fehs-model-stubline-4.png?alt=media" alt=""><figcaption></figcaption></figure>

### Run the model

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-ddd7e513eaf174e593e64fd8342f421bf8bf4613%2Fehs-model-stubline-5.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Stubline configuration <a href="#stubline-configuration" id="stubline-configuration"></a>

Stubline can be used as either a series-inductor or a shunt-capacitor where its value is given either in henry or farad. The other parameter to select is the decoupling latency which is the time it takes for a signal measured in eHS be sent to the CPU. When adding an inductive stubline, parasitic capacitance are also added. In the case of a capacitive snubber, parasitic inductor are added.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-6c3045f66b7f92085553df3090f757cd8bf484fb%2Fehs-model-stubline-6.png?alt=media" alt=""><figcaption></figcaption></figure>

$$
C\_{Parasitic}=\frac{(Decoupling Latency)^2}{2\cdot L\_{Stubline}} \\\[8pt]
L\_{Parasitic}=\frac{(DecouplingLatency)^2}{2\cdot C\_{Stubline}}
$$

In this example, Decoupling Latency is equal to 3 time the CPU sampling time, or 30µs


---

# 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/rt-lab/example-models/ehs-example-models/features-example-models/stubline-transformer.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.
