This section describes the formulas
used for the voltage, current, power, and energy calculations. As previously
described, voltage and current samples are obtained at a sampling rate of 8000 Hz.
All of the samples that are taken in approximately one second frames are kept and
used to obtain the RMS values for voltage and current for each phase. The RMS values
are obtained with the following formulas:
Equation 4.
Equation 5.
where
- ph = Phase parameters that are
being calculated [that is, Phase A (= 1) or B (= 2)]
- vph(n) = Voltage sample
at a sample instant n
- voffset,ph = Offset used
to subtract effects of the additive white Gaussian noise from the voltage
converter
- iph(n) = Each current
sample at a sample instant n
- ioffset,ph = Offset used
to subtract effects of the additive white Gaussian noise from the current
converter
- Sample count = Number of samples
within the present frame
- Kv,ph = Scaling factor
for voltage
- Ki,ph = Scaling factor
for current
Power and energy are calculated for
active and reactive energy samples of one frame. These samples are phase-corrected
and passed on to the foreground process, which uses the number of samples (sample
count) to calculate phase active and reactive powers through the following
formulas:
Equation 6.
Equation 7.
Equation 8.
where
- v90(n) = Voltage sample
at a sample instant ‘n’ shifted by 90°
- KACT,ph = Scaling factor
for active power
- KREACT,ph = Scaling
factor for reactive power
- PACT_offset,ph = Offset
used to subtract effects of crosstalk on the active power measurements from
other phases and the neutral
- PREACT_offset,ph =
Offset used to subtract effects of crosstalk on the reactive power measurements
from other phases and the neutral
Note that for reactive energy, the 90°
phase shift approach is used for two reasons:
- This approach allows accurate
measurement of the reactive power for very small currents
- This approach conforms to the
measurement method specified by IEC and ANSI standards
The calculated mains frequency is used
to calculate the 90 degrees-shifted voltage sample. Because the frequency of the
mains varies, the mains frequency is first measured accurately to phase shift the
voltage samples accordingly.
To get an exact 90° phase shift,
interpolation is used between two samples. For these two samples, a voltage sample
slightly more than 90 degrees before the current sample and a voltage sample
slightly less than 90 degrees before the current sample are used. The phase shift
implementation of the application consists of an integer part and a fractional part.
The integer part is realized by providing an N samples delay. The fractional part is
realized by a one-tap FIR filter. In the test software, a lookup table provides the
filter coefficients that are used to create the fractional delays.
In addition to calculating the
per-phase active and reactive powers, the cumulative sum of these parameters are
also calculated using Equation 9, Equation 10, and Equation 11.
Equation 9.
Equation 10.
Equation 11.
Using the calculated powers, energies
are calculated with the following formulas in Equation 12.
Equation 12.
From there, the energies are also
accumulated to calculate the cumulative energies, by the following Equation 13, Equation 14, and Equation 15.
Equation 13.
Equation 14.
Equation 15.
The calculated energies are then
accumulated into buffers that store the total amount of energy consumed since system
reset. Note that these energies are different from the working variables used to
accumulate energy for outputting energy pulses. There are four sets of buffers that
are available: one for each phase and one for the cumulative of the phases. Within
each set of buffers, the following energies are accumulated:
- Active import energy (active energy
when active energy ≥
0)
- Active export energy (active energy
when active energy < 0)
- React. Quad I energy (reactive
energy when reactive energy ≥ 0 and active power ≥ 0; inductive load)
- React. Quad II energy (reactive
energy when reactive energy ≥ 0 and active power < 0; capacitive
generator)
- React. Quad III energy (reactive
energy when reactive energy < 0 and active power < 0; inductive
generator)
- React. Quad IV energy (reactive
energy when reactive energy < 0 and active power ≥ 0; capacitive load)
- App. import energy (apparent energy
when active energy ≥ 0)
- App. export energy (apparent energy
when active energy < 0)
The background process also calculates
the frequency in terms of samples-per-mains cycle. The foreground process then
converts this samples-per-mains cycle to Hertz with Equation 16.
Equation 16.
After the active power and apparent
power have been calculated, the absolute value of the power factor is calculated. In
the internal representation of power factor of the system, a positive power factor
corresponds to a capacitive load; a negative power factor corresponds to an
inductive load. The sign of the internal representation of power factor is
determined by whether the current leads or lags voltage, which is determined in the
background process. Therefore, the internal representation of power factor is
calculated with Equation 17.
Equation 17.