[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the mainline kernel bma400 device driver, there are multiple-scale
values for different acceleration ranges +-2g, +-4g, etc.

root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
cat in_accel_scale_available
0.038357 0.076714 0.153428 0.306856

With +-4g range
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
cat in_accel_scale
0.076714
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
cat in_accel_z_raw
519
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
echo "0.076714 * 506" | bc
39.277568

With +- 2g range
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
echo 0.038357 > in_accel_scale
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
cat in_accel_scale
0.038357
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
cat in_accel_z_raw
1012
root@raspberrypi:/sys/devices/platform/soc/3f804000.i2c/i2c-1/1-0014/iio:device0#
echo "0.038357 * 1012" | bc
38.817284

The _raw value from the sensor is as per the datasheet but the final value for the
Z axis after applying scale for all ranges is around 38.8 which is not expected.
I tried by placing the sensor in a different position where the X-axis value should
be approximately 9.8 m/s2 but In this case also the value is around 38.8 m/s2

Is the above method to calculate the acceleration in the Z-axis correct or
am I missing something?

For confirmation I also tested the mpu6050 IMU.

root@raspberrypi:/sys/bus/iio/devices/iio:device1# cat in_accel_scale_available
0.000598 0.001196 0.002392 0.004785
root@raspberrypi:/sys/bus/iio/devices/iio:device1# cat in_accel_scale
0.000598
root@raspberrypi:/sys/bus/iio/devices/iio:device1# cat in_accel_z_raw
16706
root@raspberrypi:/sys/bus/iio/devices/iio:device1# echo "0.000598 * 16706" | bc
9.9801
With MPU6050 I am getting 9.9801 m/s2 which is near to earth's acceleration due
to gravity 9.8 m/s2

For BMA400 I recalculated the scale values from sensitivity for different
acceleration ranges
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bma400-ds000.pdf

For +-2g - 1 LSB = 0.0095768 m/s2
For +-4g - 1 LSB = 0.0191536 m/s2
For +-4g - 1 LSB = 0.0383072 m/s2
Is the above method to calculate the scale values correct or am I missing
something?

Thank you
Jagath




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux