• This Website Is Not For Sale

# How is clutch modeled in Racer?

Discussion in 'Racer Physics and Technical' started by smr597, May 2, 2012.

1. ### smr597

Is it still modeled the primitive way like in racer 050 source?

I wrote a bit simplyfied version of the 050 source here, the ClutchCapacity is "max_torque" from car.ini clutch section.

The force calculation function:
Code:
```   clutchCurrentTorque = ClutchCapacity * ClutchInput;
cumulativeRatio = GearRatio * DifferentialRatio;

// In neutral gear the pre and post parts are always unlocked,
// and no clutch torque is applied.
if ( Gear = Neutral )
{
UnlockClutch();
clutchCurrentTorque = 0;
}

// Calculate current clutch torque (including torque direction)
if( Clutch = Not_Locked )
{
// Engine is running separately from the rest of the driveline.
// The clutch works to make the velocity of pre-clutch (engine) and
// post-clutch (rest) equal.
if ( EngineSpeed - GearboxSpeed * GearRatio )
ClutchTorque = clutchCurrentTorque;
else
ClutchTorque = -clutchCurrentTorque;
}
// else acceleration will be given by the driveline (engine rotates
// along with the rest of the driveline as a single assembly)

if ( Clutch = Locked )
{
// Check if pre and post are still locked
if ( Abs( EngineTorque - ( ReactionTorque + BrakeTorque ) ) > ClutchTorque )
{
UnlockClutch();
}
}
// else it will get locked again when velocity reversal happens
// of the engine vs. rest of the drivetrain (=gearbox in angular velocity)

if( IsSingleDiff() )
{
if( Clutch = Locked )
{
Torque = EngineTorque * CumulativeRatio;
}
else
{
// Engine spins at a different rate from the rest of the driveline
// In this case the clutch fully works on getting the pre- and post-
// clutch angular velocities equal.
// Note that if the clutch is fully depressed (engine totally decoupled
// from the rest of the driveline), this torque will be 0, and the
// postclutch driveline will just rotate freely.
Torque = ClutchTorque * CumulativeRatio;
}
SetDifferentialTorque( Torque, EffectiveInertia );
}
```
The integration function:
Code:
```  // Remember difference between engine and gear rotation
Difference = EngineSpeed - GearboxSpeed * GearRatio;
if ( Clutch = Locked )
{
// Check for the engine and gearbox (ratio'd)
// to rotate just about equally.
if ( Difference > DELTA_VEL_THRESHOLD )
{
// Unlock pre-post to let things catch up again
UnlockClutch();
}
}

// Engine
Engine_Integrate();
Gearbox_Integrate();

if ( Clutch = Not_Locked )
{
// Check if gearbox is catching up with engine
newDifference = EngineSpeed - GearboxSpeed * GearRatio;
if ((Difference > 0 AND newDifference < 0 ) OR (Difference < 0 AND newDifference > 0 ))
{
LockClutch();
// Force engine and gearbox velocity to be the same
EngineSpeed = GearboxSpeed * GearRatio;
}
}
```
The logics of a driveline:
Engine -> Clutch -> Gearbox -> Differential -> Wheel(Left/Right)

The GearboxSpeed is the physical calculation of driveline (wheels->differential->gearbox).
The EngineSpeed is one out of 2, the GearboxSpeed Or RotationalFrame(fake speed to represent engine speed when freely reving).

If the Clutch is Locked, EngineSpeed=GearBoxSpeed, correct.
If the Clutch is Not Locked, well there should be sliping and the forces should be mixed (GearBoxSpeed & Rotational frame) depending on the ClutchInput value ie. clutch sliping etc.

Well whats strange to me is that the driveline is always connected, the forces are always delivered to the differential in this model, while in real life when the clutch is not connected(fully pressed down), the engine and driveline run seprate...

So is this model still being used in racer or not? Visualy it gives satisfying results, atleast in racer 050 it did, but im not sure if thats real?

2. ### Alex Forbin

I seem to remember something about the clutch being changed after 0.50.
I do wish that Racers force calculations would include heat dissipation as well as force/counterforce since it is very central to a lot of other factors in a driving sim, for example...
Tires/clutches/brakes all generate heat as they slip and it affects their performance as well.
If you know how much heat the tires are generating you can base SA/traction / smoke and failure on it as well, the same hold true for the other things mentioned.
While you can fake this with other values ,why not just base it on total energy in / vs energy out?

Getting back on track, I think the driveline really needs a going over so that we can have true 4WD AWD as well as a more accurate clutch.

Alex Forbin

• Like x 1
3. ### Harey

Yeah my biggest grip is with having to fake 4wd, and the clutch does not feel at all right, most cars you barely lift up the pedal and then you'd pulled out the clutch too far.

• Like x 1
4. ### Alex Forbin

I found that setting the clutch linearity in the controls.ini as shown makes a world of difference in controlling the engagement.

Code:
```    clutch
{
axis=slider1
min=-1000
max=1000
button=-1
pov=-1
negate=1
make_analog=0
linearity=1.8 ; <-- This is the important part! :)
sensitivity_rise=5.000000
sensitivity_fall=50.000000
key=
}
```
Alex Forbin

• Like x 2
5. ### Mr Whippy

I'm beginning to think this is the route to at least having tyres do what we need them to do for post-limit behaviours.

Right now if I adjust b0 too high, then cars just over-steer all the time, steady-state, high speed, and are impossible or very hard to correct.
b0 too low, and the car becomes too stable. The tyres still skid, but when they do they result in very little loss of traction and so you just have fantastic stability no matter what you do.

If we could have the SR value 'generate' heat (could possibly script this soon!), then we could move the b0 coefficient up and down... that would mean at first slip a tyre gives you some forgiving nature, but if you let the slip continue it would rapidly propagate in b0 increasing and suddenly you would have to wind on lots of lock to correct it.

I'm not sure if that is right, but right now I get the total wheel spin super fun sideways action that is also hard to balance with b0 ~ 1.5 > 1.6, but then in steady state driving with no wheel spin the tyres are horribly sensitive. But then at b0 ~ 1.3 > 1.4 the tyres feel really nice in steady state, grippy, a limit you can lean on, but then when you push it too far they don't bite, ever.

I'm sat at around 1.45 ish now (for my particular pacejka) which I think is almost perfect vs most sims I drive, and games like GT5 etc... but it's ultimately a compromise.

I bet heat is the factor that would make that adjustment perfect for now. It'd at least get us having tyres that can be driven gently and feel solid, or pushed and have a wild limit... because right now both of those just can't be had without impacting the other.

Hmmmm

Dave

6. ### smr597

Thanks for the info dave, il try this out in my own sim soon, tires really are a part of hardcore physics in sims, anyway, can you tell me more about the slip rato and tire heat, how it should work, i can add tire heat but im not quite sure hows the correct method, i know logically the more you spin your wheels the higher the slip ratio so it will generate heat, but from what to where is what i am curious about, and the mathematical value itself. PM me if you are interested of testing my sim.

7. ### Mr Whippy

Hi there,

I'm not really sure how the heat should work.

I think the best thing to do is start a tyre off at ambient air temp. You will then have a heating and cooling coefficient.

Cooling will be a base value that errs towards ambient air temp based on current temp (say a factor like 0.995x per unit time)
And then a velocity multiplier to that coefficient, so when the tyre is moving faster it can cool faster (more air flow)?

Then you have heating, which you might say is just a function of combined slip, so sr + sa (both multiplied by a correction factor), and are added to the tyre temp!?

Then just adjust a2/b2 using that variable. Probably a nice polynomial curve so you get some grip boost when at an ideal temp, then curves off with increasing temp. Put limiters on the polynomial at certain points so it can't go too far either way.

Hmmm

Dave

8. ### camsinny

Don't you also produce a small amount of heat when just running the tyre? i.e. if you're driving in a straight line at 60kph you're not just cooling it...are you?

9. ### Mr Whippy

Just driving at 60kph will generate some heat yes, that is where your coefficients for the slip ratio will come in.
Just driving along the tyre generates a force to overcome aero drag and the tyre drag itself, and to generate that the tyre needs a slip ratio.

Obviously different tyres will heat/cool and give best grip at different temps, but that is where your coefficient tweaking and polynomial tweaking will come in.

Also you are only changing a2/b2 in my example, which would be an ok start, but ideally you'd change a wide range of coefficients.
Best to start small and get it working really nicely then expand though, rather than try do too much and do it badly.

Cheers

Dave

10. ### smr597

Hmm well i tried another method, a method FSR mentioned, but i dont know if its a good way to go, basically i am modifying optimal slip ratio and optimal slip angle, basically i have a linear curve with values like these:

Start
optimalSlip=0.11
optimalAngle=0.12
End
optimalSlip=0.12
optimalAngle=0.20

...and heat is the value that i go through these values, heat is generated from time and slipratio

But i quess its not the correct way anyways...
just tryed to get backward entry drifts to work.

11. ### camsinny

Ah, knew I should have paid attention in physics. Didn't know that's how slip angle behaved. Thanks!

12. ### Mr Whippy

Well, it's slip ratio AND slip angle... but mainly slip ratio in steady state driving.

Of course a bit of toe in/out and subtle yawing motions etc will all generate some heat.

Also, I suppose the carcass constant deformation will generate heat purely down to the rotational velocity of the tyre.
If you massage a tyre with no slip ratio or slip angle it'll still warm up!

Dave