Engine RPM and wheel angular velocity

Started by
80 comments, last by adriansnetlis 7 years, 11 months ago

Some of you may already know that I've been recently working on vehicle physics system. However, I faced with big problem once I started making RPM. Firstly, I am not sure for 100% how to calculate it. Currently I use this:


acc = torque / inertia
rpm += acc * delta_time

However, I'm not sure if this is correct. I also don't know how this all interacts with wheels, clutch and transmission. I also don't understand how to build it so that wheel angular velocity gets calculated correctly. But I need to find out all of that.

Advertisement

I would make engine RPM be some function of fuel flow or normalized throttle input. Maybe something linear where 0 throttle = 500rpm (idle) and a throttle of 1.0 = 5000rpm. You could then convert RPM to torque using some kind of mapping function, maybe use a datafile that defines the graph so you can have different types of engines. Here's an example image that I found showing RPM -> torque

MU-X+torque_curve.png

Once you have a torque value from your rpm value, then you need to apply your "transmission." Based on the current gear, maybe it's in reverse, you get a wheel revolution speed out of it and use that value to move your model. To implement a clutch, you would have a function before your transmission that could simply either pass through the torque value or pass a 0 when the clutch pedal is pressed.

I'm sure I'm missing a bunch of things, but does that help answer your question?

cheers,

Bob


[size="3"]Halfway down the trail to Hell...

You might want to study this first:

http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html

Engine<->Wheel transmission is a closed cycle with clutch, gear box and differential in between. Torque produced by the engine is transferred by transmission to wheel, where it changes wheel hub angular acceleration. Change in acceleration influence interaction with the road surface, which in return influences wheel angular acceleration and speed as a result. Wheel speed is what you pass back through the transmission to engine and calculate RPM from it. Change in RPM effects torque produced by engine and cycle repeats.

I would make engine RPM be some function of fuel flow or normalized throttle input. Maybe something linear where 0 throttle = 500rpm (idle) and a throttle of 1.0 = 5000rpm. You could then convert RPM to torque using some kind of mapping function, maybe use a datafile that defines the graph so you can have different types of engines. Here's an example image that I found showing RPM -> torque

MU-X+torque_curve.png

Once you have a torque value from your rpm value, then you need to apply your "transmission." Based on the current gear, maybe it's in reverse, you get a wheel revolution speed out of it and use that value to move your model. To implement a clutch, you would have a function before your transmission that could simply either pass through the torque value or pass a 0 when the clutch pedal is pressed.

I'm sure I'm missing a bunch of things, but does that help answer your question?

cheers,

Bob

Sorry Scourage, but throttle is more of a "blend" value. Typical EngineTorqueFromRPM function is indeed sampling of the torque curve by RPM value of the engine shaft. Throttle is just a multiplier of sampling result, it's value is between 0 and 1. IRL throttle is a bit more complicated but what it does is injects fuel into cylinders, without fuel injection, engine shaft will keep spinning, it just won't provide any torque and will slowly slow down because of the internal friction.

You might want to study this first:

http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html

Engine<->Wheel transmission is a closed cycle with clutch, gear box and differential in between. Torque produced by the engine is transferred by transmission to wheel, where it changes wheel hub angular acceleration. Change in acceleration influence interaction with the road surface, which in return influences wheel angular acceleration and speed as a result. Wheel speed is what you pass back through the transmission to engine and calculate RPM from it. Change in RPM effects torque produced by engine and cycle repeats.

Well, yeah, but - how to make it act correctly at diferent conditions? With different conditions I mean the transition between no clutch and full clutch. It's kind of obiovous that when clutch pedal is pressed you can't express engine RPM from wheels. Yeah, the way I calculate it works. But once I start releasing clutch pedal - either I have to set RPM to one expressed from wheels(resulting in imediate engine stall). If I knew exactly how to blend between both in a good way, it'd be already better(wheel rpm + (wheel rpm - engine rpm) * clutch doesn't seem to work exactly as needed). However, if I leave it to use engine calculations(just increase inertia as the transmission, differential and wheels adds it) than the RPM won't change much and the maximum speed will stay remaining at around 3 km/h.
Oh, and I don't know how to precisely calculate the turning resistance forces(I don't know how many are there in play, I know 2 - engine friction and rolling resistance). Also I don't know how to make a good throttle system that prevents from pointless skidding(resulting in around 5000% slip ratio) on startup since I don't have analog controller. I do apply throttle slowly(


if throttle < 1:
    throttle += 0.01
else:
    throttle = 1 # To ensure that it doesn't go above 1, e.g. 1.005

), however, this still doesn't help. Car drives at around 3 km/h at full 7500 RPM and doesn't even tend to accelerate. The wheel's spin crazy. I don't have any idea for any possible solutions.

:(

BoredEngineer,

Thanks for the link, that's a good article.

Cheers,

Bob


[size="3"]Halfway down the trail to Hell...

You might want to study this first:

http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html

Engine<->Wheel transmission is a closed cycle with clutch, gear box and differential in between. Torque produced by the engine is transferred by transmission to wheel, where it changes wheel hub angular acceleration. Change in acceleration influence interaction with the road surface, which in return influences wheel angular acceleration and speed as a result. Wheel speed is what you pass back through the transmission to engine and calculate RPM from it. Change in RPM effects torque produced by engine and cycle repeats.

Well, yeah, but - how to make it act correctly at diferent conditions? With different conditions I mean the transition between no clutch and full clutch. It's kind of obiovous that when clutch pedal is pressed you can't express engine RPM from wheels. Yeah, the way I calculate it works. But once I start releasing clutch pedal - either I have to set RPM to one expressed from wheels(resulting in imediate engine stall). If I knew exactly how to blend between both in a good way, it'd be already better(wheel rpm + (wheel rpm - engine rpm) * clutch doesn't seem to work exactly as needed). However, if I leave it to use engine calculations(just increase inertia as the transmission, differential and wheels adds it) than the RPM won't change much and the maximum speed will stay remaining at around 3 km/h.
Oh, and I don't know how to precisely calculate the turning resistance forces(I don't know how many are there in play, I know 2 - engine friction and rolling resistance). Also I don't know how to make a good throttle system that prevents from pointless skidding(resulting in around 5000% slip ratio) on startup since I don't have analog controller. I do apply throttle slowly(


if throttle < 1:
    throttle += 0.01
else:
    throttle = 1 # To ensure that it doesn't go above 1, e.g. 1.005

), however, this still doesn't help. Car drives at around 3 km/h at full 7500 RPM and doesn't even tend to accelerate. The wheel's spin crazy. I don't have any idea for any possible solutions.

:(

Forget about clutch at first. Pretend that you have an semi-automatic gear box. But you need gearbox to get proper relationship between RPM on engine and RPM on wheels.

Formula that I use to calculate RPM from the axle of the wheel:

RPM = (GearRatio * Differential * W * 60) / (2 * Pi)

W is angular velocity of the wheel axle. My first gear ratio is 1.15 and differential is 3.5. But you have to find realistic number for these constants with appropriate engine torque curve. Check that article I've linked earlier.

RPM goes into EngineTorque function, where it is clamped to some minimal RPM (each engine have it) and maximum RPM where spark is cut out and engine doesn't provide any torque, this is called "red zone".

Engine torque is multiplied by throttle, which is just 0..1 variable.

Now we need to calculate torque on axle. For this I use this formula:

DriveAxleTorque = EngineTorque * GearRatio * Differential * TransmissionEfficiency

TransmissionEfficiency is a constant (values between 0.6-0.9 should be good).

From DriveAxleTorque you can calculate angular acceleration of the wheel axle as Torque/MomentOfInertia which is easy to estimate as a cylinder for wheel hub and pipe for the axle. From angular acceleration of the wheel you get new wheel angular velocity, which you have to track on each simulation step. Torque just comes and go, but angular velocity is integrated on each frame.


But I need to find out all of that.

34/27 is the magic number (as i recall).

PV=NRT

under perfect combustion of oxygen and octane, you get 34 molecules (of CO2 and H2O) out for every 27 molecules (of O2 and octane) in.

T also goes up with each firing (and then back down a bit). the result is increased P (pressure).

F=P*A is the force on the piston. A is the area of the piston face.

F cos rod angle is the force on the crank. longer rods = smaller angle = more force. that's why "long rod engines pull harder coming out of the turns" as Smokey Yunick used to say.

Fcrank * stroke = torque (added by that piston).

Torque is transmitted along the drivetrain to the rear axles with some frictional loss. transmission gears and torque converters can multiply the torque.

.

so you have a torque at the rear axle.

force = torque * moment arm length. moment arm length is just the tire radius.

so shear force applied to the pavement is axle torque* tire radius.

assuming no slip, this is the f for your f=ma acceleration of the car.


It's kind of obiovous that when clutch pedal is pressed you can't express engine RPM from wheels.

rpm = f(load, throttle position)

more throttle = more rpm.

more load = less rpm.

load = f(vehicle mass, wheel slippage)

more mass = more load

more slippage = less load.

i used to spend my time in 1st year physics lecture figuring this stuff out while the instructor read the book for those who could not read for themselves.

and i have the 688 HP chevelle in my driveway to prove it. 688 hp, no turbo, no nitrous, no blower, no nothing, just twin 1150's, individual runner intake (like 8 one barrels), and the biggest intake runners and valves on the planet. 10.28 to 1 compression - just a mild dome on the pistons. .030 over 454 with a 1/4 inch stoke. makes a 3500 lb convertible a 9 second car. in a corvette body it would do 240 on the top end.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

You might want to study this first:

http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html

Engine<->Wheel transmission is a closed cycle with clutch, gear box and differential in between. Torque produced by the engine is transferred by transmission to wheel, where it changes wheel hub angular acceleration. Change in acceleration influence interaction with the road surface, which in return influences wheel angular acceleration and speed as a result. Wheel speed is what you pass back through the transmission to engine and calculate RPM from it. Change in RPM effects torque produced by engine and cycle repeats.

Well, yeah, but - how to make it act correctly at diferent conditions? With different conditions I mean the transition between no clutch and full clutch. It's kind of obiovous that when clutch pedal is pressed you can't express engine RPM from wheels. Yeah, the way I calculate it works. But once I start releasing clutch pedal - either I have to set RPM to one expressed from wheels(resulting in imediate engine stall). If I knew exactly how to blend between both in a good way, it'd be already better(wheel rpm + (wheel rpm - engine rpm) * clutch doesn't seem to work exactly as needed). However, if I leave it to use engine calculations(just increase inertia as the transmission, differential and wheels adds it) than the RPM won't change much and the maximum speed will stay remaining at around 3 km/h.
Oh, and I don't know how to precisely calculate the turning resistance forces(I don't know how many are there in play, I know 2 - engine friction and rolling resistance). Also I don't know how to make a good throttle system that prevents from pointless skidding(resulting in around 5000% slip ratio) on startup since I don't have analog controller. I do apply throttle slowly(


if throttle < 1:
    throttle += 0.01
else:
    throttle = 1 # To ensure that it doesn't go above 1, e.g. 1.005

), however, this still doesn't help. Car drives at around 3 km/h at full 7500 RPM and doesn't even tend to accelerate. The wheel's spin crazy. I don't have any idea for any possible solutions.

:(

Forget about clutch at first. Pretend that you have an semi-automatic gear box. But you need gearbox to get proper relationship between RPM on engine and RPM on wheels.

Formula that I use to calculate RPM from the axle of the wheel:

RPM = (GearRatio * Differential * W * 60) / (2 * Pi)

W is angular velocity of the wheel axle. My first gear ratio is 1.15 and differential is 3.5. But you have to find realistic number for these constants with appropriate engine torque curve. Check that article I've linked earlier.

RPM goes into EngineTorque function, where it is clamped to some minimal RPM (each engine have it) and maximum RPM where spark is cut out and engine doesn't provide any torque, this is called "red zone".

Engine torque is multiplied by throttle, which is just 0..1 variable.

Now we need to calculate torque on axle. For this I use this formula:

DriveAxleTorque = EngineTorque * GearRatio * Differential * TransmissionEfficiency

TransmissionEfficiency is a constant (values between 0.6-0.9 should be good).

From DriveAxleTorque you can calculate angular acceleration of the wheel axle as Torque/MomentOfInertia which is easy to estimate as a cylinder for wheel hub and pipe for the axle. From angular acceleration of the wheel you get new wheel angular velocity, which you have to track on each simulation step. Torque just comes and go, but angular velocity is integrated on each frame.

I know all of it. I used it ago, but some problems were obselete, for example, no working neutral gear. That tutorial was what I started with, but my goal is more realistic simulation. I already use Pacejka for it(clamped to prevent shaking on low speeds. Low speeds still use pacejka, but clamped.


But I need to find out all of that.

34/27 is the magic number (as i recall).

PV=NRT

under perfect combustion of oxygen and octane, you get 34 molecules (of CO2 and H2O) out for every 27 molecules (of O2 and octane) in.

T also goes up with each firing (and then back down a bit). the result is increased P (pressure).

F=P*A is the force on the piston. A is the area of the piston face.

F cos rod angle is the force on the crank. longer rods = smaller angle = more force. that's why "long rod engines pull harder coming out of the turns" as Smokey Yunick used to say.

Fcrank * stroke = torque (added by that piston).

Torque is transmitted along the drivetrain to the rear axles with some frictional loss. transmission gears and torque converters can multiply the torque.

.

so you have a torque at the rear axle.

force = torque * moment arm length. moment arm length is just the tire radius.

so shear force applied to the pavement is axle torque* tire radius.

assuming no slip, this is the f for your f=ma acceleration of the car.


It's kind of obiovous that when clutch pedal is pressed you can't express engine RPM from wheels.

rpm = f(load, throttle position)

more throttle = more rpm.

more load = less rpm.

load = f(vehicle mass, wheel slippage)

more mass = more load

more slippage = less load.

i used to spend my time in 1st year physics lecture figuring this stuff out while the instructor read the book for those who could not read for themselves.

and i have the 688 HP chevelle in my driveway to prove it. 688 hp, no turbo, no nitrous, no blower, no nothing, just twin 1150's, individual runner intake (like 8 one barrels), and the biggest intake runners and valves on the planet. 10.28 to 1 compression - just a mild dome on the pistons. .030 over 454 with a 1/4 inch stoke. makes a 3500 lb convertible a 9 second car. in a corvette body it would do 240 on the top end.

Hm... OK! Kind of interesting, but I don't understand for sure. It'd be great if you could like type down the equations in a local place and add explanation.

However, thanks for this information. Oh, by the way, imperical units confuse me:D


Hm... OK! Kind of interesting,

ought to be - its how it really works.


but I don't understand for sure.

don't know what to say, man, its just basic physics and chemistry,

PV=NRT (the gas law)

Force=Pressure*Area

torque=force*moment arm

force=mass*acceleration.

force in a given direction = projection of the force vector onto the direction vector. for force transmitted along connecting rod. note that this should be summed over the duration of the power stoke, so its actually a definite integral to determine average force.

check out "Physics" by Tippler. its will teach you everything you ever needed to know about physics.


Oh, by the way, imperical units confuse me:D

just convert to SI.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement