07-01-2020 07:41 AM
Hello LV experts,
I am trying to build a Vibration monitoring system using MPU 6050 Arduino module. I am able to read the data sucessfully from arduno and plot on my labview program.
However there are a couple of problems.
1. When i run the problem the labview reads a certain spike which i don't see in arduino serial monitor due to which i believe my fft plots shows a peak at he very beginning on low frequency as seen in the graph.
2. I have also tried using ptbypt filters and ptbypt spectrum measurements but nothing gives satisfactory value.
3. Because of staying at home i don't have any system for which i know the exact values such as max. rpm or anything so that i can verify if the program is giving correct values.
4. For now I am just able to visualize the data using different graphs, but I would request if anyone has any better ways or ideas I can implement to make the project more good.
I appreciate any help and feedback at this point iof time as I am just stuck at this since a week.
-layman93
Solved! Go to Solution.
07-01-2020 08:35 AM
That FFT anomaly at 0 Hz is typical of data that contains a significant DC offset. I'll assume you aren't interested in this DC offset and would like to remove it from your analysis.
A super simple way to surpress a fairly constant DC offset is to subtract the average of the dataset from each individual data point before doing your FFT. I don't think this method would be considered mathematically "pure", but it often helps quite a lot for how simple it is.
High pass filtering would be another option and is probably preferable for more of a purist approach.
-Kevin P
07-01-2020 09:10 AM - edited 07-01-2020 09:18 AM
Hi Kevin,
Thanks for replying, you solution explains a lot.
Although shouldn't I be using a band pass filter then since the input is from a Arduino which will have electronic noise as well?
Also to the Labview Experts is there any better way to visualize it?
-layman93
07-01-2020 09:54 AM
I know you are addressing LabVIEW Experts, which I assume means those who have sufficient psychic powers that they can visualize the LabVIEW Code (the actual .VI file) that you failed to attach for us non-Experts. We'll just "guess" at what you are doing and suggest ways to improve it (sight-unseen, but "you get what you pay for").
I gather that you do not know much about FFTs, how it works, what "leakage" means, etc. A typical "power-of-2" FFT has 2^n terms -- two are "special", the "DC" term (which is exactly the arithmetical mean of the data) and the "noise" term (which is "what is left over when you have fit the remaining 2^n-1 terms). The other terms are pair-wise representations of harmonics of a sine wave whose period is the sampling period, so if you sample for 1 second, the harmonics will be 1 Hz, 2 Hz, 3 Hz, ... 2^(n-1) - 1 Hz.
If you are writing LabVIEW code to collect data and do an FFT on it, and you don't understand what you are seeing (and don't understand what you are doing), especially if you don't have "real data" to test, write a (very small) LabVIEW program that generates some data (there are Waveform Generators on the Waveform Palette, or you can simply try making a sine wave, or a square wave, or a triangle wave) and feeding your "signal" into an FFT. You can "experiment" by doing such things as:
You can learn a lot by doing this, and because you are doing it, it will "stick" with you better than if some "expert" tries to explain it to you (particularly if you can't ask questions and get answers quickly).
Bob Schor
07-01-2020 10:12 AM
Hello Bob,
Thank you for your response.
Out of all the things you suggested I have tried a few and I did understand how the data changes. Maybe I am not able to communicate properly, my properly.
I have vibrating elements which vibrates at 6 speeds from 2100RPM to 3600RPM.
From the simulated signal in Labview I did understand that how my program is supposed to behave. But when i used the sensor to acquire real time in real time, the program gives results in different way. For this i tried using ptbypt Vi's also since it is said that it helps with real time processing.
But the result is still the same. I am attaching the VI again to show what I have tried.
- What happens if you add a DC Offset to your signal? How does that change the FFT?
- What happens if you apply a digital filter before you run the FFT?
I will try to do these two thanks for the insight.
@Bob and other can you help me do it in a better way and also please point out any mistakes or nonsense code if present in it.
-Thanks
layman93
07-06-2020 11:30 AM
Hello All,
I am trying to create a simple LV interface where in I can plot data of vibration acquired using MPU 6050 Sensor using Arduino UNO board in realtime.
I am trying to visualize the fft plot but haven't been able to do so as seen in the picture attached.
The system has a motor running at 2100 rpm for which I expected a peak at 35Hz , but the graph being plotted is no where near that and i don't even understand what scale is it using.
Plotting FFT or Power spectrum is important for me to further process the data but I am not able to do it. Can anyone please explain why is the plot not correct also is there any problem in my LV program. I have attached my Lab view program.
Please help.
-Thanks
07-06-2020 01:59 PM
Can't really tell what's going on in your VI.
I think you should try Bob's suggestion and make a simulation.
However here are some points to consider:
mcduff
07-07-2020 11:37 AM
Hello all and McDuff
Thank you for your help with which I was able to figure out the technical aspects of my system.
I also followed you explanation in this thread.
Please see attached VI
My sampling rate is 338 hz and the frequency of m,y interest range from 35 hz to 60 hz, thus satisfying the Nyquist law.
I am trying to sample 10000 data points at a time. with my df being 0.0338 Hz for my acquisition time of 29 secs.
But when i try to plot my data the frequency axis is not proper as shown-in capture png.
I believe the peak is correct but I am not able to set the frequency resolution properly.
I have also attached my Matlab plot which gives out correct peak.
Can you please help.
layman93
07-07-2020 12:28 PM
07-07-2020 12:47 PM
Hello Srikrishna,
Here is the code attached and data set.