LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Frequency Measurement

Hi,

 

After quite a lot of Googling and looking at the FPGA examples, i've decided to post here.

 

The problem is this:

 

I have three, 50Hz signals (three phase voltages) that i'm feeding to the FPGA analog input. These are sampled every 50 micro seonds. These  values then go into a DMA FIFO. (Four values, one after the other).

 

I am then reading these signals in a host VI, running in RT. I'm able to plot the signals with the correct magnitudes and phases.


The problem is that i'm trying to detect a low frequency oscillation (ca 0.6Hz). Even with filters and after trying several FFT and tone measurement VI's, i'm not able to meaure this signal.

 

Host VI Loop rate : 40 milli seconds. (reading blocks of data)

FPGA Loop rate: 50 micro seconds

 

I'm guessing that the problem could be with the time stamps of the signals. I cannot seem to be able to figure out how to add the correct time stamp to the signals. 

 

I have looked at this : http://forums.ni.com/t5/Real-Time-Measurement-and/how-to-get-real-time-timestamp-for-cRIO-and-FPGA-V... and i still have no solution.

 

With my present VI, i'm able to measure a frequency of 40Hz, which is clearly wrong.

 

Anyone with a suggestion?

 

Eldrich

 

(I can post code screenshots if it would help. The RT VI is a mess. I don't have  LabView 2013 on this computer and i can't edit it. Sorry)

Download All
0 Kudos
Message 1 of 3
(3,268 Views)

I made a bit of progress with this VI.

 

With a lot of help, we identified two issues:

 

1. Both  RT loops need loop timers. Only one had it. fixed now.

 

2. Extra complication in the FPGA VI. Removed and fixed now.

 

I'm uploading the VI's again.

 

I'm still having a problem with identifying frequencies in the data that i'm reading. The measured frequency is still wrong.

 

Any comments or help with this code will be appreciated!

 

-Eldrich

Download All
0 Kudos
Message 2 of 3
(3,192 Views)

I had a solution methodology in mind.

 

What i intend to do is to read elements from the FPGA and store them somwhere in RT. This 'somewhere' couldb be a queue or a RT FIFO.

 

What i will then do is to read the number of elements i require from this storage. Say i need to measure frequencies down to 0.2Hz. I would need to read the last (maybe) 30000 elements. I will then perform an FFT on these and look at the results. For each iteration of reading 30000 elemeents, i will also delete the exact number of elements that i have read from the FPGA. This way, the number of elements stays constant and my purpose is solved.

 

Data coming out of the FPGA : array of elements.

 

Looks like i'll need to use an array of arrays to solve this.

 

Any help would be appreciated.

 

-Eldrich

0 Kudos
Message 3 of 3
(3,168 Views)