rec.autos.simulators

Car physics; suspension natural frequency

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Tue, 06 Nov 2001 23:56:39





>> Hm, perhaps even the value of PI changes according to where you are on
>> Earth to follow gravity. ;-)

>Hmmm.... in that case, I wonder what would be the value of
>American Pie--- I mean, Pi? :-)

Well, probably, eh, 2 slugs?
'That'll be 2 slugs of Pi, ma'am'. :)

...

Let's just say God probably used Mathematica alpha v0.1 when he
created the laws of physics. ;-)

Ehm, I think I should yes. I had one, but it was a bit whacky, as the
'epsilon' from your formulae got bigger than 1, and the whole thing
was NaN. Ofcourse, that may be physically understandable, as there is
no frequency then. Hm.

Alien!! :)

Ruud van Gaal
Free car sim  : http://www.racesimcentral.net/
Pencil art    : http://www.racesimcentral.net/

Petri Blomqvis

Car physics; suspension natural frequency

by Petri Blomqvis » Wed, 07 Nov 2001 03:49:56



That would be *cherry Pi*, and some *damn good coffee*! :-)

Does that mean Mathematica v1.0 was carved on stone tablets? :-)

Well, there's really no oscillation in an overdamped system, so it can't
really have a frequency, now can it? :-)

I resemble that remark! In the sense that I'm a Finn like Greger Huttu, that
is. :-) My lap times in GPL are lousy, though. I bought the game a few
months ago but I haven't had much time to practice yet, and the few practice
sessions I've tried have been on Monza, where my best lap is a measly
1:31.77, in an Eagle. I just discovered GPL Lap Analyzer, maybe that'll
help. I guess adjusting the default setups would be a good idea too. :-)

Petri

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Thu, 08 Nov 2001 01:18:38





>> Let's just say God probably used Mathematica alpha v0.1 when he
>> created the laws of physics. ;-)

>Does that mean Mathematica v1.0 was carved on stone tablets? :-)

Hm. :) It hasn't been digged out yet though, but it's there... Created
by Martians btw and left for us to find.

Uhm yes. Still a shame that it doesn't give 0. :)

That's quite a good lap, in an Eagle. Well, considering the couple of
months. About the Alien mark, one thing I've learned in time about
software is that software from Finnish people always tend to be faster
than you could figure the CPU was worth. Really great stuff always
leaves that country. Must be that it's too cold or the numerous lakes
keep you from getting anywhere that so many programmers spend so much
time behind the computers optimizing things. ;-)

Right, the analyzer will enable you to compare a Huttu lap to yours.
Or well, I started with the default replays, and it turned out that
most of the time I was just losing real time in 1 or 2 of the corners.
So you then know where to focus.
God I need that for Racer. Oh wait, I'm *this* close to ghost laps
already. :)

Ruud van Gaal
Free car sim  : http://www.marketgraph.nl/gallery/racer/
Pencil art    : http://www.marketgraph.nl/gallery/

Petri Blomqvis

Car physics; suspension natural frequency

by Petri Blomqvis » Thu, 08 Nov 2001 04:51:02



Thought I'd give the Lotus another try today, and I managed a 1:31.25. Five
more seconds to shave off I guess... yikes!

Nah, it's just alien super-intelligence. :-) But seriously, I think it may
have something to do with the fact that the demoscene has always been really
big here, and when those demo coders go on to bigger and better things they
bring with them their performance-oriented mindset and skills. :-)

Great! I really like Racer, although it seems there's still something a bit
weird about your tire model... seems to lose grip almost completely when
going sideways. And I'm getting divide by zero exceptions pretty regularly.
But once you've sorted those out, it's going to be a great sim! I'm losing
motivation to continue working on my own sim... :-(

Petri

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Thu, 08 Nov 2001 20:54:09





>> >1:31.77, in an Eagle.

>> That's quite a good lap, in an Eagle. Well, considering the couple of
>> months.

>Thought I'd give the Lotus another try today, and I managed a 1:31.25. Five
>more seconds to shave off I guess... yikes!

Hehe, well, my best time in a Lotus on Monza is still somewhere in the
midst 1:29's. Never improved on that. :(
The thing about the hotlap setups is that the diffs are set up so
coming off the throttle makes the car steer. Not too easy to drive
without good reflexes.

Indeed, people that still look at assembly output differences between
i++ and ++i. :)
I guess it's a good attitude (obviously history has proven that), as
long as you have the skills to look at a project from a bird's eye
view as well.

Right, there were some timing tests done to compare a GPL Ferrari with
the 312 I have for Racer (v0.4.9alpha2 also has antirollbars, so now
mostly what is missing is the Salisbury diff which is pretty much
clear to me right now). Slipping sideways kept the car sliding 2x as
long as the GPL counterpart, while acceleration and braking
performance wasn't nearly as off.
Perhaps just a Pacejka slipangle peak, as a slipangle of 90 degrees
makes the tire look like a locked tire, and in RCVD it is said that a
locked braking tire still manages to get about 75% of peak performance
out. Either this doesn't happen (but may be fixed with the Pacejka
editor) or some oscillation is happening so the weight transfers
jitter, giving an average of outer wheel weight that is about half of
what the steady state would say.

That's probably v0.4.8 and the original FMOD.dll. That had a bug.
Either get one of the v0.4.9 alphas from the download page (there's a
little 'beta' link :)), or download the new FMODAPI.zip directly from
www.fmod.org and extract the FMOD.dll into the Racer directory.

There will always be goals probably that you will achieve with your
*own* sim that you can't do with mine. I'm looking up against programs
like GT3, N4, GPL to see where I lack and where I could surpass them,
hehe. One of the great things with your own sim is just making it, and
lots and lots of new things to be learned. I'm currently doing a
semi-2D AABBTree to use for collisions with my track. Quite a nice
diversion.

But really, there's stuff I want to try in the future where commercial
sims stop because it isn't commercialy viable for the masses. Like
taking a live Nascar race, getting the GPS data for the cars and
driving along. ;-)
And getting positional data at kart tracks, storing them and putting
them up for download or getting them on disk so you could replay them
back in a Kart Racer replayer and see why the fastest lap was the
fastest lap. Still, it may be costly, but Orad has the technology for
that (used in tennis and soccer for example) and it would be so cool.
:)

Anyway, creating your own sim enables you to do things totally your
way. That's always a personal thing.

Ruud van Gaal
Free car sim  : http://www.marketgraph.nl/gallery/racer/
Pencil art    : http://www.marketgraph.nl/gallery/

Petri Blomqvis

Car physics; suspension natural frequency

by Petri Blomqvis » Fri, 09 Nov 2001 06:04:53



I think I'm going to have a hard time even reaching that! Maybe moving
straight from the Need For Speed series to GPL was a bit ambitious a leap
for me... :-)

Of course, compilers and processor architectures have come a long way in
past years, so probably the importance of assembly-level optimizations isn't
quite as high as it used to be. But I'm sure the demo coders are very good
at coding efficient algorithms as well.

It's too bad one usually can't detect problems like this simply by going
through the code. Life would be so much easier. :-) Somehow I've managed to
avoid that problem in my own tire code, though. I'm probably not doing
things much differently from your code (I use the Pacejka model for
longitudinal and lateral forces separately (with relaxation length taken
into account in both directions) and combine them using Gregor Veble's
approach. I don't even use any low-speed special-case code - I only switch
to using regular static/dynamic friction with a sort of spring
representation of the tire when the tire is completely locked.

One thing I probably am doing differently, is that I limit the magnitude of
rotational acceleration the ground can cause on the tire based on whether
the tire force would overaccelerate the tire, which it obviously can do with
any time step larger than zero.

So, I first predict what the speed difference between tire and ground would
be one timestep later if the full tire force were applied to the wheel. If
it would increase the speed difference, I simply set the angular velocity of
the wheel so the speed difference is zero, otherwise I calculate the
acceleration normally. (Actually, it's a bit more complex than that, you
have to think about the order in which you apply and test ground reaction
torques, brake torques and drivetrain torques, but that's the general idea.)

This method works like a charm! I also use it for the brakes and clutch, and
at some point I'll try to implement a dry friction limited-slip differential
with the same method (only got viscous ones working right now).

Great, thanks!

True. :-) My sim simply uses (for the moment) a triangular mesh for the
terrain, which I put into a quadtree, so the terrain can just as well be a
square patch of mountainous terrain as a long, straight strip of asphalt.
Obviously I'm going to have to implement spline patches at some point. Maybe
the whole terrain could be composed of Bezier patches, or just the road.

One thing I also tried was adding trailers. :-) Worked fine in low speeds
(it was great fun to watch a house trailer desperately trying to follow a
souped-up Camaro!) but because I used a simple spring connection, the
oscillations prevented the combo from accelerating beyond a certain speed
limit which depended on the stiffness of the spring. :-) Time to study
constrained dynamics, apparently.

Well that's a brilliant idea if I ever heard one! Too bad there's no GPS
data from the 60's F1 races... :-)

Cool is an understatement!

True, and like you said, the learning process is valuable in itself.

Petri Blomqvist

Doug Millike

Car physics; suspension natural frequency

by Doug Millike » Fri, 09 Nov 2001 09:58:12




> > Let's just say God probably used Mathematica alpha v0.1 when he
> > created the laws of physics. ;-)

> Does that mean Mathematica v1.0 was carved on stone tablets? :-)

Hey, Steve Wolfram is a nice guy, don't be dissin' him, man!

Did you know that he wrote the 1st version of Mathematica as a fast hack,
so that he would have a nice tool to solve his physics problems?  Yes, he
is _that_ bright (and a MacArther Genius grant winner to boot).

Asbj?rn Bj?rnst

Car physics; suspension natural frequency

by Asbj?rn Bj?rnst » Fri, 09 Nov 2001 11:54:05


> Hey, Steve Wolfram is a nice guy, don't be dissin' him, man!

> Did you know that he wrote the 1st version of Mathematica as a fast hack,
> so that he would have a nice tool to solve his physics problems?  Yes, he
> is _that_ bright (and a MacArther Genius grant winner to boot).

Not arguing that he isn't bright or anything, but isn't that how most
software start? Someone needs a tool and quicky trows something
together, starts refining it and eventually realizes that other people
want this as well. Of course, what it eventually ends up as depends on
how good the tool/idea is and how many people "need" it.

Not counting "I want to make a {game, browser,
whateverthemonthsflavoris} and make a lot of cash" projects.

Why do we have perl, email, spreadsheets, Linux?
--
  -Sandman

p..

Car physics; suspension natural frequency

by p.. » Fri, 09 Nov 2001 17:10:28





> > > Let's just say God probably used Mathematica alpha v0.1 when he
> > > created the laws of physics. ;-)

> > Does that mean Mathematica v1.0 was carved on stone tablets? :-)

> Hey, Steve Wolfram is a nice guy, don't be dissin' him, man!

Absolutely no dissin' was intended by me (or Ruud, I'm sure)! Just some
well-meaning not-so-witty reparte. ;-)

I admit to having been totally ignorant of the man's accomplishments until
taking a look at his website a moment ago. But it makes sense that he'd be
as bright as a white-hot wolfram filament. Hahaha..ha..ha.. ahem.

Petri Blomqvist

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Fri, 09 Nov 2001 20:23:17






>> > > Let's just say God probably used Mathematica alpha v0.1 when he
>> > > created the laws of physics. ;-)

>> > Does that mean Mathematica v1.0 was carved on stone tablets? :-)

>> Hey, Steve Wolfram is a nice guy, don't be dissin' him, man!

>Absolutely no dissin' was intended by me (or Ruud, I'm sure)! Just some
>well-meaning not-so-witty reparte. ;-)

Same here ofcourse. :)

LOL!

Ruud van Gaal
Free car sim  : http://www.marketgraph.nl/gallery/racer/
Pencil art    : http://www.marketgraph.nl/gallery/

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Fri, 09 Nov 2001 22:24:51



Hehe, well, after a couple of laps in Racer, I find GPL much easier to
drive. :)

Yes, what's missing from all these profilers is variable telemetry.
Just letting things run, but storing variables based on time or
iteration count, and after a run, viewing the variables in a graph.
This would be useful not only for carsims I think. Copyright/trademark
etc Ruud van Gaal. ;-)
I have a hunch my tires are oscillating vertically (thus giving a
worse average grip), and this could be looked at more nicely with a
sort of graph utility and some generalized way of storing of a
variable's value.

Do you get the (dynamic) friction coefficient directly from the D in
Pacejka?

Wouldn't that mean that you can't slip the tire? I mean, if both tire
spin and road speed are held at the same speed, surely there's no
slipping (and no slip ratio?!).

Good to hear! :)
So it's a predictor-corrector method. Still don't see how a big skid
would be done that way though.

The formulae I use from Gregor Veble include a generic locking moment.
It is just (delta_rotational_velocity*viscous_factor) for viscous
diffs, but for other LSD's I think it should work (like for a
Salisbury, it is something like (road_reaction_torque_difference)
between the 2 diff outputs (to the wheels), capped based on the max
ratio the diff can handle, and some preload checks added. Not that
it's working here (and I haven't tried yet).

Right. I don't use quadtrees but am building an AABBTree
implementation. It's creating trees, except for doublesided triangles
which don't want to be split (as they have the same vertices), and
then I'll have to add info so I can check the car's bounding box with
the tree. It may generate tighter fits (smaller trees) than with
quadtrees, but the main reason I'm using it is for object-object
collision detection. If I use the AABBtree (quite a simple concept,
see 'AABBTrees Collision Detection for Deformable Models' by Gino van
den Bergen) for the car as well, I could do quick track-car detection
and be triangle accurate. Very important to get rough crashes to look
ok! ;-)

I'd do just the road. Outside that, the triangles should be rough
anyway. I don't use Bezier patches, just a 3D Hermite spline (well,
multiple segments) running through the road vertices. Some info on
that is on my site.

Cool!

Ouch, big matrices and all that, or LCP solving, yikes.

Yes, indeed. :) But for Nascar it would work, as Fox already has a
line of SGI O2's and a bigger SGI (Onyx2 or something) that renders
info on the cars live. Nice, but just a technical gadget. Driving
along would be a much nicer application (live ofcourse, with just a
delay because of some servers inbetween). :)

Ruud van Gaal
Free car sim  : http://www.marketgraph.nl/gallery/racer/
Pencil art    : http://www.marketgraph.nl/gallery/

Petri Blomqvis

Car physics; suspension natural frequency

by Petri Blomqvis » Sat, 10 Nov 2001 05:24:06

"Ruud van Gaal" <r...@marketgraph.nl> wrote in message
news:3bea83b0.1374424658@news.xs4all.nl...

> Hehe, well, after a couple of laps in Racer, I find GPL much easier to
> drive. :)

:-)

> >It's too bad one usually can't detect problems like this simply by going
> >through the code. Life would be so much easier. :-)

> Yes, what's missing from all these profilers is variable telemetry.
> Just letting things run, but storing variables based on time or
> iteration count, and after a run, viewing the variables in a graph.
> This would be useful not only for carsims I think. Copyright/trademark
> etc Ruud van Gaal. ;-)

Of course, you can always do that yourself while waiting for compilers to
gain this important feature. :-) I actually did that for my own sim. I just
output the variable I want to graph, into a text file. Very crude, but I can
view it with my own little (equally crude) graph viewer app. :-)

> I have a hunch my tires are oscillating vertically (thus giving a
> worse average grip), and this could be looked at more nicely with a
> sort of graph utility and some generalized way of storing of a
> variable's value.

I don't really see how you could have unwanted oscillations in the
suspension even using the tire rate, unless you're using really low damper
values or a really big time step. I run my physics code at 500 Hz, and I'm
not experiencing any oscillations, even if I lower it to something like 200
Hz. One thing that improves stability greatly is including the second
derivative in integrating the new suspension jounce distance (or any rigid
body position, for that matter):

dx/dt = v + 0.5*a*dt,

where 'v' is jounce velocity and 'a' is the acceleration which is assumed to
be constant over the time step. It's certainly better than a plain Euler
integrator. I actually used a 4th order Runge-Kutta integrator originally,
but I went back to a Euler integrator because I had coded some things in a
way that doesn't really work with an integrator that needs to step back and
forth. Actually, my sim, as it is, is coded VERY badly. I just began to
build it around one of NeHe's OpenGL tutorials, and some things like camera
angles, sound fx, etc. are still in the main() function. :-) I've thought
about just rewriting the whole thing using some free game engine, but I
guess I should just bite the bullet and try to create a simple engine
myself. I have all the building blocks, obviously, but combining them into
efficient and easy-to use classes and interfaces, and writing manager
classes for meshes, sound fx etc. is even more difficult to me than coding
the physics! But I digress. :-)

Anyway, any oscillation that would affect the tire load force to any
significant degree would certainly be visible, and looking at the wheels in
Racer, they look very stable. Are you sure it's not just a problem with
calculating the lateral tire force?

> >I don't even use any low-speed special-case code - I only switch
> >to using regular static/dynamic friction with a sort of spring
> >representation of the tire when the tire is completely locked.

> Do you get the (dynamic) friction coefficient directly from the D in
> Pacejka?

No, I calculate the dynamic friction coefficient based on the slip ratio of
a locked tire (-1, obviously). Although actually, at the moment I'm
experimenting with a simplified tire model  instead of Pacejka. Since all
those Pacejka coefficients are next to impossible to come by (except for
that "Ferrari tire" that almost everyone seems to use) and I'm not taking
camber or conicity or any of those other things into account yet, I figured
there's not much point calculating the force in such a complicated manner.
Instead, I parameterize my tire with the peak slip ratio and the friction
coefficient at that ratio, and the friction coefficient at a slip ratio of
one. Then I simply bridge the gaps with sine functions. :-) The only real
problem I can see with this model is that cornering stiffness is not
parameterized, but since there's only one set of Pacejka constants I have
access to, and I'm trying to simulate dozens of different cars with tires
ranging from old bias-ply road car tires to actual racing tires, I could
just as well use a simpler parameterization that I can adapt for different
tires more easily than using the Pacejka model. Of course, the Pacejka model
is still there in the code ready to be used if needed. :-)

> >So, I first predict what the speed difference between tire and ground
> >would be one timestep later if the full tire force were applied to the
> >wheel. If it would increase the speed difference, I simply set the
> >angular velocity of the wheel so the speed difference is zero,
> >otherwise I calculate the acceleration normally.

> Wouldn't that mean that you can't slip the tire? I mean, if both tire
> spin and road speed are held at the same speed, surely there's no
> slipping (and no slip ratio?!).

No, you misunderstood. :-) I don't hold the tire spin and road speed at the
same value, I simply prevent the tire-ground friction from doing what it
can't do by definition - it's a friction force, so it always attempts to
minimize the speed difference between tire and road. But because of the
discrete time steps, the friction force we calculate at the beginning of a
timestep can overaccelerate the tire during the time step so the speed
difference can actually increase, which is physically impossible. The exact
same thing applies for the brakes, they also shouldn't be able to increase
the absolute value of the wheel's angular velocity. When the friction forces
are taken care of, the drive torque can be applied normally, which of course
accelerates the wheel as it should, resulting in slip.

> >This method works like a charm!

> Good to hear! :)
> So it's a predictor-corrector method.

In a sense I suppose you could call it that, although it only kicks in for
the special case when the friction forces need to be prevented from adding
energy to the system. *Real* predictor-corrector integrators are constantly
predicting-correcting, I believe. :-)

But it definitely eliminates all unwanted rotational oscillations in the
tire!

> Still don't see how a big skid
> would be done that way though.

Believe me, it can! You should see the amount of smoke that's generated when
I do donuts in a Camaro. :-)

> The formulae I use from Gregor Veble include a generic locking moment.
> It is just (delta_rotational_velocity*viscous_factor) for viscous
> diffs, but for other LSD's I think it should work (like for a
> Salisbury, it is something like (road_reaction_torque_difference)
> between the 2 diff outputs (to the wheels), capped based on the max
> ratio the diff can handle, and some preload checks added. Not that
> it's working here (and I haven't tried yet).

I think I'll try to code a regular dry-friction clutch-plate LSD before I go
for things like Salisburys or Torsens. :-)

> If I use the AABBtree (quite a simple concept,
> see 'AABBTrees Collision Detection for Deformable Models' by Gino van
> den Bergen) for the car as well, I could do quick track-car detection
> and be triangle accurate. Very important to get rough crashes to look
> ok! ;-)

Sounds interesting, will have to investigate. :-) I'm using the vertices of
a simplified body model as collision contacts with the ground, which works
perfectly as long as the ground is relatively smooth. No object-to-object
collisions yet, as there are no other objects yet. :-)

> >Obviously I'm going to have to implement spline patches at some point.
> Maybe the whole terrain could be composed of Bezier patches, or just the
> road.

> I'd do just the road. Outside that, the triangles should be rough
> anyway.

Perhaps so, but one good aspect of doing the whole terrain as Bezier (or
Hermite, or whatever) patches would be the amount of memory saved. Instead
of every triangle, you just need to store the patch, and the triangles can
be generated dynamically, possibly even using LOD.

> I don't use Bezier patches, just a 3D Hermite spline (well,
> multiple segments) running through the road vertices. Some info on
> that is on my site.

I've read through that, and your method is probably the smartest way to do
it for a racetrack-oriented sim. I guess that's how it's implemented in
commercial games as well? But I'm trying to make my sim as general as
possible, so I'd also like to be able to generate smoothly undulating
off-road terrain.

> >limit which depended on the stiffness of the spring. :-) Time to study
> >constrained dynamics, apparently.

> Ouch, big matrices and all that, or LCP solving, yikes.

Quite. :-)

> Yes, indeed. :) But for Nascar it would work, as Fox already has a
> line of SGI O2's and a bigger SGI (Onyx2 or something) that renders
> info on the cars live. Nice, but just a technical gadget. Driving
> along would be a much nicer application (live ofcourse, with just a
> delay because of some servers inbetween). :)

Oh yeah. But how would you implement collisions between the virtual cars and
the real cars? :-)

Petri Blomqvist

Ruud van Ga

Car physics; suspension natural frequency

by Ruud van Ga » Sun, 11 Nov 2001 01:00:22

On Thu, 8 Nov 2001 22:24:06 +0200, "Petri Blomqvist" <p...@iobox.com>
wrote:

>Of course, you can always do that yourself while waiting for compilers to
>gain this important feature. :-) I actually did that for my own sim. I just
>output the variable I want to graph, into a text file. Very crude, but I can
>view it with my own little (equally crude) graph viewer app. :-)

Indeed, might be a good one. Perhaps even to generalize it a bit
still, so it's easier to do (which effectively means you'll use it,
instead of having the technology to do it ;-)).

>> I have a hunch my tires are oscillating vertically (thus giving a
>> worse average grip), and this could be looked at more nicely with a
>> sort of graph utility and some generalized way of storing of a
>> variable's value.

>I don't really see how you could have unwanted oscillations in the
>suspension even using the tire rate, unless you're using really low damper
>values or a really big time step.

Well, say I have a tire with 200,000N/m tirerate. It's being pushed
1cm into the tarmac. That gives 200,000N/m*0.01m = 2000N of force. If
the wheel is 20kg, that would mean an acceleration of F=ma =>
a=2000/20=100 m/s^2.
Integrated at 200Hz that means v gets updated to 1/200*100 = 0.5 m/s.
So the next step, v=0.5 m/s, integrated again: 1/200*0.5=0.0025 m. Hm,
just 2,5mm. ;-)

But I think it was the damping that caused problems. The more damping,
the less numerically stable things got. With the help of Gregor, I put
in an implicit integrator, which steps back in time (see Baraff's
paper on Implicit Integration for example). This seems to make things
much more stable.

> I run my physics code at 500 Hz, and I'm
>not experiencing any oscillations, even if I lower it to something like 200
>Hz. One thing that improves stability greatly is including the second
>derivative in integrating the new suspension jounce distance (or any rigid
>body position, for that matter):

>dx/dt = v + 0.5*a*dt,

Yes, weird. The infinite Taylor series on integration would go like:

x(t0+h) = x(t0) + h*x'(t0)+(h^2/2!)*x''(t0)+...

translated that would be:

x(t0+h) = x(t0) + h*x'(t0) + (h^2/2!)*x''(t0)+...
        = x(t0) + h*v + 0.5*a*h^2 + ...

which looks more like:

dx/dt = v + 0.5*a*dt^2
then    v + 0.5*a*dt

I don't really understand that. What I do understand is that your
method takes the midpoint velocity. Like an RK2 step, only simpler I
think.
I already did some 0.5*a*dt^2 additions in the suspension and that
already helped. Perhaps using 'dt' (non-squared) helps even more?!

>where 'v' is jounce velocity and 'a' is the acceleration which is assumed to
>be constant over the time step. It's certainly better than a plain Euler
>integrator. I actually used a 4th order Runge-Kutta integrator originally,
>but I went back to a Euler integrator because I had coded some things in a
>way that doesn't really work with an integrator that needs to step back and
>forth.

Ouch, that doesn't seem a nice debug-friendly environment. :)
For collisions it might not be that bad; if I can figure out if
FastCar's linear projection method works ok even for a stack of cubes,
then I'd rather use that than to double buffer all my force results
(to be able to 'undo' a step).

...

>classes for meshes, sound fx etc. is even more difficult to me than coding
>the physics! But I digress. :-)

Hehe, well, if it works, it's hard to fix things. New things, I tend
to think, are much more interesting and attract all the energy.

>Anyway, any oscillation that would affect the tire load force to any
>significant degree would certainly be visible, and looking at the wheels in
>Racer, they look very stable. Are you sure it's not just a problem with
>calculating the lateral tire force?

Partly perhaps. ;-) Actually, it makes a whole lot of difference at
what HEIGHT I apply the lateral forces to the body. If I move the
application point away from the CG height too much, the body roll
torque gets unstable and sliding the car sideways, for example, can
make things a bit springy (although it was some time ago that I
checked the effect). It was a big problem with the SAE950311 method
(Barnard) where the slipAngle (SA) wouldn't be updated quickly enough,
and I'd get a slowly swinging car from left to right (in the order of
0.5Hz something), growing worse with every swing. I took out the
damping for that method though, since it caused trouble (have to
reinstate it and vary the damping force negative/positive for each
timestep, which seems to be needed).

Try increasing the damping of a wheel in Racer (all released versions)
to say 8000N/m/s. Kablam! That's mostly fixed now.

I took out the lateral forces 2 days ago to check if that may be part
of the problem, but the jitters kept on being there because of the
high spring rates (mostly the tire). Damping seemed to be a big part
of the problem.

>> Do you get the (dynamic) friction coefficient directly from the D in
>> Pacejka?

>No, I calculate the dynamic friction coefficient based on the slip ratio of
>a locked tire (-1, obviously).

Ah. I have the idea that Pacejka goes down too much there, and isn't
really suited for a locked tire coefficient. I play with the a0/b0
parameters to go easy on the lateral/longitudinal force fallback.

> Although actually, at the moment I'm
>experimenting with a simplified tire model  instead of Pacejka. Since all
>those Pacejka coefficients are next to impossible to come by (except for
>that "Ferrari tire" that almost everyone seems to use)

Figures where half of it has not been calculated btw. No
load-sensitivity in those numbers. The car before that, a saloon car
or something (1.271 lateral friction coefficient) looks much better.
Perhaps some factors could make it apply to race tires.

Although Pacejka is quite complex, I can play with it (check out
Racer's Pacejka editor) and it doesn't really matter that there are so
many coefficients. Although a simpler BCDE version can also be useful
I guess.

>> Wouldn't that mean that you can't slip the tire? I mean, if both tire
>> spin and road speed are held at the same speed, surely there's no
>> slipping (and no slip ratio?!).

>No, you misunderstood. :-) I don't hold the tire spin and road speed at the
>same value, I simply prevent the tire-ground friction from doing what it
>can't do by definition - it's a friction force, so it always attempts to
>minimize the speed difference between tire and road. But because of the
>discrete time steps, the friction force we calculate at the beginning of a
>timestep can overaccelerate the tire during the time step so the speed
>difference can actually increase, which is physically impossible.

Hm, interesting idea. So you look at the road reaction (the output
from the Pacejka or Blomqvist curves ;-)) first to see how it would
accelerate the tire? (disregarding engine/differential torque for that
moment) Funny, I'd think you could only look at the combined forces,
not one force at a time and cap the friction (road reaction) force
separately and later add the engine torque.

But the friction force always points in the reverse direction of the
wheel vs road rotation, right? So how could it make the speed
difference *bigger*? By velocity reversal (spinning the wheel in
reverse)? (and giving more reverse speed than the wheel is current
going forward)
It would seem at medium to high speeds the friction check doesn't come
into play at all.

>In a sense I suppose you could call it that, although it only kicks in for
>the special case when the friction forces need to be prevented from adding
>energy to the system. *Real* predictor-corrector integrators are constantly
>predicting-correcting, I believe. :-)

You're right, you're I think only predicting with the friction force,
and not doing the same with engine force/torque for example.

>But it definitely eliminates all unwanted rotational oscillations in the
>tire!

Heh, that's why I want to understand it fully. :)

>> Still don't see how a big skid
>> would be done that way though.

>Believe me, it can! You should see the amount of smoke that's generated when
>I do donuts in a Camaro. :-)

Cool. :) Are you ever going to release a demo of your sim btw?

>I think I'll try to code a regular dry-friction clutch-plate LSD before I go
>for things like Salisburys or Torsens. :-)

Salisbury is a friction clutch plate LSD, but there's something about
the amount of locking torque it can generate, which is seemingly
infinite (well, at one point you get damage points awarded ofcourse
and a little firey particle is trigger ;-)).

>> If I use the AABBtree (quite a simple concept,
>> see 'AABBTrees Collision Detection for Deformable Models' by Gino van
>> den Bergen) for the car as well, I could do quick track-car detection
>> and be triangle accurate. Very important to get rough crashes to look
>> ok! ;-)

>Sounds interesting, will have to investigate. :-) I'm using the vertices of
>a simplified body model as collision contacts with the ground, which works
>perfectly as long as the ground is relatively smooth. No object-to-object
>collisions yet, as there are no other objects yet. :-)

Right, and falling straight onto a pit wall is hard to do with points
only. The AABBTrees are really like BSP trees (GPL uses those), and
you can run through 2 trees and find the overlapping areas. The
question is just how MUCH overlap it's going to generate.
I started with a semi-3D AABBTree, mostly 2D since a track basically
looks very 2D-ish (to the birds :)). But I see it can be generalized
for car-car collisions as well (and car-anything to add hittable
things on the track).
Unfortunately I have nothing in the direction of a contact point
solving system yet. And I don't really get Baraff supposedly 'much
easier' way of iteratively solving for all contact forces.
So no juicy collisions yet.

...

>Perhaps so, but one good aspect of doing the whole terrain as Bezier (or
>Hermite, or whatever) patches would be the amount of memory saved. Instead

...

read more »

Petri Blomqvis

Car physics; suspension natural frequency

by Petri Blomqvis » Sun, 11 Nov 2001 07:19:16



And that's for a wheel disconnected from the car! Don't forget there's the
spring & damper limiting that acceleration. :-)

Actually, the dt^2 should only be there after multiplying both sides by dt.
Using your equation, you'd get dx = v*dt + 0.5*a*dt^3. :-)

I don't think it would... you're supposed to multiply acceleration (m/s^2)
by dt^2 (s^2) to get position (m).

It's not. :-)

Of course, adding new things would be *so* much easier if I had coded things
properly from the start... oh well. :-)

I had that problem too, but I'll have to look at the source code to remember
how I got rid of it.

It seems that way to me, too. Another reason why I switched to the
simplified tire model. Plus, it's easier to use with Gregor Veble's combined
slip method, since the peak slip ratio is a parameter.

Blomqvist '01 Tire Model! I like the sound of that. :-)

I myself wasn't sure if it would work at first, but I implemented it anyway
in a sort of act of desperation. :-) To my surprise, it does work! It's
certainly not 100% accurate, but since it hasn't affected the maximum
acceleration of my cars at all, and it eliminates oscillations in tire
rotation, my conclusion is that it's perfect. :-)

Exactly! Wouldn't really be a problem if we could run our physics code with
1 nanosecond timesteps in realtime. Friction's a real *** phenomenon for
numerical integration to handle. :-(

Could be - I haven't checked yet. Thanks for reminding me! It occurs to me
that I could output 1's and 0's depending on when the friction limiting is
active and check how it works with my little graph viewer.

Quite right - although I might try to predict the acceleration caused by a
limited-slip differential (as soon as I get around to coding those), because
the same thing would apply with the friction plates - they too could
overaccelerate the wheels relative to each other.

I'm a bit hesitant to release one at the current state of the program -
things like controller axes and buttons are still completely hardcoded, and
there's very little error-checking anywhere. Maybe I'll post some
screenshots soon.

Did a little searching, and I think I now understand the basic idea of how
Salisburys work. Basically the clutch packs are just pressed together more
tightly by the ramps as you apply more torque to the ring gear, right?
Doesn't sound too hard to implement, actually! (I could be wrong, of course.
:-)

Lightwave, which I use, has subdivision surfaces, but I'm also not quite
prepared to try to use them yet. :-)

Which reminds me... Racer works fine for me, but I'm getting 0.01 fps in
Track Editor. I wonder what's up with that. :-)

Hmmm.. very interesting idea! Of course, that would lead to hysteresis -
terrain height would be different depending on from which direction you're
crossing a border between two triangles. But with sufficiently low angles,
meaning enough triangles, it could be useful, at least as a quick fix until
I manage to create bicubic surfaces.

I guess that's what it would take to make some people believe that a gravity
of 9.81 m/s^2 does look right. :-)

Petri Blomqvist

mjessick-Motorsim

Car physics; suspension natural frequency

by mjessick-Motorsim » Sun, 11 Nov 2001 09:09:28


> Yes, what's missing from all these profilers is variable telemetry.
> Just letting things run, but storing variables based on time or
> iteration count, and after a run, viewing the variables in a graph.
> This would be useful not only for carsims I think. Copyright/trademark
> etc Ruud van Gaal. ;-)
> I have a hunch my tires are oscillating vertically (thus giving a
> worse average grip), and this could be looked at more nicely with a
> sort of graph utility and some generalized way of storing of a
> variable's value.

I would like to suggest using the freeware "Gnuplot" for plotting
text files and basic plotting of math functions.
It is script based and multiple platform. I first started using
it years ago because I could plot the same data files
using the same scripts on UNIX Sparc workstations and PC's.

(The "Gnu" has nothing to do with the public license
folks and is unfortunately confusing. Do an internet search for
Gnuplot.)

--
Matthew V. Jessick         Motorsims

Vehicle Dynamics Engineer  (972)910-8866 Ext.125, Fax: (972)910-8216


rec.autos.simulators is a usenet newsgroup formed in December, 1993. As this group was always unmoderated there may be some spam or off topic articles included. Some links do point back to racesimcentral.net as we could not validate the original address. Please report any pages that you believe warrant deletion from this archive (include the link in your email). RaceSimCentral.net is in no way responsible and does not endorse any of the content herein.