accelerometer variables question..

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

accelerometer variables question..

Jump to solution
1,457 Views
josol
Contributor III

Hi...

I'm testing a sensor fusion with library 5.0

and I want to use accelerometer variables to make other functions.

 

a variable fGsAvg[3] is shown in Toolbox. and i think it is correct a raw sensor value

83914_83914.pngpastedImage_0.png

but, in fusion.c , it explains that fAccGl[3] is the linear acceleration in the global frame

what is difference between fGsAvg[3] and fAccGl[3] ??

Thank you

Labels (1)
0 Kudos
Reply
1 Solution
1,109 Views
michaelestanley
NXP Employee
NXP Employee

The difference is in the frame of reference. The display on the Sensors tab is in the sensor’s frame of reference. This is versus fAccGl, which is in the global frame of reference. The sensor frame of reference rotates with respect to the global. So although the vector is the same in both case, the basis vectors by which it is measured are different in the two frames of reference. I did a couple of blogs on the topic a few years ago: http://blogs.freescale.com/iot/2012/10/orientation-representations-part-1/ and http://blogs.freescale.com/sensors/2013/01/orientation-representations-part-2/.

View solution in original post

0 Kudos
Reply
7 Replies
1,110 Views
michaelestanley
NXP Employee
NXP Employee

The difference is in the frame of reference. The display on the Sensors tab is in the sensor’s frame of reference. This is versus fAccGl, which is in the global frame of reference. The sensor frame of reference rotates with respect to the global. So although the vector is the same in both case, the basis vectors by which it is measured are different in the two frames of reference. I did a couple of blogs on the topic a few years ago: http://blogs.freescale.com/iot/2012/10/orientation-representations-part-1/ and http://blogs.freescale.com/sensors/2013/01/orientation-representations-part-2/.

0 Kudos
Reply
1,109 Views
josol
Contributor III

Thank you for kindly answer.

Actually, i tried to use acceleration values with the attempt to create a velocity Making a integration function

and i found a variable fVelGl[3] meaning velocity (m/s) in global frame by chance!!

as result of debug, the value of fVelGl[3] seems unstable. because when the board is not moving, its value goes up rapidly..

so it is usable variable to get a real velocity valuse? or should i change algorithm and function?

Thank you every time

0 Kudos
Reply
1,109 Views
markpedley
NXP Employee
NXP Employee

We added the inertial integration of acceleration (global frame) to velocity and to position to check out the limits of what is possible with consumer grade accelerometer, magnetometer and gyroscope sensors. Our conclusion is that inertial navigation is not feasible with the current generation of consumer devices. There are two fundamental problems. The first is that the problem is mathematically unconstrained so integration errors from sensor errors accumulate quadratically. The second is that we live in a 1g gravity field so that orientation must be known precisely in order to subtract off the 1g gravity field.

Take a look at the accelerometer display in the Sensors tab. You'll see that the magnitude of the accelerometer output even at rest is not precisely 1g. So when we subtract off the 1g gravity field we have a small residual acceleration error which very quickly leads to significant positional errors within a short time of order seconds.

The source code highlights this with the comment:

// integrate the acceleration to velocity and displacement in the global frame.

// Note: integration errors accumulate without limit over time and this code should only be

// used for inertial integration of the order of seconds.

:

0 Kudos
Reply
1,109 Views
josol
Contributor III

you mean that i can not get a velocity using FXLS8471Q​​ and MMA8652FC​ ?? or should try another way not inertial integration?

Thank you

0 Kudos
Reply
1,109 Views
markpedley
NXP Employee
NXP Employee

Short answer, no you cannot get velocity nor displacement from any consumer grade sensor whether from Freescale or any other supplier.

Longer answer: a consumer accelerometer is accurate to perhaps 25mg to 50mg. Multiply by 9.81 to convert from g to m/s2 and then multiply by time t and that gives your velocity error. It very rapidly becomes significant.

1,109 Views
vikasy
Contributor I

My guess is fGsAvg is "average value of raw sensor data".

0 Kudos
Reply
1,109 Views
michaelestanley
NXP Employee
NXP Employee

Yes

0 Kudos
Reply