> 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/aerospace-example-models/more-electric-aircraft.md).

# More Electric Aircraft

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

The **More Electric Aircraft** project demonstrates the use of the eHS solver to compute the outputs of an FPGA-based Microgrid circuit created using the OPAL-RT Schematic Editor in real time. The FPGA-based circuit uses decoupling blocks to improve the minimum time step of the simulated circuit. With this example project, the user is able to control the simulation parameters (inputs and gates values) in real-time via the RT-LAB console.

The model represents an **Aero Microgrid circuit**, with 4 three-phased AC Voltage sources connected to AC and DC loads. Below each source is an AC resistive load, and all the loads are connected together in a chain. Under each AC load is a rectifier circuit connected to a DC resistive load. The DC loads are connected two by two with each other. Most of the connection points between components can be connected or disconnected at will using switches. The image below represents an overview of the Schematic Editor circuit, with the different parts highlighted.

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

There are two decoupling blocks added to this Microgrid circuit. They both replace a capacitor at the exit of the left rectifier circuits. Those decoupling blocks allow the circuit to be separated in two parts, splitting the AC and DC sections. The time step can thus be improved compared to the non decoupled version.

## Detailed explanation

The RT model is composed of the following two main subsystems: the Console (SC) and the Master (SM).

* The **console subsystem**, which runs on the host computer, manages the communication between the host computer and the target simulator. It is used as a user interface during the real time simulation to control the model and visualize the outputs of the eHS solver.
* The **master subsystem**, which runs in real time on the target simulator, manages the communication between the CPU model and the eHS solver running on the FPGA. For example, gates and sources parameters sent from the console are processed in this subsystem and subsequently sent to the eHS solver.

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

RT-LAB, and eHS FPGA-based Power Electronics Toolbox must be installed in order to successfully run this example project.

This demo requires **HIGH PERFORMANCE license** to run properly.

## 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>>Aerospace >>AeroMicroGridDecoupling**.
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.

<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

It is possible to execute this simulation in different chassis. The “Simulator Selection” block 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-bb2fe2568924fe66741d14b60d52bb12fa3d3e72%2Fehs-model-elecaircraft-2.png?alt=media" alt=""><figcaption></figcaption></figure>

The following parameters used for the simulation are editable by the user in the model:

* Ts: CPU simulation time step, default value is 20 ­µs.
* Amplitude: Amplitude of the AC voltage sources.
* Frequency: Frequency of the AC voltage sources.

There are also various switches that can be open or closed in the circuit, “off” meaning the switch is open and “on” meaning the switch is closed:

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

### Run the model

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.

The bottom displays show the RMS of the AC source voltages on phase A and the power output of the AC sources

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d9ab30ccfb83c2e51acf8482a216093e201b5d16%2Fehs-model-elecaircraft-4.png?alt=media" alt=""><figcaption><p>Phase A voltages RMS and AC Sources power output</p></figcaption></figure>

The first scopes show the AC sources voltage and current measurements

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-9782100ab8c1ed70a0e7ac18b14d63997a8a11ef%2Fehs-model-elecaircraft-5.png?alt=media" alt=""><figcaption><p>Voltage applied to AC load 1</p></figcaption></figure>

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d7ae4af900ce30ca3add748fd5387565d728eb49%2Fehs-model-elecaircraft-6.png?alt=media" alt=""><figcaption><p>Current output from AC voltage source 1</p></figcaption></figure>

The last scopes show the rectifier circuits' outputs

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-da878d0e8df6d25e38522f5894f627bcff23cce6%2Fehs-model-elecaircraft-7.png?alt=media" alt=""><figcaption><p>Rectified voltage and current out of rectifier circuit 1</p></figcaption></figure>


---

# 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/aerospace-example-models/more-electric-aircraft.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.
