> 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/protection/ghost-microgrid-model-with-protection-scheme.md).

# GHOST Microgrid Model with Protection Scheme

## Description

The **GHOST Microgrid Protection** example, located in **File > Open an Example File > Protection**, is based on the Banshee distribution network model developed by NREL and Massachusetts Institute of Technology Lincoln Laboratory during the Microgrid & DER Controller Symposium (February 2017) \[1] \[2].

This example demonstrates the implementation of multi-function protection relays and associated control logic across a distribution-level microgrid with three feeders and multiple DERs. It also includes a simple power management controller to illustrate grid-connected and islanded operation.

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

## Requirements

This example is designed for real-time execution on a simulator at a 100 µs time step.

For real-time use, it is recommended to:

* Allocate 6 CPU cores on the simulator; performance may vary based on simulator specifications.
* Select “opgcc” under Settings – Target – Compiler and Linker.

## Detailed explanation

### **Model overview**

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-6e7e179bbf6420709d97bd405bab51b04bac8911%2Fimage%20(217).png?alt=media" alt=""><figcaption><p>Single line diagram of the GHOST network</p></figcaption></figure>

The GHOST microgrid is a distribution-level network with three primary feeders supplying multiple medium- and low-voltage levels (13.8 kV, 4.16 kV, 480 V, 208 V) from a 115 kV utility grid. It includes eighteen RL loads (6 critical, 6 priority, 6 interruptible) and two 159.7 kVA induction motors (one each in Feeder 1 and Feeder 3) representing industrial loads. Critical loads require high reliability and power quality, priority loads can be disconnected during contingencies to maintain balance, and interruptible loads can be shed during contingencies.

All DERs include their associated controllers (exciters, governors, converter controls, etc.).

| DER type             | Location | Power rating (kVA) | Voltage rating (kV) | Grid-forming capability |
| -------------------- | -------- | ------------------ | ------------------- | ----------------------- |
| **Diesel generator** | Feeder 1 | 4000               | 13.8                | Yes                     |
| **PV**               | Feeder 2 | 5000               | 0.48                | No                      |
| **BESS**             | Feeder 2 | 3000               | 0.48                | Yes                     |
| **CHP**              | Feeder 3 | 3500               | 13.8                | Yes                     |
| **Diesel generator** | Feeder 4 | 80                 | 0.48                | Yes                     |
| **PV**               | Feeder 4 | 100                | 0.48                | No                      |
| **BESS**             | Feeder 4 | 250                | 0.48                | Yes                     |

Feeder 4 represents a laboratory PHIL setup of DERs connected through a 13.8/0.48 kV transformer at the end of Feeder 3. The PHIL node interface itself is not modeled. Feeder 4 includes two buses, a 100 kVA PV system, a 250 kVA BESS, and an 80 kVA diesel generator \[1].

For the GHOST microgrid model without the protection scheme, see the example [GHOST Microgrid Model](https://www.opal-rt.com/docs/hypersim/examples/distribution-and-industrial-power-systems/ghost-microgrid-model.md).

### **Protection relay implementation**

Each circuit breaker is paired with a [Multi-relay](https://www.opal-rt.com/docs/hypersim/examples/protection/ghost-microgrid-model-with-protection-scheme/multi-relay.md) block, a multi-function protection relay subsystem that acquires measurements and executes logic to trip or close breakers based on configurable thresholds and delays.

Each breaker provides 10 measurements (breaker status; three-phase current through the breaker; three-phase voltages on input and output sides).

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

Within each feeder, these measurements are multiplexed, sent to the feeder’s relay subsystem, then demultiplexed and routed to the corresponding relay blocks.

The relay subsystem evaluates network conditions and drives the Trip output that controls the breaker status.

You can open the Relay\_1 subcircuit with the shortcut **Ctrl + Shift + i**

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-fc576bcd9e7859473a6322ea733af1136353635f%2Fimage%20(221).png?alt=media" alt=""><figcaption><p>Implementation of the protection relay subsystem (shown for feeder 2 relay subsystem) in the model</p></figcaption></figure>

To configure Multi-relay block, see the [documentation](https://www.opal-rt.com/docs/hypersim/examples/protection/ghost-microgrid-model-with-protection-scheme/multi-relay.md).

Predefined relay settings are provided within the model.

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

{% hint style="info" %}
All protection functions implemented are designed for 60 Hz operation.
{% endhint %}

## Simulation and results

The example is exercised through a sequence of operating scenarios. Start the simulation, launch ScopeView, open the template ‘*GHOST\_ugrid\_Protection.svt*’, ensure both ‘*Sync*’ and ‘*Trig*’ are checked, and start data acquisition.

{% hint style="info" %}
**When executing in real-time**, it is recommended to put "opgcc" in Settings – Target – Compiler and Linker.
{% endhint %}

**Power References of DERs at Start of Simulation**

| **Feeder**                           | **Type of DER** | **Active Power (pu)** | **Reactive Power (pu)** |
| ------------------------------------ | --------------- | --------------------- | ----------------------- |
| **Feeder 1**                         | DG              | 0.8                   | 0.5                     |
| <p><strong>Feeder 2</strong><br></p> | BESS            | 0.8                   | 0.2                     |
|                                      | PV              | 0.8                   | 0.2                     |
| **Feeder 3**                         | CHP             | 0.8                   | 0.4                     |
| **Feeder 4**                         | BESS            | 0.8                   | 0.1                     |
|                                      | DG              | 0.6                   | 0.1                     |
|                                      | PV              | 0.2\*                 | 0                       |

*\*- Increased to 0.8 pu in the test scenario 3.*

### Scenarios considered

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-ea0792f256fbfc42bb216e4ff30e27ab442d5685%2Fimage%20(223).png?alt=media" alt=""><figcaption><p>Different fault locations [1] that were considered in the test scenarios</p></figcaption></figure>

<table><thead><tr><th width="82.5555419921875">Step</th><th width="142.111083984375">Test Scenario</th><th width="119.888916015625">Time</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>Scenario 1</td><td>T = 0 s</td><td>Model starts in grid-connected mode.</td></tr><tr><td>2</td><td>Scenario 2</td><td>T = 10 s</td><td>A three-phase to ground fault of time duration 0.5 s happens at location 4 in feeder 3.</td></tr><tr><td>3</td><td></td><td>T = 10.21 s</td><td>Multi-relay block 307 in feeder 3 relay subsystem isolates the faulty section.</td></tr><tr><td>4</td><td>Scenario 3</td><td>T = 15 s</td><td>Active power of PV at feeder 4 is increased from 0.2 pu to 0.8 pu in steps of 0.15 pu / 0.5 s emulating an increase in solar irradiance.</td></tr><tr><td>5</td><td>Scenario 4</td><td>T = 17.98 s</td><td>A three-phase to ground fault of time duration 0.1 s happens at location 1 on the grid side.</td></tr><tr><td>6</td><td></td><td>T = 18 s</td><td>Grid-side breakers open and three islands are created.</td></tr><tr><td>7</td><td>Scenario 5</td><td>T = 27 s</td><td>A three-phase to ground fault of time duration 5 s happens at location 5 in feeder 2.</td></tr><tr><td>8</td><td></td><td>T = 27.42 s</td><td>Multi-relay block 203 in feeder 2 relay subsystem clears the faulty section.</td></tr></tbody></table>

Start the simulation and launch ScopeView, open the template: ‘*GHOST\_ugrid\_Protection.svt*’.

Make sure both ‘*Sync*’ and ‘*Trig*’ are checked, then start the data acquisition. The figures below show the results of the model under various scenarios.

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

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

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

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

### **Scenario 1**

From t = 0 s to t = 10.00 s, the model operates grid-connected with all DERs supplying power according to the table above. All DGs track their active and reactive power references, demonstrating stable operation.

### **Scenario 2**

From t = 10.00 s to t = 10.50 s, a three-phase-to-ground fault occurs on the load side in Feeder 3.

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

The nearest breaker’s relay (multi-relay block 307) detects overcurrent (51P) and trips at t = 10.21 s, isolating the fault.

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

It can be seen in the figure below that the faulted location is isolated from the rest of the network and the model operates stably.

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

### **Scenario 3**

At t = 15 s, PV power in Feeder 4 ramps from 0.2 pu to 0.8 pu in 0.15 pu steps every 0.5 s, emulating rising irradiance. The system remains stable as DER controllers track the new setpoints.

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

### **Scenario 4**

From t = 17.98 s to t = 18.08 s, a three-phase-to-ground fault occurs at the grid side (location 1). Grid-side breakers open at t = 18 s, creating three islands. Each island maintains voltage and frequency while meeting local load demand:

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

* Feeder 1: The diesel generator switches to grid-forming mode; active power increases from 0.8 pu to 1.0 pu to supply local loads.

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

* Feeder 2: The BESS reduces active power from 0.8 pu to 0.45 pu and increases reactive power to support voltage (Vrms ≈ 1 pu, f = 60 Hz).

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

* Feeder 3: CHP increases active power from 0.8 pu to 0.88 pu to meet load.

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

* Feeder 4: PV exhibits a transient at t = 18 s due to Feeder 3 PCC breaker opening; DERs controllers quickly resettle to references.

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

### **Scenario 5**

From t = 27.00 s to t = 32.00 s, a three-phase-to-ground fault occurs at BUS 206 of Feeder 2.

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

The nearest breaker relay (multi-relay block 203) detects overcurrent (51P) and trips at t = 27.91 s, isolating the fault. The undervoltage (27) elements in multi-relay subsystems 214, 215, and 218 subsequently open breakers 14, 15, and 18 after a 2 s delay (t = 29 s). The system remains stable following isolation.

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

## References

\[1] 2017 Microgrid Controller Procurement Information Packet Volume 1.6, P. Koralewicz, ed.: NREL, 2017. \[Online].

\[2] R. Salcedo et al., "Banshee distribution network benchmark and prototyping platform for hardware-in-the-loop integration of microgrid and device controllers," in The Journal of Engineering, vol. 2019, no. 8, pp. 5365-5373, 8 2019.


---

# 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/protection/ghost-microgrid-model-with-protection-scheme.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.
