Skip to content

Single-Phase PQ Meter

Single-phase active / reactive power meter. Takes instantaneous voltage v and current i (control signals) and computes active power P = LPF(v·i) and reactive power Q = LPF(v_q·i), where v_q is v delayed by a quarter fundamental cycle (a 90° phase shift) — the standard single-phase quadrature method. Both outputs are smoothed by a first-order low-pass filter 1/(τs+1); set the time constant τ = 0 for the raw instantaneous product (which still carries the 2·f ripple). Optional outputs: phase angle φ = atan2(Q, P) in radians, and signed power factor PF = ±|P|/√(P²+Q²) (positive = lagging / inductive Q ≥ 0, negative = leading / capacitive Q < 0). For a sinusoid at the configured frequency, P → Vrms·Irms·cos φ and Q → Vrms·Irms·sin φ once the filter settles.

Category: Continuous

Ports

NameDirectionValue typeNotes
vinputdouble
iinputdouble
poutputdouble
qoutputdouble
phioutputdoubleVisible when emit_phi == 1
pfoutputdoubleVisible when emit_pf == 1

Parameters

NameLabelTypeDefaultUnitsDescription
frequencyfdouble60Fundamental frequency. Sizes the quarter-cycle (90°) voltage delay used for the reactive-power computation (delay = 1 / (4·f)). Set to your AC system's nominal frequency (60 in North America, 50 in Europe).
time_constantτ (s)double0.0167Time constant of the first-order low-pass filter applied to both P and Q (1/(τs+1)). Larger values smooth the 2·f power ripple more but settle slower; the default ≈ one 60 Hz cycle. Set τ = 0 to output the raw instantaneous v·i and v_q·i products with no filtering.
emit_phiOutput φenum (Off / On)0Add a φ output port carrying the phase angle atan2(Q, P) in radians.
emit_pfOutput PFenum (Off / On)0Add a PF output port carrying the signed power factor ±|P|/√(P²+Q²) (sign follows Q: + lagging/inductive, − leading/capacitive; unity when there is no power flow).