Hi all,
Here's a nice one that some people stumbled upon on the Racer forum,
and frankly I'm not sure what to do with it:
(see also
http://forum.racesimcentral.com/showthread.php?s=&postid=655668 )
The PDF that is talked about is a standard talk about the Magic
Formula. The problem is about the sign of camber.
Quote from the forum:
---
The camber sign is related to which side of the car the tire is. When
camber is negative the tire leans in. In fabulous ASCII art:
/ - \ (looking from the rear of the car forward to the nose)
Both tires have negative camber. However, Fy (lateral force) points in
the same direction for both tires, as it is a world axis (!). The sign
of gamma (camber) in the formula in that PDF therefore is undefined?!
The reason being that for both tires in the above diagram, you'd
expect the delta-Fy to be negative for one tire, and positive for the
other. But from the formula the camber (gamma) effect is the same for
both tires (on Fy). This clearly isn't right.
For this camber-dependeny reason, there is inclination angle, which is
the angle as viewed from the rear of the vehicle. So for the above
diagram, the left tire has a negative incl. angle, the right tire has
a positive incl. angle. This is what is used in Racer.
So the problem is: in the PDF and the Pacejka model, what is the
(world) direction of positive camber?? With just 'camber', you'd
expect different formulae for the left and right side tires of the
car! (sign changes)
In other words, is the Pacejka tire model completely broke? Not
really ofcourse, but I have no idea on what side the Pacejka model is
based.
---
Anyone?
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/
Notable threadSign conventions for camber in the Pacejka tyre model
Ruud van Gaal asked how to handle the sign of camber in the Magic Formula tyre model on left and right wheels. Todd Wasson, Stephen Clibbery and Doug Milliken advised using inclination angle relative to the car's lateral axis and flipping conicity and ply-steer terms on one side. Dave Pollatsek, a developer of Viper Racing, joked about the mess of unit and axis conventions in his team's codebase.
With Dave Pollatsek (Monster Games)
physics/realism debateRacer
Automated summary.
"Ruud van Gaal" <[email hidden]> wrote in message
news:[email hidden]...
[big snip..]
>In other words, is the Pacejka tire model completely broke? Not
>really ofcourse, but I have no idea on what side the Pacejka model is
>based.
>---
To start the discussion going... I'll say... umm... the left side?
;-)
itazura
Quoted text (8 lines)
> Hi all, > > Here's a nice one that some people stumbled upon on the Racer forum, > and frankly I'm not sure what to do with it: > > (see also > http://forum.racesimcentral.com/showthread.php?s=&postid=655668 ) >[big snip..]
To start the discussion going... I'll say... umm... the left side?
;-)
itazura
Hi Ruud,
I saw that thread :-)
To fix it up, either negative or positive inclination is going to increase
force along the positive direction of your lateral axis. Couldn't you try both
and see which it is? Imagine looking down on one tire with no car attached
instead... The "right" or spin axis vector is either pointing up or down in
the presence of camber. You could define either one (up or down) as being
negative inclination depending on how your coordinate systems work. I'd try
both and get rid of camber entirely in the physics model and just use the angle
between the spin axis vector and surface normal vector (minus 90 degrees) to
get inclination, then try both signs in Pacejka and see which works correctly.
Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com
My little car sim screenshots:
http://performancesimulations.com/scnshot4.htm
Quoted text (8 lines)
>I'd try >both and get rid of camber entirely in the physics model and just use the >angle >between the spin axis vector and surface normal vector (minus 90 degrees) to >get inclination, then try both signs in Pacejka and see which works >correctly. > >I agree entirely with Todd about just using inclination.
One other thing though, if you're using the Magic Formula with conicity and
ply-steer effects, then you may want to either remove them or flip the signs
of the appropriate coefficients on the left hand side of the car (the
equivalent of matching the tyres on each side of the car), otherwise you
will have an imbalance and it'll be easier to turn left than right or
whatever. Unless you want that to happen, since tyres on real cars are
unlikely to be exactly balanced. Although in that case, you should probably
apply random coefficients from within a pre-set range to each tyre at
load-time rather than just use the same ones all round. Anyway, I'll shut up
now. :)
Cheers,
Steve.
J. Todd Wasson <[email hidden]> wrote in message
news:[email hidden]...
> >I'd try
> >both and get rid of camber entirely in the physics model and just use the
> >angle
> >between the spin axis vector and surface normal vector (minus 90 degrees)to
want to
> display camber on screen, it's easiest (for me anyway) to just make that atext
> operation where you reverse the signs for one side of the car. You'realready
> doing that though, I'm sure :-)
>
> As far as the other part goes, what I meant was if your positive lateral
> direction is to the right, then find out which sign when fed into theMagic
Quoted text (7 lines)
> >get inclination, then try both signs in Pacejka and see which works > >correctly. > > > > > > > Whoops, one more thing. After you've got that worked out and you stillQuoted text (19 lines)
> model will result in increased force to the right (most likely negative > inclination). If your positive axis goes left instead, swap signs and you > should be fine I think. > > > > > > > Todd Wasson > --- > Performance Simulations > Drag Racing and Top Speed Prediction > Software > http://PerformanceSimulations.Com > > My little car sim screenshots: > http://performancesimulations.com/scnshot4.htm >Ruud van Gaal wrote:
You can just do what we did: (IIRC)
Use the angle as inclination but mistakenly call it camber.
Then write a lot of lines of comments to that effect rather than
just changing the variable and accessors everywhere.
I think something like this is most traditional ;)
- Matt
Quoted text (8 lines)
> The camber sign is related to which side of the car the tire is. When > camber is negative the tire leans in. In fabulous ASCII art: > > / - \ (looking from the rear of the car forward to the nose) > > Both tires have negative camber. However, Fy (lateral force) points in > the same direction for both tires, as it is a world axis (!). The sign > of gamma (camber) in the formula in that PDF therefore is undefined?!>You can just do what we did: (IIRC)
>Use the angle as inclination but mistakenly call it camber.
>Then write a lot of lines of comments to that effect rather than
>just changing the variable and accessors everywhere.
>
>I think something like this is most traditional ;)
LOL ! I didn't guys like you were prone to this sort of thing too , Matt! :-D
Thanks for the chuckle. You wouldn't even believe the blunder I'm trying to
fix now :-P
Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com
My little car sim screenshots:
http://performancesimulations.com/scnshot4.htm
Sounds like you are not using SAE axis system (no reason why
you should be)... RCVD pages 62-63.
We actually went through and called it inclination angle everywhere
that we use it (at least in all our docs, not sure about comments
all through the code).
On Fri, 14 Feb 2003, Ruud van Gaal wrote:
Quoted text (50 lines)
> Hi all, > > Here's a nice one that some people stumbled upon on the Racer forum, > and frankly I'm not sure what to do with it: > > (see also > http://forum.racesimcentral.com/showthread.php?s=&postid=655668 ) > > The PDF that is talked about is a standard talk about the Magic > Formula. The problem is about the sign of camber. > > Quote from the forum: > --- > The camber sign is related to which side of the car the tire is. When > camber is negative the tire leans in. In fabulous ASCII art: > > / - \ (looking from the rear of the car forward to the nose) > > Both tires have negative camber. However, Fy (lateral force) points in > the same direction for both tires, as it is a world axis (!). The sign > of gamma (camber) in the formula in that PDF therefore is undefined?! > > The reason being that for both tires in the above diagram, you'd > expect the delta-Fy to be negative for one tire, and positive for the > other. But from the formula the camber (gamma) effect is the same for > both tires (on Fy). This clearly isn't right. > > For this camber-dependeny reason, there is inclination angle, which is > the angle as viewed from the rear of the vehicle. So for the above > diagram, the left tire has a negative incl. angle, the right tire has > a positive incl. angle. This is what is used in Racer. > > So the problem is: in the PDF and the Pacejka model, what is the > (world) direction of positive camber?? With just 'camber', you'd > expect different formulae for the left and right side tires of the > car! (sign changes) > > In other words, is the Pacejka tire model completely broke? Not > really ofcourse, but I have no idea on what side the Pacejka model is > based. > --- > > Anyone? > > > Ruud van Gaal > Free car sim: http://www.racer.nl/ > Pencil art : http://www.marketgraph.nl/gallery/ > >Matt Jessick wrote:
This was a bit facetious. But you should be able to
imagine the chaos if anyone else ever has to work on
your code and you have neglected to define for each variable:
The coordinate system (including positive direction)
The units
Concise purpose
And if you choose a non-standard coordinate system you
need even more comments. Starboard is the same direction
on every ship for a reason :)
I'm working on someone elses code now where whole
classes are mysterious. This thing isn't working
because the "pool" member variable is empty. The purpose
of this pool object could have been written in a sentence
in 5 seconds and I would have then immediately known that
not having one was a serious problem. Instead I spent
at lest an hour figuring out what it was, what object
was supposed to have created it and why it failed.
I believe people sometimes think that those type of comments
aren't needed if they are the only person that will ever
be looking at this code. Until 6 months later and they
can't remember what the class is for either! :)
- Matt
Quoted text (18 lines)
> Ruud van Gaal wrote: > >> The camber sign is related to which side of the car the tire is. When >> camber is negative the tire leans in. In fabulous ASCII art: >> >> / - \ (looking from the rear of the car forward to the nose) >> >> Both tires have negative camber. However, Fy (lateral force) points in >> the same direction for both tires, as it is a world axis (!). The sign >> of gamma (camber) in the formula in that PDF therefore is undefined?! > > > You can just do what we did: (IIRC) > Use the angle as inclination but mistakenly call it camber. > Then write a lot of lines of comments to that effect rather than > just changing the variable and accessors everywhere. > > I think something like this is most traditional ;)<pedantic>
Getting sign, unit, or axis conventions wrong is a very common problem
(I know I'm always getting bitten by it), especially because each paper
seems to use a different set of conventions (and they don't always
specify them exactly), but it's generally a bad idea to just flip the
sign of different things in your program until you get the expected
result, instead of actually being rigorous and tracking down exactly
what sign convention each equation uses and making sure they're all
correct in the code before you run it...
when doing "random sign flipping", you can often get something where two
things are backwards, but (at least mostly) cancel each other out, but
then when you make some other change, things will be off in some way...
Not that I always follow my own advice, but at least I feel guilty when
I do... ;) and try to remember to go through the code again to
double-check. (It's very easy to get impatient when you have a model
that is very close to working and you're just itching to be able to
drive it around and do donuts and stuff instead of squinting at rows of
numbers...)
</pedantic>
-Dave P.
MGI
PS. Hey Doug, I think RCVD could use another chapter on tire
behavior--it would be great to have one overview reference that went
over more tire modelling stuff, hopefully all using the same notation
conventions... ;-)
[snip]
Quoted text (7 lines)
> > >I'd try > > >both and get rid of camber entirely in the physics model and just use the > > >angle > > >between the spin axis vector and surface normal vector (minus 90 degrees) > to > > >get inclination, then try both signs in Pacejka and see which works > > >correctly.Quoted text (9 lines)
><pedantic> >Getting sign, unit, or axis conventions wrong is a very common problem >(I know I'm always getting bitten by it), especially because each paper >seems to use a different set of conventions (and they don't always >specify them exactly), but it's generally a bad idea to just flip the >sign of different things in your program until you get the expected >result, instead of actually being rigorous and tracking down exactly >what sign convention each equation uses and making sure they're all >correct in the code before you run it...On 24 Feb 2003 23:07:41 GMT, [email hidden] (J. Todd Wasson) wrote:
If the game is still in its infancy, and the programmer is not too
religious; you can switch DirectX into a righthanded system (making it
the same as OpenGL).
> I have
>had at least a couple of funny - signs scattered about to get things working
>right on all systems at the same time :-D
If nobody had invented the minus sign, we'd sure be up a smelly brown
creek yes. ;-)
Dave is right though; 'debug' minus signs have a high probability of
coming back and haunting you on the search for very deeply hidden
bugs.
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/
Quoted text (16 lines)
>><pedantic> >>Getting sign, unit, or axis conventions wrong is a very common problem >>(I know I'm always getting bitten by it), especially because each paper >>seems to use a different set of conventions (and they don't always >>specify them exactly), but it's generally a bad idea to just flip the >>sign of different things in your program until you get the expected >>result, instead of actually being rigorous and tracking down exactly >>what sign convention each equation uses and making sure they're all >>correct in the code before you run it... > ><snip> > >I'm somewhat familiar with this occurance :-D > >My vehicle model runs in one axis system, my graphics testbed (OpenGL) runs in >another, and a game this is going into runs in still another (DirectX).Quoted text (8 lines)
>>My vehicle model runs in one axis system, my graphics testbed (OpenGL) runs >in >>another, and a game this is going into runs in still another (DirectX). > >If the game is still in its infancy, and the programmer is not too >religious; you can switch DirectX into a righthanded system (making it >the same as OpenGL). >Quoted text (12 lines)
>> I have >>had at least a couple of funny - signs scattered about to get things working >>right on all systems at the same time :-D > >If nobody had invented the minus sign, we'd sure be up a smelly brown >creek yes. ;-) > >Dave is right though; 'debug' minus signs have a high probability of >coming back and haunting you on the search for very deeply hidden >bugs. > >Right now the number of sign/axis/unit conventions in our codebase is pretty
rediculous...
Models in 3DSMAX are done in inches, and with the cars tipped on their ends
for some reason, so I think +z is forward and +x is left. The 3DS exporter
for the pitcrew used meters, though. Tracks in Multigen are in meters, and
Y is up. Our game's graphics system uses meters, with +x = left, +y = up.
Our internal matrix routines use left-handed notation: x' = x M and
left-handed cross products, but my new physics stuff uses my pseudo-C to VU
compiler using the more standard linear algebra notation. Our physical
constants are stored in mostly english/SAE units (horsepower,
pounds-per-inch, etc.), and converted to metric at load time for internal
computations, which are all in SI units. The various platform-specific
graphics backends use different axis conventions as well, especially on
PC/Xbox/GameCube which actually force you to call into someone else's code
to put something on the screen... ;)
Although it's not really that bad, because usually the parts that use
different conventions are pretty independent... but I do remember the one
time we had 20,000 lb AI cars briefly (someone thought the mass was in
Newtons or something), that were just sort of bobbing up and down at the
start finish line (the suspension system automatically calculated the
preload to get the desired ride height, so they had normal spring-rates but
with huge preload). Strangely enough, they had a hard time getting going...
"J. Todd Wasson" <[email hidden]> wrote in message
news:[email hidden]...
> >>My vehicle model runs in one axis system, my graphics testbed (OpenGL)runs
fine
> now.
>
>
> >> I have
> >>had at least a couple of funny - signs scattered about to get thingsworking
Quoted text (9 lines)
> >in > >>another, and a game this is going into runs in still another (DirectX). > > > >If the game is still in its infancy, and the programmer is not too > >religious; you can switch DirectX into a righthanded system (making it > >the same as OpenGL). > > > > Ah well, that's his problem ;-) In all seriousness, it's all sorted outQuoted text (26 lines)
> >>right on all systems at the same time :-D > > > >If nobody had invented the minus sign, we'd sure be up a smelly brown > >creek yes. ;-) > > > >Dave is right though; 'debug' minus signs have a high probability of > >coming back and haunting you on the search for very deeply hidden > >bugs. > > > > > > Yep :-) > > > > > Todd Wasson > --- > Performance Simulations > Drag Racing and Top Speed Prediction > Software > http://PerformanceSimulations.Com > > My little car sim screenshots: > http://performancesimulations.com/scnshot4.htm >On Sun, 02 Mar 2003 00:43:19 GMT, "Dave Pollatsek"
<[email hidden]> wrote:
...
Enough perhaps at times to get you in a straightjacket if you don't go
out once in a while. ;-)
>pounds-per-inch, etc.), and converted to metric at load time for internal
>computations, which are all in SI units.
So I guess you do all your debugging output in SI units?
>but I do remember the one
>time we had 20,000 lb AI cars briefly (someone thought the mass was in
>Newtons or something), that were just sort of bobbing up and down at the
>start finish line
Well, you can call that a 'feature', I'd say. :) Call it 'Old American
Cars Heat' and you're set...
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/
Quoted text (7 lines)
>Models in 3DSMAX are done in inches, and with the cars tipped on their ends >for some reason, so I think +z is forward and +x is left. The 3DS exporter >for the pitcrew used meters, though. Tracks in Multigen are in meters, and >Y is up. Our game's graphics system uses meters, with +x = left, +y = up. >Our internal matrix routines use left-handed notation: x' = x M and >left-handed cross products, but my new physics stuff uses my pseudo-C to VU >compiler using the more standard linear algebra notation.heh heh, actually I often convert back to english units for debugging
outputs--those damned English colonialists condemned us Americans to a
screwed up measuring system--perhaps if Napoleon had taken over America for
a few years, converted us to metric, and then left... ;)
For some reason I can think in meters and meters/second^x, but I have a real
hard time visualizing things like spring constants and torque in SI units...
maybe my little brain can only hold one "unit" constant at a time, so
converting from meters to feet or km to miles requires only one mental
multiply or divide, while converting N/m to lbs/in requires two...
"Ruud van Gaal" <[email hidden]> wrote in message
news:[email hidden]...
> On Sun, 02 Mar 2003 00:43:19 GMT, "Dave Pollatsek"
> <[email hidden]> wrote:
>
> >Models in 3DSMAX are done in inches, and with the cars tipped on theirends
> >for some reason, so I think +z is forward and +x is left. The 3DSexporter
> >for the pitcrew used meters, though. Tracks in Multigen are in meters,and
> >Y is up. Our game's graphics system uses meters, with +x = left, +y =up.
> >Our internal matrix routines use left-handed notation: x' = x M and
> >left-handed cross products, but my new physics stuff uses my pseudo-C toVU
Quoted text (23 lines)
> >compiler using the more standard linear algebra notation. > ... > > Enough perhaps at times to get you in a straightjacket if you don't go > out once in a while. ;-) > > >pounds-per-inch, etc.), and converted to metric at load time for internal > >computations, which are all in SI units. > > So I guess you do all your debugging output in SI units? > > >but I do remember the one > >time we had 20,000 lb AI cars briefly (someone thought the mass was in > >Newtons or something), that were just sort of bobbing up and down at the > >start finish line > > Well, you can call that a 'feature', I'd say. :) Call it 'Old American > Cars Heat' and you're set... > > > Ruud van Gaal > Free car sim: http://www.racer.nl/ > Pencil art : http://www.marketgraph.nl/gallery/On Mon, 03 Mar 2003 06:21:46 GMT, "Dave Pollatsek"
<[email hidden]> wrote:
>heh heh, actually I often convert back to english units for debugging
>outputs--those damned English colonialists condemned us Americans to a
>screwed up measuring system--perhaps if Napoleon had taken over America for
>a few years, converted us to metric, and then left... ;)
Yep, that would save quite a couple of funny constants (5151?) that
could be used for other more fun stuff, like remembering the year that
Napoleon had left. ;-)
Besides, combinations like 'slug' and 'Ferrari' don't really seem to
have the same feel about them. It just doesn't sound high-tech
anymore. ;-) Hail SI.
>For some reason I can think in meters and meters/second^x, but I have a real
>hard time visualizing things like spring constants and torque in SI units...
>maybe my little brain can only hold one "unit" constant at a time, so
>converting from meters to feet or km to miles requires only one mental
>multiply or divide, while converting N/m to lbs/in requires two...
That's ok I guess; I have a hard time visualizing what N/m does
anyway, lol. Although I do think the 5N/m of steering torque I felt
was actually that, 5N/m. It felt like 10N/m was enough to rip your
hand off. That does give you a clue. :)
It's just at one time you can draw a meter length line on the floor,
and be off by only a couple of centimeters. That helps visualizing
things indeed.
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/
Dave Pollatsek <[email hidden]> wrote in message
news:_vC8a.47116$[email hidden]...
> heh heh, actually I often convert back to english units for debugging
> outputs--those damned English colonialists condemned us Americans to a
> screwed up measuring system--perhaps if Napoleon had taken over Americafor
> a few years, converted us to metric, and then left... ;)
>
Ironically, us english have pretty much gone metric now, it's just you lot
over the pond who stick with those bizarre old units...
I mean, really, Slugs and Stones and Feet... It sounds like some kind of
weird torture device... ;)
hey man, you guys are the ones who use "stones" in common parlance for
measuring human weight... I think slugs are only used over here by
engineers, and cubits are *so* last millenium... ;)
I remember we thought we were so "l33t" when we made Viper Racing ask
Windows if we should display metric or english units (along with numeric
seperator, date format, etc), and have all the in-game displays convert
automatically. Then an English user complained that the speeds were shown
in KPH on his machine. (At the time, at least, Windows didn't have any
setting for "screwed up country that can't decide if they're metric or
english" and just returned "metric" for UK)
oops.
Oh, and just to stay vaguely on topic, I just got a copy of Pacejka's new
book, "Tire and Vehicle Dynamics" (I think at most an hour elapsed between
when I got the postcard from SAE announcing it and when I ordered it from
their website!). Looks promising so far, and it's nice to read an actual
book instead of another .PDF file for a change...
"Stephen Clibbery" <[email hidden]> wrote:
> Ironically, us english have pretty much gone metric now, it's just youlot
> over the pond who stick with those bizarre old units...
> I mean, really, Slugs and Stones and Feet... It sounds like some kind of
> weird torture device... ;)
On Wed, 05 Mar 2003 01:41:31 GMT, "Dave Pollatsek"
<[email hidden]> wrote:
Ouch, just like I saw a language (it wasn't VB was it?) that started
to convert it source code; so instead of 'IF A=5 THEN' you got (in
Dutch) 'ALS A=5 DAN'. Yeah, that's really handy! Even worse, the , and
. notation got confusing when a script was used on another machine, as
writing 5.3 would be recognized by one machine, and not the other (if
languages differ).
>Oh, and just to stay vaguely on topic, I just got a copy of Pacejka's new
>book, "Tire and Vehicle Dynamics" (I think at most an hour elapsed between
>when I got the postcard from SAE announcing it and when I ordered it from
>their website!).
It's quite hardcore, it starts out immediately with raw stuff; might
be interesting indeed. A nice note about the book; it should have come
out a bit sooner than this, but in fact the first (unreleased) edition
came out with the title 'Tyre Dynamics and Vehicle Mechanics' (I've
seen a copy), which wasn't quite what is was supposed to be. :) So it
got delayed a bit.
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/
Quoted text (7 lines)
>I remember we thought we were so "l33t" when we made Viper Racing ask >Windows if we should display metric or english units (along with numeric >seperator, date format, etc), and have all the in-game displays convert >automatically. Then an English user complained that the speeds were shown >in KPH on his machine. (At the time, at least, Windows didn't have any >setting for "screwed up country that can't decide if they're metric or >english" and just returned "metric" for UK)> automatically. Then an English user complained that the speeds were shown
> in KPH on his machine. (At the time, at least, Windows didn't have any
> setting for "screwed up country that can't decide if they're metric or
> english" and just returned "metric" for UK)
D'oh! That's actually a very fair point... :)
I've just been writing a unit converter for my sim which reads string
descriptions of units, converts them to SI for use in the engine, and also
checks that they are dimensionally appropriate for the quantity being set.
May be overkill really, but it's quite nice to be able to specify (for
example) tyre pressures in psi or kPa or atmospheres or whatever in files
and editors.
> Oh, and just to stay vaguely on topic, I just got a copy of Pacejka's new
> book, "Tire and Vehicle Dynamics" (I think at most an hour elapsed between
I've got that too; I'm only on chapter 3 or so, but it's already
considerably deepened my understanding of tyre modelling, and given me quite
a few ideas for the future. Good stuff!


































