The online racing simulator
Chronometer mod for LFS?
2
(31 posts, started )
I looked on wiki for gforce, and found http://en.wikipedia.org/wiki/G-force, which has small piece about a dragster which "can accelerate from zero to 160 kilometres per hour (100 mph) in 0.86 seconds. This is a horizontal acceleration of 5.3 g. Combined with the vertical g-force in the stationary case the Pythagorean theorem yields a g-force of 5.4 g".

By my figures, it would be

(100mph - 0 / 0.86) / 21.93685 = 5.3006 g

This is same as in article. Excluding Pythagorus!

If I get you right, you're saying

(160kph - 0 / 0.86) / 9.80665 = 18.9714 g

And Dygear's used a different formula I don't understand.
44.44m/s / (g * 0.86s) = 5.26932424g
Where g is the strength of the gravitational field at the Earth's surface expressed as the standard average, 9.80665.
Quote from sinanju :And Dygear's used a different formula I don't understand.

It's the same as what you are using.

Here I convert the current Speed (from the MCI packet) into MPH:

<?php 
$cSpeed 
= (($CompCar->Speed 32768) * 100) * 2.2369362920544;
?>

$lSpeed contains the last known value of Speed already converted int MPH for us.
$cTime is the current time (for the current MCI packet), $lTime is the time we got are previous MCI packet. We below take these two numbers away to find out how much time has passed between the two packets. I then like you divide this number by the constant you came up with and that converts it's value into gForce that's pretty close to what LFS is reporting.

Here

<?php 
$gForce 
round(($cSpeed $lSpeed) / ($cTime $lTime) / $this->MPH2);
?>

Quote from morpha :44.44m/s / (g * 0.86s) = 5.26932424g
Where g is the strength of the gravitational field at the Earth's surface expressed as the standard average, 9.80665.

I like that, that should be quite a bit faster as it saves me having to convert into MPH or KPH to get the G-Force.


<?php 
$cSpeed 
= (($CompCar->Speed 32768) * 100);
$gForce round(($cSpeed $lSpeed) / (9.80665 * ($cTime $lTime)), 2);
?>

I just tested that and I can confirm that it does work better over all, but it still disagrees or as I understand it, it disagrees with the the F9 g meter in some cases. This is mostly seen when going around turns in the oval where LFS g meter shows that my car still has a positive value and this equation produces a negative number (I'm slowing down as compared to my last frame.). So it's better, but there is still things to be desired.
Quote from sinanju :acceleration = velocity squared / radius

I wonder if we could guess the radius by using the delta between two AngVel values. At least it would give us a snapshot for that one section that should provide some information on the lateral gforce load on the car. We don't have to have the whole radius of the turn, just micro radius between packets should be all that we need. I might do some maths for this one later, if I become so inclined.

Quote from sinanju :Dygear has done proper maths and made this for his PRISM system - See Post No. 2 http://www.lfsforum.net/showthread.php?t=71041 for his code.

Nope, I've done no maths, I've borrowed your homework and now I'm borrowing morpha's too .
Quote from sinanju :
Quote from jeff123 :if you take the acceleration, and you devide that by approx. 9.8, you get the G-forces..
if you can put that into a program, you're done :P

No you don't!

Apologies; I stand corrected.

You were indeed correct.

Seems I've remembered less than I thought 35 years on from attending Physic's classes at High School!

On the upside, at least there's now a couple of ways of getting an LFS button to display a g-force reading (of some sort).
Actually, I did myself a dis-service!

Quote :gforce = acceleration / 21.93685 miles/second squared
or
gforce = acceleration /
35.30394 km/second squared

g = 9.80665 m/s = 35.30394 kph = 21.93685 mph

[e.g. ((9.80665 x 3600 seconds) / 1000 = 35.30394) - where 3600 is seconds in an hour and 1000 is metres in a kilometre].

Silly me forgot how I got the kph and mph figures in first place.
2

Chronometer mod for LFS?
(31 posts, started )
FGED GREDG RDFGDR GSFDG