Acceleration

Information about the inner-side magic

Moderator: kilo

Acceleration

Postby horo » Thu May 15, 2014 4:42 am

Hello guys,

I'm a little lost with all these acceleration values in the physical engine.
I manage to understand that the current version used by default is the simuv2.1. However, I don't precisely understand why there are 9 values of the acceleration.

Here is the code I'm talking about :
Code: Select all
/* compute accelerations */

car->DynGC.acc.x = F.F.x * minv;
car->DynGC.acc.y = F.F.y * minv;
car->DynGC.acc.z = F.F.z * minv;

car->DynGCg.acc.x = (F.F.x * Cosz - F.F.y * Sinz - Rx) * minv;
car->DynGCg.acc.y = (F.F.x * Sinz + F.F.y * Cosz - Ry) * minv;
car->DynGCg.acc.z = car->DynGC.acc.z;

car->DynGCg.acc.ax = car->DynGC.acc.ax = F.M.x * car->Iinv.x;
car->DynGCg.acc.ay = car->DynGC.acc.ay = F.M.y * car->Iinv.y;
car->DynGCg.acc.az = car->DynGC.acc.az = (F.M.z - Rm) * car->Iinv.z;


So I kinda understand that the first 3 values are the acceleration in an immutable spatial reference, the 3 next ones are related to the car reference (or maybe the opposite way), but I really don't understand the 3 last ones.
As I would like to retrieve the value of the projection of the acceleration on the axis perpendicular to the camera view direction (Y axis on the attached draw where the X vector is the direction of the camera view). I would like to be sure that I pick the good one.
So, could you tell me if what I said was right and what are the 3 last values ?

Best,
You do not have the required permissions to view the files attached to this post.
horo
 
Posts: 13
Joined: Thu May 15, 2014 3:40 am

Re: Acceleration

Postby mungewell » Fri May 16, 2014 3:24 pm

Since there's a 'M' in there I suspect that this is just being (ab)used to pass data around the sim engine. Think I saw some stuff in 'collide.cpp' wrt but can't find it now....
Code: Select all
car->DynGCg.acc.ax = car->DynGC.acc.ax = F.M.x * car->Iinv.x;
car->DynGCg.acc.ay = car->DynGC.acc.ay = F.M.y * car->Iinv.y;
car->DynGCg.acc.az = car->DynGC.acc.az = (F.M.z - Rm) * car->Iinv.z;


The definitions for that struct are:
http://sourceforge.net/p/speed-dreams/code/HEAD/tree/trunk/src/interfaces/car.h#l225

They are either Car (DynGC) or World (DynGCg) referenced. Used to draw the 'G-Meter' for the GUI:
http://sourceforge.net/p/speed-dreams/code/HEAD/tree/trunk/src/modules/graphic/ssggraph/grboard.cpp#l362

Cheers,
Simon
mungewell
 
Posts: 307
Joined: Fri May 20, 2011 4:05 pm
Location: Southen Alberta, Canada

Re: Acceleration

Postby horo » Thu May 22, 2014 5:05 am

Thank you for you answer mungewell, so it seems like I need : car->DynGC.acc.y ? I still don't really understand what the ax ay az values stand for, but it seems like they are not useful for me.

I have a second problem, I did realize that I lost a lot of my knowledge in physic and that I'm getting it back gradually. In fact, I need to know which force is felt by the driver. So I won't only need the lateral acceleration according to the car axis, I would also need the spin acceleration (and maybe velocity) of the car around the Z axis (vertical one).

Could you tell me where is these values (cause by grepping, I was only able to find the wheels' spin velocity) ?
If you have some knowledge in physic, could you confirm that my reasoning makes sense (I do not need any other value to compute the lateral acceleration felt by the driver) ?

Best,
horo
 
Posts: 13
Joined: Thu May 15, 2014 3:40 am

Re: Acceleration

Postby horo » Sat May 24, 2014 2:55 pm

I think I found what I was looking for.

The ax ay and az stand for "angular according to x/y/z". So I just need DynGC.vel/acc.ax/ay/az.

However, there is still something strange. To simplify calculation, the angular velocities and acceleration are not calculated according the referentiel. I mean that DynGC and DynGCg angular acceleration and velocity are always equal, even though these two referentiel only share the Z axis. This is pretty strange for a "simulator".
horo
 
Posts: 13
Joined: Thu May 15, 2014 3:40 am


Return to SD Physics & Internals

Who is online

Users browsing this forum: No registered users and 1 guest

cron