Shop OBEX P1 Docs P2 Docs Learn Events
HM55b compass w/ tilt and force issues... (need physics help!) — Parallax Forums

HM55b compass w/ tilt and force issues... (need physics help!)

The Lazy DestroyerThe Lazy Destroyer Posts: 21
edited 2006-05-04 15:06 in General Discussion
Hello guys, had an issue I'm trying to problem solve and wanted to see if I can get some input. Before going too far into the post I'd like to say the I'm starting to think the best option to deal with the inaccuracy is to just ignore it. But before I finalize anything, I'd like to get some input to see if there is in fact any way to correct it.

The problem I'm having is that I have a 2p40 controlled digital display for my motorcycle, and the final thing I'm adding is a compass. I ride mostly in the mountains so it'd definately be nice to have. I got the HM55 that Parallax offers so I can have a straightforward and simple approach to it, and I think I've found a problem with an electronic compass that I didn't account for: lateral bike tilt.

The compass module gets pretty innaccurate when the unit gets tilted, enough for me to want to try and correct it or find a way to ignore the compass reading while the bike is leaned over. 45 degrees tilt skews the readings by about maybe 40 degrees or so, enough for me to think having 8 displayed directions (N, NE, E, SE, S, SW, W, NW) it would start to skew into the wrong direction. I wouldn't be looking at the compass while mid-corner, but being the perfectionist that I am surely would prefer it be accurate all the time.

I already have an accelerometer measuring forces forward and backward, so trying to use lateral g-forces to compensate (or simply "ignore" the compass readings while leaned over) would be perfect since I already have it mounted and have that axis ready to use. With that in mind I made this post in a motorcycle forum:
Sorry for a semi-threadjack, but how does the lateral g-forces the bike directly sees get affected mid-turn? Say you have a glass of water glued to the top of the tank, how much is it going to get sloshed to the one side? The bike is leaned, but it is still balanced through the centrifugal forces. At the same time, the centrifugal forces are parallel to the ground level and not parallel to the water level, which would be different when the bike is leaned. The picture fascia posted shows this. The red arrow stays in line w/ the ground, not the bike. I'm thinking hanging off would actually disrupt the possible balance the bike sees side to side? said...
The picture reference was this one:

image20.gif

and this one:

coming5.gif

And this was the response I had received:
The simple answer: None.

The slightly longer answer: The red arrow is not the important one. It is parallel to the ground because it is defined that way. It plus the yellow arrow are the decomposition of the blue arrow, which is the "real" force vector and the important consideration. As fas as the bike is concerned, this blue arrow represents gravity, and though it gets longer and shorter and moves side to side a bit, it always points basically towards the tire, until you crash. If the arrow points at the contact patch, the bike is balanced and will remain at the same lean angle, be it 0deg or 53deg. If it points to the inside of the contact patch, the bike will "fall" deeper into the corner. said...


Anyhow, where was I? As yes, how lean affects lateral force on that glass of water. We will assume that the road is smooth so the glass doesn't get bumped into discombobulation. If you and the bike stay inline, the water will remain basically flat, being sloshed only by the transient of corner entry. Once you settle into steady state cornering, the water doesn't know the difference between cornering and sitting still. It just knows it's being pulled to the bottom of the glass. If you lean your body into the corner, you will have stood the bike more upright than it would otherwise be for that turn. The water will keep the same level and will thus be leaning furhter into the corned than the bike. So your compass should always be visible to you, even at full tilt.
Having a sportbike up in the twisty mountain roads,·I do lean off which would throw the forces to the side some, but since I do not do it often (and when I do my pace is one that doesnt allow looking at a compass), it sounds like using a mounted·accelerometer measuring lateral G's will not help.

My thoughts so far are this: I should simply ignore lean side to side (turning) for two reasons: 1) I wouldn't look at it while turning anyways and 2) I am trying to keep my project simple and the only other way I can figure to see if the bike is turning without using an accelerometer (since one would not be accurate considering motorcycle physics) is to use some sort of distance measuring sensor (ultrasonic) mounted to each side of my bikes fairings, which is WAY overkill.

My conclusion so far is to maybe do this: read the compass and then compare it to the last measurement. I only take measurements once every two or three seconds so if I go into a turn and it records a (incorrect) value, it doesn't display it since it didn't match the previous. I go out of the turn, it records another value, and then records another one again. Since in that case both of them are the same, and probably accurate, it displays the new value, hopefully correct.

Does this sound like an acceptable method, or would there be any other "tricks" I could use to see if the bike is leaned?

Thank you for any help, I know this post is long but I'm hoping I'm on the right track. Thanks again!

-Blake

Comments

  • JavalinJavalin Posts: 892
    edited 2006-05-02 14:52
    If I am reading this correctly - and correct me if not - why dont you use a gimbal.

    Simply put this would always keep the compass or whatever flat arround corners.

    A simple none technical solution?

    (something like: http://www.newmarksystems.com/gimbal.html)

    James
  • Al AdrianAl Adrian Posts: 4
    edited 2006-05-02 15:08
    Something to consider... magnetic compasses don't work very well under acceleration... Aviators have known this for years... This is why gyro compasses were invented...

    But Personally I'd use a GPS to give me a decent compass heading on my Bike... You could bring the GPS data into your display unit from an imbedded "mouse" GPS, or you could mount one on your cluster and leave it on the compass setting if you don't want to look at the map...

    There are so many other "gadgety" things you get when you incorporate a GPS too... track-log, statistics (of more or less accuracy), autoroute navigation...

    Al...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-02 15:15
    That's a good point.· But a combination of both items would cover you in any situation.· You could use the HM55B for static heading when you're not moving.· In these cases the GPS cannot provide any accurate heading.· When the bike is in motion or tilted (which implies motion most of the time) use the GPS heading.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • The Lazy DestroyerThe Lazy Destroyer Posts: 21
    edited 2006-05-02 16:12
    Something to consider... magnetic compasses don't work very well under acceleration... Aviators have known this for years... This is why gyro compasses were invented... said...
    Looks like I'll have to whip something up on a protoboard and take a spin in my car and see how much acceleration will affect the HM55. If it looks like significant acceleration changes it's readings by over 5 or 10 degrees than it'll have to be a bust. sad.gif The gimbal is a thought but there is so little room on my sportbike already, and to be honest even if there was I wouldn't rig that up, it's not worth it.

    Thanks for the replies so far!
  • John AbshierJohn Abshier Posts: 1,116
    edited 2006-05-02 21:56
    I don't that force or acceleration is the problem.· Tilt definitely causes the compass to read incorrectly.· There are 3-axis compasses that provide 3 magnetic readings (x, y, & z) that can be corrected if you can also read pitch and roll separately from the compass.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-02 22:19
    In this situation, wouldn't a gimbal be affected by acceleration?

    I think John Abshier is on the right track with a 3-axis compass... Under normal upright conditions, two compass could be mounted with a specific deg of offset.
    Say one at +30 deg and the other at -30 deg. By comparing the output of the two, you should be able to derive the true heading of the bike.

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

    IC Layout Engineer
    Parallax, Inc.
  • steve_bsteve_b Posts: 1,563
    edited 2006-05-03 12:02
    How does the HMB55 compass work? Is it strictly an electric field measuring device? or is there a mechanical component embedded (something like those MEMSIC devices)??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-03 15:00
    Steve,

    ·· The device has two internal hall-effect like sensors on different axes which are capable of detecting the magentic field at uTesla levels.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • The Lazy DestroyerThe Lazy Destroyer Posts: 21
    edited 2006-05-04 15:06
    I think for simplicity reasons I'm going to go for comparing previous outputs on a single HM55 so it only updates the direction when I'm going straight for longer than say 2 seconds. Should still be accurate, only downfall is the reading can be delayed and potentially really off for a longer turn, but it'll keep things simple (which is good since I don't have much time to run the function since the same stamp controls a constantly moving bar-graph of G-forces). The delay is okay since I am not going to look at direction while mid-turn. Plus, I don't have to buy anything more, another benefit since my budget is already overkill and I'm cheap.

    I'll more than likely change things around on a later revision, which I'll probably use a dual HM55 setup, or find a 3-axis unit. Using two w/ offset angles sounds like it'll work better but might be tough to test. Thanks so much for the help guys!!!
Sign In or Register to comment.