I said it would be in another post, so here it is!
Not modelling differentials. I'm calculating the angular velocity of the
wheels thus:
FZ = weight on that wheel (uses weight transfer)
Driven Wheels:
angularAcc = { (totalTorque) / radius} / (FZ/GRAVITY)
where totalTorque = (-resistanceForce * radius) + (engineTorque *
gearboxReduction * radius) + (-brakeForce * radius)
angularVel += angularAcc * deltaTime
Undriven Wheels: I am assuming they are rolling at the same speed of the
car
angularAcc = carAcc
angularVel += angularAcc * deltaTime
However I am not sure how correct this is as there is no reference to how to
calculate angular velocity. And effects like applying brakes should lock
just the driven wheel in this case
(as an undriven wheel doesnt account for brake forces in the above
description, it is just the speed of the car)
, and it does. However, if I release the brake, the wheel should roll again,
but does not take into
account the speed of the car, so it does not roll along, it stays locked.
There is obviously error in the calculation, and I must be missing out some
things.
Using the relaxation length approach to calculating slip ratio, the car
starts and stops, I am assuming (and
hoping) that it is due to a problem with this calculation.
Please help! Thanks! I know I can rely on you guys!
Hi Alex,
right, onto the questions then :)
On Wed, 10 Apr 2002, Alex Smith wrote:
This is not as relevant, but there's a slight error in the first
equation. The value you should divide by is the effective moment of
inertia on that wheel, not FZ/GRAVITY. That moment is quite difficult to
calculate since it is a joint contribution from all the parts linking to
the wheel (not to mention that the diff makes matters even more complex),
but let's for now assume that only wheels contribute as we want the stuff
to get rolling first, right :)? A typical total moment of inertia MOI for
a wheel is of the order of magnitude 1 kg m m, so that might be the value
you should use for now. The rest seems quite alright, though, although one
would typically define not a brakeforce but a braketorque, but that's just
a matter of definitions.
>
> Undriven Wheels: I am assuming they are rolling at the same speed of the
> car
> angularAcc = carAcc
> angularVel += angularAcc * deltaTime
>
Do not assume too much. Treat them exactly as the driven ones, but do not
put any engine torque to them. It is true that for the most part this
approximation is quite correct, but I believe this might be the problem
for your calculations.
What you will also notice is that it's hard to define the braking force
for when the wheel is locked, much like in the case of a tyre force at
rest. But for now, let the braking force (torque) just point the opposite
to the angular velocity, as all this will induce will be a slight
oscillation of locked wheels (hopefully :) ). I believe this will for the
most part help with the problems described bellow.
Caution: you might need to increase the frequency of physics updates once
you plug the moments of inertia in, as this tends to make the wheels adapt
very quickly.
You can rely on us, but only if you really trust us (I wouldn't be so
certain myself ;) ).
-Gregor
Quoted text (12 lines)
> I said it would be in another post, so here it is! > Not modelling differentials. I'm calculating the angular velocity of the > wheels thus: > > FZ = weight on that wheel (uses weight transfer) > > Driven Wheels: > angularAcc = { (totalTorque) / radius} / (FZ/GRAVITY) > where totalTorque = (-resistanceForce * radius) + (engineTorque * > gearboxReduction * radius) + (-brakeForce * radius) > > angularVel += angularAcc * deltaTimeQuoted text (17 lines)
> However I am not sure how correct this is as there is no reference to how to > calculate angular velocity. And effects like applying brakes should lock > just the driven wheel in this case > (as an undriven wheel doesnt account for brake forces in the above > description, it is just the speed of the car) > , and it does. However, if I release the brake, the wheel should roll again, > but does not take into > account the speed of the car, so it does not roll along, it stays locked. > > There is obviously error in the calculation, and I must be missing out some > things. > Using the relaxation length approach to calculating slip ratio, the car > starts and stops, I am assuming (and > hoping) that it is due to a problem with this calculation. > > Please help! Thanks! I know I can rely on you guys! >
Gregor Veble <[email hidden]> wrote in message
news:[email hidden]...
> A typical total moment of inertia MOI for
> a wheel is of the order of magnitude 1 kg m m, so that might be the value
> you should use for now. The rest seems quite alright, though,
hmm, not quite sure I understand the units.
> Do not assume too much. Treat them exactly as the driven ones, but do not
> put any engine torque to them. It is true that for the most part this
> approximation is quite correct, but I believe this might be the problem
> for your calculations.
In my implementation (which is wrong :), the undriven wheels have no forward
torque
as they are not driven by the engine which is why the only way I can make
them
rotate is by setting the angularVelocity directly, not calculating it by its
torque.
Am I giving the wheel a torque due to the car accelerating?
In that case would I need a special case in the wheel.getTorque() function
like
if (wheel is not driven)
torque = carAcceleration * wheel.load/GRAVITY * radius [or
inertia :)]
??
> What you will also notice is that it's hard to define the braking force
> for when the wheel is locked, much like in the case of a tyre force at
> rest. But for now, let the braking force (torque) just point the opposite
> to the angular velocity, as all this will induce will be a slight
> oscillation of locked wheels (hopefully :) ). I believe this will for the
> most part help with the problems described bellow.
I can get the wheels to lock, but when I want them to start rolling again
by releasing the brake, it doesn't because there is no torque related to how
fast
the road is moving beneath it. However if I add this torque to the driving
torque,
the car would shoot off (?)
aaaAAAArgh! Maybe I should just start my wheel model from scratch again :(
Get the torque from the ground...keep deriving the slip ratio.. the wheel
will be slower than the ground and will generate a Fx... but then u have to
feedback that Fx into the wheel again.. opposite direction... and it'll
become a positive torque..and there it is your wheel accellerating to keep
up with the ground...
I hope this'll help.
Stefano Casillo
"Alex Smith" <[email hidden]> wrote in message
news:a91tr5$o76$[email hidden]...
>
> Gregor Veble <[email hidden]> wrote in message
> news:[email hidden]...
>
> > A typical total moment of inertia MOI for
> > a wheel is of the order of magnitude 1 kg m m, so that might be thevalue
> > you should use for now. The rest seems quite alright, though,
>
> hmm, not quite sure I understand the units.
>
> > Do not assume too much. Treat them exactly as the driven ones, but donot
> > put any engine torque to them. It is true that for the most part this
> > approximation is quite correct, but I believe this might be the problem
> > for your calculations.
>
> In my implementation (which is wrong :), the undriven wheels have noforward
> torque
> as they are not driven by the engine which is why the only way I can make
> them
> rotate is by setting the angularVelocity directly, not calculating it byits
opposite
> > to the angular velocity, as all this will induce will be a slight
> > oscillation of locked wheels (hopefully :) ). I believe this will forthe
> > most part help with the problems described bellow.
>
> I can get the wheels to lock, but when I want them to start rolling again
> by releasing the brake, it doesn't because there is no torque related tohow
Quoted text (14 lines)
> torque. > Am I giving the wheel a torque due to the car accelerating? > > In that case would I need a special case in the wheel.getTorque() function > like > > if (wheel is not driven) > torque = carAcceleration * wheel.load/GRAVITY * radius [or > inertia :)] > > ?? > > What you will also notice is that it's hard to define the braking force > > for when the wheel is locked, much like in the case of a tyre force at > > rest. But for now, let the braking force (torque) just point theQuoted text (8 lines)
> fast > the road is moving beneath it. However if I add this torque to the driving > torque, > the car would shoot off (?) > > aaaAAAArgh! Maybe I should just start my wheel model from scratch again :( > >
Stefano Casillo <[email hidden]> wrote in message
news:a92fo1$cc6$[email hidden]...
> Get the torque from the ground...keep deriving the slip ratio.. the wheel
> will be slower than the ground and will generate a Fx... but then u haveto
So
roadTorque = -wheel.FX * radius ?? (unsure)
then
angularAcc = (wheelTorque + roadTorque ) / inertia
this does indeed produce the desired effect!!
However, the increase in speed of the driven wheels is very uneven, and this
must be due
to the changing road torque, which is dependant on the slip ratio. Also, it
limits the
top speed and in high gears it cannot reach the redline.
Any suggestions!?
Quoted text (7 lines)
> feedback that Fx into the wheel again.. opposite direction... and it'll > become a positive torque..and there it is your wheel accellerating to keep > up with the ground... > > I hope this'll help. > > Stefano CasilloIf u use that for the driven wheels the you have to calculate the inertia
for all the block wheels, diff, gear, engine connected..
I wouldnt know really... in my sim works just nice... also not so much low
speed instability.. but you have to be tricky with the brakes code.
keep expermimenting... I think that's the way to go...
"Alex Smith" <[email hidden]> wrote in message
news:a92jc0$jgr$[email hidden]...
>
>
>
> Stefano Casillo <[email hidden]> wrote in message
> news:a92fo1$cc6$[email hidden]...
> > Get the torque from the ground...keep deriving the slip ratio.. thewheel
> > will be slower than the ground and will generate a Fx... but then u have
> to
> > feedback that Fx into the wheel again.. opposite direction... and it'll
> > become a positive torque..and there it is your wheel accellerating tokeep
this
> must be due
> to the changing road torque, which is dependant on the slip ratio. Also,it
> limits the
> top speed and in high gears it cannot reach the redline.
>
> Any suggestions!?
>
>
Quoted text (14 lines)
> > up with the ground... > > > > I hope this'll help. > > > > Stefano Casillo > > So > roadTorque = -wheel.FX * radius ?? (unsure) > > then > angularAcc = (wheelTorque + roadTorque ) / inertia > > this does indeed produce the desired effect!! > However, the increase in speed of the driven wheels is very uneven, and
"Alex Smith" <[email hidden]> wrote in message
news:a91e1t$1aa$[email hidden]...
to
> calculate angular velocity. And effects like applying brakes should lock
> just the driven wheel in this case
> (as an undriven wheel doesnt account for brake forces in the above
> description, it is just the speed of the car)
> , and it does. However, if I release the brake, the wheel should rollagain,
> but does not take into
> account the speed of the car, so it does not roll along, it stays locked.
>
> There is obviously error in the calculation, and I must be missing outsome
Quoted text (19 lines)
> I said it would be in another post, so here it is! > Not modelling differentials. I'm calculating the angular velocity of the > wheels thus: > > FZ = weight on that wheel (uses weight transfer) > > Driven Wheels: > angularAcc = { (totalTorque) / radius} / (FZ/GRAVITY) > where totalTorque = (-resistanceForce * radius) + (engineTorque * > gearboxReduction * radius) + (-brakeForce * radius) > > angularVel += angularAcc * deltaTime > > Undriven Wheels: I am assuming they are rolling at the same speed of the > car > angularAcc = carAcc > angularVel += angularAcc * deltaTime > > However I am not sure how correct this is as there is no reference to howQuoted text (8 lines)
> things. > Using the relaxation length approach to calculating slip ratio, the car > starts and stops, I am assuming (and > hoping) that it is due to a problem with this calculation. > > Please help! Thanks! I know I can rely on you guys! > >Hi Alex!
I'm not sure whether others have answered this or not yet (blame the
awful news server/reader), so here it goes (again :) )...
On Wed, 10 Apr 2002, Alex Smith wrote:
Let's do a review; angular acceleration has units of rad/(s*s). Radians
aren't really units (as they measure arclength divided by radius, which is
then unitless), so what you have is just 1/(s*s). Ang_accel=M/J, where M
is torque and since it is given as force times distance, the units are
N * m=kg*m/(s*s) * m. To get the proper units for J which is the moment of
inertia it is clear that only kg*m*m will do.
The undriven wheels in a stationary situation indeed match the road speed
and as such have no forward torque indeed. However, imagine now that the
wheel speed (ang vel* R) doesn't exactly match the road speed. What
happens is that a slip angle becomes nonzero, and this in turn creates a
(maybe very small) longitudinal force on the wheel which makes the wheel
turn a bit faster until after a while it matches road speed again.
The moral is that you should not set the road speed equal to wheel speed
by force, as this should follow naturally from the calculations of slip
ratios on the front wheel, the resulting longitudinal forces and the
updated rotational dynamics of those wheels
Do not use a different method for the front and back wheels. As explained
above, the udriven wheels should have exactly the same equations as the
driven ones (forgetting diffs now), except that on the undriven ones there
is no driving torque. Just use the same code for the undriven ones as you
do for the driven ones, set the driving torque to 0 and off you go, you'll
see that (should all else be ok :) ) it'll work just as it should.
As told before, if you do the undriven wheels the same way as the driven
ones, when you lock the undriven ones you will develop a -1 slip ratio
which, after the wheel gets unlocked, will be responsible for getting the
wheel back to the road speed without any other input. Just plug it all in
and see physics do its magic. :)
-Gregor
Quoted text (10 lines)
> > Gregor Veble <[email hidden]> wrote in message > news:[email hidden]... > > > A typical total moment of inertia MOI for > > a wheel is of the order of magnitude 1 kg m m, so that might be the value > > you should use for now. The rest seems quite alright, though, > > hmm, not quite sure I understand the units. >Quoted text (13 lines)
> > Do not assume too much. Treat them exactly as the driven ones, but do not > > put any engine torque to them. It is true that for the most part this > > approximation is quite correct, but I believe this might be the problem > > for your calculations. > > In my implementation (which is wrong :), the undriven wheels have no forward > torque > as they are not driven by the engine which is why the only way I can make > them > rotate is by setting the angularVelocity directly, not calculating it by its > torque. > Am I giving the wheel a torque due to the car accelerating? >Quoted text (7 lines)
> In that case would I need a special case in the wheel.getTorque() function > like > > if (wheel is not driven) > torque = carAcceleration * wheel.load/GRAVITY * radius [or > inertia :)] >Quoted text (13 lines)
> > What you will also notice is that it's hard to define the braking force > > for when the wheel is locked, much like in the case of a tyre force at > > rest. But for now, let the braking force (torque) just point the opposite > > to the angular velocity, as all this will induce will be a slight > > oscillation of locked wheels (hopefully :) ). I believe this will for the > > most part help with the problems described bellow. > > I can get the wheels to lock, but when I want them to start rolling again > by releasing the brake, it doesn't because there is no torque related to how > fast > the road is moving beneath it. However if I add this torque to the driving > torque, > the car would shoot off (?)On Wed, 10 Apr 2002 13:17:49 +0000 (UTC), "Alex Smith"
<[email hidden]> wrote:
The car acceleration is different from the wheel angular acc, because
one is linear, and the other one is round (depending on radius of the
wheel at least).
So if you simplify by saying the undriven wheels have the speed to
match that of the car, you could more simply do a direct:
angularVel=carVel/(2*PI*wheelRadius) or some factor to that effect.
;-) (math from the top of my head isn't my strong point)
In fact, you should calculate slipRatio on the undriven wheels
themselves, then apply the resulting Fx force as torque (using T=F*r),
and then use that torque in: angularAcc=torque/wheelSpinInertia.
It will follow the car velocity by itself that way.
Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/


































