01-02-2012 05:56 AM
Hi,
I am implementing an online closed loop controller using LABVIEW. There are three signal inputs, the FFT of each signal are to be computed online,and the frequency at which the spectra is lowest is to be detected.
The plot of the spectra is attached..
Please advice on how to acheive this...
thanks,
ruser.
Solved! Go to Solution.
01-02-2012 09:54 AM
ruser,
you should provide more information about what the "minimum frequency from FFT of three signals" is. Looking into the docx-file, i can see a graph with three different plots. Is that minimum frequency you refer to the minimum for each plot (4.7 or 6.1 for blue, 2.3 or some other for red and 3.2 for green)? Or is it the point where all plots in sum have the lowest value (should be somewhere 4.7 or 6.0)?
In addition to that, i hope that you have a performant algorithm for the FFT in order to keep your controller loop time. And depending on the requirement of the stability of the controller: Are you running RT?
hope this helps,
Norbert
01-03-2012 12:33 AM
Nobert,
Thank you for the reply,...
The frequency to be detected is at the "point where all plots in sum have the lowest value"..; hence please advice on which function block to use
The program will be run in real time, however , i dont understand what you mentioned about the "performant algorithm for the FFT ".;
i have run the program in real time before with controllers etc ; but they didnt have to execute the FFT of the signals...
regards,
Ruser
01-03-2012 02:09 AM - edited 01-03-2012 02:13 AM
Ruser,
the basic requirment for a FFT is a periodic, repeating signal. Hence, a single data point of a waveform cannot have a frequency. And here the dilemma starts: You want to do control, but you have to acquire several data points and expect those data points to build a continuous, selfrepeating, periodic signal. So acquisition times are longer and you need some data computation (FFT) before getting a new setpoint for your control. This takes time.
There are methods to accomplish this, of course. For instance, LV delivers a function called "FFT (single point)". This is most probable the function you will go for. But be carefull since it does not return acceptable values for the first iterations..... see attached example for this (LV 2011).
Now regarding your question:
Simply sum up your data arrays and search for the smallest value. Since the "distance" of each datapoint is constant (Delta f for the result of the FFT), you can compute the frequency of that point by multiplying the index with Delta f.
hope this helps,
Norbert
01-03-2012 04:10 AM
Dear Nobert,
Thank you for your reply,
I have version 9.0; but the vi you sent is in version 11.0...
If you have the time, pls can you send me a snapshot of the vi block diagram, so that i can have a look?
I was thinking of collecting the signals using a collector before passing them on to the FFT single point block ? would that make it easier?
thanks again,
Regards,
Ruser
01-03-2012 06:44 AM
01-04-2012 01:32 AM
Nobert,
thank you for the .png image; somehow i cannot open it, though!!...
could you send it again pasted in word document?
Thanks for the help..
regards,
ruser
01-04-2012 02:57 AM
Ruser,
i am not sure what you mean by "open the png". I assume you are talking about putting it into LV as code. This of course cannot work since the screenshot is nothing more than a screenshot, so no VI snippet. No functionality included in the png to create LV code...
The screenshot displays the issue you face regarding the FFT, not an answer to the original question "How do i find the minimum of the frequency plots?". To find the minimum of the frequencies, as already pointed out, simply sum up all three data array (should have the same length of course) and then use the Min/Max function....
hope this helps,
Norbert
01-04-2012 04:48 AM
Hi Nobert,
What i meant was that i could not 'view' the snapshot;...
I tried using the ' compound arithmetic ' block to sum the array elements synchrously... that just doesne seem to work though!
ruser
01-04-2012 05:10 AM
Nobert,
I am attaching a word document which has the VI front panel and block diagram... i cant get any fft graph either ways...
One graph displays the acceleration data in the x, y and z axis....
Thanks a lot,
regards,
fesmi.