Integrating accelerometer data in gs to get velocity data in IPS

20 views (last 30 days)
I'm trying to figure out how to integrate accelerometer data measured in gs in order to get velocity in inches/second (IPS). I created a 100Hz 1g sine tone in a program called ME'scope (see first attachment). Within ME'scope I can click on "Integrate" and it will integrate that waveform (see second attachment). The 1g acceleration comes out to ~0.6IPS peak. This is confirmed by using the equation v = 61.4*G/f = 61.4*1/100 =0.614. I exported the 100Hz 1g data to an Excel file.
Using the following code I read in the Excel file. I convert the gs to in/sec^2 by multiplying by 386.09. I then run cumtrapz on it.
data_filename='100Hz Sine Tone.xlsx';
[Time,txt] = xlsread(datafilename,1,'A:A');
[Data_g,txt] = xlsread(datafilename,1,'B:B');
Data_insec = Data_g * 386.09;
Data_v_cum = cumtrapz(Time,Data_insec);
Attachment 3 is the read in data (Data_g).
Attachment 4 is the output of cumtrapz (Data_v_cum).
Since cumtrapz is cumulative I subtracted each proceeding value from the next one. Attachment 5 shows that output.
None of these give me the answer of a 0.6IPS sine tone.
Hoe can I integrate accelerometer time domain data?
  1 Comment
Muhammad Anugrah Husen Aidilla
Edited: Muhammad Anugrah Husen Aidilla on 4 Aug 2019
Just to be clear, isn't that output (attachment 4) 0.6 + 0.6*sin ? If you don't want the constant you can just substract it by the mean of itself.
Oh, and I don't think that 'substracting each proceeding value from the next one' is needed, just cumtrapz is enough, it's how integration works.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!