> 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-1-ph.md).

# PLL, 1 ph

## Description

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

The **PLL 1-phase** block, located in the **Control Miscellaneous** library, models a phase-locked loop (PLL) closed-loop control system that tracks the frequency and phase of a sinusoidal signal using an internal oscillator. The input signal 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 phase error to zero by acting on a controlled oscillator. The controlled oscillator output provides the angular velocity signal wt. The PID output is rate-limited, filtered by a low-pass filter, and converted to a frequency used by the mean value block. The filtered signal provides 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-6a7beb1a892a57dcd4b3021f07d5ceda4d9524e2%2Fimage%20(938).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-14b1553dfde35085de8854be2488f3d839de8882%2FPLL1ph.jpg?alt=media" alt=""><figcaption></figcaption></figure>

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

<table><thead><tr><th width="200.20001220703125">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.199951171875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Kp</strong></td><td>Proportional gain of the internal PID controller Kp = [0, 1e12].</td></tr><tr><td><strong>Ki</strong></td><td>Integral gain of the internal PID controller Ki = [0, 1e12].</td></tr><tr><td><strong>Kd</strong></td><td>Derivative gain of the internal PID controller 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 the 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 on the derivative action (s) Tc_Derivative = [0, 1e12].</td></tr><tr><td><strong>Duration of initial value</strong></td><td>Duration of the initial value of the internal PID controller output (s) Tinit = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr></tbody></table>
{% endtab %}

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

<table><thead><tr><th width="220.20001220703125">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),<br>Freq_RateLimiter = [0, 1e12].</td></tr><tr><td><strong>Filter natural frequency</strong></td><td>Natural frequency of the internal second-order low-pass filter (Hz), FreqFilter_fn = [0, 1e12].</td></tr><tr><td><strong>Filter damping ratio</strong></td><td>Damping ratio of the second-order low-pass filter, 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>In</strong></td><td>Input signal (pu).</td></tr></tbody></table>

{% hint style="danger" %}
Because the internal PID controller has no automatic gain control, the input signal should be in pu and close to one.
{% endhint %}

## Outputs

<table><thead><tr><th width="219.5999755859375">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 signal (rad), varying between 0 and 2*pi, synchronized to the ascending zero-crossing of the fundamental of the input signal.</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-1-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.
