From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acceleration data to dispalcement data

Solved!
Go to solution

The goal of my task is to estimate the displacement of an engine (using accelerometers) being tested on a dyno and shut down the test if the displacement exceeds a certain threshold. I went down the rabbit hole of the FFT path because of potential issues with the time domain method (double integral) such as noise and zero-offset drift on the A/D converter (we will be using a NI 9234 in AC-coupled mode).  Our supplier wants us to use filters to limit the frequency from 110 Hz to 2 KHz; the DAQ card sampling rate can be set such that the 2KHz Fc is taken care of via hardware anti-alias filters and I'll use a Butterworth filter with a lower Fc of 110 Hz.

 

Using the simple accelerometer simulator (sine wave) that creates a +/- 1 g signal at say 500 Hz, I tested-out a double integral then took the RMS of the sample window (1 second of data) divided by 0.707 (since it's a pure sine wave) to get the peak displacement, but it doesn't come close to the number I get from the FFT method.  The FFT method matches the value calculated using 19.57*(Peak g)/F^2 which I found on a website (for a pure sine wave vibration).  I do have the sound and vibration toolkit for LabVIEW which has VIs that essentially use the double-integral method, but it results in a an even different peak value

 

I'll do some more experimentation this weekend and will update with what I find.

 

Thanks for you help mcduff!

0 Kudos
Message 21 of 25
(1,105 Views)

I took a look at using double integrals, the NI Sound and vibration toolkit, and using the FFT method to determine displacement using an accelerator.  I must of been doing something obviously wrong when I looked at the NI Sound and Vibration toolkit because the results of it are about what is expected (double integral, FFT method, NI sound and vibration toolkit all have about the same results).

 

I can use the double integral and NI Sound and Vibration toolkit methods, but would like to use the FFT method too and test out on a tes system to see which works best, but, I need to figure out how to properly add the FFT bins using their phases.

 

See attached screen shots and code snippet, and code

0 Kudos
Message 22 of 25
(1,080 Views)

What kind of latency do you need? If you need to stop the engine "immediately" you will need real time and a FPGA. With those systems you can analyze point by point and stop immediately if needed.

 

If you "zero" the DC signal, set f=0 component to 0 in your FFT, you should then be able to get the RMS displacement of the AC part.

 

The rms of the double integral and the rms FFT should be equivalent; getting the correct scale factors can be tricky.

 

See snippet below show equivalence of rms of time and frequency data.

 

mcduff

 

snip.png

0 Kudos
Message 23 of 25
(1,072 Views)

Sorry for the delay...working other projects can now back to this one.

 

Latency isn't a big deal. 1 second is fine.

 

I have an algorithm working using double-integrals in the time domain that works pretty well (PC) but has more error as the frequency goes up...I don't care since there is also decreasing movement with a given acceleration (g).  The algorithm works well and was also able to convert it for an EtherCAT FPGA and also works well. But...I'm still curious about the FFT method.

 

So today I took a fresh look at it, and have the FFT method working quite well....that is if there is not an integer number of cycles being passed into the algorithm at which the output (FFT->Division->Inverse FFT) gets pretty wonky and constant moves. The Double-Integral method RMS reading has some uncertainty (as expected) due to not having an exact # of cycles in the sample window, but the effect is minimal.

 

Code (LV2020SP1) attached.

0 Kudos
Message 24 of 25
(606 Views)

I found a simple solution...I should have known this from signal processing classes I had 30 years ago. One Word: Window

 

My production system acquires data at 10 Hz rate with Fs=5120 Hz, buffers 2 seconds of data, and uses a high-pass filter after the accelerometer, but the code I attached shows how it works w/o this.

 

Also attached is a block diagram of the different methods (note: the hardware I'm using has a LPF with a Fc of 0.45*Fs because I'm using a NI 9234).

 

I hope this helps at least 1 other person.

Download All
0 Kudos
Message 25 of 25
(567 Views)