Difference between log variables acc.x and stateEstimate.ax

Firmware/software/electronics/mechanics
Post Reply
dalisha18
Beginner
Posts: 4
Joined: Mon May 10, 2021 1:27 pm

Difference between log variables acc.x and stateEstimate.ax

Post by dalisha18 »

Hello everyone,


my question is, what is the main difference between the log variables acc.x, acc.y, acc.z and stateEstimate.ax, stateEstimate.ay , stateEstimate.az for the acceleration?

Which one is better to take, if you want to get the acceleration of the CF?

I read that stateEstimate.az does not include gravity in the calculation. Did I understand that right?

If yes, does all other mentioned log variables (acc.x,.....,stateEstimate.ay) include the aspect of gravity?



Thank you for your help!

Best Regards,


Dalisha
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Difference between log variables acc.x and stateEstimate.ax

Post by kimberly »

Hi!

Did you know that now we have automated log and param documentation ? So you can find the explanation of the acc log and the stateEstimate log.

So you are indeed right. StateEstimate.az does not include gravity, and since this is rotated in the global reference frame, it means it is always pointing directly to earth no matter in which orientation the crazyflie is in. So all StateEstimate.ax/ay/az, should not contain any gravity in theory, Ofcourse we can't account for the gyro delay if the CF turns very quickly, you might have some 'residue' gravity in the other global axi as we only compensate on the .ax. This is how the gravity factor is removed in the kalman filter:

Acc.x/y/z has the gravity factor still included as these are the accelerometers measurement ouitput. You can check by logging the acc.x/y/z in the logger. Since is in the body axis, this means that it depends on the crazyflie's attittude. If the crazyflie is on a flat surface, acc.z is 1 Gs, but if you turn the crazyflie's attitude, you can see this shift this to any of the other accelerometer axis as well.
Post Reply