LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acceleration data to dispalcement data

Solved!
Go to solution
Solution
Accepted by topic author wyoung

You need to subtract the mean of your integral, not the original mean. See below

snip.png

 

 

mcduff

Message 11 of 25
(4,130 Views)

I forgot to add the integral in the last snippet.

 

There is another way to do this.

 

  1. Take the FFT of the data.
  2. Divide each point by (2 pi f) where f is the frequency of the ith point of the FFT -> This is the 1st integration, will give you velocity
  3. Divide each point by (2 pi f)^2 where f is the frequency of the ith point of the FFT -> This is the 2nd integration, will give you displacement

If you do the inverse FFT you will still blow up due to a DC signal or low frequency signal, but maybe you can just examine your signal in frequency space.

 

mcduff

0 Kudos
Message 12 of 25
(4,120 Views)

I'm intrigued with the FFT path to determine displacement since it should eliminate the issues of DAQ zero drift, and low frequency interference, but I'm not sure how to do it.

 

I found an article from Liu Qihe (https://iopscience.iop.org/article/10.1088/1742-6596/1345/4/042067/pdf) that describes this but the symbolic math is fairly deep and it's late in the day...I can't focus and convert it to LabVIEW.

 

mcduff, assuming I have the RMS FFT done (I do; FFT of the raw accelerator voltage, based on examples I found), how can I convert this into displacement?  See attached screen shot (note: no scaling done yet...accel data is simulated).

 

0 Kudos
Message 13 of 25
(3,851 Views)

@labviewman wrote:

I'm intrigued with the FFT path to determine displacement since it should eliminate the issues of DAQ zero drift, and low frequency interference, but I'm not sure how to do it.

 

I found an article from Liu Qihe (https://iopscience.iop.org/article/10.1088/1742-6596/1345/4/042067/pdf) that describes this but the symbolic math is fairly deep and it's late in the day...I can't focus and convert it to LabVIEW.

 

mcduff, assuming I have the RMS FFT done (I do; FFT of the raw accelerator voltage, based on examples I found), how can I convert this into displacement?  See attached screen shot (note: no scaling done yet...accel data is simulated).

 


 

  • Take the FFT of the data.
  • Divide each point by (2 pi f) where f is the frequency of the ith point of the FFT -> This is the 1st integration, will give you velocity
  • Divide each point by (2 pi f)^2 where f is the frequency of the ith point of the FFT -> This is the 2nd integration, will give you displacement

So, if you have the FFT of the acceleration data point at 1kHz, divide that point by (2 pi 1000)^2, you get the displacement at 1kHz. Do the same for all you other points changing the frequency. When you do the fft you get a "frequency axis". Take these points, multiply each by 2 pi, then square each point; after that divide your FFT amplitude point-by-point with the values you just calculated.

 

Note this method works well is you a stationary signal at a dominant frequency. If you have many frequencies, then this method may not give you what you want. To get the overall displacement you would need to add all those displacements at specific frequencies together and account for the phases between the frequencies.

 

Look at the photo. I make my acceleration (Accel) the sum of two sine waves. The only difference between the two cases is a phase difference. Look at the displacement curve (disp). The plot of the FFT magnitude is the same for both cases; that is both cases have the same displacements at their respective frequencies, the phase difference is not accounted for.

 

mcduff

 

Snap4.png

 

Message 14 of 25
(3,842 Views)

Thanks, that helped! 

 

Took a while for me to realize I needed to work in the correct units.  I still have to calculate the overall displacement based on the individual contributions of each frequency considering their phases.

 

See attached code and screenshots.

Download All
0 Kudos
Message 15 of 25
(3,830 Views)

Need to go to a meeting, so don't have time to look at the code, but think of what you need.

 

Assume my motor is vibrating at 60Hz; most likely there are odd overtones also at 180, 300 Hz, ...

 

Using the FFT method at 60 Hz I can say the rms displacement at 60Hz is 0.01mm. The other overtones are so small that I don't care much about them.

 

Now if I was monitoring a strut on a bridge, the displacement as a function of time may be interesting; that way I can get how much the struct is moving in response to load, wind, etc. The average value is less interesting.

 

Doing a double integral is not too hard in LabVIEW.

 

mcduff

0 Kudos
Message 16 of 25
(3,826 Views)

I used the double-integral method, at least with a clean sine wave, I get the same results as the FFT method.  Will see with the actual accel values soon to determine the best method. 

0 Kudos
Message 17 of 25
(3,820 Views)

Your math looks okay to me, you can make the following substitution to simply things a bit

Snap7.png

 

Another trick I like to use is the Power Spectrum VI. No complex numbers, but you need to scale the output for the correct units, like below. (Think I did it right) You still need to only use "half" of the array like in your VI.

 

Snap8.png

mcduff

 

0 Kudos
Message 18 of 25
(3,811 Views)

Yep, both suggestions work great ‌👍

 

To get overall displacement, how do I sum all the bins together and account for their phases?  I've tired several methods but none give an expected result.

0 Kudos
Message 19 of 25
(3,799 Views)

@labviewman wrote:

Yep, both suggestions work great ‌👍

 

To get overall displacement, how do I sum all the bins together and account for their phases?  I've tired several methods but none give an expected result.


This is where you need to be careful in defining what you want.

Assume your acceleration is a perfect sine wave, sin[2 pi t].

If you integrate it twice, you get - sin[2 pi t]/(4 pi^2).

At t=0.5 or 1, the instantaneous displacement is 0. The RMS value is 1/(sqrt(2) * 4 pi^2 ). When you take the FFT you essentially "average" over the time period. So how do you convert an average to an instantaneous value? Not easy.

If you want to know the "RMS" over the whole frequency span, no need to do a FFT,  just take the rms of the time series, see (https://en.wikipedia.org/wiki/Root_mean_square)

rms.png

The RMS of the frequency spectrum should give the same answer due to energy conservation, but since we zero out the DC component, it will not match. (Not sure what to do about the DC component.)

 

So do you want an instantaneous displacement or an average displacement value; that will drive your analysis.

 

mcduff

 

0 Kudos
Message 20 of 25
(3,794 Views)