> 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/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/analysis/power-pll-driven-positive-sequence.md).

# Power (PLL-Driven, Positive-Sequence)

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-7ecdc61e157a819528340554d6a13922484495f2%2Fpower_positiveseq_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Power (PLL-Driven, Positive-Sequence)** block, located in the **OPAL-RT SPS Software/Sensors and Measurements** library, computes the positive-sequence active power P (in watts) and reactive power Q (in vars) of a periodic set of three-phase voltages and currents.

To perform this computation, the block first computes the positive sequence of the input voltages and currents with a running window over one cycle of the fundamental frequency given by input 1. The reference frame required for the computation is given by the input 2.

These formulas are then evaluated:

$$
P
=

3 \times \frac{|V\_1|}{\sqrt{2}} \times \frac{|I\_1|}{\sqrt{2}} \times \cos(\phi)
\\\[8pt]

# Q

3 \times \frac{|V\_1|}{\sqrt{2}} \times \frac{|I\_1|}{\sqrt{2}} \times \sin(\phi)
\\\[8pt]

\phi = \angle V\_1 - \angle I\_1
\\\[8pt]
$$

V<sub>1</sub> is the positive-sequence component of input Vabc. I<sub>1</sub> is the positive-sequence component of input Iabc.

With these formulas, a current flowing into an RL circuit produces a positive P and a positive Q.

As this block uses a running average window, one cycle of simulation must complete before the outputs give the correct value.

For the first cycle of simulation, the output is held constant using the values specified by the **Voltage initial input** and **Current initial input** parameters.

## Parameters

<table data-header-hidden><thead><tr><th width="250.22222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Initial frequency (Hz)</strong></td><td><p>Specify the frequency of the first cycle of simulation.</p><p>Default is 60.</p></td></tr><tr><td><strong>Minimum frequency (Hz)</strong></td><td>Specify the minimum frequency value to determine the buffer size of the Variable Time Delay block used by the block to compute the phasors. Default is 45.</td></tr><tr><td><strong>Voltage initial input [ Mag, Phase (degrees) ]</strong></td><td>Specify the initial positive-sequence magnitude and phase (relative to the PLL phase), in degrees, of the voltage signals. Default is [1, 0].</td></tr><tr><td><strong>Current initial input [ Mag, Phase (degrees) ]</strong></td><td>Specify the initial positive-sequence magnitude and phase (relative to the PLL phase), in degrees, of the current signals. Default is [1, 0].</td></tr><tr><td><strong>Sample time</strong></td><td><p>Specify the sample time of the block, in seconds.</p><p>Set to 0 to implement a continuous block. Default is 0.</p></td></tr></tbody></table>

## Inputs and Outputs

<table data-header-hidden><thead><tr><th width="249.55548095703125"></th><th></th></tr></thead><tbody><tr><td><strong>Freq</strong></td><td><p>Fundamental frequency (Hz) required by the computation.</p><p>This input is normally connected to the output Freq of a PLL block.</p></td></tr><tr><td><strong>wt</strong></td><td><p>Angle of the reference frame (rad/s) required for the computation.</p><p>This input is normally connected to the output wt of a PLL block.</p></td></tr><tr><td><strong>Vabc</strong></td><td><p>The vectorized signal of the three [a b c ] voltage sinusoidal signals.</p><p>Typical input signals are voltages measured by the Three-Phase V-I Measurement block.</p></td></tr><tr><td><strong>Iabc</strong></td><td><p>The vectorized signal of the three [a b c ] current sinusoidal signals.</p><p>Typical input signals are currents measured by the Three-Phase V-I Measurement block.</p></td></tr><tr><td><strong>P</strong></td><td>Positive-sequence active power (watts)</td></tr><tr><td><strong>Q</strong></td><td>Positive-sequence reactive power (vars)</td></tr></tbody></table>

## Characteristics

<table data-header-hidden><thead><tr><th width="250.4444580078125"></th><th></th></tr></thead><tbody><tr><td><strong>Sample Time</strong></td><td>Specified in the <strong>Sample Time</strong> parameter Continuous if <strong>Sample Time</strong> = 0</td></tr><tr><td><strong>Scalar Expansion</strong></td><td>No</td></tr><tr><td><strong>Dimensionalized</strong></td><td>No</td></tr></tbody></table>

## Examples

The power\_PowerPLLDrivenPositiveSequence model shows how the block evaluates the positive-sequence active and reactive powers of a voltage source connected to a three-phase load. It shows that the block outputs accurate values for P and Q even if the fundamental frequency of the voltage supply (containing harmonics) varies during the simulation.

The model sample time is parameterized by the Ts variable set to a default value of 50e-6 s. Set Ts to 0 in the command window and change the **Simulation type** parameter of the Powergui block to Continuous to simulate the model in continuous mode.


---

# 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/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/analysis/power-pll-driven-positive-sequence.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.
