Shop OBEX P1 Docs P2 Docs Learn Events
H48C Tri-Axis Accelerometer to balance a segway style device — Parallax Forums

H48C Tri-Axis Accelerometer to balance a segway style device

donnpangydonnpangy Posts: 49
edited 2009-08-17 06:42 in Accessories
The H48C Tri-Axis Accelerometer seems to have a static tilt component and a dynamic acceleration component. Is there a way to separate the 2 or is there a way to use the dynamic acceleration to my advantage?
··· The static tilt portion works great as long as you don't have any acceleration.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2009-08-16 04:14
    donnpangy,

    What you are observing as the "static tilt component" is actually the acceleration due to 1g of gravity on Earth that every object at rest experiences.

    The Accelerometer only has one component and can not by itself determine the difference between an incline vs. an acceleration. You need other components such as a Gyro which can determine angular rate acceleration but has no response to the effects of gravity to mathematically determine your tilt angle.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/16/2009 1:48:00 PM GMT
  • donnpangydonnpangy Posts: 49
    edited 2009-08-16 05:53
    Beau,

    · Thanks for your input on the Tri-Axis Accelerometer chip. Do you think it can do this job or is there a better choice to accomplish this.

    ·· Should I use an RC rate gyro with heading hold? Is there a chip that·I can get that will do this, or should I just get the gyro.

    Thanks so much
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2009-08-16 13:50
    donnpangy,

    Depending on what you want to do, a single sensor solution is not going to do it. In order to determine where 'down' is at all times, you need an accelerometer and a Gyro to work together to resolve the correct position.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • donnpangydonnpangy Posts: 49
    edited 2009-08-16 18:45
    Beau,

    ···· Thanks for the info. I have an RC helicopter gyro (Futaba GY260) that I will install today. It has a heading hold feature which should really help the balancing.

    Thanks again,

    Don
  • donnpangydonnpangy Posts: 49
    edited 2009-08-17 04:11
    Beau,
    · I have the gyro hooked up and I am having problems reading the servo input.·If you read the servo using the·Propeller spin code, the resolution is pretty poor. Do you know of an assembly code that does something similiar so that i can get a head start with this. I have not started to play with the Propeller assembly yet. A head start would be appreciated.
    · (Below is my Propeller code that only gives me 50 for a centered servo pulse.)
    thanks so much,
    Don
    ············· repeat while INA[noparse][[/noparse]4] == 0
    ················ servo4 := 0················
    ············· repeat while INA[noparse][[/noparse]4] == 1
    ················ servo4 := servo4 + 1

    ·········· VGA.dec(servo4)
    ·········· VGA.str(string("· "))
  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-17 05:41
    Somebodys already tried this at http://obex.parallax.com/objects/331/
  • donnpangydonnpangy Posts: 49
    edited 2009-08-17 06:42
    Tim,

    · Thanks for the info. I looked at the code and I think it will work for me.

    thanks again,

    Don
Sign In or Register to comment.