LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Measure frequency of less than 300 Hz

That is not what I meant by real time, I meant I do not want to wait until my queue gets empty once my measurement is done, so I do not wnat my queue to fill at all.

 

also, 10 Hz is not enough for fast response system, I do not want my signal's peaks to be ''cut'' because I cannot sample fast enough.

 

I have joined my VI's. You won't be able to run it but at least you can see. The second VI is the small Vi computing the RSM/Hz of the signal. I already use the producer/consumer.

 

I flashed on something though. Will the better ratio sampling rate/sample would be the frequency x N (N an integer) I am measuring itself? I mean, theoricaly, I need only one cycle to find RMS and frequency of a periodic signal. So I could set, ratio sampling rate/sample of 60, 120, 180 and so on... but how can I acheive this without filling my queue???

 

 

Download All
0 Kudos
Message 11 of 14
(746 Views)

Sampling at multiple of the signal frequency is useful if the frequency is precisely known so that the sampling is truly synchronous. However, you are trying to measure transient changes of frequency so it is almost impossible to sample synchronously.

 

The waveforms coming from the DAQ Read have a timestamp (t0). What are you trying to gain by setting a timestamp attribute and changing to the Dynamic Data Type (which hides its data behind dialog boxes)?  Particularly because you do not use that data?

 

How do you have any idea which data goes where in the consumer? Converting DDT to arrays two places probably puts the same data on both arrays.  If you had stayed with the array of waveforms you could use index array to separate them with assurance that you get the data you want.

 

Use shift registers to pass data from one state to another rather than local variables.

 

Avoid building arrays inside while loops.  This will cause frequent memory re-allocations and may lead to crashes as the arrays get larger. Initialize the art=rays to full size the use Replace Array Subset.

 

I think you can use some fairly simple time domain signal processing to get your frequency and voltage measurements.  Can you post some data, preferably showing a load transient?

 

Lynn

0 Kudos
Message 12 of 14
(734 Views)

Thank you for responding,

 

Don't bother details, this VI was quickly build for testing purpose. The main issue here is the Real-time data acquisitions and the Rms and freq computation which require lots of samples, converting them all to 1 resulting data.

 

I think I just won't have the choice... after all, Rms is a mean.

 

Frequency is easy to compute when you have un periodic infinite signal, which is not the case when I will do transient. I'm sorry I can't show transient right now as the test room is still under construction.

 

I am just a bit surprise that if I go over a ratio of 10 sampling rate/number of sample, the queue start to fill... which I can't allow to happen in my case. Is there anything I could do that would allow higher ratio?

0 Kudos
Message 13 of 14
(711 Views)

Eric,

 

The issue of the queue building up is in principle due to not reading the queue fast enough.  Since many of your subVIs are missing, I cannot tell all of the timinig details.

 

What is the DAQ Read timing? Looking back at the earlier posts, it appears that you are sampling at 10 kHz and reading 1000 samples at a time.  This means that the producer loop runs about 10 iterations per second and enqueues an array of N channels of 1000 element waveforms plus a (redundant) timestamp.  How many channels are you sampling?

 

I do not see anything in the consumer loop which should not be able to execute in 100 ms.  Of course the memory allocations for the growing arrays will eventually slow things down.

 

When you change the sampling rate/number of samples ratio, which do you change, the sampling rate or the number of channels?

 

If you consumer needs to run faster than the screen update rate for your monitor, the OS may slow things down. You write data to the charts on every iteration. Putting the screen updates in a separate loop or only updating indicators once every N iterations may allow you to keep up with the queue. N should be chosen to give 5-10 screen uptdates per second or fewer.

 

Lynn

0 Kudos
Message 14 of 14
(703 Views)