The online racing simulator
Bike lean
1
(35 posts, started )
Bike lean
Hi

I'm working on a driving game that will include motorbikes. We are not going down the proper simulation route (as nicely described here), rather we are just using a single rigid body simulation and creating an imaginary torque torque (or rather, using a Havok constraint to do this for us) to keep the bike at the right angle.

The question is, how to calculate what angle to lean the bike to?

Now for flat surfaces, this is easy:

LeanAngle = Atan ( 1.0 / LatAcc )

(where LatAcc is in gs and the angle is obtained in radians)

What puzzles me though, is how to take sloped surfaces into account. Now when there is no lateral acceleration, then the bike must be upright (we are not modelling rider movement so that CoG is always laterally central) irrespective of the ground angle.

Throw a corner into the mix though, and things are less obvious, as any sloped road has banked corners. I'm trying to think of an extreme situation, such as when stunt riders ride the wall of death. I'm thinking that, if the corner is helpfully banked (like an oval circuit), you will be leaning more (from a true vertical reference), but do you need to add on the 'camber' of the road, or multiply the above equation, or something else?

Can anyone shed some light on what should be happening and how to mathematically calculate the lean, given I know the vector for the normal to the surface under each tyre? Would be appreciated.

Cheers

Note: I've posted the same question over at RSC
isnt it a fairly stright forward 2d force problem?
just tilting the normal and tangental tyre forces thereby lengthening the arm the "flipping" torque acts on should automagically give the correct result
Not sure what you need, you are trying to find out the max lean angle? because obviously the lean angle changes with speed and corner radius.

There isn't a "magic" lean angle, obviously the lean comes from having to change the COG to enable the bike to "turn" the corner, and this can be as much as you want (or how much the tyres can grip).

Also, you have to take into account countersteering, because you can alter the amount of lean required for a given corner by applying various amounts of countersteer to the handlebars.
I'll need to have a think about the sloping surfaces part of the question, but I'd like to clarify something about your equation for the lean angle on a flat surface. Is the lean angle defined from the vertical or the horizontal?

Also, whether the angle comes out in radians or degrees has nothing to do with the equation you use, just which mode your calculator is in
There is some formulae here > http://en.wikipedia.org/wiki/B ... s#Center_of_mass_location

Look in the turning section.

Personally, having a far bit of on track knowledge of bike riding, I am suprised a single forumla will take all the different factors into account, because there are many other factors that can change the amount of lean required for a given corner at a given speed, like I said previously, countersteering changes it, also, the amount the rider "hangs off" can change the amount of lean required.
Shotglass - could you explain that a bit more?

Quote from danowat :There is some formulae here > http://en.wikipedia.org/wiki/B ... s#Center_of_mass_location

Look in the turning section.

The CoG height affects the moment of inertia, and thus the lean rate, but not the lean angle which would achieve balance.

Quote from danowat :like I said previously, countersteering changes it, also, the amount the rider "hangs off" can change the amount of lean required.

Of course, steering the bike alters the tyre forces, thus lateral g, thus the balanced lean angle. Rider movement, as stated, I am ingoring (but that does indeed reduce the lean angle required to balance the bike). All the time the lean of the bike is changing, the bike is unbalanced, but I'm not asking about these transient periods. I've already got a nice system for leaning the bike smoothly, I just want it to cope with cornering on bankings so that, although the physics is complete rubbish internally, the bike will at least lean convincingly.

Quote from StewartFisher :I'll need to have a think about the sloping surfaces part of the question, but I'd like to clarify something about your equation for the lean angle on a flat surface. Is the lean angle defined from the vertical or the horizontal?

I'm defining it from the vertical, but the equation I posted gives it to the horizonal, so I add or subtract half pi accordingly.
behold my craptastic paint skills

basically just an illustration fo what forces are acting on the bike at different point
if you put in all the relevant angles you should see that the formula will stay exactly the same (in relation to the world normal not the road normal)
Attached images
forces.JPG
I think you've misinterpreted the objective of the question; I'm not concerned with the forces at the tyres (they are fine), I want to know how much the bike would be leaning were this a motorbike sim (which it isn't), so I can fake the lean.
Would it be as simple as ,angle of sloping surface - required lean angle for a given speed/radius?
Quote from Bob Smith :I think you've misinterpreted the objective of the question; I'm not concerned with the forces at the tyres (they are fine), I want to know how much the bike would be leaning were this a motorbike sim (which it isn't), so I can fake the lean.

yes but the only way to work that out is to look at the relevant torques acting on the bike and how they change with road camber
and as you can tell from my picture they dont
When driving in straight line, I agree, they don't. How to explain the old wall of death trick though? The bike is pretty much horizontal in that case, which would require a lot more g than they are pulling.
well how much gs do they pull exactly? and how much do they lean?
what i do know from that trick is that they drive around a very small circle at a more or less high speed which should result in a considerably high centrifugal force acting on the cog

whichever way you look at it the bike will pivot around its contact patch and theres only 2 forces acting on the cog that always point in the same direction

the only thing the road camber should change is how much/little of the normal force on the contact patch can be used to counter the centrifugal force => how much you have to steer to not fall into the corner
Quote from Shotglass :well how much gs do they pull exactly? and how much do they lean?
what i do know from that trick is that they drive around a very small circle at a more or less high speed which should result in a considerably high centrifugal force acting on the cog

Well I've found that one wall was 32 ft in diamater, and estimating from a video, that they take about 2.2 seconds to get round that. So assuming that's a constant average speed of 31mph, they are pulling close to 3g (if I've done the maths correctly). Which would give a balanced lean angle of a little over 70 degrees (from the vertical). Looking at the video, they do appear to be leaning slightly upwards, not perfectly horizontal, so perhaps this does all tie up afterall?
To my mind, the lean angle relative to vertical doesn't change depending on the camber of the road. You'll still need to lean just as far to take a corner at 40 mph, no matter if that corner is negatively cambered or steeply banked. The only thing that changes is the available grip to the tyres, ground clearance, and consequently, the maximum possible lean angle. Hence why the wall of death works, they'd never be able to complete those circles at such speed on a flat road, obviously.
Excellent, some guy on RSC posted basically the same thing, which hopefully should be enough to keep my boss happy that changing it to be like this (rather than comparing against the road normal) was indeed the right thing to do.
To re-use this thread:

Is there are specific term for the reduction of wheelbase (or longitudinal wheel movements) that occures with suspension compression due to the rake angle on a motorcycle fork? Otherwise describing it seems a bit of a mouthful and I need a variable name.
Trial

edit : wheelbase measured at the vertical axis of the front wheel, the distance that alters when rake is changed or suspension is compressed is called trial
I suspect you're thinking of trail, which is somewhat similar but not what I'm after. TBH their might well not be a specific name for this but thought I'd pick some brains in case there is.

I'm going with "wheelbase reduction rate" for now (which, if you're interested, is just the negative tangent of rake, whereas trail is more complex).
Trail has nothing to do with suspension movement Dan, it's a measurement taken at static ride height. Yes, trail varies with suspension movement, but the figure of trail does not tell you how it will change.
this might seem like a stupid question and certainly is an unhelpful one but why do you need a name for a variation thats hardly visible to the naked eye in a game which as you described isnt even trying to simulate bikes?
Specific term for reduction in wheelbase when suspension compresses.............

Trial reduces when suspension compresses.............

Bob never asked HOW it will change, he just asked for a term to annotate this change.......

As far as I know, there isn't term for "wheelbase reduction rate", not that I know of anyway.

Quote :Trail has nothing to do with suspension movement Dan, it's a measurement taken at static ride height. Yes, trail varies with suspension movement

Not that I am being arguementative, but that statement is contridictory.....
AFAIK, trail does not vary with suspension compression.

Shotglass - because if we do not model this, there will be graphical inconsistencies. The wheel should be seen to move up the fork. Just because this is not a bike sim*, does not mean the bikes should move and handle convincingly (but in an arcade fashion). Recently I've still been working on the bike leaning to make it smoother, reduce oscillation, and more correct (previously the bike wasn't leaning quite enough).

*Also it means that, in the unlikely event we should be contracted to create a bike sim, we have code in place.
Quote from Bob Smith :AFAIK, trail does not vary with suspension compression.

depends on how you compress it
Quote from danowat :Not that I am being arguementative, but that statement is contridictory.....

I meant that the term trail does not tell you anything about suspension movement through compression or steering, even though it does vary (but not with compression as Ben says). Ben's new term is a good one, and is something not usually quoted on bike specs (not that you'd expect the nuances of suspension geometry to ever be).

Ride height changes with acceleration, but ride height has nothing to do with acceleration. Same sentence (nearly), different variables, and non contradictory.

Trail varies with suspension compression only if you take dive angle into account, which you probably would.
1

Bike lean
(35 posts, started )
FGED GREDG RDFGDR GSFDG