
Metrology Computation Engine
5.4.2 Foreground Process
After the background has collected sufficient data, the flag PHASE_STATUS_NEW_LOG is set by the
background. The main loop should then check the status of this flag and call the foreground process
calculate_phase_readings() to perform the rest of the computation to deliver the measurement readings.
The foreground process is:
1. Power processing
(a) Calculate the active power by scaling with number of samples and power scaling factor
(b) Calculate the reactive power by scaling with number of samples and power scaling factor
(c) Calculate fundamental active power by scaling with number of samples and power scaling factor
(d) Calculate fundamental reactive power by scaling with number of samples and power scaling factor
2. Voltage processing
(a) Calculate the RMS voltage by scaling with number of samples, perform square root and multiply
with the voltage scaling factor
(b) Calculate the fundamental RMS voltage by scaling with number of samples, perform square root
and multiply with the voltage scaling factor
(c) Current processing
(i) Calculate the RMS current by scaling with number of samples, perform square root and multiply
with the current scaling factor
(ii) Calculate fundamental RMS current from power and voltage
(iii) Calculate the apparent power by multiplying the root mean square voltage and root means
square current
(iv) Other processing
(i) Calculate the power factor
(ii) Calculate the frequency of the ac line
36
Firmware and Embedded Metering Library API
SLAU587 – August 2014
Copyright © 2014, Texas Instruments Incorporated