Jump to content
  • Advertisement
Sign in to follow this  
jujunosuke

Defining car speed relative to rear wheels rotation

This topic is 2540 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 !

I have a comprehension problem when i want to define the car speed in my simulation.
Lets make it simple :
There is 0 slip and the car should go as fast as the rear wheels rotation goes.


TorqueEngine = 200;

TorqueDrive = TorqueEngine * gearRatio * differentialRatio * transmissionEfficiency;
ForceDrive = TorqueDrive / WHEEL_RADIUS;

rearWheelsAngularAcceleration = TorqueDrive / (getCylinderInertia( 75, WHEEL_RADIUS) * 2);
rearWheelsAngularVelocity += rearWheelsAngularAcceleration * TIME_STEP;

acceleration = ForceDrive / mass;
velocity = velocity + (TIME_STEP * acceleration);
position = position + (TIME_STEP * velocity);


What i don't understand is the fact that we calculate the acceleration with the ForceDrive / mass...
But the rearWheels rotation depend of the inertia... ?

In my simulation, how can i get the wheel turn in a realistic behavior compared to the car speed ???
Right now, too slow or too fast... (It depends on the amount of inertia i set)...

I am a little bit confuse.
Any help or comment would help a lot.

Thank you very much for any answer.
Regards.

Share this post


Link to post
Share on other sites
Advertisement
nope, that's not the way to do it. Here's a simple breakdown of the process you need to simulate:

- Engine accelerates the wheels and you are doing it right.
- Wheel relative speed with respect to the ground (slip) generates longitudinal forces.. according to whatever slip/force relationship you have (paecjjka? brush? lookup table?)
- Longitudinal forces accelerate the car and SLOW down wheel / drivetrain and engine

Share this post


Link to post
Share on other sites
Hey Kunos !

Some times ago, i made a post to get a simple 2D car simulation and made it work. (I remember you was also joining the thread ;) )
Previous Car demo

But in my previous simulation pacejka was not implemented and the wheels was just following the car speed. (0 slip).


Now, i am back for more and i would like to add pacejka LONGITUDINAL formula to get a more interesting result. (I don't need pacjka lateral because its only a straight line sim at the moment...).
But i can't understand where to put the formula ? what is the timing ?

I need to know the back wheels angular velocity + the car velocity to get the slip ratio right ?

Hum, i really have trouble to understand here...

The car SLOW down the wheels ???

Share this post


Link to post
Share on other sites


The car SLOW down the wheels ???


No it is not the car. It is the longitudinal force generated by the tyre at the point of contact. This is acting on the wheel center moving it forward (or backward) but it is also creating a torque around the wheel axis that gets transfered to the drivetrain and engine. Draw a wheel on a paper, apply a force at the bottom of it and it will be easy to visualize the torque that will try to slow down wheel, drivetrain and engine.

If you disregard this torque (in my code this is called "feedback torque") the engine will always accelerate VERY fast regardless of the car weight, the only variable controlling how fast the engine (and thus, wheel) will rev up is the wheel inertia.. and that, of course, can't be true.

Share this post


Link to post
Share on other sites
Hi kunos, thank you for taking time to reply.
I understand what you mean.

To recap, if i disregard this torque, its like my car weight was like 0kg right ?

If i understand, the car weight is the load on the tire for Pacejka curve ? (Is half of the car weight a good value for the rear wheels ?)
And the pacejka curve will give me the resulting feedback torque ?

Is something like this correct ?(One more time i would like to ignore the slip for the moment).


//We get the Forcedrive first
TorqueEngine = 200;
TorqueDrive = TorqueEngine * gearRatio * differentialRatio * transmissionEfficiency;
ForceDrive = TorqueDrive / WHEEL_RADIUS;

Then we divide the Force by the mass of the car
CarAcceleration = ForceDrive / (mass/2);

TorqueFeedback = CarAcceleration * WHEEL_RADIUS;

TorqueTotal = TorqueDrive + TorqueFeedback;
rearWheelsAngularAcceleration = TorqueTotal / (getCylinderInertia( 75, WHEEL_RADIUS) * 2);
rearWheelsAngularVelocity += rearWheelsAngularAcceleration * TIME_STEP;



**EDIT**
in my code this is called "feedback torque"[/quote]
You made a tutorial somewhere ?

Share this post


Link to post
Share on other sites

Hi kunos, thank you for taking time to reply.
I understand what you mean.

To recap, if i disregard this torque, its like my car weight was like 0kg right ?

If i understand, the car weight is the load on the tire for Pacejka curve ? (Is half of the car weight a good value for the rear wheels ?)
And the pacejka curve will give me the resulting feedback torque ?

Is something like this correct ?(One more time i would like to ignore the slip for the moment).


//We get the Forcedrive first
TorqueEngine = 200;
TorqueDrive = TorqueEngine * gearRatio * differentialRatio * transmissionEfficiency;
ForceDrive = TorqueDrive / WHEEL_RADIUS;

Then we divide the Force by the mass of the car
CarAcceleration = ForceDrive / (mass/2);

TorqueFeedback = CarAcceleration * WHEEL_RADIUS;

TorqueTotal = TorqueDrive + TorqueFeedback;
rearWheelsAngularAcceleration = TorqueTotal / (getCylinderInertia( 75, WHEEL_RADIUS) * 2);
rearWheelsAngularVelocity += rearWheelsAngularAcceleration * TIME_STEP;



**EDIT**
in my code this is called "feedback torque"

You made a tutorial somewhere ?
[/quote]

hya.. sorry for the long time to answer.. it has been relocation time and I am finally settling in tongue.gif

Your code is a huge oversimplification of the situation, it's difficult to understand if the implications of that simplification are clear or not to you.. For example you are still assuming that the inertia of the drivetrain seen from the engine is the same as the inertia seen from the wheels... which isn't the case because the gear and final ratios involved.
Calculating inertias for geared components can be tricky.. I suggest you to google for a nice math rundown from Ruud Van Gaal about this matter, or get yourself a copy of the car dynamics book by Gillespie that goes through this stuff a bit.

Sadly no, I never had the time to write a tutorial on these stuff.. sad.gif too busy coding.

Share this post


Link to post
Share on other sites
Hey kunos, thank you for following my thread.

I decided to rethink my code and adopt a new strategy..

After reading a lot of documentation about the traction force (I think this is what is missing in my code now) and pacejka.
But there is still something that i don't understand.


My longitudinal Pacejka return a number between 0 and 1. (Is it supposed to be correct ?)
Then, i do not really know what to do with this output.. Every articles i read say that Pacejka return a force.

What force does it return ? Traction Force ? How do i calculate this traction force if my output is between 0 and 1 ?

Share this post


Link to post
Share on other sites
Guys, that ain't rocket science after all. If you have 0 slip, then the linear velocity of the point of the wheel touching the ground is zero, and that's enough to work out a kinetic model.

Share this post


Link to post
Share on other sites
Surely if you have the velocity of the car, the angular velocity of the wheel, assuming no slip, should just be the magnitude of the car velocity, divided by the circumference of the wheel?

Share this post


Link to post
Share on other sites
Guys, that ain't rocket science after all. If you have 0 slip, then the linear velocity of the point of the wheel touching the ground is zero, and that's enough to work out a kinetic model. [/quote]

Surely if you have the velocity of the car, the angular velocity of the wheel, assuming no slip, should just be the magnitude of the car velocity, divided by the circumference of the wheel? [/quote]

I a sorry my first post was not clear.
Probably because i am not English native.

In fact, my question was not a kinetic problem, but i was trying to understand how to calculate the good way of calculating wheels rotation speed/
Then Kunos told me that the way of doing my calculation was not correct. He also suggest me to take the Friction force in consideration.

So, i still do not understand how to deal with the Pacejka longitudinal and how to use it correctly in my program.

As i said, before, the force returned from pacejka is between 0 and 1. I still don't know if it is a correct way of returning the friction force and how to deal with it...
May i have some more explanations ?

Sorry again in my first topic was confusing.
Regards.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!