Modeling a drivetrain

tanuva
Posts: 5
Joined: Wed Aug 10, 2011 9:37 am

Modeling a drivetrain

Post by tanuva »

[After typing this I noticed the BulletVehicle (Panda3D terminology) is called btRaycastVehicle in cpp...]

Moin!

I'm trying to model the drivetrain for a BulletVehicle. This is not going to be a race car but rather a truck. ;) I thought of having the engine's internal inertia simulated as a moving object with a specified mass that is accelerated or braked as gas and load changes. The engine should be able to keep itself at idle rpm by accelerating automatically against a coast torque curve. Now acceleration looks quite simple: Tell the engine to accelerate (gas = 1.0), poll current torque output and apply it (after some gearing) to BulletVehicle.applyEngineForce() [0].

The problem is doing it the other way round: when gas = 0.0 but the clutch stays closed, the engine obviously doesn't drop to idle rpm but is being pushed by the rolling vehicle. To achieve that, I need the torque (force? see [0]) currently generated by the vehicle, don't I? BulletVehicle doesn't offer a function for that, I can just get a wheel's current rpm.

Do I have a fundamental error here or can you point me at how I could model this?

[0]: BulletVehicle.applyEngineForce(..) is named "Force". Is this really a linear force or rather a torque applied directly to the wheel?
jauthu
Posts: 12
Joined: Tue Feb 28, 2012 7:34 pm

Re: Modeling a drivetrain

Post by jauthu »

It seems that applyEngineForce is the force that goes directly to the wheel, so your last guess is right(for me). All the gearbox/drive/differential stuff is up to you.

Also, there is no friction/aerodynamics slowdown when goung forward, so you need to add them also.

To achieve different friction calculations on different surfaces take a look at this http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=3751. (lost amount of time with that, so maybe you'll find it useful).
tanuva
Posts: 5
Joined: Wed Aug 10, 2011 9:37 am

Re: Modeling a drivetrain

Post by tanuva »

jauthu wrote:It seems that applyEngineForce is the force that goes directly to the wheel, so your last guess is right(for me).
Thats good to know, thanks.
jauthu wrote:All the gearbox/drive/differential stuff is up to you.

Also, there is no friction/aerodynamics slowdown when goung forward, so you need to add them also.

To achieve different friction calculations on different surfaces take a look at this http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=3751. (lost amount of time with that, so maybe you'll find it useful).
I'm aware that there's no friction etc., thats why I'm wondering about all this. The main problem is currently to get the vehicle's dynamics to influence the drivetrain back into the engine.

To approximate the inertia of the vehicle (What I want to find out atm), I could probably take the vehicle's speed and combine that number with it's mass and at least the associated rigid bodies that I can find easily - payload via ghost node on the cargo area and I know about connected trailers anyway... That might do the job for now.