FFT e-meter library for Kinetis M

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FFT e-meter library for Kinetis M

4,614 次查看
svenmoeller
Contributor II

Hello,

i want to use the FFT e-meter library on my TWR-KM34Z50. The problem is there is no description of the function "EnergyCalculation" (in AN4255, AN4847). The only reference to that function i have found is in DRM149. The function is used in the "Kinetis-M Two - Phase Power Meter Reference Design" Firmware. Is it possible to get that firmware, so i can see how to implement the function?

Thank you

0 项奖励
回复
10 回复数

2,403 次查看
Leonard30
Contributor I

Hi 
I would like to download the metering libraries with FFT library and filter library. 
Could anyone let me know link to download ?

Regards,
Leonardo


0 项奖励
回复

3,484 次查看
Ludek
NXP Employee
NXP Employee
0 项奖励
回复

2,346 次查看
Leonard30
Contributor I

Hi Ludek

I am get a message as this when I try to download the files.

Leonard30_0-1681915855876.png

 

0 项奖励
回复

3,484 次查看
Ludek
NXP Employee
NXP Employee

Declaration:

void EnergyCalculation (volatile unsigned long *energy, unsigned long *energyrem, unsigned long power, unsigned long coef);

Parameters:

energy - pointer to the active/reactive, import/export energy with resolutionn 0.1 Wh or 0.1 VARh, i.e. 1000=100.0 Wh/VARh.

energyrem - pointer to the energy remainder (decimal point of the energy)

power - instantaneous power (active or reactive)

coef - 'hour' coefficient = line frequency*3600, with mHz frequency resolution, i.e. 50000=50.000Hz

Description: The function upgrades both the energy and energy remainder values (addressed by respective pointers) by a new values. This function should be called after the 'PowerCalculation' processing in the user code.

Note: I will add the function description into the AN4255 soon. Currently I am preparing a new FFT metering library (METERLIBFFT 2.3.1) with different API and with different functions name (unified with the 'Filter-based' metering library).

0 项奖励
回复

3,484 次查看
nickng
Contributor II

Hi Ludek,

What does that mean "import/export" energy here?

if import + export = total, why don't just use energy as a single variable instead of two params (import+export)here? 

0 项奖励
回复

3,484 次查看
Ludek
NXP Employee
NXP Employee

The FFT-based metering library is used for 4-quadrant energy measurement, that is: import/export, active/reactive.

It means it can measure both positive and negative active energy, and the same for reactive energy. Therefore, it uses four separated energy counters.

Identification of imported and exported active and reactive energy allows you to monitor energy flow in both directions: delivered from the utility and produced on-site which is ideal for facilities with back-up generators or green power capabilities (for example solar panels).

0 项奖励
回复

3,484 次查看
nickng
Contributor II

Hi Ludek,

Thanks for your explanation.

What about the reactive energy counter with that import and export  concept? how do you distinguish whether it is capacitive or inductive load . I expected the Varh counter is a signed counter, but according to the meter fft lib, the reactive energy counter is an unsigned uint 32 varaible. 

0 项奖励
回复

3,484 次查看
Ludek
NXP Employee
NXP Employee

All four energy counters are unsigned values. These values are incremented only!

  • import active (wh_i) energy counter is incremented only if active power (Watts) is positive
  • export active (wh_e) energy counter is incremented only if active power (Watts) is negative (by its absolute value)
  • import reactive (varh_i) energy counter is incremented only if reactive power (VAr) is positive
  • export reactive (varh_e) energy counter is incremented only if reactive power (VAr) is negative (by its absolute value)

The type of the load (i or c) is recognized by the sign of both active (P) and reactive (Q) power:

  • Quadrant I : P>0, Q>0 = motor mode, inductive load
  • Quadrant II: P<0, Q>0 = generator mode, inductive load
  • Quadrant III: P<0, Q<0 = generator mode, capacitive load
  • Quadrant IV: P>0, Q<0 = motor mode, capacitive load

Note: for deep explanation of the power / energy measurement see here: Beckhoff Information System - English 

0 项奖励
回复

3,484 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Regarding the firmware of meterlib, I think you can download it via the AN4265SW from the website:

http://tinyurl.com/n6tsugg

The meter library includes the api function  to compute the RMS value for voltage and current in both time and frequency domain. You have to register on the website, then download the software.

0 项奖励
回复

3,484 次查看
svenmoeller
Contributor II

AN4265SW includes the Filter based meterlib, but i would like to use the FFT based meterlib (AN4847SW) to analyse the harmonics of a signal. In the FFT based meterlib there exist 2 functions for calculation of the metering quantities.

  1. PowerCalculation    -> application programming interface (API) is explained in AN4255
  2. EnergyCalculation   -> no explanation of the API neither in AN4255 nor in AN4847
0 项奖励
回复