[iphone] Removing the influence of gravity on accelerometer readings

I have an app that reads acceleration data from the Y axis however when the device is tipped I get bogus readings due to gravity influence.
I'd like to combine the data from another axis (X I believe, I don't have the diagram handy) to negate this effect.
For example, if the phone is laying flat on its back, the Y axis should read 0 and the X axis should read 1g. If one end of the phone is then lifted, the reading on the Y axis should increase (if the top of the device is lifted) and the X axis should decrease.
So I should be able to combine these values mathematically and filter this effect from the "real" acceleration data I'm interested in the Y axis, correct?
I think there would be limits since I imagine beyond a certain point of deflection the readings from the Y accelerometer will become too inaccurate, but if I could compensate for minor changes in device angle that would be sufficient for my application.
I've tried a few approaches to this but either my math skills or some nonlinearity of the accelerometer are leading to unexpected results.
Is this possible, or is there an easier answer to this problem? Any ideas are appreciated.
Thanks!

Some basic trigonometry might help you understand the problem.
You have two sides of a force vector triangle, one is the force of gravity, the other is your accelerometer reading. Unless you have a 3rd known, for instance one of the angles, the triangle solution is ambiguous. You can't solve for the 3rd side. It could be almost anything (from the sum to the difference of the other two side lengths/accelerations).
First order low pass filtering just smoothes, or averages out, the readings of the acceleration value, it doesn't help you with any information about the unknown angle.
So you can't remove the influence of gravity from the accelerometer readings for arbitrary motion.
You could fix one of the angles of the unknown triangle by clamping the device such that it can't be tilted at all when moved. Then solving for acceleration is possible, because you would then have 2 sides plus one angle.
.

Similar Messages

Maybe you are looking for

  • States not displaying in Components

    Hello all I just created a main page - in which I created three views like this... <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:views="com.views.*">      <views:Login />      <views:Member /> </mx:Application> Now in my LoginScreen

  • Search function issue

    When using the search box in the upper right corner:  I get a response that lists a number of albums/songs/etc.  But, when I click "show more" nothing happens.  This field seems to be grayed out.  Also, if I click on the "+" sign, it does not add the

  • Turn colored pdf text to monochrome pdf

    I want to print a pdf which contains coloured text to a b/w printer. Text now becomes unreadable greyscale. Is there a way to convert every text color in a pdf (or postscript) file to pure black? So not greyscale like in Acrobat, but 100% black? I'm

  • Importing DV files from HD tape camera into one file

    Hi there, I have an old sony HD Cam using DV tapes. I am capturing those tapes into Final Cut Pro to keep the original files in a .mov format, but when I do that, Final Cut slices the movie in 100 little pieces. I would like to know if there is a way

  • TS2771 My Ipod touch displays white lines across the screen.  I've turned it on and off but still shows up HELP!!!

    My Ipod touch displays white lines across my entire screen.  I've turned it on and off and it still hasn't cleared up.HELP!?!