Shop OBEX P1 Docs P2 Docs Learn Events
Best way to get lean angle of a motorcycle - Page 2 — Parallax Forums

Best way to get lean angle of a motorcycle

24

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-11-12 03:02
    Also vibration from the motor and roadway may affect the PING's performance (not saying it will be a problem, only that it's a possibility).

    What about doing it mechanically? Use a free swing gimble mount and gyroscope to maintain camera orientation. I know this would work for weelies, not sure about corners though, the roll would be accounted for, but I dont know if the camera would lead, it seems more likely it would lag, trying to maintain it's original orientation. Perhaps·resticting the DOF would overcome this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 11/12/2008 3:17:19 AM GMT
  • SRLMSRLM Posts: 5,045
    edited 2008-11-12 03:52
    How about taking a trick from the sailors of old? You can find your rotation by measuring the position of the sun (or moon, or stars) and comparing that to what the expected position is (for being in that longitude, latitude, and time). The celestial clock is never wrong, and you can relive history! No vibration to worry about, acceleration is now a laughing matter, and you can even make it so that the camera points away from the sun.


    Of course, you'll need to find (or make) astronomical tables for years to come and input all that data into the uC...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-12 05:23
    SRLM,

    Sun? You obviously don't live anywhere near Seattle! smile.gif

    Seriously, this is not a bad idea, given an unobstructed view of the sky. The astro tables are unnecessary, though, for short-term stability. Just mount the light sensor on the camera mount, take a reference reading with it level, then seek to that reading a reading that equates to the same altitude value with the bike in motion.

    -Phil

    Edit: 'Forgot to account for variable direction of travel. Corrected.

    Post Edited (Phil Pilgrim (PhiPi)) : 11/12/2008 6:38:05 AM GMT
  • QuantumRIQuantumRI Posts: 3
    edited 2008-11-12 07:30
    Why not use a IR sensor its cheap and simple.· The one below is good for 5ft.

    http://www.sparkfun.com/commerce/product_info.php?products_id=8958

    It has a analog out and its linear and it would work with adc like 381·I belive parallax has them.· Write some code that rotates a pan/tilit platform with the camera.

    I included a crude picture.·

    Paul

    Edit:· The picture is a little off.· If you know the distance the sensor is away from the bike center and the result the sensor is returning you can figure the angle out.· Flip the two legs of the triangle and leave the hypotenuse.· But I hope this explains alittle better.



    Post Edited (QuantumRI) : 11/12/2008 7:41:58 AM GMT
    1297 x 757 - 39K
  • Nick McClickNick McClick Posts: 1,003
    edited 2008-11-12 07:40
    It would probably be easier to dynamically calculate astronomical tables with the uController [noparse]:)[/noparse]

    Didn't think about interference for the ping sensors... there are a lot of odd whistles and noises that might get the sensors confused. Rattle & shake isn't a problem, though, because it should affect both sensors equally. It still is trig, though.

    I thought of an IR sensor, but different road surfaces will absorb different amounts of IR. And the great outdoors is flooded with IR, so I suspect it wouldn't be that reliable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
  • ArkaneArkane Posts: 1
    edited 2010-07-03 11:20
    I think most of the questions been achieved. A company is about to launch a data logger that can calculate and record lean angles.
    Take a look at www.flextion.co.uk They don't say much, but it is interesting

    hop.gif
  • edited 2010-07-03 14:56
    I looked around the web and someone else did the math:

    http://www.msgroup.org/forums/mtt/topic.asp?TOPIC_ID=312

    Apparently, you also have to do the math for the width of the tire.
  • EatSleepRIDEEatSleepRIDE Posts: 2
    edited 2013-07-31 12:15
    Hey everyone,

    It's been a while since this thread was active, but EatSleepRIDE has recently developed an iOS App for motorcyclists that help riders calculate their lean angle, and get other riding data like speed, elevation, and duration the ride. We used internal sensors in the iPhone (accelerometer, gyroscope and GPS technology), so no external hardware is required. http://app.eatsleepride.com/

    You can also record your route, discover routes in your area, connect with riders on the road and gives riders access to motorcycle crash detection that detects a crash and notifies your pre-set contacts with your geo-location.

    Would anyone use an App like this?
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-07-31 12:51
    ...EatSleepRIDE has recently developed an iOS App for motorcyclists that help riders calculate their lean angle...

    Interesting project. I'm just curious: how did you go about verifying your application gives the proper lean angle?
  • skylightskylight Posts: 1,915
    edited 2013-07-31 14:54
    Although this is an old thread, I feel that a weighted race bearing that operates an encoder or a pot would work, with the weight at bottom centre the pot could be fitted to read 50% of it's value any deviation left or right of centre and the reading could be taken and an angle worked out from that, likewise the encoder could be read for movement from centre.
    The device could allow for any centrifugal effect by using a strain gauge sensor that is calibrated for the weight, any deviation in weight as it gets heavier due to centrifugal forces can be calculated out of the equation.

    Or for simplicity damping springs?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-31 15:07
    skylight wrote: »
    Although this is an old thread, I feel that a weighted race bearing that operates an encoder or a pot would work, with the weight at bottom centre the pot could be fitted to read 50% of it's value any deviation left or right of centre and the reading could be taken and an angle worked out from that, likewise the encoder could be read for movement from centre.

    A weighted bearing would have the same issues as using an accelerometer by itself. It couldn't tell the difference between an acceleration from a lean vs a turn. In a coordinated turn (an aviation term) all the g force experienced by the pilot from the turn is directed downward in relationship to the sitting pilot. A motocycle probably has most of the centrifugal force directed down in line with the wheels of the motorcycle. So if the motorcycle it turning in a coordinated fashion, the bearing will always be near the bottom of the race even if the motorcycle is experiencing substantial lean.

    As has been suggested, I think being able to sense the magnitude along with the direction of the acceleration would aid in computing if the cycle is leaning or not (though I'm not sure it would be enough).

    As others have mentioned, a gyro would make this type of calculation a lot easier. I assume the app uses the iPhones accelerometer and gyro to compute the lean angle.
  • skylightskylight Posts: 1,915
    edited 2013-07-31 15:12
    Sorry Duane I was thinking about CF and was editing the post when you must have posted, see above
    What about a bar horizontal to the ground with a circular weight on it, as the fixed bar tilts the weight moves left or right the axes would be fixed by the bar and the amount of movement along the bar gives the angle through a strain guage this may be less susceptible to CF?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-31 15:16
    skylight wrote: »
    Sorry Duane I was thinking about CF forces and was editing the post when you must have posted, see above

    I should give posts time to "settle" before replying. I know my posts often get edited several times within their first few minutes of life.
  • skylightskylight Posts: 1,915
    edited 2013-07-31 15:26
    Duane Degn wrote: »
    I should give posts time to "settle" before replying. I know my posts often get edited several times within their first few minutes of life.
    Sorry to mess you around , I think i've done it again as I edited my reply.

    Another idea, instead of the bar how about a plastic tube with windings on the outside at either end,
    inside would be a metal slug and the tube would be filled with viscous liquid to dampen the speed of the slug, the inductance of the windings would change as the slug moved within the windings

    ok that may not work as at a certain angle the weighted slug would still move down, perhaps the original idea of suspending the slug inside by a strain guage, the more tilt the heavier it becomes to the guage?

    Another idea is to have a tilting plate with holes drilled in it, a light source and a sensor either side of the plate in an enclosure to stop any other light entering and as the plate tilts the light is slowly cut off from the sensor
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-07-31 16:58
    Just curious: could you derive lean angle from the GPS by itself? If you derive position, speed and velocity from the GPS, and the app determines you have gone in an arc, wouldn't your lean angle be a function of the centrifugal effects you would likely see given those GPS measurements? Might even accelerations be derived from the GPS, for both changes in altitude and slope of the road?
  • W9GFOW9GFO Posts: 4,010
    edited 2013-07-31 17:21
    No one has commented on this suggestion...
  • ercoerco Posts: 20,257
    edited 2013-07-31 17:31
    Tracking 100% with you, Rich. Nice idea. Once you calibrate it and make a lookup table for speed & bank angle, you're all set. Typically, bikes slow down for very sharp turns. For dynamic lean only, you might even get by with a single vertical accelerometer.

    1.0000 g= vertical, and anything over 1.0000 g is an angle which could be calibrated.
  • W9GFOW9GFO Posts: 4,010
    edited 2013-07-31 17:42
    I think that two axis would be required. There's no way to know which way you are leaning with one axis, and dips and rises would give false readings. With two axis at 90 deg to each other you should be able to filter that out.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-07-31 17:46
    erco wrote: »
    ... For dynamic lean only, you might even get by with a single vertical accelerometer.

    1.0000 g= vertical, and anything over 1.0000 g is an angle which could be calibrated.

    True on a slope? EDIT: oops, I see the man in the shades beat me to it.
  • W9GFOW9GFO Posts: 4,010
    edited 2013-07-31 17:48
    Lean angle is the same whether on horizontal ground or on a slope.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-07-31 18:14
    W9GFO wrote: »
    Lean angle is the same whether on horizontal ground or on a slope.

    Maybe so, but... uh, wasn't I just agreeing with you about the dips and such? For erco's idea of using a single accelerometer, wouldn't a sudden rise look like a lean? Or am I confused?

    W9GFO wrote: »
    ...dips and rises would give false readings....
  • W9GFOW9GFO Posts: 4,010
    edited 2013-07-31 18:24
    I thought you meant slope as in a banked curve, where the angle between the ground and vehicle would be different than the lean angle.

    Dips and rises would give false readings with a single accelerometer. I don't think you are confused. [noparse]:-)[/noparse]
  • ercoerco Posts: 20,257
    edited 2013-07-31 19:19
    Actually I'm wrong for numerous reasons. The dips & rises listed, PLUS you couldn't tell left or right from a single sensor.

    Rich wins again. Confound you, W9GFO!

    BTW, I guess now that orbital Kepler's out for the count, your bot's on deck. Any progress there? :)
  • xanaduxanadu Posts: 3,347
    edited 2013-07-31 19:37
    I have two Parallax three-axis accelerometers if someone posts code I'll go test it on my Yamaha R1 :)

    Going around a corner on a bike you feel it a lot more in the lower body, in an airplane forget it.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-07-31 19:57
    In a proper turn would you even get an acceleration component that isn't normal to the seat? The whole point of leaning into the turn is to keep side forces to a minimum, right?
    xanadu wrote:
    in an airplane forget it.
    Correct. In a coordinated turn, the only force ts "down" relative to the airframe. I suspect the same is somewhat true with a motorcycle, with tire friction compensating for any residual side forces.

    -Phil
  • xanaduxanadu Posts: 3,347
    edited 2013-07-31 20:23
    I can test this all with my RC autopilot's logging abilities. I'll take it for a ride on my bike and post the graphs. I need to pull it from the model plane and put it on the bike so it might be a couple days. It's also going to be impossible to mount the sensors at the bike's CG, so hopefully that doesn't throw it too far off.
  • xanaduxanadu Posts: 3,347
    edited 2013-07-31 20:39
    In a proper turn would you even get an acceleration component that isn't normal to the seat? The whole point of leaning into the turn is to keep side forces to a minimum, right?

    ...
    -Phil

    On a bike you need to grip it with lower body to keep any pressure off the hand grips and accelerate into the corner to keep the bike's weight even on both tires or... well hopefully you have insurance lol. Since that lower body grip increases with the lean angle I'm guessing a sensor (or two like W9GFO said) may actually be able to sense the lean angle. I have a feeling the road surface grade will dictate what the sensor shows and accelerometers may only be reliable on a flat surface or need some kind of dynamic tuning where the road surface is taken into consideration.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-08-01 08:03
    W9GFO wrote: »
    No one has commented on this suggestion...

    I think it's true that two accelerometers at 90 degrees could give you useable information under static conditions. However, if we assume that the lean is essentially the result of summing the gravity (weight) force vectors with the centrifugal effect under dynamic conditions, then I think two accelerometers affixed to the motorcycle 90 degrees to each other under this sort of dynamic condition would not provide you with anymore information: instead, each accelerometer would be reading only its particular component of the vector that is normal to the driver's seat.

    As Phil pointed out, the whole purpose of leaning the motorcycle when moving is to kinda make the side-wise vectors disappear. I think the accelerometers would then have no way of detecting any other forces in their motorcycle frame of reference.

    Maybe I'm wrong about this, and I hope somebody will point out the error in my thinking, but this might be why a gyro of some kind might be useful for this app - you need a frame of reference that is outside the motorcycle because the act of leaning is making any other vectors sorta evaporate. The frame of reference in the case of the gyro would be the gyro's inertia, which is happily independent of the motorcycle.
  • W9GFOW9GFO Posts: 4,010
    edited 2013-08-01 13:02
    I think it's true that two accelerometers at 90 degrees could give you useable information under static conditions. However, if we assume that the lean is essentially the result of summing the gravity (weight) force vectors with the centrifugal effect under dynamic conditions, then I think two accelerometers affixed to the motorcycle 90 degrees to each other under this sort of dynamic condition would not provide you with anymore information: instead, each accelerometer would be reading only its particular component of the vector that is normal to the driver's seat.

    If the motorcycle were traveling at high speed, with a lean angle of 45 degrees then one accelerometer axis would be vertical, reading one gee. The other would be horizontal, reading whatever amount of acceleration was due to traveling in an arc. No matter what the vehicle is doing there will always be at least one gee present. Since it is constrained to a two dimensional surface you should be able to solve what that vector is. Good filtering would be necessary of course to remove the effects of road imperfections and dips and rises.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-08-01 13:48
    Rich, I think I see what you're getting at. On a flat track, and because the motorcycle is earthbound, there will always be one G normal to the track's surface. Any additional accelerations will be due to centripetal factors encountered during turns.

    But how to filter those out? I would contend that the net acceleration vector will always be normal to the seat when the motorcycle is in motion. Because it's a two-wheeled vehicle, the rider constantly has to correct to neutralize any side components; otherwise he will either be flung outward in a curve if he's too upright or fall inward if he banks too much.

    Also, whether the accelerometer axes are at 45/45 degrees, 0/90 degrees, or 30/60 degrees is irrelevant. Since the measurement vectors are orthogonal, it will be possible to transform the measurement from any sensor orientation to a rotational frame with the Y axis normal to the seat.

    -Phil
Sign In or Register to comment.