Hi,

After years of playing LFS, I've now started looking into the programming side of it.

For a vehicle dynamics class at uni I'm developing an algorithm to detect if a car is understeerin / oversteering. Something modern ABS and ESP system uses. For that I need the lateral acceleration and yaw speed.

In order to generate some data to test the algorithm I figured I could use LFS. I've started playing with the RAF files and the RAF-tyre-extract software. From that I've been able to extract the positions (X,Y,Z) and by differentiating the signal get velocities (thus the heading). After another differentiation I get the accelerations in the global coordinate system. By calculating a rotational transformation matrix using the angle between the heading and the global coordinate system, I can convert the global acceleration vector to a traditional long/lat acceleration vector.

However, I also need the to know the rotation around it's own axis (yaw speed). I've noticed how F1perfViewer can plot a "slip angle". Do anyone know how this is calculated? I also noticed in the RAF file format on the help LFS website how the heading can be calculating use trigonometry on the tire forces? Is the wheel always travelling in the same direction as described by the tire forces? Will that give me the heading in the global coordinate system?

I am doing all the calculations and plotting in MATLAB, and I import *.csv created in F1perfViewer and RAF-tyre-extractor. Unfortunatley I don't know how to go about and get the data straight from the RAF-file.

Any help or suggestions will be greatly appreciated!

I'm attaching some graphs I've been able to generate.

One is the track map with the color changing with the speed (can be any variable, lat acc, long acc, brake, throttle etc etc)

The other graph is just some estimations of the yaw speed and yaw acceleration using the trajectory change. Thus not telling me anything about oversteer and understeer.

After years of playing LFS, I've now started looking into the programming side of it.

For a vehicle dynamics class at uni I'm developing an algorithm to detect if a car is understeerin / oversteering. Something modern ABS and ESP system uses. For that I need the lateral acceleration and yaw speed.

In order to generate some data to test the algorithm I figured I could use LFS. I've started playing with the RAF files and the RAF-tyre-extract software. From that I've been able to extract the positions (X,Y,Z) and by differentiating the signal get velocities (thus the heading). After another differentiation I get the accelerations in the global coordinate system. By calculating a rotational transformation matrix using the angle between the heading and the global coordinate system, I can convert the global acceleration vector to a traditional long/lat acceleration vector.

However, I also need the to know the rotation around it's own axis (yaw speed). I've noticed how F1perfViewer can plot a "slip angle". Do anyone know how this is calculated? I also noticed in the RAF file format on the help LFS website how the heading can be calculating use trigonometry on the tire forces? Is the wheel always travelling in the same direction as described by the tire forces? Will that give me the heading in the global coordinate system?

I am doing all the calculations and plotting in MATLAB, and I import *.csv created in F1perfViewer and RAF-tyre-extractor. Unfortunatley I don't know how to go about and get the data straight from the RAF-file.

Any help or suggestions will be greatly appreciated!

I'm attaching some graphs I've been able to generate.

One is the track map with the color changing with the speed (can be any variable, lat acc, long acc, brake, throttle etc etc)

The other graph is just some estimations of the yaw speed and yaw acceleration using the trajectory change. Thus not telling me anything about oversteer and understeer.