> 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/example-models/control-and-measurements/three-phase-programmable-source-pll-voltage-and-power-measurement.md).

# Three Phase Programmable Source, PLL, Voltage and Power Measurement

This example shows the use of the 3-Phase Programmable Voltage Source, PLL and Variable-Frequency Positive-Sequence Voltage and Power Measurement blocks.

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

## Description

A 25kV, 100 MVA short-circuit level, equivalent network feeds a 5 MW, 5 Mvar capacitive load. The internal voltage of the source is controlled by the Discrete 3-Phase Programmable Voltage Source block.

Open the programmable source dialog box and look at the parameters controlling the voltage and frequency. A 60 Hz, positive-sequence of 1.0 pu, 45 degrees is specified.

At t = 0.5 s, a sinusoidal modulation of the frequency (amplitude 3 Hz, frequency 0.4 Hz) is started. The modulation stops at t =3 s so that a full cycle of modulation can be observed.

The Three-Phase V-I Measurement block is used to monitor the three load voltages and currents. Open its dialog box and see how this block allows to output the three voltages and currents in p.u.

The Discrete 3-Phase PLL block measures the frequency and generates a signal (wt output) locked on the variable frequency system voltage. The PLL drives two measurement blocks taking into account the variable frequency: one block computing the fundamental value of the positive-sequence load voltage and another one computing the load active and reactive powers. These two blocks and the PLL are initialized in order to start in steady state.

The whole system, (power network, PLL and measurement blocks) is discretized at a 50 us sample time.

## Simulation

Start the simulation.

Observe on Scope1 block how the PLL tracks the changing system frequency (trace 1). As expected, the system frequency varies between 57 Hz and 63 Hz with a maximum rate of change of 7.5 Hz/s. Traces 2 and 3 show the variations of magnitude and phase of positive-sequence voltage as the frequency is changing. Traces 4 and 5 show the variations of active and reactive powers.

Observe on Scope2 that the (wt) ramp output of the PLL stays locked on zero crossings of phase A voltage.

## Command

Example model name: power\_3phpll

{% code lineNumbers="true" %}

```matlab
open('power_3phpll')
```

{% endcode %}


---

# 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/example-models/control-and-measurements/three-phase-programmable-source-pll-voltage-and-power-measurement.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.
