Engee documentation

PLL

Determines the frequency and phase of the fundamental harmonic of the signal.

blockType: SubSystem

Path in the library:

/Physical Modeling/Electrical/Control/General Control/PLL

Description

Block PLL Simulates a feedback control system based on phase-locked frequency (PLL), which monitors the frequency and phase of a sinusoidal signal using an internal frequency generator. The control system adjusts the frequency of the internal oscillator to maintain zero phase difference.

The figure shows the internal circuit of the PLL.

pll 1 en

The input signal is mixed with the signal of the internal generator. The constant component of the mixed signal (proportional to the phase difference between these two signals) is allocated using the average value of the variable frequency. Proportional-integral-differential (PID) controller with additional automatic gain control (AGC) maintains the phase difference equal to 0 acting on a controlled generator. The output of the PID controller corresponding to the angular velocity is filtered and converted to a frequency in hertz, which is used to calculate the average value.

Ports

Output

# Freq — measured frequency, Hz
scalar

Details

The measured frequency in Hz.

Data types

Float64

Complex numbers support

No

# ωt — the angle synchronized with the zero intersection of the fundamental harmonic of the input signal is rad
scalar in the range [0, 2π]

Details

The angle in radians, varying from 0 before , is synchronized with the zero crossings (leading edge) of the fundamental harmonic of the input signal.

Data types

Float64

Complex numbers support

No

Input

# In — normalized input signal, O.E.
scalar

Details

Normalized input signal in relative units.

Data types

Float64

Complex numbers support

No

Parameters

Parameters

# Minimum frequency, Hz: — minimum expected input frequency

Details

The minimum expected frequency of the input signal. This parameter determines the size of the block buffer. Mean (Variable Frequency), used inside the block to calculate the average value.

Default value

45

Program usage name

f_min

Evaluatable

Yes

# Initial inputs [Phase (deg), Frequency (Hz)]: — initial values of the phase and frequency of the input signal

Details

The initial values of the phase and frequency of the input signal.

Default value

[0, 50]

Program usage name

phase_and_f_start

Evaluatable

Yes

# Regulator gains [Kp, Ki, Kd]: — proportional, integral and differential coefficients of the internal PID controller

Details

Proportional, integral and differential coefficients of the internal PID controller. Use these coefficients to adjust the PLL response time, outlier, and steady-state error.

Default value

[180, 3200, 1]

Program usage name

coefficients_of_PID

Evaluatable

Yes

# Time constant for derivative action, s: — the time constant for the first-order filter

Details

The time constant for the first-order filter.

Default value

1e-4

Program usage name

T_d

Evaluatable

Yes

# Maximum rate of change of frequency, Hz/s: — maximum positive and negative slope of the signal frequency

Details

The maximum positive and negative slope of the signal frequency.

Default value

12

Program usage name

ROCOF_max

Evaluatable

Yes

# Filter cut-off frequency for frequency measurement, Hz: — the cutoff frequency of the second-order low-pass filter

Details

The cutoff frequency of the second-order low-pass filter.

Default value

25

Program usage name

f_c

Evaluatable

Yes

# Sample time: — sampling period

Details

Specify the sampling period of the block in seconds. Set the value 0 to implement a continuous block.

Default value

0.0001

Program usage name

sample_time

Evaluatable

Yes

# Enable automatic gain control — enabling automatic gain control

Details

When this check box is selected, the block PLL optimizes its operation by scaling the signal of the PID controller according to the magnitude of the input signal. Check this box if the input signal is not normalized.

Default value

true (switched on)

Program usage name

enable_automatic_gain_control

Evaluatable

Yes