LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vibration: Converting mm/s^2 to mm/s

Hi all,

 

I am trying to capture vibration from an accelerometer using the Sound & Vibration toolkit.  I need the output to be in mm/s RMS and I would like to calculate the RMS once every second.  I started with one of NI's examples, and I think I am nearly there.  Attached is my code.  My questions are:

 

  • What do I specify for dB reference and pregain?  Or can I ignore these?
  • I am grabbing 2048 samples from the buffer (chunk size=2048) every iteration because I want to display the data quickly.  The VI that is calculating RMS appears to be giving me an RMS value for every chunk, instead of every second.  How do I get a value every second?

 

  

http://www.medicollector.com
0 Kudos
Message 1 of 11
(337 Views)

I cannot look at your VI, but to go from acceleration to velocity, you need to integrate. Typically before integrating you use a high pass filter set around 10Hz to eliminate any low frequency drift that would lead to a continuously increasing integral/velocity. The other method is to do the integration in the frequency domain. There the coefficients, except for 0f, which you can set to 0, are divided by 2 pi f.

0 Kudos
Message 2 of 11
(325 Views)

Yes, you need to integrate to get displacement from acceleration. (see below)

 

I don't have your toolkits and cannot look at your VI, but you did not tell us the loop rate. Once you know the loop rate, you know how many samples are needed for one second and you can uses a ptbypt RMS to get the result for one second worth of data.

 

 

0 Kudos
Message 3 of 11
(301 Views)

@altenbach wrote:

Yes, you need to integrate (twice) to get displacement from acceleration.

 

Message 4 of 11
(298 Views)

@mcduff wrote:

@altenbach wrote:

Yes, you need to integrate (twice) to get displacement from acceleration.


Sorry, meant to say speed. 😄

 

(hopefully, vibration does not cause overall displacement, except at the end of destructive testing 😄 )

0 Kudos
Message 5 of 11
(283 Views)

Hi everyone.  Thank you for your replies.  I realize the subject of my post is a bit misleading. I actually know how to convert mm/s^2 to mm/s.  Below are my questions, and I was able to answer one of them myself.  Can anyone help with the first one in BOLD? I also uploaded a snippet so you can see my code easier:  

 

  • Q1 What do I specify for dB reference and pregain?  Or can I ignore these?
  • Q2 I am grabbing 2048 samples from the buffer (chunk size=2048) every iteration because I want to display the data quickly.  The VI that is calculating RMS appears to be giving me an RMS value for every chunk, instead of every second.  How do I get a value every second?
    I was having trouble using the RMS subVI from the  Sound & Vibration toolkit, so I just switched to the one shown below.  It calculates RMS once per second nicely now.

vibration test.png

http://www.medicollector.com
0 Kudos
Message 6 of 11
(218 Views)

Hi J,

 


@josborne wrote:
  • Q2 I am grabbing 2048 samples from the buffer (chunk size=2048) every iteration because I want to display the data quickly.  The VI that is calculating RMS appears to be giving me an RMS value for every chunk, instead of every second.  How do I get a value every second?
    I was having trouble using the RMS subVI from the  Sound & Vibration toolkit, so I just switched to the one shown below.  It calculates RMS once per second nicely now.

  • No, you grab "as much samples as available". Wire a "2048" to the "number of samples" input of DAQmxRead to get a fixed number of samples!
  • The RMS data is calculated from the samples in the waveform delivered from DAQmxRead. When that waveform covers just 0.1s then you get 10 RMS values each second!
  • When you want one RMS value per second then you need to collect the samples for 1s. I guess you use a sample rate of 20480S/s so you need to collect 20480 samples…
  • You could use a ring buffer of 20480 samples where you replace your chunks of 2048 samples. This way you could display data at 10Hz, but still calculate RMS values for the last second of sample data…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(212 Views)

Hi josborne,

 

I haven't used the Sound & Vibration toolkit but if you're converting a voltage signal to engineering units, the pregain value is usually used to account for any gain applied to the signal before it reaches the data acquisition system.  For example, if you were passing the voltage signal through an amplifier before connecting it to the DAQ the pregain would specify whatever gain had been set on the amplifier.  If you have no pre-conditioning, set the gain to 0 if it's specified in dB or 1 if it's a linear scaling.

 

The dB reference is just whatever reference value is used when converting from engineering units to decibels: dB value = 10 * log10(signal^2 / dB reference^2).  Changing the reference by a factor of 10 results in the dB value changing by 20 dB, i.e. 10  * log10(10^2), but as long as you're consistent it doesn't matter so much as it can be easily corrected.

 

PsyenceFact

Message 8 of 11
(189 Views)

@josborne wrote:

 

  • Q1 What do I specify for dB reference and pregain?  Or can I ignore these?

Google is your friend. Check out this https://www.microflown.com/blogs/db-level-references-acoustics

0 Kudos
Message 9 of 11
(169 Views)

@PsyenceFact wrote:

Hi josborne,

 

I haven't used the Sound & Vibration toolkit but if you're converting a voltage signal to engineering units, the pregain value is usually used to account for any gain applied to the signal before it reaches the data acquisition system.  For example, if you were passing the voltage signal through an amplifier before connecting it to the DAQ the pregain would specify whatever gain had been set on the amplifier.  If you have no pre-conditioning, set the gain to 0 if it's specified in dB or 1 if it's a linear scaling.

 

The dB reference is just whatever reference value is used when converting from engineering units to decibels: dB value = 10 * log10(signal^2 / dB reference^2).  Changing the reference by a factor of 10 results in the dB value changing by 20 dB, i.e. 10  * log10(10^2), but as long as you're consistent it doesn't matter so much as it can be easily corrected.

 

PsyenceFact



Exactly right and affirmed by SVT help for those controls:

dsbNI_0-1758033755186.png

 

dsbNI_1-1758033766547.png

 

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 10 of 11
(166 Views)