Jump to content
  • Advertisement
Sign in to follow this  
jujunosuke

From Angular Velocity to rpm

This topic is 2308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

In my car simulation i have change a lot of settings and i am trying a new approach.
I try to simulate an Engine and then get the resulting speed of the wheels.

Here is what i have done so far, but i don't think that my engine_rpm calculation is correct..
I try to calculate it from the engine angular velocity.


var maxTorque = getTorqueCurve( getRPMEngine() ); //This function return a Torque at a given rpm ( rpm minimum is 1000 )

engineAngularAcceleration = maxTorque / getCylinderInertia( 1000, 0.5 );
engineAngularVelocity += engineAngularAcceleration * TIME_STEP;

var rps_engine = engineAngularVelocity * Math.PI * 2;
rpm_engine = rps_engine * 60;


Any help to clear this out would be welcome.
Thank you very much.

Share this post


Link to post
Share on other sites
Advertisement
What seems to be the problem? Do you have an example of a situation where that code produces a clearly absurd output?

And why did you call that variable `maxTorque'? Isn't it just `torque'?

Share this post


Link to post
Share on other sites
To convert from rad/s to rpm this is the macro I use:

#define RADS_TO_RPM(a) ((a)/(PI*2.0f)*60.0f)

So ya, your calculation is wrong.

Share this post


Link to post
Share on other sites
kunos is right:

var rps_engine = engineAngularVelocity * Math.PI * 2;

should be

var rps_engine = engineAngularVelocity / (Math.PI * 2);

But please use functions instead of macros.

Share this post


Link to post
Share on other sites
What seems to be the problem? Do you have an example of a situation where that code produces a clearly absurd output?[/quote]
I don't have totally strange output but, any wrong calculation will lead to wrong simulation of course...

And why did you call that variable `maxTorque'? Isn't it just `torque'?[/quote]
Yeah, This is just an example, in fact, i have some previous calculation with the variable torque, but anyway..

Thank you Kunos my master ! :D
And thank you alvaro.

I really appreciate both of your help !
Thanks again !

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!