Closed MasterPlayer closed 2 years ago
in full-resolution mode for range -2g to 2g:
calculations :
10 bit = [-512..511]
`|-2g..2g| = 4g
4g = 1024 LSB
1 LSB = 4g/1024lsb = 0.00390625 g
this is DATAX, DATAY, DATAZ registers
Precision of this mode = 0.00390625g/LSB
offset = 8 bit -128..127 range Scale factor of offset register = 15.6 mg/LSB
for example, if reading data = 230 in decimal, but must 256, then 230 - 256 = -26 260.00390625 = 0.1015625 g 230 0.00390625 = 0.8984375 g 26/(Scale(offset)/Scale(data)) = -Round(-26/4) = 6 a 6 value we must write to register OFSX
Now, we need calculate average value, then calculate OFFSET and write them to registers.
Rule : 1 LSB of offset register correct 4 LSB of data register
But : need support for various Sensitivities and various Scale factors
but need analyze FULL_RES flaq in DATA_FORMAT registry
Calibration includes next steps :
Calibration completed
or not?