The online racing simulator
Drivetrain math articles?
(5 posts, started )
Drivetrain math articles?
Moin!

tl;dr: see bottom.

Currently I'm working on a small truck simulation game. Its not really about racing but more about getting it to work nicely...
Now I have a very simple drivetrain working that has kind of a gearbox and rigidly connected engine (no clutch and engine inertia, "instant" gear changes)

The next stage shall have an independently simulated engine that allows idle revving and therefore also some clutch usage. A better gearbox has almost become a side effect. On the input side I can obtain the wheels' rpm and an approximated torque induced into the drivetrain by the vehicle's movement. For force output, I can apply a torque to selected wheels.

tl;dr:
Since my knowledge seems a little limited here, I'm looking for some reading on the subject. Can you recommend articles or books especially concerning the drivetrain?
On one hand, I have looked into the university's lectures, but there its more about everything else (tyres, brakes, suspension, aerodynamics). On the other hand, everything I found on the web were really detailed engine simulation suites...
There isn't much to the drivetrain that's not covered in other game components, the speeds are just basic maths and the forces are handled by the physics engine the same way any components mass and direction are handled. Any open source vehicle sim's code will give good examples, there are many, I found vdrift's code base easy to get to grips with YMMV.

EDIT. If you mean engine characteristics its often done with the torque/rpm values for various rpm in a vehicle config file, think LFS uses a formula to produce a torque curve though.
I have a torque curve available, thats not the problem (there's fairly much documentation on Mercedes truck engines).
The problem is more about merging all the forces which cannot be done using the physics engine from what I know yet. Its the clutch part: taking the input force (moving vehicle's torque induced through the wheels), calculating it's effect on the engine and then going that way back: engine output torque -> gearbox -> wheels.

The latter (output) part is the one I seem to have gotten right. Putting input forces together with the engine and figuring out how I could model the clutch (-> fixed wheel-engine rpm ratio when closed) seems to be a little harder though. Maybe thats just the black magic part every game gets it's uniqueness from?
You can do the whole thing without using the physics engine, the maths are simple enough, but it has to link in with the environment somewhere and its as well to have it the option of rotating components affecting the vehicle dynamics from the beginning plus most physics engines built in functions simplify the maths.

Throttle opening gives a percentage of torque derived from RPM, clutch allows a percentage of torque from engine to gearbox, torque is multiplied by gear ratio, resulting torque is divided by final drive, split by the diff and sent to the wheels. Sounds like this is the point your connecting to the physics engine, the next physics clock should give you the new wheel speeds to run the whole lot back and get the new engine RPM.

Throttle opening isn't simply a torque percentage, it should be a torque curve of its own but that's an almost perpetual situation as you would need to write an engine simulator, simply using the percentage of torque and max RPM would be enough to get started, negative torque output after max RPM otherwise no engine braking. If engine inertia isn't applied then you get no progression, the engine either sits at max RPM or syncs with wheel speed, when inertia is calculated it can be taken into account with RPM to modify clutch output. Then the physics engine gets into a big fight with your inertia calcs and throws the whole truck in the air
Quote from Tanuva : Its the clutch part: taking the input force (moving vehicle's torque induced through the wheels), calculating it's effect on the engine and then going that way back: engine output torque -> gearbox -> wheels.

You sound like you're currently simulating the rotation of the drivetrain as a fixed piece. This is fine for normal conditions. When you need the clutch to slip, simply start simulating their rotations separately. Engine speed is dictated by output torque vs clutch torque, while the drivetrain speed is dictated by clutch torque vs the resultant torque generated by the combined longitudinal forces of the tyres in the driven wheels.

If you have more specific questions, just ask. I'll subscribe to this thread.

Drivetrain math articles?
(5 posts, started )
FGED GREDG RDFGDR GSFDG