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
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
Solved! Go to Solution.
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/.
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/.
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
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.
:
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.
My guess is fGsAvg is "average value of raw sensor data".
Yes