Data Fields
_EM_Metrology_ Struct Reference

#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
 

Field Documentation

§ sampleCount

int16_t _EM_Metrology_::sampleCount

Number of samples being accumulated in the block of processed signals being gathered used for the oneDivSC calculation.

§ actPowDotProd

int64_t _EM_Metrology_::actPowDotProd

Accumulated multiplication of the phase corrected current and voltage (I.V) used for the active power calculation.

§ reactPowDotProd

int64_t _EM_Metrology_::reactPowDotProd

Accumulated multiplication of the phase corrected current and voltage 90 (I.V90) used for the reactive power calculation.

§ vDotProd

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.

§ iDotProd

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.

§ cycleSampleCount

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.

§ reactPowGConst

_iq30 _EM_Metrology_::reactPowGConst

G Constant used for the IIR filter to calculate Reactive Power.

§ mainPeriod

uint32_t _EM_Metrology_::mainPeriod

This a running average of the length of a mains cycle. (samples/cycle * 256)

§ prevMainPeriod

uint32_t _EM_Metrology_::prevMainPeriod

This a running average of the length of a mains cycle. (samples/cycle * 256)

§ oneDivSC

_iq30 _EM_Metrology_::oneDivSC

Constant used to calculate the VRMS,IRMS, power and energy values (1/sample_count)

§ prevSampleCount

uint16_t _EM_Metrology_::prevSampleCount

Stores the prev sample count used to calculate oneDivSC. This is used to avoid calculating 1/SC each cycle.

§ cycleCount

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.


The documentation for this struct was generated from the following file:
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale