Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
acceleration to displacement accelerometer data

Subject: acceleration to displacement accelerometer data

From: Omio Abedin

Date: 16 Apr, 2010 02:32:08

Message: 1 of 9

Hi all,

I have a problem which seems simple enough, but I just can't work it out. I have discrete accelerometer data from an IMU, which is collecting data at 10Hz. I have 6DOF being the x, y, z linear accelerations, and the roll, pitch, yaw rate.

I want to convert the linear accelerations to displacements and the angular velocities to angular displacements. I have been trying many different thinigs to solve this problem. I have tried cumtrapz with and without a high pass filter, but the result do not appear to be what I am looking for.

I know they are inccorect because I moving the IMU to a certain known position and the results are not conforming to that. I am moving the IMU from a table to the floor (750mm below), and thus my position should read 0.75m once it reaches the floor. But it doesn't, it starts reading 0 again.

Surely, this problem is common one, and someone out there must know how to solve it. Is there any other way to solve it without integrating? I am hoping that someone has already had to figure it out, and has got a script I could use, but any help would be greatly appreciated.

Thanks,
Omio

P.S. if any wants, I can email the script I have so far.

Subject: acceleration to displacement accelerometer data

From: Roger Stafford

Date: 16 Apr, 2010 04:10:22

Message: 2 of 9

"Omio Abedin" <omio.abedin@dsto.defence.gov.au> wrote in message <hq8i78$j84$1@fred.mathworks.com>...
> Hi all,
>
> I have a problem which seems simple enough, but I just can't work it out. I have discrete accelerometer data from an IMU, which is collecting data at 10Hz. I have 6DOF being the x, y, z linear accelerations, and the roll, pitch, yaw rate.
>
> I want to convert the linear accelerations to displacements and the angular velocities to angular displacements. I have been trying many different thinigs to solve this problem. I have tried cumtrapz with and without a high pass filter, but the result do not appear to be what I am looking for.
>
> I know they are inccorect because I moving the IMU to a certain known position and the results are not conforming to that. I am moving the IMU from a table to the floor (750mm below), and thus my position should read 0.75m once it reaches the floor. But it doesn't, it starts reading 0 again.
>
> Surely, this problem is common one, and someone out there must know how to solve it. Is there any other way to solve it without integrating? I am hoping that someone has already had to figure it out, and has got a script I could use, but any help would be greatly appreciated.
>
> Thanks,
> Omio
>
> P.S. if any wants, I can email the script I have so far.
-----------------
  Accuracy of the double integration involved is crucial to the proper operation of an IMU. I seriously doubt if 'cumtrapz' is good enough. You should be using some version of the matlab 'ode' functions for solving these second order ordinary differential equations. The effects of small errors can build up very rapidly. Knowing correct orientation is crucially important in making the proper corrections for the effects of gravity. The poor IMU has no way of knowing that it is not accelerating straight upwards at some 32 feet per second per second, and if orientation is in error, it literally doesn't know which is the "up" direction to correct in. At best these devices can function only a very short time without receiving input from other sensors to allow corrections to be made. Read:

 http://en.wikipedia.org/wiki/Inertial_measurement_unit

Roger Stafford

Subject: acceleration to displacement accelerometer data

From: TideMan

Date: 16 Apr, 2010 04:31:39

Message: 3 of 9

On Apr 16, 2:32 pm, "Omio Abedin" <omio.abe...@dsto.defence.gov.au>
wrote:
> Hi all,
>
> I have a problem which seems simple enough, but I just can't work it out. I have discrete accelerometer data from an IMU, which is collecting data at 10Hz. I have 6DOF being the x, y, z linear accelerations, and the roll, pitch, yaw rate.
>
> I want to convert the linear accelerations to displacements and the angular velocities to angular displacements. I have been trying many different thinigs to solve this problem. I have tried cumtrapz with and without a high pass filter, but the result do not appear to be what I am looking for.
>
> I know they are inccorect because I moving the IMU to a certain known position and the results are not conforming to that. I am moving the IMU from a table to the floor (750mm below), and thus my position should read 0.75m once it reaches the floor. But it doesn't, it starts reading 0 again.
>
> Surely, this problem is common one, and someone out there must know how to solve it. Is there any other way to solve it without integrating?  I am hoping that someone has already had to figure it out, and has got a script I could use, but any help would be greatly appreciated.
>
> Thanks,
> Omio
>
> P.S. if any wants, I can email the script I have so far.

I'm using an array of pairs of accelerometers to measure the
horizontal vibration of a large structure.

What I found was that the accelerometers are only good down to about
0.15 Hz, so anything at lower frequencies is rubbish, but when you
integrate, this low freq. stuff gets amplified several-fold.
Therefore, it's important to eliminate the low freq components from
the signal before integrating.
I use orthogonal wavelet decomposition, then integrate each wavelet
detail in turn twice, before superimposing at the end. I keep an eye
on the double-integrated wavelet details to make sure no drift is
introduced.
I guess there are other lots of other ways of doing it, but this works
for my application.

Moving the accelerometer from the desk to the floor would not work for
my accelerometers because there would be too much low freq energy,
which they cannot resolve.

Subject: acceleration to displacement accelerometer data

From: Omio Abedin

Date: 16 Apr, 2010 05:00:05

Message: 4 of 9

TideMan <mulgor@gmail.com> wrote in message <d551b1cc-f14a-449e-a617-4af5532ba214@i37g2000yqn.googlegroups.com>...
> On Apr 16, 2:32 pm, "Omio Abedin" <omio.abe...@dsto.defence.gov.au>
> wrote:
> > Hi all,
> >
> > I have a problem which seems simple enough, but I just can't work it out. I have discrete accelerometer data from an IMU, which is collecting data at 10Hz. I have 6DOF being the x, y, z linear accelerations, and the roll, pitch, yaw rate.
> >
> > I want to convert the linear accelerations to displacements and the angular velocities to angular displacements. I have been trying many different thinigs to solve this problem. I have tried cumtrapz with and without a high pass filter, but the result do not appear to be what I am looking for.
> >
> > I know they are inccorect because I moving the IMU to a certain known position and the results are not conforming to that. I am moving the IMU from a table to the floor (750mm below), and thus my position should read 0.75m once it reaches the floor. But it doesn't, it starts reading 0 again.
> >
> > Surely, this problem is common one, and someone out there must know how to solve it. Is there any other way to solve it without integrating?  I am hoping that someone has already had to figure it out, and has got a script I could use, but any help would be greatly appreciated.
> >
> > Thanks,
> > Omio
> >
> > P.S. if any wants, I can email the script I have so far.
>
> I'm using an array of pairs of accelerometers to measure the
> horizontal vibration of a large structure.
>
> What I found was that the accelerometers are only good down to about
> 0.15 Hz, so anything at lower frequencies is rubbish, but when you
> integrate, this low freq. stuff gets amplified several-fold.
> Therefore, it's important to eliminate the low freq components from
> the signal before integrating.
> I use orthogonal wavelet decomposition, then integrate each wavelet
> detail in turn twice, before superimposing at the end. I keep an eye
> on the double-integrated wavelet details to make sure no drift is
> introduced.
> I guess there are other lots of other ways of doing it, but this works
> for my application.
>
> Moving the accelerometer from the desk to the floor would not work for
> my accelerometers because there would be too much low freq energy,
> which they cannot resolve.

Thanks for the info Tideman.

What parameters did you use for you wavelet analysis? I have the wavelet toolbox, but not sure which parameters to use. I had previously created a high pass filter, but that didn't work to well anyway:

fNorm = 1/(10/2);
[b,a] = butter(10, fNorm, 'high');
acchigh = filtfilt(b,a,accel);

I am not sure if I'm getting something fundamentally wrong with my work, because I would expect sort of like a step function for the displacement when I move it to the floor. But its nothing like that atm.

Btw what acclerometer are you using? I am using a Racelogic IMU atm, but may soon turn to a Xsense IMU, as I think it can log at 100Hz.

Thanks,
Omio

Subject: acceleration to displacement accelerometer data

From: TideMan

Date: 16 Apr, 2010 08:27:04

Message: 5 of 9

On Apr 16, 5:00 pm, "Omio Abedin" <omio.abe...@dsto.defence.gov.au>
wrote:
> TideMan <mul...@gmail.com> wrote in message <d551b1cc-f14a-449e-a617-4af5532ba...@i37g2000yqn.googlegroups.com>...
> > On Apr 16, 2:32 pm, "Omio Abedin" <omio.abe...@dsto.defence.gov.au>
> > wrote:
> > > Hi all,
>
> > > I have a problem which seems simple enough, but I just can't work it out. I have discrete accelerometer data from an IMU, which is collecting data at 10Hz. I have 6DOF being the x, y, z linear accelerations, and the roll, pitch, yaw rate.
>
> > > I want to convert the linear accelerations to displacements and the angular velocities to angular displacements. I have been trying many different thinigs to solve this problem. I have tried cumtrapz with and without a high pass filter, but the result do not appear to be what I am looking for.
>
> > > I know they are inccorect because I moving the IMU to a certain known position and the results are not conforming to that. I am moving the IMU from a table to the floor (750mm below), and thus my position should read 0.75m once it reaches the floor. But it doesn't, it starts reading 0 again.
>
> > > Surely, this problem is common one, and someone out there must know how to solve it. Is there any other way to solve it without integrating?  I am hoping that someone has already had to figure it out, and has got a script I could use, but any help would be greatly appreciated.
>
> > > Thanks,
> > > Omio
>
> > > P.S. if any wants, I can email the script I have so far.
>
> > I'm using an array of pairs of accelerometers to measure the
> > horizontal vibration of a large structure.
>
> > What I found was that the accelerometers are only good down to about
> > 0.15 Hz, so anything at lower frequencies is rubbish, but when you
> > integrate, this low freq. stuff gets amplified several-fold.
> > Therefore, it's important to eliminate the low freq components from
> > the signal before integrating.
> > I use orthogonal wavelet decomposition, then integrate each wavelet
> > detail in turn twice, before superimposing at the end.  I keep an eye
> > on the double-integrated wavelet details to make sure no drift is
> > introduced.
> > I guess there are other lots of other ways of doing it, but this works
> > for my application.
>
> > Moving the accelerometer from the desk to the floor would not work for
> > my accelerometers because there would be too much low freq energy,
> > which they cannot resolve.
>
> Thanks for the info Tideman.
>
> What parameters did you use for you wavelet analysis? I have the wavelet toolbox, but not sure which parameters to use. I had previously created a high pass filter, but that didn't work to well anyway:
>
> fNorm = 1/(10/2);
> [b,a] = butter(10, fNorm, 'high');
> acchigh = filtfilt(b,a,accel);
>
> I am not sure if I'm getting something fundamentally wrong with my work, because I would expect sort of like a step function for the displacement when I move it to the floor. But its nothing like that atm.
>
> Btw what acclerometer are you using? I am using a Racelogic IMU atm, but may soon turn to a Xsense IMU, as I think it can log at 100Hz.
>
> Thanks,
> Omio

I'm at our beach cottage for the weekend, so I cannot answer your
questions until Monday.

Subject: acceleration to displacement accelerometer data

From: Johannes Korsawe

Date: 26 Jul, 2010 06:18:05

Message: 6 of 9

Hello TideMan,

I have some similar problem to solve and would like to test your idea of wavelet decomposition and integrating every part for itself. I have already found that a pure butterworth filter would not work for my data, as the drift is very near to the relevant data in a frequency domain measure.

But i stick to the same question as Omio Abedin did: What parameters to use for the decomposition? I have not done that decomposition and transformations by now and would like to learn about it. My question(s):

1. Could you share some (pseudo-)code snippets on how to do the double time-integration in this wavelet-decomposed manner?

2. Or could you give some hints on what MATLAB commands to use, s.t. i can figure it out for myself.

I willl be grateful for any help. Thank you in advance.

Best Regards,
Johannes

Subject: acceleration to displacement accelerometer data

From: TideMan

Date: 26 Jul, 2010 08:37:42

Message: 7 of 9

On Jul 26, 6:18 pm, "Johannes Korsawe"
<johannes.korsawe.nos...@volkswagen.de> wrote:
> Hello TideMan,
>
> I have some similar problem to solve and would like to test your idea of wavelet decomposition and integrating every part for itself. I have already found that a pure butterworth filter would not work for my data, as the drift is very near to the relevant data in a frequency domain measure.
>
> But i stick to the same question as Omio Abedin did: What parameters to use for the decomposition? I have not done that decomposition and transformations by now and would like to learn about it. My question(s):
>
> 1. Could you share some (pseudo-)code snippets on how to do the double time-integration in this wavelet-decomposed manner?
>
> 2. Or could you give some hints on what MATLAB commands to use, s.t. i can figure it out for myself.
>
> I willl be grateful for any help. Thank you in advance.
>
> Best Regards,
> Johannes

First of all, you need the wavelet toolbox.
Then you decompose your signal using wavedec. Don't get hung up on
which mother wavelet to use. I use 'db5' for almost everything.
Decompose to the maximum level (determined from wmaxlev).
Now, you recompose the wavelet details individually using wrcoef.
And numerically integrate each one of them individually using cumtrapz
or whatever.
The wavelet details are orthogonal - prove this to yourself by
calculating their covariance - so can simply be added together, either
before or after integration.
You need to play with your data to find what works for you.
For my application, I discard all but a few details in the middle of
the range - the ones at low scale are noise I'm not interested in and
the ones at large scale are spurious instrument drift.

Subject: acceleration to displacement accelerometer data

From: Jerry

Date: 27 Sep, 2011 19:04:13

Message: 8 of 9

Hey everyone,

I am just starting out and working on the motions of a wave buoy project. For my Project I was asked to calculate the displacement in the z (Heave direction) but all displacements are desired. A Very similar project to "the desk to floor movement" you are discussing. I know to get the displacement you have to integrate twice but I am having issues with the Initial conditions.( from what I have done any slight variation in IC causes a big change in displacement)

I read through the posts and I am wondering which you determined worked best Integrating or the wavelet tool box?

How did you lay out writing your code?

 If anyone is will to share parts of code or ideas any help is greatly appreciated

Thanks
Jerry

Subject: acceleration to displacement accelerometer data

From: TideMan

Date: 27 Sep, 2011 19:23:07

Message: 9 of 9

On Sep 28, 8:04 am, "Jerry " <storm...@comcast.net> wrote:
> Hey everyone,
>
> I am just starting out and working on the motions of a wave buoy project.  For my Project I was asked to calculate the displacement in the z (Heave direction) but all displacements are desired.  A Very similar project to "the desk to floor movement" you are discussing.  I know to get the displacement you have to integrate twice but I am having issues with the Initial conditions.( from what I have done any slight variation in IC causes a big change in displacement)
>
> I read through the posts and I am wondering which you determined worked best Integrating or the wavelet tool box?
>
> How did you lay out writing your code?
>
>  If anyone is will to share parts of code or ideas any help is greatly appreciated
>
> Thanks
> Jerry

A wave buoy floating in the ocean has no resemblance whatsoever to
moving an object from the desk to the floor.
One's an oscillatory motion with periods between 3 and 25 s, and the
other is a step change.
What makes you think they are "Very similar"?

Did you read the previous posts carefully?
It's not a choice between wavelets and integration.
You do one, then the other.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us