Car engine simulation questions

Started by
16 comments, last by Miksan 20 years ago
Yes you should. But I would decrease this timestep with this Euler integration to 1-2 ms to keep it stabler. With RK2 perhaps 3-4 ms would be ok yet. And with RK4 perhaps up to 8 ms. But this timestep is related to how huge the applied force or torque is. If it''s huger you should use smaller timesteps.
When your engine did not stop accelerating, it was due to the instability, I think.
And because of not writing this 0.05, your car accelerated too fast, 20 times faster than it should.
Advertisement
Yes you should. But I would decrease this timestep with this Euler integration to 1-2 ms to keep it stabler. With RK2 perhaps 3-4 ms would be ok yet. And with RK4 perhaps up to 8 ms. But this timestep is related to how huge the applied force or torque is. If it''s huger you should use smaller timesteps.
When your engine did not stop accelerating, it was due to the instability, I think.
And because of not writing this 0.05, your car accelerated too fast, 20 times faster than it should.
Ok, thanks a lot for your help

I''ve now implemented this engine system as a modular. I have separate classes for engine, clutch, gearbox etc...

Business is business and Moses is Moses
[Homesite]
Remember that torque is not a direct function of rpm, it depends more on throttle position than rpm. Im sure youre taking this into account though...

My thought for engine breaking was to have "negative" torque for whatever set of values of rpm and throttle position.
quote:Original post by Anonymous Poster
Remember that torque is not a direct function of rpm, it depends more on throttle position than rpm. Im sure youre taking this into account though...

My thought for engine breaking was to have "negative" torque for whatever set of values of rpm and throttle position.


Yep, this line here:
float engineTorque = maximumTorque * throttle;

I was just thinking how would this euler''s integration "instability" or "blowing up" affect the motor system? I really don''t get it where is it unstable? Or when might it blow up? (Revving too long too high, of course )



Business is business and Moses is Moses
[Homesite]
I'm trying to do the exact same thing. Would you mind letting me have a look at the code? I really suck at car physics and it would be good to see an example that works. I've tried using Marco Monsters tutorial but I can't seem to make a decent implementation.. you seem to be on the right track.

There really isn't any good info to be found. I wish someone would put up a tutorial with example classes for a 2d car physics engine. Everything is either 3D or really complex.

[edited by - Lightstrike on March 30, 2004 11:33:32 AM]
quote:Original post by Lightstrike
I'm trying to do the exact same thing. Would you mind letting me have a look at the code?


Did you mean me? Look at the first post. There's the first version I made, it lacks clutch though.

Or did you mean the one with all parts separated as classes? I'm not going to show anything yet That's because I've got something like three different solutions for it, and I don't know yet which of them works the best.

I have now implemented the engine, clutch, gearbox, differential and wheel parts. At the moment they all work in like 1-dimension, so differential only acts like it's coupled with one wheel

I haven't been doing anything with the driveline for past few days, because I got interested in doing some sort of sound system for the motor. It's a bit of pain in the ass, because I haven't ever done anything with sounds before. But I think it's going to be very cool if I get it working...

edit: Btw, Lightstrike, that Street Cars is way too cool Reminds me of GTA.

I'm also trying to implement a real engine behaviour - so that the engine will stall out if you get rpms too low. And to get it running, you have to use starter engine I thought this was unique, but I just tried Toca Race Driver 2... It has very cool engine behaviour.

Business is business and Moses is Moses
[Homesite]

[edited by - Miksan on March 30, 2004 2:39:09 PM]
quote:Original post by Miksan
Or did you mean the one with all parts separated as classes? I'm not going to show anything yet That's because I've got something like three different solutions for it, and I don't know yet which of them works the best.


Yeah, hehe okay. I finally understood some parts of the tutorial so I've managed to get started but I haven't reached the slip stuff yet.

quote:Original post by Miksan
I have now implemented the engine, clutch, gearbox, differential and wheel parts. At the moment they all work in like 1-dimension, so differential only acts like it's coupled with one wheel


hehe well thats cool too

quote:Original post by Miksan
I haven't been doing anything with the driveline for past few days, because I got interested in doing some sort of sound system for the motor. It's a bit of pain in the ass, because I haven't ever done anything with sounds before. But I think it's going to be very cool if I get it working...


yeah it is.. we actually got the sound engine 100% ready now and it feels great

quote:Original post by Miksan
edit: Btw, Lightstrike, that Street Cars is way too cool Reminds me of GTA.


Thanks.. I'm reworking the physics for it now. How did you know I was making it?

quote:Original post by Miksan
I'm also trying to implement a real engine behaviour - so that the engine will stall out if you get rpms too low. And to get it running, you have to use starter engine I thought this was unique, but I just tried Toca Race Driver 2... It has very cool engine behaviour.


yeah its a cool feature.. is there a demo out for race driver 2?

[edited by - Lightstrike on March 30, 2004 4:04:34 PM]

This topic is closed to new replies.

Advertisement