Appearance
3-Phase PLL
Synchronous-reference-frame phase-locked loop for a three-phase signal set (A, B, C). Each step it Park-transforms the inputs at its current angle, runs a PI controller on the q-component (divided by the d-q magnitude when Normalize is On) and integrates the resulting frequency. Outputs the tracked angle theta in [0, 2π) rad, the frequency in Hz, and the amplitude-invariant vd / vq. Theta uses the same cosine convention as the abc → dq0 block, so feeding that block the same signals with this theta gives d = peak amplitude and q = 0 once locked. The defaults (Kp = 178, Ki = 15800) give a natural frequency near 20 Hz with damping about 0.7. Use it to synchronise grid-following inverter controls, as a frequency meter, or to measure phase jumps.
Category: Continuous
How it works
The block is a synchronous-reference-frame PLL. Each time step it:
- Park-transforms the three inputs at its current angle
(amplitude-invariant):
- Forms the error
with (Normalize On), or (Normalize Off). - Runs a PI controller on the error to get the frequency deviation,
. The integrator and are both clamped to . - Outputs
, , and for this sample. - Advances the angle:
, wrapped to .
For a balanced set
Angle convention
theta uses the same cosine convention as the abc → dq0 block. Feeding that block the PLL's inputs together with its theta gives
A voltage source set to a sine waveform produces
Tuning
With Normalize On, the small-signal loop is a second-order system whatever the input amplitude:
The defaults
- To make the loop faster, raise
by the square of the speed-up and in proportion to keep the damping. - A faster loop also passes more harmonics and unbalance into
thetaandfreq.
With Normalize Off the error is in the input's units, so the effective gains scale with the input amplitude. Leave it On unless you are matching a specific reference design.
Notes
- Unbalance. Negative-sequence voltage appears in
as a ripple at twice the line frequency. A plain SRF-PLL passes part of that ripple into freq. Lower the gains if the frequency ripple matters. - Inputs from the electrical side. Voltages measured on the electrical network reach a control block one step late, and they read zero on the first step. With Normalize On a zero input gives zero error, so the loop simply holds the nominal frequency until a signal arrives.
- Frequency limit.
Δf maxbounds both the integrator and the total deviation, so a long dropout does not wind the loop up. Set it to 0 to remove the clamp.
Ports
| Port | Kind | Signal | Notes |
|---|---|---|---|
in_a | Control input | Real | |
in_b | Control input | Real | |
in_c | Control input | Real | |
theta | Control output | Real | |
freq | Control output | Real | |
vd | Control output | Real | |
vq | Control output | Real |
Parameters
| Parameter | Type | Default | Units | Description | ID |
|---|---|---|---|---|---|
| f nominal | Number | 60 | Hz (also rad/s) | Nominal frequency. The loop starts here at theta = 0, and the PI output is the deviation from it. | frequency |
| Kp | Number | 178 | — | Proportional gain, in rad/s per unit of error. With Normalize On the error is sin(phase error), so the loop is amplitude-independent: natural frequency ωn = √Ki rad/s and damping ζ = Kp / (2√Ki). | kp |
| Ki | Number | 15800 | — | Integral gain, in rad/s² per unit of error. Sets the natural frequency ωn = √Ki (rad/s); the default 15800 gives about 20 Hz. | ki |
| Δf max | Number | 10 | Hz (also rad/s) | Largest allowed frequency deviation from nominal. Both the integrator and the total deviation are clamped to ± this value (anti-windup). 0 disables the clamp. | freq_limit |
| Normalize | Choice: Off / On | On | — | When On, the loop error is vq / |v| (|v| = √(vd² + vq²)), so the lock time does not depend on the input amplitude: 1 V and 100 kV lock identically. Off uses vq directly, so the effective gains scale with the amplitude. | normalize |