> 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/renewable-energy/fpga-based-dual-active-bridge.md).

# FPGA Based Dual Active Bridge

## Description

The **FPGA‑based Dual Active Bridge** example, located in **File > Open an Example File > Renewable Energy**, demonstrates the use of the Gen5 eHSx128 solver to compute the outputs of an FPGA‑based Dual Active Bridge circuit in real time on a Versal board. The circuit is a bidirectional DC‑DC converter with two bridges separated by a single‑phase ideal two‑winding transformer. The circuit is created in the OPAL‑RT Schematic Editor, and simulation parameters can be adjusted in real time via HYPERSIM.

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

## Requirements

This example requires a real-time simulator equipped with FPGA capability and Digital bidirectional I/O modules. If you are using this model on board that doesn’t have bi-directional I/Os, a digital loopback connection must be configured on the simulator, linking Digital Input channels 0–15 to the corresponding Digital Output channels.

An Gen5 eHSx128 solver license is needed.

The minimal time step on a CPU core is 10µs.

## Detailed explanation

### **Plant and digital I/O**

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-a4f9e5ecb658f5340c0fbab1f7a8e499fe3aa3dc%2Fimage%20(259).png?alt=media" alt=""><figcaption><p>The digital in configuration for Versal</p></figcaption></figure>

The plant model (Dual\_Active\_Bridge\_OP48XX) built in the Schematic Editor is configured to read PWM pulses from the Digital Inputs of the OPAL‑RT real‑time simulator. If you use this model on a board without bidirectional I/O, set a digital loopback wire on the simulator between Digital Inputs and Digital Outputs channels 0 to 15.

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

### **Simulator and solver selection**

Configure the simulator platform, solver form factor, and bitstream in the Schematic Editor to match your hardware. The example uses an OP4815 with an eHSx128 form factor.

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

### **HYPERSIM I/O configuration**

Configure I/O in HYPERSIM to ensure proper data exchange between the FPGA (eHS) and CPU solvers.

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

### **PWM configuration**

To configure PWM outputs, route the modulation signals, carrier frequencies, and dead time to the duty and frequency inputs of the PWM outputs.

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

### I/O Configuration

Because part of the simulation runs through eHS, HYPERSIM must be connected to it. Follow these steps:

1. Open the I/O Interface Configuration.
2. Add an OPAL‑RT Board.<br>

   <figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-dfb3cf9cca8a1e64b9191b7a6dbde031f540a87e%2Fimage%20(256).png?alt=media" alt=""><figcaption></figcaption></figure>
3. Select the correct Chassis ID and enter the IP address. This example uses an OP4815 (Versal) simulator.
4. Select Optical for the type of generated synchronization signal.
5. Select Standard repositories for the bitstream configuration location, then select your bitstream configuration file. In this example, the bitstream configuration file is OP5145\_2-EX-0001-eHSx128\_Gen5\_Machines\_IOConfig1.opal and the bitstream name is OP5145\_2-EX-0001-3\_5\_0\_817-eHSx128\_Gen5\_500Mhz\_Machines\_IoConf1-5A-23.pdi.

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

## Simulation and results

This model provides two operating modes controlled by a constant block in HYPERSIM:

* Open‑loop control (set the constant to 1): V\_out does not converge to V\_Ref.

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

* Closed‑loop control (set the constant to 2): V\_out converges to V\_Ref.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-bd75f861a2a0fa6c35ab9cab4842858f8d762334%2Fimage%20(519).png?alt=media" alt=""><figcaption><p>Close loop control</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/hypersim/examples/renewable-energy/fpga-based-dual-active-bridge.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.
