rec.autos.simulators

Car Physics: Pacejka on non-powered wheels

J. Perki

Car Physics: Pacejka on non-powered wheels

by J. Perki » Fri, 21 Dec 2001 23:07:59

It's been too long since there was a good physics thread on here.

I'm trying to apply the Pacejka formula to the non-powered (not
connected to the drivetrain) wheels on my car. During acceleration,
the road speed increases quickly, a slip ratio builds up and
forces are generated at the CP that make the wheel spin to catch
up. The problem is that too much force is generated, and the
wheel overshoots the road speed. Even larger forces are generated
to bring the speed back down, causing the wheel to overshoot
again - spinning the wrong way now - and so on and so on until
the wheels are just spinning wildly back and forth.

I'm considering locking the force applied at the CP to "reasonable"
values; that is, I won't allow (roadVel-cpVel) to switch sign in
a timestep. This should make things appear right visually, though
it seems a little hacky. Does anyone have a better/more elegant
solution for the problem? (Or is it just my problem?)

Jason
379

Ruud van Ga

Car Physics: Pacejka on non-powered wheels

by Ruud van Ga » Sat, 22 Dec 2001 02:13:50


These are general low-speed problems. Several ways to approach the
problem:
1. Use a larger physics frequency (so the jumps aren't that noticable
visually).
2. Add SAE950311's way of indirecting slipratio. What you do is not
calculate SR directly as SR=V_wheel/V_road-1 (or one of all the
various variations), but update it slowly using an extra variable
which accounts for relaxation length.
3. Predictor/corrector-like: predict what the generated force will do
to the wheel. If it will cause velocity reversal (of the wheel spin),
either set wheel velocity and acceleration to 0, or cut back the force
so it just makes the wheel velocity 0 (there are subtle side-effects
between these 2 if you're dealing with a drivetrain where everything
is hooked together).

I think a good enough physics frequency and using the SAE950311 is the
most elegant solution I've seen yet. Although correcting the force
seems to work ok for some, the SAE950311 method is good because it
includes relaxation length, which is something happening physically
anyway (and gives you 'standing still sideways on a bridge' for
example).

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

Doug Millike

Car Physics: Pacejka on non-powered wheels

by Doug Millike » Sat, 22 Dec 2001 01:44:38

What time is your integration step size for wheel speed?


Gregor Vebl

Car Physics: Pacejka on non-powered wheels

by Gregor Vebl » Sat, 22 Dec 2001 02:32:23

Car Physics again! :)

What you are experiencing is a typical instability of numerical
computation. With the force vs. slip ratio/angle approach, this
instability is always there at a sufficiently low speed due to the way
slip ratio is calculated (it is divided by the size of the velocity),
which means that the oscillation in the differential equations becomes
very 'stiff'.

For wheels, the best way to regularize this behaviour is to use the
relaxation length approach at low speeds (Google masters, help us out
here!). This will regularize behaviour at low speeds with the added
benefit of the car being able to fully stop on an incline, while at high
speeds you can (and indeed, need to!) still switch to the usual model.
Keep in mind, though, that for realistic racing car parameters you may
still end up with the required simulation frequencies well in hundreds
(even thousands).

Another way to do avoid excessively small timesteps is to use the
implicit integration schemes as per Baraff (Google masters, again!).
These, however, may become very complex to implement once differentials
come into play, and may introduce artifacts and cannot completely
guarantee stability for the typical overshoots that are present in the
tyre/road system. But if you decide to go that way, I'd be delighted to
hear about results! :)

Cheers,

-Gregor


> It's been too long since there was a good physics thread on here.

> I'm trying to apply the Pacejka formula to the non-powered (not
> connected to the drivetrain) wheels on my car. During acceleration,
> the road speed increases quickly, a slip ratio builds up and
> forces are generated at the CP that make the wheel spin to catch
> up. The problem is that too much force is generated, and the
> wheel overshoots the road speed. Even larger forces are generated
> to bring the speed back down, causing the wheel to overshoot
> again - spinning the wrong way now - and so on and so on until
> the wheels are just spinning wildly back and forth.

> I'm considering locking the force applied at the CP to "reasonable"
> values; that is, I won't allow (roadVel-cpVel) to switch sign in
> a timestep. This should make things appear right visually, though
> it seems a little hacky. Does anyone have a better/more elegant
> solution for the problem? (Or is it just my problem?)

> Jason
> 379

J. Perki

Car Physics: Pacejka on non-powered wheels

by J. Perki » Sat, 22 Dec 2001 06:21:33



> >I'm trying to apply the Pacejka formula to the non-powered (not
> >connected to the drivetrain) wheels on my car. The problem is
> >that too much force is generated, and the wheel overshoots the
> >road speed.

> These are general low-speed problems. Several ways to approach the
> problem:
> 1. Use a larger physics frequency (so the jumps aren't that noticable
> visually).

My updates are tied to the framerate currently (I know, I know) but
I'm getting a pretty steady 100fps (0.01-0.014 secs/frame).

I'm already doing this, but I think it might be making the problem
worse, as it adds a latency into the SR response. It may be that
I'm not flipping signs at the right time, and I am looking at
that now. The drive wheels are working great, it's just the free
rolling wheels that are giving me problems. Now that I know that
other people are using the same approach with acceptable results,
it seems likely I've a bug somewhere.

This is the approach (reducing the force to match the velocities)
I am considering (if I can't find a problem in my SR calculations),
but I am concerned about potential side effects. Mostly concerned
that I don't know what the side effects might be.

I suppose I could try cranking up the frequency on my tire code
and see if the problem goes away. I've been meaning to switch to
a fixed frequency anyway.
Jason
379

Ruud van Ga

Car Physics: Pacejka on non-powered wheels

by Ruud van Ga » Sun, 23 Dec 2001 05:50:44




>> >I'm trying to apply the Pacejka formula to the non-powered (not
>> >connected to the drivetrain) wheels on my car. The problem is
>> >that too much force is generated, and the wheel overshoots the
>> >road speed.

>> These are general low-speed problems. Several ways to approach the
>> problem:
>> 1. Use a larger physics frequency (so the jumps aren't that noticable
>> visually).

>My updates are tied to the framerate currently (I know, I know) but
>I'm getting a pretty steady 100fps (0.01-0.014 secs/frame).

That's not a lot. I typically can't drive below 200 to 250Hz without
things getting bad for most cars. The dampers were the worst part
though, requiring about 500Hz if I would integrate explicitly (now
it's fine, implicitly, at 200Hz and up).

That's the whole idea of relaxation length. ;-)
Although longitudinally (SR-wise) it should be very small, as you can
imagine the *** not being that flexible around the spin axis). The
lateral relaxation length is a part of the wheel circumference
(mostly, say 0.9 for a start), and use 1/10th of that for
longitudinally. So it (SR) should increase quickly.

Flipping signs of what?

That's a little weird (although the 100Hz may explain that). I have
about the same problems with both types of wheels.

Are you applying damping? Pedri had a nice comment about applying
damping the other day; he always applied the damping in the reverse
direction of the wheel velocity. Yes, duh. ;-)
It seemed a periodic formula, in the SAE950311 document.

Hehe, indeed. Better to just let it run free; you'll get into trouble
later on with differentials anyway (probably) by doing this.

Shouldn't be that hard, as you already use a framerate-derived
frequency already. It's just timing when to paint that needs to be
added.

Hope a bit more frequency helps. Also, ofcourse, a bit more wheel
inertia also does wonders. ;-)

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

J. Todd Wass

Car Physics: Pacejka on non-powered wheels

by J. Todd Wass » Sun, 23 Dec 2001 08:35:34

  I haven't done the relaxation length stuff everyone is talking about just
yet, but what I do do (do do??) is run the tire rotational frequency at a
higher, adjustable frequency inside the main loop.  I'm modelling (besides full
sized cars), little radio controlled cars that have a peak grip coefficient of
around 3.5-3.8 (from what we've been able to tell anyway), and very little
rotational inertia..  I run these at several thousand hertz, which just
wouldn't work if the whole system had to run that fast..  Adjustable split
frequencies can do great things, although I'd love to hear about it if someone
gets an implicit integrator working with wheel rotation and relaxation length
:0)

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

J. Perki

Car Physics: Pacejka on non-powered wheels

by J. Perki » Mon, 24 Dec 2001 06:04:39


Out of curiosity, what do you do for a slip ratio when road speed
is zero (the case where you would end up dividing by zero in the
traditional slip ratio formula)?

I think all the smart folks here are right and I need to up my
simulation frequency. Hopefully I'll get a chance to try it out
after the holidays.

Jason
379

J. Todd Wass

Car Physics: Pacejka on non-powered wheels

by J. Todd Wass » Mon, 24 Dec 2001 08:27:57

  I switch to a seperate model at low speed that basically acts like a torsion
spring.  It's good because you can stop on hills and it locates the rotational
position really well, but it doesn't transition into the high speed model
smoothly yet, and it doesn't care much for my differential model if it unlocks.
 I'd think a relaxation length approach would work better, but I haven't tried
it yet.

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

Ruud van Ga

Car Physics: Pacejka on non-powered wheels

by Ruud van Ga » Wed, 26 Dec 2001 01:06:14


The idea behind the relaxation stuff is adding a filter to SR. This
way it won't jitter as much. The filter is physically accurate, so
that's a nice bonus. ;-)

Something I once did was:

  if(spinVel<1)T_total*=spinVel;

To reduce the torques at low spin velocity.

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

J. Todd Wass

Car Physics: Pacejka on non-powered wheels

by J. Todd Wass » Thu, 27 Dec 2001 04:33:38

  Good tip, thanks :-)

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

J. Perki

Car Physics: Pacejka on non-powered wheels

by J. Perki » Sun, 30 Dec 2001 11:47:08


You know, this seemed to make perfect sense when I read it, until I
started trying to work it out on paper. Where do you draw the line
between the tire simulation and the chassis? That is, what are computing
at the higher frequency? I suppose I could just compute the SR derivative
at the smaller timestep, without actually changing the wheel velocities
or applying any forces - is this what you're talking about?

That said, I bumped up my physics to a fixed 500Hz and things are
behaving considerably better, though not perfect, but my current
implementation requires me to run the entire vehicle model at this
frequency. There may still be a bug in here somewhere, of course.

Jason
379

J. Todd Wass

Car Physics: Pacejka on non-powered wheels

by J. Todd Wass » Tue, 01 Jan 2002 16:14:01

  I calculate slip ratio, tire torque (road reaction torque from slip ratio and
load), and... (it's late...?), then I let the wheel accelerate several times
within the main loop (at a decreased time step).  The forces at the last step
are used to move the car, although you could probably use the average of them
instead I suppose..  This lets things stabilize much better and at far less
cost than increasing the entire engine's frequency.  With my little RC cars,
before we had correct rotational inertia data, I was running the main engine
frequency at 200-300Hz, but the tires needed about 20,000-30,000Hz to stay
stable below around 8-10kph car speed.  Now that we have good data, this can be
reduced by a factor of 10 or so, probably.  Still, it's probably better to use
relaxation lengths.

  The differential gear systems run at the stepped up frequency too, although
this could probably be cheated a bit for speed if it was allowable.

  You probably don't have a bug...  This is just the nature of slip ratio
modelling; all the SAE/other papers I've seen mention the same problem and have
either a low speed "switch" approximation or get rid of it by treating slip
ratio/angle as a state variable (relaxation length approach.)  

  You may have noticed that your car won't stop on hills either... :0)  

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

J. Perki

Car Physics: Pacejka on non-powered wheels

by J. Perki » Thu, 03 Jan 2002 23:19:28


Okay so you're just ignoring the forces generated at the "in-between"
timesteps. I guess this makes sense since the chassis won't be moving
either.

I am using the relaxation length stuff, and I'm still seeing this
instability, so it's not a cure-all. Only on the free-rolling wheels
though, there must be enough inertia/friction in the drivetrain to
dampen the drive wheels. It looks like the problem goes away around
250-300Hz, which would be a better rate to run my collision/physics
anyway.

Yes, I fixed that by getting rid of the hills. ;)

Jason
379

J. Todd Wass

Car Physics: Pacejka on non-powered wheels

by J. Todd Wass » Fri, 04 Jan 2002 12:42:27

  That's what I figure at least..  It keeps the wheels from overshooting the
"correct" slip ratio a bit better.

  I don't know what values you're using, but one measured moment of inertia for
a wheel assembly was 8.97 ft*lbs^2 off a real car, quite a bit higher than I
would have intuitively guessed.  This was from a little racer in a suspension
design/analysis program that weighed something like 1500-2000 lbs IIRC, rather
light wheels in all likelihood  Ruud and you other guys, you listening?

  I'll leave it up to you to convert to metric :-)

  I also don't deal with the wheel hop mode, so that's probably going to add
some instability as well if you are doing that (if you have a tire "spring"
somewhere).    

  lol!  A great solution! :0)

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

My little car sim screenshots:
http://performancesimulations.com/scnshot4.htm


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.