Hi all,
I've just been missing some physics discussions lately I guess. Anyone,
any questions, explanations etc. :)?
-Gregor
Notable threadCar physics Q&A on dampers, integrators and turbos
Gregor Veble invited physics questions, leading to discussion of separate bump and rebound damping, nonlinear damper curves and upgrading from Euler to midpoint, RK4 or Adams–Moulton integrators. Ruud van Gaal said Racer now used Gregor's implicit integration and asked how to model turbochargers. Jonny Hodgson, Todd Wasson, Grant Reeve and Papyrus's Randy Cassidy explained boost lag, intercooling and blow-off behaviour.
With Randy Cassidy (Papyrus); Grant Reeve (Papyrus)
physics/realism debateRacer
Automated summary.
"Gregor Veble" <[email hidden]> skrev i en meddelelse
news:[email hidden]...
> Hi all,
>
> I've just been missing some physics discussions lately I guess.Anyone,
> any questions, explanations etc. :)?
>Has there ever been a discussion about modelling the real non-linearity
of springs? ;-)
Or the rigidity of the chassis?
/Jens
Physics.
Gregor Veble wrote:
> Hi all,
>
> I've just been missing some physics discussions lately I guess. Anyone,
> any questions, explanations etc. :)?
>
> -Gregor
Not really been working on physics for the last month. Been working on the
graphics side to give my brain a rest ....
But here's a small point I was wondering about. For the springs in my
suspension system I generate forces using
F = k_s * extension + k_d * v_diff
where k_s and k_d are spring and damper constatnts, and v_diff is the
velocity of the sprung mass relative to the unsprung mass.
In other sims (eg Racer) I've noticed they use damper bump rate and rebound
rate rather than just a damper constant. Can anybody tell me how this works?
Cheers,
Mike.
"Gregor Veble" <[email hidden]> wrote in message
news:[email hidden]...
Quoted text (9 lines)
> Hi all, > > I've just been missing some physics discussions lately I guess. Anyone, > any questions, explanations etc. :)? > > -Gregor > > >I have a long line of questions, but need to work through them a bit myself
before burdening the RAS population quite yet :). I have been too lazy
recently ;)
Ash
If the spring is being compressed, use k_bump, if it's being extended, use
k_rebound, if it's not being compressed or extended then it doesn't matter
anyway as v_diff = 0.
Hope that's right (!)
Jim
"Mike Stanley" <[email hidden]> wrote in message
news:_h8N7.2486$[email hidden]...
rebound
> rate rather than just a damper constant. Can anybody tell me how thisworks?
Quoted text (12 lines)
> Not really been working on physics for the last month. Been working on the > graphics side to give my brain a rest .... > > But here's a small point I was wondering about. For the springs in my > suspension system I generate forces using > > F = k_s * extension + k_d * v_diff > > where k_s and k_d are spring and damper constatnts, and v_diff is the > velocity of the sprung mass relative to the unsprung mass. > > In other sims (eg Racer) I've noticed they use damper bump rate andQuoted text (18 lines)
> > Cheers, > > Mike. > > "Gregor Veble" <[email hidden]> wrote in message > news:[email hidden]... > > Hi all, > > > > I've just been missing some physics discussions lately I guess. Anyone, > > any questions, explanations etc. :)? > > > > -Gregor > > > > > > > >On Wed, 28 Nov 2001, Mike Stanley wrote:
That one's not too difficult. It just means that if v_diff>0, then k_d has
a different value (say k_d=k_bump) than when v_diff<0 (k_d=k_rebound,
depending on how you define the v_diff).
In general, though, you might even want to generalize the damping force to
not be
F_d= k_d * v_diff
but
F_d=F_damp(v_diff)
which is now a general function of velocity which can then separate high
speed from low speed behaviour. But that's a new topic altogether.
Now, I'll think about the chassis rigidity question and post
tomorrow.... :)
Thanks to all, I needed that ;)
-Gregor
Quoted text (9 lines)
> > F = k_s * extension + k_d * v_diff > > where k_s and k_d are spring and damper constatnts, and v_diff is the > velocity of the sprung mass relative to the unsprung mass. > > In other sims (eg Racer) I've noticed they use damper bump rate and rebound > rate rather than just a damper constant. Can anybody tell me how this works? >On Wed, 28 Nov 2001, andrew wrote:
> Physics.
>
Thanks, I needed that :).
-Gregor
On Wed, 28 Nov 2001 18:20:50 +0100, Gregor Veble
<[email hidden]> wrote:
Right. Also note that Racer v0.4.9a3.1 (geez, what a name!) now uses
Gregor's excellent implicit integration proposition.
What I mean is you look at the integration formula,
newWheelVel=oldWheelVel+... where ... is some F=m*a formulae that is
normally like:
F_total/m * dt
but as damper forces really made my cars unstable, it changed into 2
separate integrations; 1 for the spring (which is ok for a 100-200Hz
integrator mostly), and 1 for the damper. Look up Baraff's paper on
Implicit Integration. That explains the idea. Weird formulae that come
out of it but it works. :)
Also note, as for the original question, nonlinearity in springs, you
can do:
F_spring = k1*d + k2*d^3
'k2' can be negative or positive, giving increasingly tight or
decreasingly tight springs. Near the equilibrium position (and
probably if k2<<k1) things will be linear enough but progressively
non-linear when 'd' gets bigger (the extension).
Now, for the next issue then, ;), how does turbo work? Compressed air
into the cylinders, right? But when does it kick in? And how much is
its effect in mathematical terms?
And why does an intercooler improve the turbo effect?
Ruud van Gaal
Free car sim : http://www.marketgraph.nl/gallery/racer/
Pencil art : http://www.marketgraph.nl/gallery/
Quoted text (13 lines)
>On Wed, 28 Nov 2001, Mike Stanley wrote: >> >> F = k_s * extension + k_d * v_diff >> >> where k_s and k_d are spring and damper constatnts, and v_diff is the >> velocity of the sprung mass relative to the unsprung mass. >> >> In other sims (eg Racer) I've noticed they use damper bump rate and rebound >> rate rather than just a damper constant. Can anybody tell me how this works? > >That one's not too difficult. It just means that if v_diff>0, then k_d has >a different value (say k_d=k_bump) than when v_diff<0 (k_d=k_rebound, >depending on how you define the v_diff).
"Gregor Veble" <[email hidden]> wrote in message
news:[email hidden]...
> That one's not too difficult.
ok, here's a trickier one then :)
I've been thinking about upgrading my integrator from Euler to midpoint or
RK4. Although the formulas are quite simple I'm a bit confused as to the
implementation. If I take as an example the integration of velocity to
produce position, then the problem is to solve
ds(t)/dt = v(t)
which for euler is
s(t+dt) = s(t) + dt*v(t).
I've been reading about using midpoint integration, and if I understand
correctly the formula for this is
s(t+dt) = s(t) + dt * v(t+dt/2)
My question is, how do I evaluate v at the half time step? I do not have an
expression for v, just a discrete set of values, so presumably I have to do
it numerically. But wouldn't this affect the accuracy of the integrator, and
reduce it back to 1st order? Has anybody tried implementing integrators
other than Euler yet?
Cheers,
Mike.
"Ruud van Gaal" <[email hidden]> wrote in message
news:[email hidden]...
> integrator mostly), and 1 for the damper. Look up Baraff's paper on
> Implicit Integration. That explains the idea. Weird formulae that come
> out of it but it works. :)
>
What's the title of that paper? I had it once but can't seem to find it now
(he's done so many!).
Cheers,
Mike.
It's ok I've found it. "Large Steps in Cloth Simulation", right?
"Mike Stanley" <[email hidden]> wrote in message
news:5UqN7.225$[email hidden]...
now
Quoted text (9 lines)
> > "Ruud van Gaal" <[email hidden]> wrote in message > news:[email hidden]... > > integrator mostly), and 1 for the damper. Look up Baraff's paper on > > Implicit Integration. That explains the idea. Weird formulae that come > > out of it but it works. :) > > > > What's the title of that paper? I had it once but can't seem to find itQuoted text (8 lines)
> (he's done so many!). > > Cheers, > > Mike. > > >
Ruud van Gaal <[email hidden]> wrote in message news:[email hidden]...
> Now, for the next issue then, ;), how does turbo work? Compressed air
> into the cylinders, right? But when does it kick in? And how much is
> its effect in mathematical terms?
As a first approximation, boost pressure is proportional
to exhaust flow (read ~engine power) with a lag; first-order
should do okay.
Flow rate through the throttle is then going to be proportional
to (atmosphere + boost pressure), and engine power should be
proportional to intake flow. Now, precisely how you determine
intake flow (as a combination of throttle opening and engine
speed) is another question - as is whether back-pressure is
significant. My guess to the latter is "no" assuming mild
turbocharging (perhaps up to ~0.7bar gauge).
> And why does an intercooler improve the turbo effect?
It increases the mass flow of air for a given volume flow,
hence allowing you to burn more fuel at stoichiometric A:F
ratio and thus produce more power.
HTH!
Jonny
"Jonny Hodgson" <[email hidden]> wrote in message
news:tcvN7.1097$[email hidden]...
>
> Ruud van Gaal <[email hidden]> wrote in messagenews:[email hidden]...
>
> > And why does an intercooler improve the turbo effect?
>
> It increases the mass flow of air for a given volume flow,
> hence allowing you to burn more fuel at stoichiometric A:F
> ratio and thus produce more power.
Compressing the air charge also heats it, making detonation an issue (at
least with a gasoline engine). Adding an intercooler allows higher boost
pressures without inducing detonation.
Randy
Quoted text (7 lines)
>Now, for the next issue then, ;), how does turbo work? Compressed air >into the cylinders, right? But when does it kick in? And how much is >its effect in mathematical terms? >And why does an intercooler improve the turbo effect? > > >Ruud van Gaal<lurk off>
just felt an urge to throw some random extras into the mix :)
"J. Todd Wasson" wrote:
> To put it more simply, the exhaust gases are pushing on one end of the
> turbo's shaft, the intake is pushing on the other. Usually, the exhaust gases
> are trying to speed up the turbo, while the intake gases are trying to slow it
> down. This isn't always the case, but usually it is.
> Here's a common example of when the exhaust gases are not driving the
turbo,
and neither are the intake gases. When you accelerate at full throttle,
then
lift off the gas to change gears. Suddenly the exhaust gas speed falls
away,
but there's still a full load of compressed air in the intake. Combine
that
with the backpressure wave from the intake air hitting the closed
throttle
plate and you get nasty intake backpressure waves crashing into the
compressor
wheel. This isn't very healthy to the long term life of a turbo, so
there
is usually some kind of pressure relief valve on the intake just after
the turbo designed to open up when there's a large pressure differential
between the intake and the manifold pressure to let this air out and
save
your turbo. The term I'm used to for naming this device is the blow-off
valve, (BOV), and this is the source of all the weird whistle/whoosh
noises
during shifts or when letting off the throttle from the tasteless boy
racer
turbo charged honda civic with neon lights you see downtown (or my very
tasteful (no neon lights) MR2 :) ).
> Still, if you can come up with a way to vary the boost pressure
> realistically, it's a pretty safe assumption that the power will scale right
> along with the change in boost pressure. You could have a factor to multiply
> the fixed torque curve by according to boost pressure. For instance, if
> standard air pressure was 1 bar, and the boost pressure was .2 bar above that
> (1.2 bar on Gregor's guage, or .2 bar??)
that would be .2 bar on the gauge. Gauges read zero at atmospheric
pressure,
and positive for greater than atmospheric pressure amounts.
They usually use units of vacuum for pressures from atmospheric down to
zero. 0.2 bar is a pathetic amount of boost :)
> Then maybe you could add the two torques together and accelerate the turbo?
Remember to make sure to model lots of turbo lag! If you're modelling a
turbo and you don't get pissed off at the bad throttle response compared
to a normally aspirated engine, you're probably missing something :)
The turbo does have it's own momentum, but the major source of turbo lag
is simply the amount of space it has to pressurise in the intake
plumbing.
For instance, if you stuck an intercooler in the front grill of a mid-
engined car, you'd have about 6 miles of intake piping from the back of
the car up to the front and back to pressurise, so it would take half an
hour to boost up! Of course this is an extreme example.
Intercoolers are great in this respect, especially on a nice cool chilly
day :) However as Randy mentioned earlier, they are also extremely
important
if you're trying to run anything like .4 bar or more to prevent your
engine
from blowing up a few pistons. As the piston is compressing the air in
the
cylinder, the cylinder pressure and temperature build. At a certain
combination of both factors, the fuel can (and will!) ignite by itself.
This of course is really bad if the piston is still going up and the
resulting explosion is trying to push the piston back down. You can
avoid it by either running less boost (which is the no-fun solution),
or using an intercooler to reduces the intake charge temperature. (Or
running a richer fuel mixture - the charge won't ignite so easily if
it's
overly rich) You can also push the self ignition point further away by
using higher octane fuel. Running 87 octane gas in my MR2 at 1 bar boost
would be a guaranteed blown motor. 93-94 octane is OK. Full on racing
gas
is vastly superior than pump gas in this respect, which is why you hear
of
CART (or 80's F1) running at 40psi (2.5 bar) or more. Or those cars
Rod Millen runs at Pike's Peak at 80psi.
This is also why most turbo cars use some form of boost pressure
regulation
to prevent the boost from going over a certain limit. This is done by
bypassing excess exhaust gas around the turbo's exhaust turbine once the
desire intake pressure is reached, via a wastegate.
<lurk on>
Quoted text (11 lines)
> As far as intercoolers go, they are used to cool the intake air. Cold air is > denser than warm air, so you wind up with more air and fuel in the cylinder > than you otherwise would. There's a rule of thumb (here in the US anyway, > sorry about the English units), that each 11 degree Fahrenheit drop in > temperature increases torque/power by 1%. Air under the hood around the engine > can get rather hot, which means full power isn't available once the thing's > running awhile. To solve this, many folks duct outside air in from the front > of the car, or through a ram-air hood or scoop of some sort. This can make a > noticable difference in some cars. Intercoolers cool the air a lot more than > this though, so it's better (but more expensive of course than some hoses and > plastic.) Grant,
WONDERFUL post! :0)
>that would be .2 bar on the gauge. Gauges read zero at atmospheric
>pressure,
>and positive for greater than atmospheric pressure amounts.
>They usually use units of vacuum for pressures from atmospheric down to
>zero. 0.2 bar is a pathetic amount of boost :)
Ah, ok. I thought so, but wasn't sure... .2 bar IS a pathetic amount of
boost :0)
>Remember to make sure to model lots of turbo lag! If you're modelling a
>turbo and you don't get pissed off at the bad throttle response compared
>to a normally aspirated engine, you're probably missing something :)
>The turbo does have it's own momentum, but the major source of turbo lag
>is simply the amount of space it has to pressurise in the intake
>plumbing.
Good point, hadn't thought of the space issue.
Ah ha! I knew there had to be another reason besides increasing density :-)
Hadn't thought of the temperature change from the work to the gas during
compression.
Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com
Quoted text (9 lines)
>Intercoolers are great in this respect, especially on a nice cool chilly >day :) However as Randy mentioned earlier, they are also extremely >important >if you're trying to run anything like .4 bar or more to prevent your >engine >from blowing up a few pistons. As the piston is compressing the air in >the >cylinder, the cylinder pressure and temperature build. At a certain >combination of both factors, the fuel can (and will!) ignite by itself.Mike Stanley wrote:
An efficient second order integrator for real time systems
that use second order systems (like your velocity and
position set above) is a combination of a
second order Adams for velocity
and a second order Moulton Corrector for position.
Here, the _prev variables are the previous value dt ago
and a is acceleration
v = v_prev + (dt/2)(3 * a - a_prev) ' 2nd order Adams
p = p_prev + (dt/2)(v + v_prev) ' 2nd order Moulton Corrector
Generally you can't use a corrector like that in a true
real time system using measurements because you don't have
the future measurements yet. However, in this case you can
use the Adams integrator to generate the data required
by the second integrator.
This gives you second order integration with a
cost of only one derivative evaluation each.
Note that you now have to maintain the previous value of
the derivative of velocity (a_prev)
A Runge-Kutta 4th order integrator will require 4 derivative
calculations. If you push the integration step high enough
to flirt with instability, you may find that the second
order integrator above is actually more efficient than the
Runge-Kutta even though you may have to run it at a 3 times
smaller time step. (3 derivatives in the same duration
that the RK4 would need 4 derivatives.)
I'm not considering accuracy in this case, rather the
frequency response that most efficiently gives "decent"
results without immediate instability.
- Matt
Ref: "Math Toolkit for Real-Time Programming," Jack W. Crenshaw,
CMP Books, Lawrence, Kansas, 2000. ISBN 1-929629-09-5
Quoted text (25 lines)
> > > ok, here's a trickier one then :) > > I've been thinking about upgrading my integrator from Euler to midpoint or > RK4. Although the formulas are quite simple I'm a bit confused as to the > implementation. If I take as an example the integration of velocity to > produce position, then the problem is to solve > > ds(t)/dt = v(t) > > which for euler is > > s(t+dt) = s(t) + dt*v(t). > > I've been reading about using midpoint integration, and if I understand > correctly the formula for this is > > s(t+dt) = s(t) + dt * v(t+dt/2) > > My question is, how do I evaluate v at the half time step? I do not have an > expression for v, just a discrete set of values, so presumably I have to do > it numerically. But wouldn't this affect the accuracy of the integrator, and > reduce it back to 1st order? Has anybody tried implementing integrators > other than Euler yet?On 30 Nov 2001 02:24:41 GMT, [email hidden] (J. Todd Wasson) wrote:
>>Now, for the next issue then, ;), how does turbo work? Compressed air
>>into the cylinders, right? But when does it kick in? And how much is
>>its effect in mathematical terms?
>>And why does an intercooler improve the turbo effect?...
>Here is my extremely scientific explanation ;-):
>
> A turbo compresses air into the cylinders, right....
Thanks for the elaborate reply, Todd!
Also thanks to Jonny, Grant and Randy (nice to see Randy still pop up
here). I now finally understand a little about turbo.
Will have to deal with all these other deadlines here though before I
can actively implement stuff, but at least my right brain can work on
that subconsciously. ;-)
To be continued in the future somewhere...
Ruud van Gaal
Free car sim : http://www.marketgraph.nl/gallery/racer/
Pencil art : http://www.marketgraph.nl/gallery/
On Sat, 01 Dec 2001 04:51:16 GMT, "Matthew V. Jessick"
<[email hidden]> wrote:
>Mike Stanley wrote:
>> I've been thinking about upgrading my integrator from Euler to midpoint or
>> RK4....
>> ds(t)/dt = v(t)
>>
>> which for euler is
>>
>> s(t+dt) = s(t) + dt*v(t).
Also take note that for F=m*a type integrations, you start out with
'a', which is the 2nd derivate. So you can expand to:
s(t+dt)=s(t)+dt*v(t)+0.5*dt^2*a(t)
Which is already more stable, and nearly free. :)
And ofcourse, precalculate t^2.
Matt's combined integrator seems very interesting too, I'd try that
too if I were you (and test with big time steps to see how it's
doing).
Ruud van Gaal
Free car sim : http://www.marketgraph.nl/gallery/racer/
Pencil art : http://www.marketgraph.nl/gallery/
OK, thanks to you both. I'm currently adding in code to allow me extend the
integrator (ie storing velocities and accelerations from the previous n
timesteps) after which I'll be in a position to test lots of different
integrators. My main aim is to improve on the stability of the Euler
integrator (mainly for spring forces) so I may attempt an implicit
integrator as well.
I'll post when I've done a few tests, and let you all know my conclusions.
Cheers,
Mike.
"Ruud van Gaal" <[email hidden]> wrote in message
news:[email hidden]...
> On Sat, 01 Dec 2001 04:51:16 GMT, "Matthew V. Jessick"
> <[email hidden]> wrote:
>
> >Mike Stanley wrote:
> >> I've been thinking about upgrading my integrator from Euler to midpointor


































