[Car Physics] Turbochargers and friends

Started by
24 comments, last by bmarci 9 years, 2 months ago
Hi guys,

Does any of you have experience, idea or a good resource about turbo? Programming wise!

My first thought is to use the engine rpm/throttle position to approximate the amount of gas going out in the exhaust, and thus increasing the pressure in the intake part, maybe calculating some spin velocity of the turbines.
I don't have much clue if it's a linear function, or can I derive the power increase from the pressure.
The only useful figure I found was that the turbo increases the output torque by 30-40%


Some other question about lsd differentials. As far as I understand with clutch packed (eg. salisbury) the clutches provide the locking. All the docs I read assumed that when the torque bias ratio and preload were exceeded the diff opens and works as an ordinary open-diff, but I'm sure in this case the preload and clutches still work to lock the wherls. So there is no formulas to calculate this locking torque.

Also if I used some clutch friction just like in the gearbox, that would make the bias-ratio unneccesary, because it would be enough to check if the road reaction torques overcame the clutch torque.

Well, many confusion and white spots, but hoping for Kunos and the other experienced ones to pop up and enlighten my day ;)

thanks for any help and suggestion.
Advertisement

I think most games fake a turbocharger by just having a pressure readout and blow off valve flutter on gear change; the torque values are from a torque curve.

If you want a simple approximation, you could have two torque curves, one for the torque values with 0 turbo pressure, and another on top for what the turbo adds at maximum pressure, and have a simple spooling function.

If you are talking about the simulation of a turbo, simulating exhaust gases flow, and manifold pressures etc., I have no idea on how to do that but that is overkill for a game.

I'm busy but I will try to answer the other questions later if noone else does

Agree with KamilKZ, in the end the turbo only affect the torque and engine power output, so it should be as simple as having a different mapping of torque values for the different turbo conditions.

great, thanks.

I figured I'd make a simple model using the enginerpm to increase the pressure, and the throttle position could determine the max value.
using the pressure with a lookup curve could be enough for the torque increment.
As I guess, the valve blowoff is not related to shifting, but to releasing the throttle, is it correct?

when the valve opens, does the pressure drop to "zero", or to the amount that the engine can handle?

In netKar PRO I did it the "hard core" way.. had a turbo with its own RPM, inertia and so on.. exhaust spins the turbo, that produces pressure that goes into the engine. The relationship between torque and pressure is basically linear.. 2 bar = twice the torque, nothing complex there.

For Assetto Corsa things are much easier because the data to feed into the "complex" system I had in netKar is basically impossible to find.. so, at the of the day what you have is the max boost for a car and the amount of lag in the system.. which is how AC is modelling it.. much easier to get to the target result quickly and more effectively.

The blow off valve protects the engine intake.. when you close the gas you close the intake, but the turbo is still spinning and pushing air through the intake that now is closed or half closed.. this generates huge pressure that needs to be eliminated to avoid damage.. that is where the valve opens to relieve the pressure.

An easy way to model it is to have an amount of pressure that can be handled by the intake as function of gas pedal position.. if the pressure is higher than that.. the valve opens.

You are right about the clutch pack differential, it doesn't turn into an "open" diff.. the clutches are still engaged creating friction... it's just that the difference of torque in the system is bigger than the clutches friction and the diff starts to slip.. but it doesn't turn into an open diff.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

thanks Kunos,

I went for the simple solution thats looks nice at first.
Here are some feedback for others who are also interested in it;

params:
lagtime (time to reach max pressure)
boost (the torque amount to add)
valvetime (time to relief the pressure)

so using the throttle position and engine rpm, something like

pressure+=throttle*maxpressure*(rpm/maxrpm)*(timestep/lagtime)

torqueadd=GetEnginePower(rpm)*boost*(pressure/maxpressure)*throttle

An alternative solution seems reasonable because all technical charts show engine power curve with turbo, so defining the power decrease without turbo seems more practical.

Also opening the valve when pressure exceeded:

pressure>throttle*maxpressure

pressure-=maxpressure*(timestep/valvetime)

Now I'm not sure if the valve closes when the pressure is acceptable, but I do so. And some "dampening" to decrease the pressure that was "consumed" by the engine, so gently stepping off the gas will not open the valve.



Differentials:
Do diffs ALWAYS split torque in 1:1 ratio?
Is it possible for a middle diff to send more torque to the rear? If so, the axle speeds will always be different thus generating locking torque. Is it normal??

Differentials:
Do diffs ALWAYS split torque in 1:1 ratio?
Is it possible for a middle diff to send more torque to the rear? If so, the axle speeds will always be different thus generating locking torque. Is it normal??

Exactly, you can have different ratio, I actually call it bias and it's only used for awd differentials where you have a central diff that splits more of the torque to the back or front, as required.

Lets say an Audi R8 AWD has 30% on the front and 70% on the back, making it a bit oversteery and well balanced for the required situation. Basically you never want a 50/50 split AWD sports car, it will end up in a tree eventually. You always want some oversteer on sportscars to have the abilty to "play around". Wich imo reminds me if Audi R8 had an upen diff in the front and limited slip in the back, can somebody correct me?


As for turbos, I'm using a supercharger method at the moment, the same method that is used in rFactor1. It's about the same as you described, but I have some factors to define how much it spools for its power per rpm and how much torque it produces or decreases. If you didnt allready know then with turbos you can sometimes actually take power when you want to add power, usually heavily boosted cars have les torque on the lower rpm but as the turbo kicks in you gain more hp's ebcause the action happens at high rpm's. But this also adds torque after the turbo is spooled up.

Turbos are really fun and if you do them right then you get a huge improvement. I for example made a drift car and once I added my boost script it instantly made it a better drift car because you get a lot more action on engine output.

I hope this info was usefull, also how have things gone with your sim? I'm glad to see that you're still working on it!


You are right about the clutch pack differential, it doesn't turn into an "open" diff.. the clutches are still engaged creating friction... it's just that the difference of torque in the system is bigger than the clutches friction and the diff starts to slip.. but it doesn't turn into an open diff.

Ok, but it makes me confused, if I take the salisbury diff (everybody wants a Lotus49 :) )

I more or less understand the concept of the ramp angles and how to derive torque bias ratios, but there are still clutches that provide the locking, and when it comes to exact figures I feel lost.

Example:

The wheels have 100Nm and 300Nm road torques, that is 3:1 ratio, if we have a diff with 2:1 bias ratio, in this case it would "open".

And then with the same diff if the wheels have 20Nm and 60Nm, that is still 3:1 ratio, and would "open" again.

But, in the first case the clutches could resist 100Nm torque difference and in the second the same clutches slip at 40Nm difference.

Somehow I have problem with this :)


I for example made a drift car and once I added my boost script it instantly made it a better drift car because you get a lot more action on engine output.

What kind of tire model do you use?

Regarding drifting I have concerns about my tires, the combined-characteristic sometimes seems odd. Or am I crazy trying to drift a car with weight 58-60% at the rear?

When the tail breaks out, it's almost impossible to recover.

I tried with more slippery tires and it got much better, but it was useless for normal driving.


I hope this info was usefull, also how have things gone with your sim? I'm glad to see that you're still working on it!

Yes it was :)

Unfortunately I didn't have too much time recently but the development is still moving forward :)

To show-off a bit, here is a video. The car is a bit "nervous", maybe the 240deg wheel I have and set to a very-non-linear steering, I dont know...

At least the turbo is working, but the encoder ruined the red gauge pointers :/ And the valve blow sounds are in the engine-coast samples, no relation to the sim, don't get mislead :)


Or am I crazy trying to drift a car with weight 58-60% at the rear?

Oh man, yes you are biggrin.png drift cars are mostly 52-48 balanced.

As for diffs, I'm not sure If you got everything right here. I'd recomend over check things, I dont remember exactly how they were working, but the reference material I used thought me somethign different.

Tire model, belive it or not, I'm using the old pacejka89 tire model. And it gets driftign done pretty well.
You can try out my demo if youd like, https://www.dropbox.com/s/h69ochlmqdxbgwr/MoDyEn%20Bryce%20Canyon.rar?dl=0
If you want I can provide a quick drift setup to it aswell, or watch forza4 drift setup videos on the tube and apply the same to my physics.

Your video is awesome!!! I really love your work, it feels natural and youve got the tire sounds pretty nicely done.
Heres my video on the same track smile.png



I'll add a drift video to to show what the tire model is capable of.


You are right about the clutch pack differential, it doesn't turn into an "open" diff.. the clutches are still engaged creating friction... it's just that the difference of torque in the system is bigger than the clutches friction and the diff starts to slip.. but it doesn't turn into an open diff.

Ok, but it makes me confused, if I take the salisbury diff (everybody wants a Lotus49 smile.png )

I more or less understand the concept of the ramp angles and how to derive torque bias ratios, but there are still clutches that provide the locking, and when it comes to exact figures I feel lost.

Example:

The wheels have 100Nm and 300Nm road torques, that is 3:1 ratio, if we have a diff with 2:1 bias ratio, in this case it would "open".

And then with the same diff if the wheels have 20Nm and 60Nm, that is still 3:1 ratio, and would "open" again.

But, in the first case the clutches could resist 100Nm torque difference and in the second the same clutches slip at 40Nm difference.

Somehow I have problem with this smile.png

mah I don't really think about bias. I have an open diff, to make a salisbury I just calculate the slip between the diff cage and the arms and apply friction from the clutches based on that, it all works out by itself.

In your example, the reason why you'll have "only" 40Nm from the clutches is explained by the fact that, in order to have 20Nm+60Nm coming as reaction torque, it is likely your engine torque is also around that value.. thus the force trying to push the clutches against the housing is less than the force in your previous example with 100,300Nm... so it all balances out at the end.

BTW, great stuff both of you. Are you using some game engine for your things or custom code? Are you looking for a job perhaps? :P

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

This topic is closed to new replies.

Advertisement