> 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/distribution-pv-switching-converter.md).

# Distribution Connected Photovoltaic Generation System with Switching Function Converter

## Description

The **Photovoltaic Generation System** example, located in **File > Open an Example File > Renewable Energy**, demonstrates a PV generation system connected to a distribution feeder using switching-function (SwF) converters for real-time simulation. The objectives are to showcase MPPT and curtailment control, regulate DC-link voltage and reactive power at the PCC, and compare results with the average-converter model of the same system.

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

## Requirements

This example model does not require any additional hardware or licenses.

## Detailed explanation

The PVGS is connected to a three-phase 22.9 kV, 60 Hz distribution system and includes a PV array, a coupling inductor, a step-up transformer, a boost DC-DC converter, and a grid-tied inverter. The PVGS has a nominal power of 750 kW and a 1050 V DC link.

The connection to the PCC is through a 22.9 kV/480 V, 0.9 MVA star–delta distribution transformer. The transformer secondary connects to the grid-side converter via a 250 μH choke filter. The converter switching frequency is 1620 Hz.

The boost converter interfaces the PV array to the inverter and operates in two modes:

* MPPT mode: a perturb-and-observe (P\&O) algorithm sets the duty cycle to extract maximum available power.
* Curtailment mode: the duty cycle is controlled to follow the active power reference Pref.

The inverter regulates the DC-link voltage and the reactive power at the PCC according to their respective references. The SwF implementation provides a realistic representation of switching-induced harmonics while remaining suitable for real-time simulation. For details on the PVGS with SwF, see Photovoltaic Generation System (PVGS) - Switching Function. For the related average-converter example, see the example [Distribution Connected Photovoltaic Generation System with Average Converter.](https://www.opal-rt.com/docs/hypersim/examples/renewable-energy/distribution-bess-average-converter.md)

## Simulation and results

The PVGS operates either in MPPT (curtailment input = 0) or in curtailment mode (curtailment input = 1). With curtailment disabled, the converter injects the maximum available power determined by irradiance. With curtailment enabled, the injected power is limited by Pref. The control sequence below applies to both the average and SwF models. Simulations were performed with a 50 μs time step.

| Operating points | From  | To    | Curtailment | Pref (pu) | Qref (pu) | Irradiance (W/m<sup>2</sup>) | Temperature (°C) |
| ---------------- | ----- | ----- | ----------- | --------- | --------- | ---------------------------- | ---------------- |
| 1                | 0 s   | 2 s   | No          | 0.3       | 0         | 800                          | 25               |
| 2                | 2 s   | 2.5 s | No          | 0.3       | 0.3       | 800                          | 25               |
| 3                | 2.5 s | 4 s   | No          | 1         | 0.3       | 800                          | 25               |
| 4                | 4 s   | 5 s   | Yes         | 1         | 0.3       | 800                          | 25               |
| 5                | 5 s   | 6.5 s | Yes         | 0.5       | 0.3       | 800                          | 25               |
| 6                | 6.5 s | 7.5 s | Yes         | 0.8       | 0.3       | 800                          | 25               |
| 7                | 7.5 s | 8 s   | Yes         | 0.8       | 0         | 800                          | 25               |
| 8                | 8 s   | 10 s  | No          | 0.3       | 0         | 800                          | 25               |
| 9                | 10 s  | 15 s  | No          | 0.3       | -0.3      | 800                          | 25               |
| 10               | 15 s  | 18 s  | No          | 0.3       | -0.3      | 1000                         | 25               |
| 11               | 18 s  | 22 s  | No          | 0.3       | -0.3      | 1000                         | 35               |

The purpose of these runs is to compare results obtained with the average-converter PVGS to those from the SwF PVGS. The plots referenced in this section were generated using the ScopeView template included with the example.

During the first MPPT window (operating points 1–3), the system ignores the active power reference and extracts the maximum available power at 800 W/m<sup>2</sup>. When the curtailment signal is enabled at 4 s (operating point 4), the requested Pref exceeds available power, so the system continues in MPPT. At 5 s (operating point 5), Pref is reduced to 0.5 pu and the array power is curtailed to meet the reference. At 6.5 s (operating point 6), Pref again exceeds the available power and the system returns to MPPT. At 15 s (operating point 10), irradiance steps to 1000 W/m<sup>2</sup>, raising active power to 1 pu. At 18 s (operating point 11), temperature increases from 25°C to 35°C and active power decreases due to temperature dependence.

Between 5 s and 10 s, the duty cycle adapts to curtail the output power to the reference. Because a typical PV array P–V curve can yield the same power at two different voltages, the duty cycle first decreases and then increases while maintaining the commanded output power. The measured reactive power follows Qref (operating points 1, 2, and 5–9) except when high active power would violate system ratings; in those cases (operating points 3, 4, 10, and 11), reactive power is reduced to remain within ratings.

Active and reactive power responses of the SwF model (PVGS2.P(SwF), PVGS2.Q(SwF)) closely match those of the average model (PVGS1.P(Avg), PVGS1.Q(Avg)) in both transient and steady state. On the DC side, PVGS2.Vdc(SwF) contains harmonic ripple (2.7%) due to the boost converter’s switching function, while its overall dynamic behavior matches PVGS1.Vdc(Avg). On the AC side, CB2\_2(SwF), PVGS2\_Iabc(SwF), and PCC\_2.V(SwF) contain switching harmonics from the DC–AC converter; however, their 60 Hz fundamental components are similar to CB2\_1(Avg), PVGS1\_Iabc(Avg), and PCC\_1.V(Avg). The choke filter value in this example intentionally allows noticeable current harmonics for illustration; it can be increased to improve harmonic rejection.

Overall, the SwF PVGS reproduces the dynamic behavior of the average model while providing more accurate representation of switching-induced harmonic content.

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

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

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

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

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

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

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

## References

\[1] J. Rocabert, A. Luna, F. Blaabjerg and P. Rodríguez, "Control of Power Converters in AC Microgrids," in *IEEE Transactions on Power Electronics*, vol. 27, no. 11, pp. 4734-4749, Nov. 2012.doi: 10.1109/TPEL.2012.2199334

\[2] Gray, J.L, “The Physics of the Solar Cell”, in Handbook of Photovoltaic Science and Engineering, A. Luque, Hegedus, S., Editor. 2011, John Wiley and Sons.


---

# 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/distribution-pv-switching-converter.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.
