#include <emSwLib.h>
Data Fields | |
int16_t | sampleCount |
int64_t | actPowDotProd |
int64_t | reactPowDotProd |
int16_t | vDotProd [3] |
int64_t | iDotProd |
uint16_t | cycleSampleCount |
_iq30 | reactPowGConst |
G Constant used for the IIR filter to calculate Reactive Power. More... | |
uint32_t | mainPeriod |
This a running average of the length of a mains cycle. (samples/cycle * 256) More... | |
uint32_t | prevMainPeriod |
This a running average of the length of a mains cycle. (samples/cycle * 256) More... | |
_iq30 | oneDivSC |
Constant used to calculate the VRMS,IRMS, power and energy values (1/sample_count) More... | |
uint16_t | prevSampleCount |
uint8_t | cycleCount |
int16_t _EM_Metrology_::sampleCount |
Number of samples being accumulated in the block of processed signals being gathered used for the oneDivSC calculation.
int64_t _EM_Metrology_::actPowDotProd |
Accumulated multiplication of the phase corrected current and voltage (I.V) used for the active power calculation.
int64_t _EM_Metrology_::reactPowDotProd |
Accumulated multiplication of the phase corrected current and voltage 90 (I.V90) used for the reactive power calculation.
int16_t _EM_Metrology_::vDotProd[3] |
Accumulated squares of the phase corrected voltage (V.V). These are used to calculate the RMS voltage, and the power factor. We need separate accumulation for each current sensor, as we accumulate the phase corrected voltage which matches the current sensor's phase shift.
int64_t _EM_Metrology_::iDotProd |
Accumulated squares of the phase corrected current (I.I). These are used to calculate the RMS current, and the power factor. We need separate accumulation for each current sensor, as we accumulate the phase corrected voltage which matches the current sensor's phase shift.
uint16_t _EM_Metrology_::cycleSampleCount |
This is a count of the number of samples to date in the current mains cycle. This is used to calculate the mainPeriod.
_iq30 _EM_Metrology_::reactPowGConst |
G Constant used for the IIR filter to calculate Reactive Power.
uint32_t _EM_Metrology_::mainPeriod |
This a running average of the length of a mains cycle. (samples/cycle * 256)
uint32_t _EM_Metrology_::prevMainPeriod |
This a running average of the length of a mains cycle. (samples/cycle * 256)
_iq30 _EM_Metrology_::oneDivSC |
Constant used to calculate the VRMS,IRMS, power and energy values (1/sample_count)
uint16_t _EM_Metrology_::prevSampleCount |
Stores the prev sample count used to calculate oneDivSC. This is used to avoid calculating 1/SC each cycle.
uint8_t _EM_Metrology_::cycleCount |
Number of zero crossings. Once this number has reached the # of nominal freq. For example for 50.2 Hz, once it reaches 50 cycles then the foreground is triggered.