Advertisement

Limited Slip Differential Modelling

Started by August 03, 2019 03:12 AM
10 comments, last by Vu Chi Thien 5 years, 3 months ago

Hi fellow gamedevs.

Currently I'm working on a vehicle simulation. My goal is to have a sim that is as realistic as possible using as simple math as possible. 

My model is torque transferring model, which means the components are separated and will be given torque. Each will compute the speed and transfer the reaction torque to the other. For example: The engine produce torque, that torque is multiplied through the gear, then divided in the differential, then to the wheels. The wheels compute speed and traction force, apply force to the body then send back the reaction torque all the way to the engine, end of frame. Next frame the engine will use the reaction torque to compute net torque then pass that along the pipeline, beginning a new cycle.
With that model, I now have a simple open diff by simply constantly dividing the engine torque by 2 and give to the wheels equally. So leftWheelTorque = rightWheelTorque = engineTorque * 0.5f.
My problem now is to figure out the exact amount of torque from limited slip diff that will go to each wheel. I'm using this formula:
leftWheelTorque = engineTorque * 0.5f + diffTorque;
rightWheelTorque = engineTorque * 0.5f - diffTorque;

I can't find any formula to calculate the diffTorque (locking torque). Can somebody point me to what I need to do or what book/article I need to read? The stuffs I've read are just overview and not very suitable for programming. A book with a ready to use formula would be awesome.

Hi, in case you haven't done that already, probably the viscous is the easiest to simulate.

 

On 8/3/2019 at 5:12 AM, Vu Chi Thien said:

leftWheelTorque = engineTorque * 0.5f + diffTorque;
rightWheelTorque = engineTorque * 0.5f - diffTorque;

The diffTorque is calculated from the wheel's angular velocity difference and a coefficient value (some magic number) :)

diffTorque = (rightAngVel - leftAngVel) * viscousCoeff * 0.5f;

The *0.5f is because the total locking torque is split between the 2 axles.

 

You can get quite far with only viscous diffs, but if you are keen on digging yourself into fancy stuff, this is a good read:

http://www.intothered.dk/simracing/differential.html

 

Also, it's quite difficult to simulate full locking with only torques. The good old method is to identify when it's fully locked and simulate it as fixed axle.

Advertisement

Thanks for the help. I already am writing a viscous, but forgot that I need to times 0.5 until I read your reply :)

16 hours ago, bmarci said:

You can get quite far with only viscous diffs

There is one thing I don't quite get about viscous is locking percentage, say 25% is "weaker" than 40%, and 100% is a fully locked/spool. How does locking percentage translate to math equation relating to coefficient, and into something programming wise? I thing many sims/sim-arcade still use viscous, such as Gran Turismo Sport, Forza 7 and even Assetto Corsa.

16 hours ago, bmarci said:

Also, it's quite difficult to simulate full locking with only torques. The good old method is to identify when it's fully locked and simulate it as fixed axle.

But then multiple linked diff system will be a trouble, say AWD or 4WD since diffs are not necessary connected to wheels.

16 hours ago, bmarci said:

but if you are keen on digging yourself into fancy stuff, this is a good read:

Most of what I've read are similar to this, but the one thing in common that I don't understand is the phrase "x times the Amount of torque go transferred from slipping wheel to grippy wheel" . I dont know what kind of torque this is, the feedback/friction torque or the amount of engine torque to each wheel.

8 hours ago, Vu Chi Thien said:

There is one thing I don't quite get about viscous is locking percentage, say 25% is "weaker" than 40%, and 100% is a fully locked/spool. How does locking percentage translate to math equation relating to coefficient, and into something programming wise? I thing many sims/sim-arcade still use viscous, such as Gran Turismo Sport, Forza 7 and even Assetto Corsa.

The viscous never locks. The viscous coefficient is a sort of viscosity resistance of the oil in the "device". No physical meaning simulation wise. You can imagine it as this number increases the thickness of the oil in the coupling increases :)

And yes, if you choose a big enough number it can act as fully locked, but in practice it'll just generate too much locking torque (locking is a bad terminology here) that overshoots and the whole simulation becomes unstable/exploding if you are not lucky.

I'm pretty sure AC is dealing with many kind of diffs, but only @kunos can confirm that :D

 

8 hours ago, Vu Chi Thien said:

But then multiple linked diff system will be a trouble, say AWD or 4WD since diffs are not necessary connected to wheels.

In AWD/4WD usually viscous is the most common choice. If you define your diff as one input and two outputs, you can handle the middle diff as 2 other diffs connected to it's output instead of 2 wheels. You still have torques and angular velocities, technically no difference :)

 

8 hours ago, Vu Chi Thien said:

Most of what I've read are similar to this, but the one thing in common that I don't understand is the phrase "x times the Amount of torque go transferred from slipping wheel to grippy wheel"

Actually that torque never leaves the differential, so when you have a slippy and sticky wheels, their axles start to rotate at different speeds. If there is a mechanism, like some fluid or clutches that act between the axles (inside the diff) that extra friction torque is what you are looking for.

In my sim I only have spool and open diff, and some "extra" on top of them handling all LSD scenarios.
I hope I helped clarifying instead of confusing ;)

4 hours ago, bmarci said:

I hope I helped clarifying instead of confusing

You helped me a lot, I'm starting to get it now. :)

 

4 hours ago, bmarci said:

The viscous never locks. The viscous coefficient is a sort of viscosity resistance of the oil in the "device". No physical meaning simulation wise. You can imagine it as this number increases the thickness of the oil in the coupling increases

I think the locking percentage also apply to all kind of diffs not just viscous like I mistakenly said above. I remember it being the amount of torque being transferred around over the total amount of feedback torque.

4 hours ago, bmarci said:

I'm pretty sure AC is dealing with many kind of diffs

In AC there are only percentage of on-power and off-power so I mistakenly assume that it's viscous diff.

And so I started to get confused after understanding this:

4 hours ago, bmarci said:

Actually that torque never leaves the differential, so when you have a slippy and sticky wheels, their axles start to rotate at different speeds. If there is a mechanism, like some fluid or clutches that act between the axles (inside the diff) that extra friction torque is what you are looking for.

I can understand that the resistance torque of the diff is caused by the different in speeds, but I what I don't understand after reading all the writing on diffs is that: How can feedback torque from the road be transferred from one wheel to another? 

Let's do an example to clear things up. Let's say we have:

engineTorque = 200Nm

leftWheelFeedback = 100Nm (on tarmac)

rightWheelFeedback = 50Nm (on dirt)

The LSD has TBR of 2:1, so it is locking at the moment. The LSD first acts as an open diff, then add resistance torque:

leftWheelOut = engineTorque * 0.5 + diffTorque = 200 * 0.5 + diffTorque = 100 + diffTorque

rightWheelOut = engineTorque * 0.5 - diffTorque = 200 * 0.5 = 100 - diffTorque

Then what is diffTorque in this case?

Say another case. This time the right wheel is now on less grippy surface, so;

engineTorque = 200Nm

leftWheelFeedback = 100Nm (on tarmac)

rightWheelFeedback = 20Nm (on dirt)

The torque bias is now 5:1 so the LSD is unlocked. In this case, what will be the diffTorque? Where will the extra torque go?

Again thanks a lot for helping :)

Also there are 2 types of answer to the question of open diff, as I read on recs.auto.simulators:

1 - The torque is always split 50-50, feedback torque is total at both wheels:

leftOut = rightOut = engineTorque * 0.5

totalFeedbackToEngine = leftOut + rightOut

2 - Like you said, the torque is split 50-50, but feedback torque is 2 times the less grippy wheel, and extra difference is transferred to the less grippy one:

leftOut = rightOut = engineTorque * 0.5

feedBack = leftFeedback * 2 (let's say left wheel is less grippy)

leftOut += rightFeedback - leftFeedBack (transfer extra difference in feedback to less grippy wheel)

So which one is correct? I'm super confused about this, since both seems ok if I put them in the wheel on ice example :)

 

On 8/7/2019 at 5:01 AM, Vu Chi Thien said:

The LSD has TBR of 2:1, so it is locking at the moment. The LSD first acts as an open diff, then add resistance torque:

That's the point, when the LSD is locked it acts as a fixed axle, and that's it. When the TBR and preload are exceeded it starts acting as an open diff, and from the torque differences and preload you can calculate some torques :)

I may already referred to this page, but who knows, maybe not: http://www.racer.nl/tutorial/differentials.htm

 

On 8/7/2019 at 5:01 AM, Vu Chi Thien said:

2 - Like you said, the torque is split 50-50, but feedback torque is 2 times the less grippy wheel, and extra difference is transferred to the less grippy one:

leftOut = rightOut = engineTorque * 0.5

feedBack = leftFeedback * 2 (let's say left wheel is less grippy)

leftOut += rightFeedback - leftFeedBack (transfer extra difference in feedback to less grippy wheel)

So which one is correct?

I'd still vote on this one.

 

Advertisement
On 8/8/2019 at 2:17 PM, bmarci said:

I may already referred to this page, but who knows, maybe not: http://www.racer.nl/tutorial/differentials.htm

Thanks for the link. I haven't found this page until now. Very informative and cleared a lot of mist. Thanks :)

However, the part on open diff:

Quote

The engine torque is normally divided into 2 and goes to both axles (outputs). For example, if Te=100 Nm then the axles will both in principle receive 50Nm. The road will push back and these torques will lower the wheel acceleration (plus, this torque goes back to the engine)

 I think it refers to the first statement I stated above, where engine torque is divided evenly and feedback torque is the sum of both wheels:

leftOut = rightOut = engine * 0.5f;

feedbackToEngine = leftFeedback + rightFeedback;

And also:

Quote

Now the right wheel returns 160Nm. Does it stay locked? The bias ratio has increased to 160:100 = 1.6. The preload was 50Nm and the difference is now 160-100 = 60Nm, so this is also overcome. How much torque is used to accelerate the wheels away from eachother? 60-50 = 10 Nm.

Where would the extra 10 Nm go?

And the case when the diff locks:

Quote

Say you have a torque bias ratio of 1.5, and a preload of 50Nm. The engine is torque is set to 0 for clarity. The left wheel returns 100Nm of road reaction torque, the right wheel returns 150Nm. Does it stay locked? The bias ratio is 100:150 => so is 150:100 (bias ratio is always >=1) so 1.5. So it stays locked. Also, the preload is 50Nm, and 150-100=50Nm so it also stays locked due to preload.

then what would be the amount of diff locking torque? As in the formula: torqueOut = engineTorque * 0.5f +- diffTorque

Again thank you so much. I'm really nearly there, just this locking torque thingy and I will be done, with the diff at least, the clutch still bothers me :) 

7 hours ago, Vu Chi Thien said:

Where would the extra 10 Nm go?

That's the torque that the diff can not handle, half of it will go to one wheel, the other half to the other wheel with opposite sign. I'm not 100% sure if not the whole goes to the wheel with less resistance, I'll have to check it up :)

 

7 hours ago, Vu Chi Thien said:

then what would be the amount of diff locking torque?

It's quite hard to tell, and it depends on the friction of the clutch or whatever locking mechanism the diff uses.

If you want to calculate the torque that brings the 2 wheels at the same speed, is not that difficult after all;

ang_acc = torque / inertia
target_ang_vel = current_ang_vel + ang_acc * dt

Here you know everything except the torque, so reordering the equation can give you the amount of torque you are looking for.
Something like:
torque = ((target_ang_vel - current_ang_vel) * inertia) / dt

You can target to the average speed.

 

The only difficulty I see here is you have to simulate one step to get the current speed of the wheel before you apply locking torque.
Having applied that the wheel speed changes and that "invalidates" the tire forces and almost every parameters that you have just calculated :/ 

 

I haven't tried this method yet, though, maybe it works :)
Probably this is why most of us "cheat" by using a single state variable for locking and modify the wheel velocity by hand, like it was a simple fixed axle.

On 8/10/2019 at 7:07 PM, bmarci said:

I'll have to check it up

Please then, thank you for the answer :) 

On 8/10/2019 at 7:07 PM, bmarci said:

Having applied that the wheel speed changes and that "invalidates" the tire forces and almost every parameters that you have just calculated

I can see what you mean. In the end I still need to have an if statement to check the locking state, so I think I'm gonna cheat after all :)

How should I structure my diff class so it can directly modify wheel speed and also the speed of other diff? I'm trying not to directly reference other wheel or diff class, but instead trying to have a package that contains torque and get passed along the drivetrain 

16 hours ago, Vu Chi Thien said:

Please then, thank you for the answer :) 

Well yes, actually it "doesn't matter" if you split the locking torque in half or not, just results in different behaviour, sometimes it's hard to tell just by eyeball ;)
I do it, by the way. Also as I figured (couldn't get it confirmed by a professional, though) that the locking is not just instant, as the wedges move, the clutches get pressed against each other...etc. so it's more like a gradual thing, and you cannot relay only on whether it's locked or not. There is a state when it's "getting locked" :)

So what I did was, using the current bias ratio to weight the wheel torques, until they get locked. Something like this;

t_locking0 = (t_preload + abs(bias_ratio - curr_ratio) * (t0 - t1)) * 0.5

t_preload = preload torque of the diff
bias_ratio = the diff's pre-defined torque bias ratio
curr_ratio = the current ratio of the wheels' feedback torque (always >1)
t0, t1 = feedback torques from the wheels
t_locking0 = the torque transferred to the (first) wheel, the other wheel gets the same with opposite sign

 

17 hours ago, Vu Chi Thien said:

How should I structure my diff class so it can directly modify wheel speed and also the speed of other diff? I'm trying not to directly reference other wheel or diff class, but instead trying to have a package that contains torque and get passed along the drivetrain

The most simple way of doing that is something used in early racer (http://racer.nl/)
If you have a driveline component class which can be literally anything that rotates, and have your diff and wheels derived from that, you can simply just have references (pointers) to those components in your diff setup.
This way the outputs of a diff can be either a wheel, or an other diff, doesn't matter as long as it has SetAngularVelocity() or GetFeedbackTorque()...etc functions :)

This topic is closed to new replies.

Advertisement