The online racing simulator
Searching in All forums
(14 results)
henningo
S2 licensed
I guess I ought to RTFM then ... thanks

Also, sort of a request but I believe that the ABS system should stop working when a certain level of suspension damage has been taken. The sensors are quite exposed.
henningo
S2 licensed
I get two errors:

Upon start at main menu:
Red text: "Can't open: Discsolidalp24"
Red text: "Can't open: Discdrilledalp24"

When leaving pits or when someone else leaves pits:
Red text: "Can't open: Wheel" x4

I also don't see the discs as well as the wheel when I'm in the incar view without cockpit visible (don't know what it's called).

I didn't reinstall LFS just replaced the .exe

Runs great besides that.
henningo
S2 licensed
Alright, thanks a lot!

wsinda, while your here, do you use the tire forces to calculate lateral acceleration? Or what is your approach?

Doing that would give the acceleration perpendicular to the heading, so with a car slip angle (not tyre slip angle), the lat acc calculated would not be as big as the lat acc of the CG. Instead you would see a component in the long direction.

On real race cars this is the case (with an accelerometer mounted), so that's why I'm planning to use it.

The other option of differentiating the position data, will probably give a lot of noise due to the slow sampling rate.

Once again, thanks a lot. Do Scawen or the other programmers know about the error in the RAF description?
henningo
S2 licensed
Here's a plot of the tire forces I'm getting (with the above code). Doesn't look like lateral forces to me?
henningo
S2 licensed
So, I'm still having troubles with the lateral tire forces. The fronts won't go over zero. I think I'm measuring the longitudinal (RWD car). The offset I'm using:

1024 for header

192 for each timestep

64 for the car related logged data

32 for each wheel

12 to get to the lateral (righthand) tire force.

I've been staring at this for too long now

Any help is greatly appreciated!


status=fseek(fid,1024+192*(ii-1)+64+12,-1);
latF.LF(ii)=fread(fid,1,'float');

status=fseek(fid,1024+192*(ii-1)+64+32+12,-1);
latF.RF(ii)=fread(fid,1,'float');

status=fseek(fid,1024+192*(ii-1)+64+32+32+12,-1);
latF.LR(ii)=fread(fid,1,'float');

status=fseek(fid,1024+192*(ii-1)+64+32+32+32+12,-1);
latF.RR(ii)=fread(fid,1,'float');
henningo
S2 licensed
Ok, it still means I could use it to calculate the lateral accelerations. I might even do a comparison with the differentiation of the position to see which one is better... Forces should be...

And, I guess right on the order of the wheels... yay

Once again, thanks a lot for the quick replies!
henningo
S2 licensed
One more questions, anyone know which order the wheels come in the dynamic wheel info? I could figure it out by generating a new replay but since im on my laptop right now I dont have LFS. Cheers
henningo
S2 licensed
Just some more thoughts/questions here.

Since I'm pretty much have to redo what F1perfview did for me, I just want to confirm with you guys that I'm doing it the right way.

Lateral acceleration calc:
1) Get X force from all tires (forces to the right, positive sign)
2) Sum all these forces
3) Read total mass of car from header
4) F = m*a

So one question here, is the tire's X force in relation to the car heading or in relation to the where the tire is pointing. So do I need to take the steering angle of the (front) tire into account when calculating the force component that adds to the lateral forces?

Edit: I should also be able to simulate the use of two accelerometers (one on each axle) and use the static normal loads (Fz on tires) to detect over/understeer since I can look at the forces on the front and rear axles and then calculate the lateral accelerations on the each axle and then estimate the yaw rate. Thoughts/comments?
henningo
S2 licensed
Ok, but in the fread(fid, X, 'float') the X stands for how many bytes it should read, so in the code I posted, it read 1 byte. So if instead step forward 191 steps, it would work?

I'm trying it now.

Ok, you were right. I changed my fseek to always count from the beginning of the file: 1024+192*counter, and it seems to work pretty nicely, I get numbers between 0 and 1.

Thanks a lot!
henningo
S2 licensed
So, I've tried to get MATLAB to read straight from the RAF file, starting of easy by trying to read the throttle input (0-->1). Here's the code, but all I get is a really spikey/noisy plot that has a maximum of 10^38.

What am I doing wrong? I don't think I messed up the offsets (or did I?), steping the first 1024 steps to pass the static header block, then reading the first byte in the dynamic block, then steping another 192 steps (size of dynamic block), and then doing that till I reach the end of the file.

Help!



clear [FONT=Courier New][SIZE=2][COLOR=#a020f0]all
[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][filename,pathname]=uigetfile([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#a020f0]'C:\'[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#a020f0]'Select RAF-file'[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#a020f0]'*.raf'[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
cd(pathname);
fid=fopen(filename);

status=fseek(fid,1024,-1); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#228b22]%step 1024 steps from file start

[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]counter=1;
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]while[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] status==0;
t2(counter)= fread(fid,1,[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#a020f0]'float'[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
status=fseek(fid,192,0); [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#228b22]%step 192 steps from current position
[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]counter=1+counter;
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]end

[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]plot(t2)
[/SIZE][/FONT]

henningo
S2 licensed
The slipangle is defined in F1perfview, is it just the difference between the heading vector and the trajectory(x,y,z vel)?

The slip angle in F1perfview is the same for all wheels, thats what makes me draw that conclusion, am I right? In that case I could use the slip angle in combination with the trajectory to calculate the yaw speed. (Which is what you get from a gyro which is used by ESP/ABS systems).

S
henningo
S2 licensed
I'm sorry I wasn't very clear. I'm not able to open up the *.RAFs as they are (lack of programming skills), I need to rely on the RAF->CSV conversions done by F1perfview and RAFtyreextractor. From what I've seen none of the heading vectors are in there?

And yes, with those vectors I should be able to do what I want to do
henningo
S2 licensed
Ok, thanks!

The way I've been doing the position/velocity/acceleration determinations is by looking at two consecutive points and the time difference between them (typically 0.01 s in *.RAFs).

My question then is how do I determine the forward direction? I would personally like another position point on the car and thereby determining the forward direction of the car, is that possible? For instance the position of a wheel in comparison to the track reference point.
Detecting understeer/oversteer from RAF data
henningo
S2 licensed
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.
FGED GREDG RDFGDR GSFDG