On Fri, 16 Aug 2002 20:12:08 +0000 (UTC), "Alex Smith"
>a) It is very slow at top speeds, for example at max revs it is only going
>about 15mph in top gear when previously it would go 90+
>b) There is no reaction torque into the driveline from the wheels
>I figure a) is because of using wrong inertia values which is making the
>angularAcc too big for the engine
>I have done as you have said Ruud and put in a clutch with
>T_Clutch = (engSpeed - [diffSpeed * gearRatio]) * factor
>where factor = (clutchAmount * maxClutchForce)
So how could A happen then? Debug that. ;-)
If engSpeed=maxRevs, and the car is driving 15mph, so
diffSpeed*gearRatio comes out at 15mph, surely the
(engSpeed-(diffSpeed*gearRatio)) calculation would not become 0?
In other words, if the engine rpm is high, and car speed is low,
T_Clutch will NOT be 0.
Should be easy to find where it goes wrong there.
Hm, I'd suggest summing ALL torques, and diving the summed torque over
ALL (effective) inertia. Don't do it piecewise.
In fact, I have a (bidirectional) tree of components, from engine ->
clutch -> gearbox -> diff -> wheel1 & 2. From the bottom or top you
can calculate effective inertia (by walking the tree up or down).
Every component has a gear ratio (make sure you get the direction
right), so it recursively dives into the tree, multiplying by
gearRatio^2 when it returns with the (total) child inertia. Something
like that at least. ;-) Be sure to check these things by hand or
different formula.
Combine everything. In my sim there's really 2 situations; either the
clutch is locked or not. Locking the clutch isn't strictly necessary,
but more stable.
Once locked, the entire drivetrain is one big rotating object, only
different parts rotate at different velocities because of gear ratios.
Once they go out of sync, you've got a problem. ;-) It happens because
of floating point roundoffs at least. That's why I think I just ignore
some velocities (like axle from gearbox to diff) and use the wheel
velocities to set that axle's velocity, if needed. Too much round-off
really.
I do get occasional moments where the engine speed != diffspeed (even
when the clutch is locked). Then I switch to unlocked clutch mode.
(note: every components is accelerated separately, so with all this
gearing going on, floating pt error is bound to happen).
In unlocked mode, you have 2 objects; pre-clutch (engine) and
post-clutch (gearbox, diff etc). You rotate these then independently,
with the clutch torque attempting to make the velocities equal. But
note that it can be seen as 2 bodies with their own effective inertia.
I have a separate 'ApplyAcceleration' type of function (abstract)
which then applies the acceleration to each component (depending on
gear ratio). Total acceleration = total summed torque / total
effective inertia.
Once you get velocity reversal (a very important concept which happens
everywhere in the digital carsim world), meaning the engine suddenly
is faster than the post-clutch part (or vice versa), you switch back
to locked-clutch mode.
Again, you could do without locked-clutch mode, but then you'd get the
same back & forth behavior as you do with wheel with slipratios that
keep switching from +10..-10. And even though that might seem to work,
I think the average behavior is not the same as the smooth behavior.
Like with a twitching wheel, the high SR's make for lower forces,
giving problems. Although for tires this only is a pain at low speed,
for engine-diff speeds this goes on at every RPM.
Still there seems to be a bug in that clutch torque generation.
Also make sure you have enough clutch torque; the engine braking
torque may be too high or something. Other than that, the clutch
torque should be somewhat higher than your engine's maxtorque (as
otherwise when flooring the throttle, your clutch would start to
slip).
Hope that helps,
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/