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.
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.
10-11-2015 10:49 AM
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
10-12-2015 01:54 PM
Hi Mike,
Please post the corresponding TDX file. We can't load the TDM without it.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-12-2015 05:26 PM
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.
10-13-2015 10:26 AM
Hi Mike,
Please have a read of the following forum post that may help you getting closer towards a solution.
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
10-13-2015 02:05 PM
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.
10-13-2015 02:22 PM
I attached the results.
10-14-2015 04:27 PM
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
10-15-2015 08:25 AM
Hi Brad,
Thank you for your effort of creating the script. I will try the script and get back to you.
Regards,
Mike