HM55b compass w/ tilt and force issues... (need physics help!)
The Lazy Destroyer
Posts: 21
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:
and this one:
And this was the response I had received:
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
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:
The picture reference was this one: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...
and this one:
And this was the response I had received:
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.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.
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
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
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 Savage
Parallax Tech Support
csavage@parallax.com
Thanks for the replies so far!
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
"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."
·· 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
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!!!