Announcement

Collapse
No announcement yet.

Estimating Tilt with 3-axis accelerometer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Estimating Tilt with 3-axis accelerometer

    Would it be possible to estimate tilt (pitch, roll, theta) using a 3-axis accelerometer in MDX?

    I'd be very interested in displaying a graph in MDX showing pitch and roll.

    I'm currently not much more than a novice in MDX and as of yet haven't got my hands really dirty...

    Does MDX support the trigonometric and power functions required to calculate the pitch roll and theta values? (Basic equations in a static context can be found in this PDF: http://www.freescale.com/files/senso...ote/AN3461.pdf)

    As an aside, would it be possible to use a button to calibrate the accelerometer based on a given position. i.e. I guess it would need to set three offset variables based on the current X, Y and Z values, these offset variables would then be used in a (root?) function to set the values of calibrated X, Y and Z variables? Had a quick look in the MDX UI and can't see if its possible to set a variable based on another variable, or if its possible to set more than one.

    Thanks

  • #2
    Both are possible, but be advised you can't really use an accelerometer to measure that stuff when the vehicle is in motion

    Comment


    • #3
      Originally posted by mbdishon View Post
      Would it be possible to estimate tilt (pitch, roll, theta) using a 3-axis accelerometer in MDX?

      I'd be very interested in displaying a graph in MDX showing pitch and roll.

      I'm currently not much more than a novice in MDX and as of yet haven't got my hands really dirty...

      Does MDX support the trigonometric and power functions required to calculate the pitch roll and theta values? (Basic equations in a static context can be found in this PDF: http://www.freescale.com/files/senso...ote/AN3461.pdf)

      As an aside, would it be possible to use a button to calibrate the accelerometer based on a given position. i.e. I guess it would need to set three offset variables based on the current X, Y and Z values, these offset variables would then be used in a (root?) function to set the values of calibrated X, Y and Z variables? Had a quick look in the MDX UI and can't see if its possible to set a variable based on another variable, or if its possible to set more than one.

      Thanks
      Looks like you could use the single axis method fairly easily. The only problem I see is that MDX doesn't seem to have the trig functions. And, if I were doing it, I would ignore any sensor reading over 1g. I'm no math wiz but looks like you could use sin=opp/hyp where opp=1 and hyp=sensor reading in g's. Since MDX can't do sin, I think I would hand calculate something like every 2 or so (maybe every 5?) and then create a logic statement. A really big logic statement. Looks like it would work while moving as long as you don't hit any bumps and speed remains constant (yeah, right). I guess you could use averaging to help out there. The only thing it wouldn't tell you is in what direction you're tilting. If you are at rest, then the x and y axis could give direction but I don't know that it would be worth the trouble. Looks like all it would take is a lot of time, and since all I seem to have right now is lots of time..........

      Comment

      Working...
      X