Re: Suspension correction
Bernhard Wymann <[email protected]> Wed, 5 Apr 2017 00:44:47 +0200
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Organization | wytec |
| Message-ID | <[email protected]> |
Hi David
> A real car has the springs preloaded (lest you have loose suspension).
Sure, but this just shifts the point of eqilibrium, the spring is still
a spring (at least for the linear springs we model).
> I've been following the commits to TORCS and heard about
> forces due to inertia and mass acting on the axle.
> If TORCS' formulas are calculated in a proper and generalized
> way, the spring may have tensile forces (negative values) at times.
The "if" statement which your patch removes does exactly deal with that.
The spring can just generate forces in one direction, if it is fully
extended it is just loose. Depending on the ride height/suspension
course setup this does not happen, but if it happens we are prepared.
> This patch does the bounds checking for negative values where
> the tire contacts the road, and not where damping may act
> against the spring.
>
> The car is more controllable on dirt tracks, and has no new
This is no argument, we could just replace it all with a constant force
and handling would be great, but the model would be dead wrong anyway.
The second part of your change is idential (semantically) to the
previous code, think about it again:
1.3.8-test1:
tdble internalForce = springForce(susp) + damperForce(susp);
if (internalForce <= 0.0f) {
susp->force = 0.0f;
} else {
susp->force = internalForce * susp->spring.bellcrank;
}
Yours:
susp->force = (springForce(susp) + damperForce(susp)) *
susp->spring.bellcrank;
if (susp->force < 0.0f)
susp->force = 0.0f;
So whatever you have felt must be something not contained in this patch.
Agreed?
> problems that I could find. Thus, I figured this is an improvement.
>
> On a real car, the spring may be preloaded so that it never gets
> a tensile force on it (no need for negative bounds checking).
Agreed, but if somebody gets the parameters of the cars wrong I do not
want the simulation to "explode", otherwise you have to implement
validations in some other places.
Kind regards
Bernhard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot