imu BMI160 - automatic accelerometer offset compensation - how to? #18336
Replies: 1 comment
-
|
I have solved my problem - i made 2 mistakes:
because i read only couple of values (to fast) - i got always first (invalid) reading after FOC. after correction ( delay in reading) i got:offset: (-2, 26, -5) i : (ax, ay, az)
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some problem with understanding with accelerometer offest compensation exacly how it shoud work :
according to dokumentaton : https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi160-ds000.pdf
If someone had using this functionality - please check my line of reasoning:
to activate automatic offset correction i have to enable functionality by setting bit 'acc_off_en' of register OFFSET_6
from this moment (as long as acc_off_en = True) I should read values form accelerometer data registers (DATA_14 to DATA_19 ) after offset compendation i.e:
acc_off_en = 0 : data ax registers (DATA_14, _15) will store value : acc_x value with offset - no correction
acc_off_en = 1 : data ax registers (DATA_14, _15) will store value : acc_x -off_acc_x value correct
I wrote My own driver and I notice some problems (at leat in understanding the process) , for example
reading raw accelometers data (imu situated flat) give me (for example) : ax, ay , az = (74, -1786, 16655)
(at this point offset refisters have value 0)
after performing FOC offset registers will have values: offset_ax, offset_ay, offset_az, = (-2, 27, -5)
then after enabling auto offetting correction ( acc_off_en = 1 ) i should read raw data : (74 , -1786, 16655) - (-2, 27, -5) but
what I get is still:
ax, ay , az = (74, -1786, 16655)
So I checked all my I2C commands manually, (read/write registers) , and at least cross-check with existing BMI160 drivers like:
https://github.com/serioeseGmbH/BMI160/tree/master
https://github.com/jposada202020/MicroPython_BMI160
I'm sure that my functions are correct, but any of tested libraries do not have example of using FOC or manual offset correction and using auto offesetting correction - so I started to doubt that my reasoning is correct.
Beta Was this translation helpful? Give feedback.
All reactions