Accuracy of harmonic measurement with AFE in KM34

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accuracy of harmonic measurement with AFE in KM34

919 Views
martinzhang
Contributor III

Hello,

Now I’m using MKM34 to measure the current harmonic. The current measure module is AFE, AFE module frequency is 6.144MHz, OSR setting is 1024 and the sampling frequency is 6000 Hz, I found that the accuracy of the harmonic is getting worse with the order, for exampling, error of 3rd is 0.11% and 31th is 1.23%


Also, I noted that for AFE module, OSR will affect the sampling:
The overall filter frequency response scales with the output sample rate which is a function of the modulator clock (mod_clk) frequency and the OSR. An example of the frequency response with a modulator clock of 6.144 MHz and an OSR=256 is shown in the following figure. In this case, the sample frequency is 24 kHz, so frequency components above 12 kHz are aliased back into the band from 0 to 12 kHz. (Kinetis KM34 Sub-Family Reference Manual)


Is there any suggestion to improve the accuracy of harmonic measurement with AFE?

Best Regards,

Martin

0 Kudos
3 Replies

837 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Martin,

Regarding your question that the 3th and above harmonic components are worse, here I gives some advice, pls have a try.

1)For the AFE module, I suggest you use hardware triggering, and One conversion following a triggering event by clearing the CC bit and setting the HW_TRG bit in AFE_CHx_CFR.

2)In order to get good result, I suggest you sample integer sine cycle. For example, assume the tested sine signal frequency is 50Hz, and you sample ONE cycle with 256 points, the ADC triggering signal frequency will be 50Hz*256=12.8KHz.

3)If possible, as a test, you can test a voltage signal from waveform generator.

Hope it can help you

BR

XiangJun Rong

0 Kudos

837 Views
martinzhang
Contributor III

Hello Xiangjun,


In my project, the AFE is working in continuous mode and this cannot be changed. By the way the SAR ADC module in the same MCU is used for voltage sampling and has same sampling frequency with AFE and it work correctly which means the harmonic accuracy is OK.


My understanding is the AFE module cannot work well in the same sampling frequency with SAR ADC is caused by the decimation filter in AFE. I have tried to disable the decimation filter in AFE but the AFE cannot work.


So, from my side, I want to keep most configuration of the MCU and to improve the harmonic measuring accuracy in AFE module. If I increase the sampling frequency more RAM should be used and MCU load also increase.


Best Regards,
Martin

0 Kudos

837 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Martin,

I think it is okay to use continuous mode, and get samples to do FFT, because the continuous mode can guarantee the fixed sampling time.

It is required to enable the decimation filter in AFE by setting the DEC_EN bit in AFE_CHx_CFR register, otherwise, the AFE does not work.

Hope it can help you

BR

Xiangjun Rong

0 Kudos