rec.autos.simulators

Basics of a car simulator

Thomas Hart

Basics of a car simulator

by Thomas Hart » Tue, 01 Nov 2005 08:19:04

I've been searching Google Groups, and it seems that questions
concerning attempts to create home made car simulators are welcome here.
I am just starting out on such a project, and I want to make sure I have
the basics clear in my head. I hope that if you have any time then any
experts reading this might be able to scan my post and correct the
mistakes I am likely to be making at this stage. I have been reading
about this purely from the point of view of someone trying to write a
simulation and previously knew very little about the internals of a car.

I'm a C++ programmer, so please forgive me if my description of the
simulator components sounds a little unnaturally partitioned compared to
the way things sit in a car or if I lump together important components -
I'm probably just allowing the way I would implement things in classes
to pervade my thought.

Of course, I am happy with and fully understand the problems that are
not specific to a car, e.g. of contact patches in a 3d world and how
computer programs approximate them, of how torque and linear forces are
related, etc. If I wasn't, I don't think this would be the place to ask.

I am only a single person and am doing this to try and create games. I
am not imagining for a second that I could ever create something as
realistic as Gran Turismo or Grand Prix Legends, but I certainly don't
want to settle for Ridge Racer type dynamics.

As I understand it, the bedrock of simulating a car engine is the
flywheel. At any given time it has a particular RPM and a particular
torque. Torque may be derived from RPM and for simple simulation
purposes this can be done using a simple graph lookup. The graph will
appear to be an upward curve, peaking towards its end although maximum
torque is not output at maximum RPM. RPM is evolved over time as a
function of flywheel torque (hence this is a differential equation),
throttle and any external torques being applied. Engine whine is
principally a function of flywheel RPM.

Output torque from the flywheel is scaled according to throttle. It then
goes through the transmission before reaching the wheels. Some energy is
lost there, decreasing total power output.

Gears are applied and are usually described by their gear ratio - in
real life a measure of relative cog sizes which for the purposes of
simulation means a number with which to multiply torque and divide RPM.
Hence power output is not affected by gear ratio. Low gears tend to have
low values greater than 1 (as RPM is sacrificed for torque to get the
thing going) and high gears tend to have values between 0 and 1 (as the
car has built up momentum and the aim is to maximise RPM).

That information is passed on to the tyres. I shall ignore the
possibility of sideways forces for the time being.

At any instant they have a linear velocity obviously derived from the
motion of the main vehicle. Based on the RPM they are being driven at,
their radius and the RPM output to them a slip ratio can be computed.
The slip ratio and the output torque together combine, in practical
implementation terms via a graph lookup that relates slip ratio to a
torque scaler, to create a linear force on the tyre and, as a result,
the car body. Every action has an equal and opposite reaction, so
whatever force is applied acts back up through the transmission to the
flywheel as an external torque affecting the current engine RPM.

The "slip ratio" formulation of tyre/surface interaction is an emulation
of the real world that seems to be credited to Pacejka. Since
calculation requires a divide by linear velocity, it is hard to deal
with at low speeds - at speed 0 it is undefined and near 0 it can play
havoc with numerical accuracy due to the very large numbers involved. So
it is common to approximate tyre reactions at low speeds using a spring
model.

A spring model can be implemented by obtaining the difference between
real linear velocity and "intended" linear velocity (i.e. that implied
as a result of output RPM and tyre radius) and applying a force
calculated as though a spring with natural length 0 were stretched to a
size proportional to the difference in velocities. The spring
coefficient is derived in some way from torque. Presumably because this
is a quick fix to make things work in an unimportant area of most car
games - namely low speed driving - then whatever processing of the
numbers that appears to work is acceptable.

Sideways forces act similarly to the forward relative ones described
above, except that RPM isn't a factor - they can be derived purely from
the wheel's linear velocity as any sideways motion is pure slip.

The traction circle limits total traction. Thinking about it
pictographically, if the forwards and sideways forces are combined to
make a 2d vector from the origin then that vector is clipped if its
endpoint is outside of the traction circle. I have to admit that I'm
sufficiently new to this that I am not sure if the circle is always a
genuine circle or if it may be an ellipse with a minor and major radius.
It is the effects of the traction circle that tends to cause sliding
towards the outside of corners approached at speed.

-Thomas

Jeff Rei

Basics of a car simulator

by Jeff Rei » Tue, 01 Nov 2005 10:41:39

I'm not sure why you have this impression. The flywheel only
adds rotational inertia to the engine. The only real effect this
has is when downshifting and the momentary braking effect it
causes while rpms are increased.

An equation or table look up for torque versus RPM is good enough.
You can make the simple assumption that response to throttle
inputs are linear (assume that the car has a real smart ECU).
Torque peak can range from about 25% to 80% of redline, I suggest
60% to 70%. For a racing engine, use a graph from a motorcyle
dyno chart (you can usually find these in bike magazines), as
the torque curves are close enough to racing engine (nomrally
aspirated ones). Scale the rpms for your intended redline.
If you can find the actual torque curve for the engine you're
trying to model, use it.

This is only good for hitting the throttle with the clutch in, or
in neutral. Normally you can caclulate rear wheel force (assuming
rear wheel drive here), from rear wheel torque and diameter,
then calculate acceleration, and intergete over time to get
velocity and distance. Use velocity and gearing to determine new
engine rpm.

Slip ratio is relative to rear wheel torque and the downforce on the tire,
not velocity. I'm not sure why so many texts use velocity based equations
since this is an effect, not a cause. The contact patch moves slightly
slower than the rest of the tire as the tread surface stretches and relaxes
as it "flows" through the contact patch. The amount of slowing is relatively
small, and you might want to consider ignoring it. You can create a two
dimensional table, torque and downforce as indexes, containing values for
slip ratios, and use linear interpolation for values in between. You may
want to consider ignoring the downforce component.

Another factor is tread squirm, the sidewalls of a tire push inwards on
the contact patch. You can probably ignore this effect as well.

Slip angles can occur without slippage. The contact patch is flexible, so
it's direction is not perpendicular to the tire's axis when there is
a side load. The smallest maximum slip angles occur on IRL type cars,
with a working slip angle of around 2%. Modern bias ply tires can go
over 5%, and the older tires were higher still.

It's usually not a circle, for most tires, forwards/backwards grip
is a little higher than sideways grip.

What happens when you exceed the traction circle depends on the tire
type. For bias ply racing slicks, there is little if any, loss of grip
while cornering even if optimal slip angle is exceeded. A streat
oriented radial has significant loss of grip, and I would not recommend
using a street radial for actual racing.

Todd Wasso

Basics of a car simulator

by Todd Wasso » Tue, 01 Nov 2005 14:07:07


> I've been searching Google Groups, and it seems that questions
> concerning attempts to create home made car simulators are welcome here.
> I am just starting out on such a project, and I want to make sure I have
> the basics clear in my head. I hope that if you have any time then any
> experts reading this might be able to scan my post and correct the
> mistakes I am likely to be making at this stage. I have been reading
> about this purely from the point of view of someone trying to write a
> simulation and previously knew very little about the internals of a car.

Sounds just like a lot of us :)

Here's a quick vid of mine at the moment.  Graphics stink, but hey :-)

http://www.PerformanceSimulations.com/files/ToddSim10a.wmv

Also did Virtual RC Racing.  There are some vids around the net of
that.

<snip>

Yes, you can look up torque as a function of RPM.  Just google "dyno
chart," "dyno test," "dyno graph," "torque curve" or simlar to find a
plethora of data.  You'll want something that looks like this:

http://www.airflowresearch.com/dyno/chevy_dyno.htm

Yes, typically you'd just multiply the flywheel torque by a fixed
driveline efficiency to get the torque at the driven wheels.  Note that
some dyno test data is actually measured at the wheels to start off
with, so in those cases the efficiency you'd use would be 100%.

Yep.  By the way, any "overdrive" gear means its value is < 1.  Just a
tidbit there..

Right.  Slip ratio = 1 - (actual rotational velocity / free rolling
velocity)

Sort of.  Tire data is in the form of longitudinal force vs. slip
ratio.  There's not a "torque scaler" there anywhere, although maybe
that's what you meant anyway.

Every action has an equal and opposite reaction, so

Right.

"Slip ratio" is a term that has been around since the dawn of vehicle
dynamics.  Not credited to Dr. Pacejka.  He has written numerous tire
models however.  His famous Magic Tire Model is very popular with the
sim racing community, so you'll see "slip ratio" and Pacejka in the
same sentence quite a lot :-)

Since

Yes, you tend toward a singularity (dividing by numbers closer and
closer to 0) as the tire's contact patch velocity approaches 0.

So

Actually, a simpler, slightly more clean way to do it is to change the
slip ratio calculation from a division to a subtraction at low speeds.
I.e., :

Slip ratio = 1 - (actual rotational velocity / free rolling velocity)

becomes something like:

Slip ratio = 1 - (actual rotational velocity - free rolling velocity)

If you went about it this way, you'd need a cutoff velocity to switch
between the two equations.  Really, if you're under that cutoff
velocity a pretty good way to handle things is to calculate it both
ways (provided free rolling velocity <> 0), then use a weighted average
of the two depending on where you are in relation to the cutoff
velocity.  This way they two methods will blend into each other nicely
and you won't get a sudden jolt/change in slip ratio at some point.

Granted, all this really does is increases stability at low speed.  You
won't be able to stop on hills this way.  There are a few ways to solve
that though, although frequently they don't really work out all that
well.  I was modelling my tires as torsion springs at low speed for
awhile there.  That actually worked quite well.

Correct.  Slip angle is simply the direction the tire is moving
relative to the direction it's facing.  It indeed an "angle," however,
not a percentage as Jeff suggested.

Yes, although clipping the vector is not really the most realistic way
to go about it (I've tried both and let engineers drive the model both
ways).  It's generally more realistic to give the longitudinal force
precedence over the lateral one.  I.e., you let the longitudinal force
go to whatever it wants, then find out how much room you have left for
sideforce.  This means you are not just clipping the vector, but also
changing its direction.  This still gives mediocre results at best, but
is what most sims appear to do so you may very well be on par with them
with that approach.

I have to admit that I'm

A circle is a good enough approximation probably in most cases.  You're
not going to get any useful, interesting tire data anyway so will need
to live with a good guess.  In reality there is usually a slightly
elliptical shape.  I wouldn't be too concerned with that at first,
however.

Todd Wasson
Racing and Engine Simulation Software
http://www.PerformanceSimulations.com
http://www.VirtualRC.com

Todd Wasso

Basics of a car simulator

by Todd Wasso » Tue, 01 Nov 2005 14:24:06


> > As I understand it, the bedrock of simulating a car engine is the
> > flywheel.

> I'm not sure why you have this impression. The flywheel only
> adds rotational inertia to the engine. The only real effect this
> has is when downshifting and the momentary braking effect it
> causes while rpms are increased.

> > At any given time it has a particular RPM and a particular
> > torque. Torque may be derived from RPM and for simple simulation
> > purposes this can be done using a simple graph lookup.

> An equation or table look up for torque versus RPM is good enough.
> You can make the simple assumption that response to throttle
> inputs are linear (assume that the car has a real smart ECU).
> Torque peak can range from about 25% to 80% of redline, I suggest
> 60% to 70%. For a racing engine, use a graph from a motorcyle
> dyno chart (you can usually find these in bike magazines), as
> the torque curves are close enough to racing engine (nomrally
> aspirated ones). Scale the rpms for your intended redline.
> If you can find the actual torque curve for the engine you're
> trying to model, use it.

Personally, I'd only use a motorcycle curve if I was modelling a
motorcycle, but that's just me :-)  There's plenty of engine data out
there for whatever you want to do.

Depends how you model the drivetrain.  Flywheel torque most certainly
effects every drivetrain part and the tires in my model.  As it does in
reality.

Normally you can caclulate rear wheel force (assuming

Yes, but that only works in the absence of wheelspin, really.  That's
how my drag racing simulation (main page in my sig) works, but a full
3D sim with proper tire modelling won't work with that approach.  Rear
wheel force is actually not a function of engine torque.  Instead, a
proper tire model is going to output the force as a function of slip
ratio/load and so on.  This force then DETERMINES the "rear wheel
torque," not the other way around.

No, the definition of slip ratio is as described in my first reply and
it's written that way in texts because, well, that's the definition of
it. :-)  Torque and downforce are not in the equation.  They end up
being whatever they are because of slip ratio, not the other way
around.

The contact patch moves slightly

I recommend NOT ignoring it because that's precisely what causes the
longitudinal force in the first place :-)

You can create a two

Again, I recommend using the actual definition of slip ratio.  That is
not a function of torque or downforce at all.  No such tables needed.

If your model produces lat/long forces as a function of slip
ratio/angle, camber, load, and so forth, then all the physical dynamics
of the tire like tread squirm and so on are already included
adequately.

Slip angle is just what the term states it is.  An "angle."  Angles are
expressed generally in degrees or radians, not as percentages.

Yes, this is pretty typical.

No data I've ever seen on tires suggests any significant loss of grip
after the peak for either type of tire, except on wet pavement or at
EXTREME slip ratios.  95% of web sites are wrong about the radial tire
force drop off and continue to propogate this myth.  The feeling that a
tire breaks away and loses grip is because the force merely stops
rising at some point.  I.e., it flattens off more suddenly generally
with a radial than a bias tire.  People then interpret this to mean the
grip drops off, and then draw up their diagrams accordingly without
ever viewing any real tire data.

Todd Wasson
Racing and Engine Simulation Software
http://www.PerformanceSimulations.com
http://www.VirtualRC.com

Jeff Rei

Basics of a car simulator

by Jeff Rei » Tue, 01 Nov 2005 16:33:58

I wasn't sure on this. As posted, if you have the actual engine
data, use it. A lot of race engine manufacturers don't publish
their torque curves, but bike engines have similar torque curves
to racing engines.

I mistunderstood on this one. I though you meant flywheel inertia,
not engine torque at the flywheel.

Agreed. One complication of wheel spinning is that engine acceleration
will depend on inertial momentum of the entire drive train from the
crank to the tires, in addition to the friction losses, and resistance
from the actual torque supplied by the tire.

It's still my belief that the relative rotation rates are the effect, not
the cause of slip ratios. It's a way of defining slip ratio, and can be
used to measure slip ratio, but what's desired is to calculate slip ratio
based on the factors that cause slip ratio. These are longitudinal force,
normal force, and velocity (usually road velocity is used).

A lot of real tire testing varies longitudinal force, normal force, and
road velocity, to create a table of slip ratios. Given a 3 dimensional table
of sample points, the issue with low velocities is eliminated, since this is
just a table lookup with interpolation. Here is a link to one tire testing
program:

http://www.millikenresearch.com/fsaettc.html

I'm not sure where to find real world data for specific tires.

There's also the issue of jerk, or the transitions in force, I don't know
how much tire testing is done regarding jerk.

But the tables are more accurate, and don't have a low velocity issue.

Hmm, can't enter degrees as a symbol, sorry. I meant degrees.

I'm not sure that this is a myth. Here is a link to a site that claims
that the lateral force curve shape is affected by the normal force on
the tire. At low loads, there is no drop off, but at higher loads there
is somewhat of a drop off. The peak coefficient of friction also lower
at higher normal forces, again according to this web site.

http://www.smithees-racetech.com.au/ackerman.html

Todd Wasso

Basics of a car simulator

by Todd Wasso » Tue, 01 Nov 2005 18:03:21

<snip>

Relative rotation rate IS the SAE definition of slip ratio, period.
Nothing to argue there.  How the slip ratio develops is another matter
of course.  But to predict it in a sim such as the OP wants to create,
you need to have slip ratio as an input, not an output.

It's a way of defining slip ratio, and can be

In simulators you don't know what the longitudinal force is until you
know what the slip ratio is.  Tire models use slip ratio and normal
force as inputs, then output the longitudinal force from that, not the
other way around.

I'm familiar with the site.  In fact, I'm meeting Doug Milliken, owner
of that company that actually runs those tire tests and does
simulation/vehicle dynamics engineering for the big toy boys, on
Tuesday to help assemble an RC tire testing machine that does the same
thing.  Interestingly enough, our testing process will be the same as
what's done for big car tires.

Anyway, they are most certainly not "creating a table of slip ratios"
from longitudinal forces, I can assure you.  We won't be doing it
either because there's no point in doing so.  What you do is load the
tire up, then vary the slip ratio/angle while recording the
longitudinal/lateral forces that result from that.  Slip ratio is the
independent variable; the INPUT.  The forces are the OUTPUT.

Angular jerk is the derivitive of angular acceleration.  This is sort
of modelled through the implementation of relaxation lengths, although
not really.  This is sometimes measured by planting a tire at a slip
angle, then measuring the gradual force buildup as the tire is rolled
forward or the belt/drum is moved.  However, pure angular jerk in
itself is not really a useful thing to bother modelling and to my
knowledge is never tested.

Where did you hear about these tables that "look up the slip ratio
given longitudinal force" and so on?

Well, I've got a book here that has quite a lot of measured tire force
data.  In some cases, yes, there is a very, very slight drop off after
the peak in the dry.  However, I have seen no difference between
radials and bias tires other than the shapes of the curves leading up
to the peak.  Radials usually have a higher cornering stiffness and
peak at a lower slip angle, in general.  They also tend to roll off
more quickly into the peak, again, in general, which makes a tire feel
more like it's losing grip suddenly.  It's not, the force has just
stopped rising more suddenly, giving that impression.  Lots of folks
swear that a car actually accelerates when it runs off into the grass.
Of course it's not, but it feels that way.  Same principle.

These diagrams that you see in many books and web sites where the
radial tire hits a peak and then plummets off at a huge negative slope,
while a bias tire on the same graph stays pretty flat are just plain
wrong.  Doug Milliken, owner of the company with the link you referred
me to there, is the one that pointed this out to me right here at ras a
few years ago.  I couldn't verify it until only fairly recently, but it
appears that he's indeed right ;-)

Anyway, ask these people that post these goofy graphs where they got
the data for them.  They won't be able to tell you other than it came
from another book where the data didn't come from an actual tire test
either.

Plenty of this stuff in one of these books shows many street tires,
both radials and bias tires alike, tested out to 20 degrees with the
force still gently climbing.  One data extraction in another book
showed the force continuing to rise even at 28 degrees.  What force
drop off? :-)  I can't tell by looking at any of these graphs whether
the tires were bias or radial by simply looking at what happens after
the peak.  Usually because even at 15 or 20 degrees most of them have
still not even peaked.

Now, if you're talking about butyl *** or something else super
sticky, that's a little bit different story, but there's no reason why
NR and SBR compounds (typical for street tires) would drop off at
anything other than very extreme temperatures and really high speeds.
I.e., lock a wheel up and fry the contact patch or get it sideways at
150mph and then yes, you'll get some pretty significant force drop off,
but I've never seen any more than maybe 10%-15% or so under these
severe conditions.  I've even seen data measured that showed the force
climbing right out past 60% slip ratio on at least one tire.

Anyway, to keep this all on point, my argument was that radials and
bias tires are not really noticably different in terms of what happens
after they peak.  At least, not from any tests I've seen.  I'll be
happy to scan an example for you if you'd like.

The peak coefficient of friction also lower

Yes, tires exhibit what's called "load sensitivity."  This is true of
all tires at anything but the very lightest loads.

Todd Wasso

Basics of a car simulator

by Todd Wasso » Tue, 01 Nov 2005 19:14:51


> I'm not sure that this is a myth. Here is a link to a site that claims
> that the lateral force curve shape is affected by the normal force on
> the tire. At low loads, there is no drop off, but at higher loads there
> is somewhat of a drop off. The peak coefficient of friction also lower
> at higher normal forces, again according to this web site.

> http://www.racesimcentral.net/

One more thing...  Note that the peak effective friction coefficient of
the tire shown in the blue picture is astronomically high.  This a kick
***racing tire just about up to F1 grip levels.  From your link:

"The 300lb blue curve might represent the inside tyre. It has a high
co-efficient of friction, 2. Thus maximum lateral force is 2 times
vertical load. The 900lb curve might represent the more heavily loaded
outside tyre. The co-efficient of friction is less at 1.6 and therefore
the maximum lateral force is only 1.6 times vertical load.
"

1.6 to 2?  This is absolutely not a street tire *** compound.  The
grip is enormous, approaching twice what you get from a street tire
under similar loads, and yet the force curve doesn't drop off very much
at all, even at 1200 lb load (looks to be about a 5% drop, agree?  Yes,
it will drop more as you go past the test slip angle range shown of
course).  Take a look at the 300 lb load line, it's as flat as a
pancake after the peak.  Even at 600 lb the drop off is barely
noticable, not even 2-3% probably.  And these are the super sticky
tires that so many people insist should plummet after the peaks even
more so than "radials do."

Here's some more real, measured data, but this time from a few typical
street tires:

http://www.racesimcentral.net/

Now, can you tell whether the top two tires are radials or bias ply?
Me neither...  The bottom picture, however, shows an example of a
radial vs. bias.  See how the radial rises more sharply (higher
cornering stiffness), but then suddenly changes its slope at one point
as it progresses out toward its peak?  This is why a radial tire may
feel like it's loosing grip more suddenly than a bias tire and a driver
would call it unforgiving.  It's not unforgiving and snappy because
it's lost grip after the peak, but rather that *the rate at which it
was increasing* suddenly changed somewhere on the way up, whereas the
bias tire rolls off more progressively.  And again, this is taken out
well past 12 degrees and the forces are still clearly climbing on both
tires, just at different rates.  Most of the other radial tire data
from this source looks more like the bias tire line does; there's not
another example that shows such a sudden change in slope part way up
the line as in this picture.  I.e., in general the radials look very
much like bias tires.

The small picture at the top right is of two tires that have identical
tread widths, radii, and *** compound.  The only thing that's
different is the construction.  I.e., cord angles, perhaps the number
and arrangement of the plies, and so on.  Similar to what one might
expect when comparing a bias to a radial tire.  The shapes are very
different indeed, but they aren't losing force anywhere out to 14
degrees slip angle.  Again, once you get out there it's usually as flat
as a pancake, or perhaps there's a miniscule drop in grip way, way out
there.  But it doesn't look much different between the two
constructions out beyond the peak.

Also, in the lower graph, note the dashed line for "limiting friction."
 This seems to imply that the force assymtotically approaches that
line.  I.e., it won't actually hit it until you're well off the right
side of the graph on either tire.

Jeff Rei

Basics of a car simulator

by Jeff Rei » Tue, 01 Nov 2005 19:40:39

My fault, I stated the wrong terms, what I remember is that the inputs were
normal force, rear wheel torque (not longitudinal force), and velocity.

How do you determine the slip ratio then? It would seem that rear
wheel torque would be a factor here. If the tire started slipping, then
rotational acceleration would occur, with inertial momentum of the
entire drive train and tires, friction (including contact patch), and
throttle limited rpms of the engine. If the tires doesn't slip, then
there must be some relationship between applied rear wheel torque
and the actual longitudinal force applied to the road.

Why does driver induced understeer work (at least on some cars)? Turn
the front tires inwards enough, and the result is understeer, and this
seems to occur at relatively small slip angles (less than 15 degrees)
on some cars. I've confirmed that this works on a Trans Am (front
heavy car) and a Caterham (rear heavy car). I've also received
emails from a couple of club racers that use a bit of induced understeer
to stabilize otherwise oversteery situations (like very high speed
turns where a lot of power is applied to overcome aerodynamic drag).

Is this because of caster / camber effects?

Jeff Rei

Basics of a car simulator

by Jeff Rei » Tue, 01 Nov 2005 19:47:17

BTW, thanks for taking the time to educate at least me, if not
others reading this thread.

One issue is that most drivers would like a somewhat consitent
repsonse to steering inputs. With a sharp bend in the curve, it
must be more difficult to drive at the limits.

Jeff Rei

Basics of a car simulator

by Jeff Rei » Wed, 02 Nov 2005 03:09:16

The flywheel is attached to the crankshaft, the main driven part of
the motor, so it can be considered as driving the wheels through
the drive train.

I'm not sure of the shape of the curve, but a classic throttle opens up
valve(s) controlling airflow into the engine. At small throttle openings,
rpms will be low, even in a no load situation. At slightly larger opening,
rpms will be high, but below the limit set by the rev-limiter, under a
no-load situation, and under load, the rpms will be less, depending on
the load versus the torque from the engine. At larger still openings,
but less than full throttle, the engine will run at max rpms set by the
rev-limiter in a no load situation, and lower rpms depending on the
load. As throttle is increased from this point, torque from the engine
increased until the airflow versus rpm is at or beyond the optimal
point. Assuming an ECU with fuel injection, the ECU controls the
amount of fuel going into the engine to correspond with air flow
and throttle position.

The curve shown for torque versus rpm is almost alway the curve that
occurs at full throttle. At lower throttle settings, the torque curve
is lowered, with more of this lowering occurring at higher rpms.
As far as actual data, hopefully Todd can help here.

In some cars, the throttle is not mechanically connected to anything
other than a sensor. Intake opening, fuel flow, ... are all computer
controlled in this case. Such a setup could produce a situation where
torque output was relative to throttle position, up to the maximum
torque for the rpm the engine is running at.

This is what I'm not getting. Where do you get the velocity that
the engine is trying to create? This engine velocity is related to
the load on the engine. The higher the load, the slower the engine
rotates (assuming a fixed throttle position). The load is related
to the slip ratio, so where is the starting point for this
process?

Engine torque will be directly proportional to rear wheel torque,
minus losses in the drive train, if the rear tire is not spinning.
If the rear tire is spinning, then engine torque is accelerating the
rate of rotation of the drive train and rear tire.

My thinking is that throttle position and engine rpm determines the
torque the engine outputs. This torque is applied to the rear wheels
causing deformation of the tread surface near the contact patch,
with the result that the tread just before and across the contact
patch is compressed (and stretched just after the contact patch,
and  relaxed elsewhere, except for centritpital forces from high
rotation rate of the tires).

Ignoring "jerk" aspects, the flow of material (molecules per second)
past any cross section of the tread surface is constant. This
means compressed sections move slower than relaxed sections, and
stretched sections move faster.

I'm wondering if the force applied by the rear tires is relative
to the rear wheel torque divided by the "effective radius". By
"effective radius", I mean the actual radius times the density
of the relaxed tread surface divided by the density of the
compressed contact patch. The "effective" radius is smaller
than or equal to the tire's relaxed radius.

If this is true, then it would be an alternative to using slip
ratio to determine force generated by the rear tire, at least
when not moving or at very slow speeds.

Jeff Rei

Basics of a car simulator

by Jeff Rei » Wed, 02 Nov 2005 03:20:58

Here's a link that explains it better:

http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/drive/t...

Jeff Rei

Basics of a car simulator

by Jeff Rei » Wed, 02 Nov 2005 03:36:05

I forgot that the force is a combination of both adhesive and sliding
grip, so I don't think the deformation alone is enough.

Another link:

http://www.control.lth.se/documents/2003/gaf+03.pdf

Thomas Hart

Basics of a car simulator

by Thomas Hart » Wed, 02 Nov 2005 04:56:03

I'm sorry, I've started writing as though the structure my code is
taking were more tightly related to reality than it is. The "velocity
the engine is trying to create" is the (angular) velocity the wheels
would be turning at were they not in contact with anything, i.e. if
there were nothing slowing them down.

Within my code - currently using a simple Euler integrator - the
internal forces are accumulated generating the "velocity the engine is
trying to create" and then the external forces (i.e. those resulting
from tyre/floor interactions) are applied. So the state of the vehicle
is evolved over time and the starting point is "vehicle is entirely
static".

I apologise for the confusion!

-Thomas

Todd Wasso

Basics of a car simulator

by Todd Wasso » Wed, 02 Nov 2005 05:22:34


> > In simulators you don't know what the longitudinal force is until you
> > know what the slip ratio is.

> My fault, I stated the wrong terms, what I remember is that the inputs were
> normal force, rear wheel torque (not longitudinal force), and velocity.

> > How the slip ratio develops is another matter
> > of course.  But to predict it in a sim such as the OP wants to create,
> > you need to have slip ratio as an input, not an output.

> How do you determine the slip ratio then? It would seem that rear
> wheel torque would be a factor here. If the tire started slipping, then
> rotational acceleration would occur, with inertial momentum of the
> entire drive train and tires, friction (including contact patch), and
> throttle limited rpms of the engine. If the tires doesn't slip, then
> there must be some relationship between applied rear wheel torque
> and the actual longitudinal force applied to the road.

In simulating a car, what you'll do is calculate all these things in an
order that lets you solve for everything.  You would start off a
cycle/step using the car's position/orientation as it was at the end of
the last cycle/step.  Since you know the position/orientation and the
race track's geometry, you can calculate what the suspension deflection
at each end of the car is.  Given the deflection, you can calculate the
normal loads (either from the suspension geometry, like I do it, or
assuming a more simplified wheel rate exists).  You also at this point
know the camber/steer angles at all four wheels (if you're modelling
camber).

Next, you'd calculate the slip ratio, which is just 1 - the ratio of
actual to free rolling velocities at each tire.  You calculate the slip
angle as well.

The tire model will now PRODUCE the lateral/longitudinal forces from
these slip ratios/angles and the normal load that you got right at the
beginning of the step.

Next, you can add these forces to the car and wheels.  You don't move
anything just yet, however.

Following that, you'd now find the torques at the wheels and so forth.
That slip ratio produced a longitudinal force, which will create a
torque at the driven wheels (or any braked ones; rolling resistance
torque can be added to this too).  This is really a "road reaction
torque," i.e., it's the "other end" of the torque that is being fed
back through the drivetrain that's resists the engine speeding up, for
example.

Now, the total torque acting on the wheel is the sum of this "road
reaction torque" and any torque coming in from the engine/differential
or whatever you're modelling.  Here's the interesting part:

Now that you have the total torque acting on the wheels, you know their
angular accelerations.  You can now speed up or slow down the wheels'
rotational velocities based on their torques.  We can now move the car,
spin the wheels a little bit, and repeat this whole process for the
next step.  Every few cycles we render a graphics frame and voila, the
car moves.

On the very next step (step 2), the slip ratio is going to change just
as you described.  I.e., the vertical load, longitudinal force, and
tire radius CONTROLLED the acceleration of the wheel, so the new slip
ratio that you calculate will indeed fall right where it would in
reality.  So yes, the longitudinal and vertical forces, tire radius,
differential action and engine torque and so on are indeed controlling
how the slip ratio changes just as you described, but to really solve
for it properly you want to use slip ratio just as it's defined.
There's no need to precalculate anything and try to store slip ratios
as some sort of lookup value based on the other parameters.  It all
just works out if you use slip ratio as an input into the tire model,
then let the forces accelerate the wheels however they want.  On the
next step, the slip ratio will be right where it should be given all
those "other inputs."

Caster/camber effects can effect it, but in general caster effects will
reduce the induced understeer you're referring to.  Even without any
caster/camber effects you should still get induced understeer at some
point, especially if the center of gravity is low relative to the
wheelbase.  I.e., a low slung open wheeler should have the effect more
pronounced than a regular road going car would.

The reason it is occurs is because even after you've passed the peak of
the lateral force curve, as you continue to dial in more steering, the
amount of side force in the car's coordinate system (pointing straight
out the left/right side of the car) is getting progressively smaller.
I.e., if you steered the front tires to 90 degrees, the tires are
making plenty of "side force," but only in the tire's frame of
reference.  I.e., to the left/right of the tire plane there's a bunch
of force.  However, relative to the car, all this force is now pointing
towards the rear bumper.  Crank in 90 degrees of steering at the tires
and you'll stop the car in a real hurry as though you locked up the
front wheels.

The diagram below shows the same tire forces as the previous link
(tire1.JPG), but this time it shows it in the car's reference frame
instead of the tire's.

http://performancesimulations.com/files/tire2.JPG

The vertical axis is showing the amount of side force in the car's
reference plane instead of the tire's.  As the tire is being steered
further and further the lateral force in the tire's frame of reference
is increasing (the length of the straight line going up to the u=0.91
point is growing.  At some point it becomes constant (distance from the
origin to the line stays the same), but as you steer the tire further
and further that "side force" is pointing more towards the rear of the
car, leaving less for side force in the car's reference frame.  As can
be seen, if you steered the tire right out to 90 degrees, you have no
side force in the car's reference frame at all.

Consequently, the horizontal component of the force in the diagram is
the induced drag and is what slows you down more and more rapidly as
you steer the tire further.

The point where the line is drawn up to u=0.91 is where you'll get the
least understeer (maximum side force in the car's reference frame).
Any more or less than this and you'll get understeer.  Note that even
at this point the tires may not have even peaked yet, but you'll still
get the best performance on the skidpad at this slip angle.  With
street tires that peak at huge slip angles it could be expected that
the quickest way around the race track would actually be to operate
quite a ways below the peak force slip angle!  I covered that in an
LFSforum post recently.  Maybe I'll dig that up and provide a link.
You may remember this diagram too:

http://performancesimulations.com/files/steering3.JPG

Going back to the polar diagram again (
http://performancesimulations.com/files/tire2.JPG ), the induced drag
(horizontal axis) will cause forward weight transfer, and this will get
larger and larger as you steer out towards 90 degrees slip angle at the
front.  This will actually cause the entire plot to grow.  I.e., if you
steered a little bit past the u=.91 point, since you're increasing the
forward weight transfer you will get even more lateral force in both
the tire and car reference frames.  The higher the center of mass is in
relation to the wheelbase, the greater this effect will be.  So with
cars that have a really high center of mass, you'll probably not get
the induced understeer until you've really got a whole bunch of
steering lock dialed in.

Also, it should be noted that even if the tire lateral force NEVER
peaked at all, but continued to grow and grow right out to 90 degrees
slip angle, you would still get understeer at some point, so the fact
that the tires peak or perhaps fall off after the peak does not in
itself cause the phenomenon.  It will indeed effect when it happens,
but this tire behavior is not necessary for induced understeer to
occur.


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.