> 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/power-electronics-example-models/llc-converter-with-pfc-hscs.md).

# LLC Converter with PFC (HSCS)

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

The **LLC Converter with PFC (HSCS)** project demonstrates the use of the **Gen5 eHSx128 solver** and **High Speed Converter Solver (HSCS)** to compute the outputs of an FPGA-based LLC Converter with Power Factor Correction (PFC) circuit in real time. The FPGA-based circuit comprises of a boost converter with PFC followed by resonant LLC Converter. This circuit is created using the OPAL-RT Schematic Editor. 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.

## 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, the PFC frequency, LLC frequency, and LLC duty are sent from the console are processed in the PFC control block into frequency and duty cycle control values, which are subsequently sent as a PWM signal to the Digital-Out.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-23cbed827d587c4fb8621efcd5db5f2b442ca9aa%2Fehs-LLCconverter-HSCS-model.png?alt=media" alt=""><figcaption><p>RT-LAB model view</p></figcaption></figure>

The LLC converter is a DC/DC converter based on a resonant circuit which allows soft-switching operation. The LLC resonant circuit reduces switching loss through zero-voltage switching (ZVS). Unlike the SLR converter, the LLC converter can keep the output voltage regulated even under light load condition. The converter consists of a switching bridge (half-bridge MOSFET), an LLC resonant circuit, a full-bridge rectifier and an output filter (Co). The resonant circuit consists of the primary leakage inductance of a transformer (Llkp), its secondary leakage inductance (Llks), its magnetization inductance (Lm) and a capacitor Cr.

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

Notice how the Boost Converter and the LLC Converter are inside the HSCS subsystem object.

## Requirements

RT-LAB, Schematic Editor/Unified Database and the eHS Power Electronics Toolbox must be installed in order to successfully run this example project.

This model requires **HIGH\_PERFORMANCE license**.

{% 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 %}

In the chassis configuration listed for this example model, **no** Digital Out to Digital In loopback wire is required.

The OP5369 card supports internal Digital Out to Digital In loopback when configured as bi-directional. This means a Digital Input assigned to a channel will directly read the output generated by a Digital Output generator on the same channel.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-4f34621b3d8cd2f3d6e27be7b8c7cdfbd9eb3f45%2Fehs-LLCconverter-HSCS.png?alt=media" alt=""><figcaption><p>PWM Out on Ch00 is read by PWM In on Ch00</p></figcaption></figure>

{% hint style="info" %}
If your IO Configuration contains bi-directional OP5369 card, you can always use its internal loopback capability.
{% endhint %}

## Simulation and results

### Setup Parameters <a href="#setup-parameters" id="setup-parameters"></a>

The following parameters used for real-time simulation are editable by the user inside the **initLLCConverter.m** file found in the model directory:

* **Tsc:** CPU Simulation Time Step - the default is 10µs.
* **Line\_Voltage\_Peak:** Input Voltage Peak to the Full Bridge Rectifier
* **Voref:** Desired Output Voltage from PFC Preconverter
* **Power:** Maximum Steady State Power Capability
* **Conv\_efficiency:** Nominal Efficiency of the Converter
* **f\_sw:** MOSFET Switching Frequency

The following parameters used for real-time simulation are editable by the user inside the **SC\_Console** subsystem:

* **llc\_frequency:** LLC Switching Frequency
* **llc\_duty:** LLC Switching Duty
* **pfc\_frequency:** PFC Switching Frequency

As the current flowing through the inductor is never zero during the switching cycle, the boost converter operates in Continuous Conduction Mode (CCM). The inductor current and the output voltage profiles are controlled using simple integral control. During start up, the reference output voltage is ramped up to the desired voltage.

### Run the model

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

1. If you have eFPGASIM installed, add the example project to RT-LAB by selecting **File>>New>>RT-LAB Project>>eFPGASIM>>Schematic Editor workflow>>Power Electronics>>LLC Converter (HSCS)**.
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 **Scope** blocks in the Simulink Console.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-aee89c61524d87ea406bbd2cba27cc134351c37b%2Fehs-LLC-HSCS-results1.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-a6ab97a8bb3f8721f0ec1623b425d87f5781f84b%2Fehs-LLC-HSCS-results2.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/power-electronics-example-models/llc-converter-with-pfc-hscs.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.
