> 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/library-blocks-reference/control-miscellaneous/pll-3-ph.md).

# PLL, 3 ph

## Description

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

The **PLL 3-phases** block, located in the **Control Miscellaneous** library, models a phase-locked loop (PLL) that tracks the frequency and phase of a sinusoidal signal using an internal controlled oscillator. The input signal u is mixed with the internal oscillator signal, and the DC component of the mixed signal is extracted using a variable-frequency mean value (phase detector). A proportional-integral-derivative (PID) controller drives the controlled oscillator to keep the phase error at zero. The controlled oscillator output is the angle signal wt. The PID output is passed through a rate-limited low-pass filter and converted to a frequency used by the mean value; this filtered signal is the frequency output f.

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

## Mask parameters

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-dc7114c64358a4a061fb4a8466c9b5b529b9223f%2FPLL3ph.jpg?alt=media" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Main" %}

<table><thead><tr><th width="221">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Text field for block information.</td></tr><tr><td><strong>Initial frequency</strong></td><td>Initial frequency for the first simulation cycle (Hz), Finit = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Minimum frequency</strong></td><td>Minimum expected frequency of the input signal (Hz), Fmin = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Initial phase</strong></td><td>Initial phase of the output signal for the first simulation cycle (deg), InitialPhase = [0, 360].<br>Cannot be modified during the simulation.</td></tr></tbody></table>
{% endtab %}

{% tab title="PID controller" %}

<table><thead><tr><th width="220.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Kp</strong></td><td>Internal PID controller proportional gain, Kp = [0, 1e12].</td></tr><tr><td><strong>Ki</strong></td><td>Internal PID controller integral gain, Ki = [0, 1e12].</td></tr><tr><td><strong>Kd</strong></td><td>Internal PID controller derivative gain, Kd = [0, 1e12].</td></tr><tr><td><strong>Lower limit</strong></td><td>Lower limit of the PI integral action, LowerLimit = [-1e64, 1e64].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Upper limit</strong></td><td>Upper limit of the PI integral action; must be greater than Lower limit UpperLimit = [-1e64, 1e64].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Initial condition</strong></td><td>Integrator initial condition Integrator_InitialCondition = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Time constant for derivative action</strong></td><td>Time constant of the first-order filter applied to the PID derivative action (s), Tc_Derivative = [0, 1e12].</td></tr><tr><td><strong>Duration of initial value</strong></td><td>Duration of the internal PID controller output’s initial value (s). Tinit = [0, 1e12].</td></tr></tbody></table>
{% endtab %}

{% tab title="Second-order Filter" %}

<table><thead><tr><th width="221">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Maximum rate of change of frequency</strong></td><td>Maximum positive and negative slope of the frequency at the second-order low-pass filter input (Hz/s), Freq_RateLimiter = [0, 1e12].</td></tr><tr><td><strong>Filter natural frequency</strong></td><td>Internal second-order low-pass filter natural frequency (Hz), FreqFilter_fn = [0, 1e12].</td></tr><tr><td><strong>Filter damping ratio</strong></td><td>Second-order low-pass filter damping ratio, typically between 0 and 1, FreqFilter_zeta = [0, 1] .</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Inputs

<table><thead><tr><th width="219.5999755859375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>abc</strong></td><td>Vector of three signals corresponding to phases A, B, and C. Each element may be a phase-to-ground voltage (Va, Vb, Vc) or current (Ia, Ib, Ic) (pu).</td></tr></tbody></table>

{% hint style="danger" %}
Because the internal PID controller has no automatic gain control, provide the input in pu with a magnitude close to one.
{% endhint %}

## Outputs

<table><thead><tr><th width="220.39996337890625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>f</strong></td><td>Measured frequency (Hz).</td></tr><tr><td><strong>wt</strong></td><td>Angle (rad) varying between 0 and 2*pi, synchronized to the ascending zero-crossing of the input signal’s fundamental.</td></tr></tbody></table>


---

# 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/library-blocks-reference/control-miscellaneous/pll-3-ph.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.
