> 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/sps-software-example-models/three-phase-diode-rectifier.md).

# Three Phase Diode Rectifier

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

The **Three Phase Diode Rectifier** model illustrates the use of the eHS solver to compute the outputs of a diode bridge rectifier with tri-phased inputs. A serial RL component is added on each phase to model the source impedance. In this example we used an **SPS Software** model.

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

To run your mode properly, the following software must be installed:

* RT-LAB
* RT-EVENTS
* eFPGASIM
* SPS Software

The eHS solver requires an FPGA-based hardware board. This board will be configured with the attached binary file automatically when the model is loaded in the RT-LAB interface. This model uses either a VC707, TE0741 as its active carrier board (OP5607 / OP5700 or OP4510 simulators). Please refer to the product documentation for details on version compatibility.

## Simulation and results

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

This model must be run with the Hardware Synchronized option, with the XHP mode enabled. It does not require any external I/O hardware except the active control card, which can be either a VC707 or TE0741 (OP5607 / OP5700 or OP4510 simulators).

Please note that following setup :

* The VC707/TE0741 kit must be connected to the target PCIe bus and detected through the RT-LAB interface “Tools > Get I/O Infos” procedure.
* The Simulink simulation step time is set to 20 microseconds as the variable Ts in the RT-LAB model “InitFcn” and “PreLoadFcn” callbacks. To modify it, select “File > Model Properties...” and then select the “Callbacks” tab.

### Run the model

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>>SimPowerSystems\_Workflow>>Three Phase Diode Rectifier**.
2. Compile the RT Model by clicking on **Build** in RT-LAB.
3. Select the appropriate platform according to your system documentation, then select OK. Go to SM\_eHS\eHS\eHS CommBlk and select the name of the SPS Software (formerly SimPowerSystems) model in the circuit file name section. The RT-LAB model using the eHS solver will open automatically, as well as the SPS Software (formerly SimPowerSystems) model describing the circuit to be solved. Note that depending on the platform selected, a different RT-LAB model is opened, with an appropriately configured OpCtrl block, but both versions refer to the same SPS Software (formerly SimPowerSystems) circuit.
4. Verify that the ML605EX1, OP7161EX1, VC707 or OP4500 board ID is set correctly in the OpCtrl block in the RT-LAB model SM\_Controller subsystem.
5. You will find two SPS Software (formerly SimPowerSystems) models for the same circuit in each model, you will find a three-phase diode bridge that implements a voltage rectifier. You will also find an RL branch on each phase of the three-phase inputs. This is added to model the input impedance. You will finally see a resistive load, and various voltage and current measurement blocks. For more information on components supported by eHS, please consult section 3 of the eHS user guide.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-c9c059e46679aeaf8aa2127887d068fe41949ed0%2Fehs-model-sps-3Pdioderectif-1.png?alt=media" alt=""><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-155a9aba77a9a6e0e01ed8e9cd84213248646813%2Fehs-model-sps-3Pdioderectif-2.png?alt=media" alt=""><figcaption></figcaption></figure>

6. The three sources of the three phases in input (Va, Vb, Vc) will be controlled from the RT-LAB console during the real-time simulation. Similarly, all seven voltage and current measurements will be sent back to the RT-LAB model console. Open both the RT-LAB console and master subsystem to see how the three sources are controlled from parameters in the console and generated as three equally separated phases of a sine wave in the RT-LAB master subsystem.

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

7. When the model is compiled in Simulink, the configuration of the eHS solver will be generated according to the SPS Software (formerly SimPowerSystems)circuit characteristics. Elements will be put into matrices and stored into .mat files that will be transferred into the solver when the model is run from the RT-LAB interface. To generate the matrices, go to SM\_eHS\eHS\eHS Gen3 CommBlk and select “Update eHS matrices”. This step is facultative, as matrices are regenerated during model compilation in RT-LAB.
8. To run a simulation including the eHS solver in real time, create an RT-LAB project and add the RT-LAB model of this example into the project. The SPS Software (formerly SimPowerSystems) model should not be added to the RT-LAB project, as it does not need to be transferred to the target computer for execution. Compile the model, then assign a target node to run it in real time, then load the model onto it.
9. Execute the real-time simulation, changing the 3-phase input frequency, amplitude and phase for better results. The following results have been obtained from the original model by setting the RT-LAB Probe control to acquire 2000 samples per signal for acquisition group #1.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-0977fd230deeb6907ee3f949cd3001a7cfc757a9%2Fehs-model-sps-3Pdioderectif-4.png?alt=media" alt=""><figcaption></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/sps-software-example-models/three-phase-diode-rectifier.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.
