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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Acceleration to calculate displacement

I have one channel (acceleration) of about 1 KHz frequency and one time channel. Samples per channel is 100 Hz. I would like to plot the displacement against time where displacement is the second integral of the acceleration. The test consists of a fixed ruler with an accelerometer at the end acting as a cantilever. A vertical displacement of 100 mm was applied and then the ruler was allowed to vibrate freely. I am not getting the displacement of 100 mm by doubly integrating the graph. Any suggestions would be appreciated! I have attached the file! --Mik

 
0 Kudos
Message 1 of 8
(6,264 Views)

Hi Mike,

 

Please post the corresponding TDX file.  We can't load the TDM without it.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 8
(6,233 Views)

Hi Brad, 

 

Here is the attached file. I uploaded the results from TDMS to Excel file because it did not allow me to upload the corresponding TDX file. Regards.

 
Mike. 

 

 

Untitled.png

0 Kudos
Message 3 of 8
(6,225 Views)

Hi Mike,

 

Please have a read of the following forum post that may help you getting closer towards a solution.

 

http://forums.ni.com/t5/DIAdem/What-does-Diadem-use-for-Integration-of-acceleration-to-velocity/td-p...

 

The main point to note: It is important to make sure you convert the acceleration data from a voltage into m/s^2 and your time is in seconds.

 

Something that can be seen from your data is that you seem to have quite a clear negative acceleration offset which would dramatically influence the integral calculation. 

 

Would you be able to introduce a calibration offset to the data acquisition?

 

Thanks 

 

Josh

 

 

0 Kudos
Message 4 of 8
(6,201 Views)

Josh and Brad,

 

The acceleration units are in g value. I converted them in m/s^2, so the 5g corresponds to 5  x 9.81 m/s^2 whereas the time is in seconds. I have done some adjustments in DIAdem such as offset of the data in the centre and take the point of interest which in this case is the oscillatory part. I removed the noise at the front and back and then performed the integration. The problem remains the same, I attached the files. This signal is with 50 mm vertical displacement in the end.

 

Kind regards. 

0 Kudos
Message 5 of 8
(6,193 Views)

I attached the results.

0 Kudos
Message 6 of 8
(6,188 Views)

Hi Mike,

 

I created a VBScript that applies the various commands you need to do this programmatically.

 

OPTION EXPLICIT
Dim QuantBased, DataFilePath, Group, TimeChannel, AccelChannel, SpeedChannel, DisplChannel
Const InitSpeed = 0
Const InitDispl = 0.1 ' meters
QuantBased = CalcQuantityBased
DataFilePath = CurrentScriptPath & "Trial 2-1.TDM"
Call Data.Root.Clear
Call DataFileLoad(DataFilePath, "TDM")
Set Group = Data.Root.ChannelGroups(1)
Set TimeChannel = Group.Channels(1)
Set AccelChannel = Group.Channels(2)
Set SpeedChannel = Group.Channels.Add("Velocity", DataTypeChnFloat64)
Set DisplChannel = Group.Channels.Add("Displacement", DataTypeChnFloat64)
ChnDim(TimeChannel) = "s"
ChnDim(AccelChannel) = "gn" ' measured in "g"s
CalcQuantityBased = 1
Call ChnIntegrate(TimeChannel, AccelChannel, SpeedChannel, "SimpsonRule")
Call ChnOffset(SpeedChannel, SpeedChannel, 1, "first value offset")
Call ChnLinScale(SpeedChannel, SpeedChannel, 1, InitSpeed)
Call ChnIntegrate(TimeChannel, SpeedChannel, DisplChannel, "SimpsonRule")
Call ChnOffset(DisplChannel, DisplChannel, 1, "first value offset")
Call ChnLinScale(DisplChannel, DisplChannel, 1, InitDispl)
'Call ChnUnitConvert(DisplChannel, DisplChannel, "mm") CalcQuantityBased = QuantBased

It helps to set the channel units correctly and then use DIAdem's unit management to deal with the conversion from g's to m/s^2, etc.  It's also useful afterward, as you can easily change the display of the Displacement channel to show in mm instead of m if you prefer.

 

The key point here is that when you integrate, you have an arbitrary constant that shows up, whose value depends on the boundary conditions.  I assumed that the displaced ruler started at rest (InitSpeed = 0) and used your 100mm initial displacement value (InitDispl = 0.1).  In order to match the integrated result to the known boundary conditions, I subtracted the first value of each integrated channel from all the values of that channel, so that it started with zero, then added the know initial value to all values of that channel.

 

You'll need to adapt the DataFilePath to the exact path of the input data file or load that file manually into an empty Data Portal and then comment out the Data.Root.Clear() and DataFileLoad() command lines.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 8
(6,158 Views)

Hi Brad, 

 

Thank you for your effort of creating the script. I will try the script and get back to you. 

 

Regards, 

Mike 

0 Kudos
Message 8 of 8
(6,138 Views)