Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong magnetometer values by driver LSM9DS1. #36

Open
ghost opened this issue Jun 19, 2018 · 1 comment
Open

Wrong magnetometer values by driver LSM9DS1. #36

ghost opened this issue Jun 19, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 19, 2018

Hello.
I have a questions about output values for drivers MPU9250 and LSM9DS1.
Accelerometers values in both sensors is multipliers of g.
Gyroscopes values in both sensors is dps. But in drivers values conver to rps (why?).
But magnetometers is differ in these sensors. For MPU9250 values is µT and for LSM9DS1 is gauss.
In driver MPU9250:
_mx = bit_data[0] * magnetometer_ASA[0];
where magnetometer_ASA
magnetometer_ASA[i] = ((data - 128) / 256 + 1) * Magnetometer_Sensitivity_Scale_Factor;
Ok. We have a value.
But in driver LSM9DS1:
_mx = 100.0 * ((float)bit_data[0] * mag_scale);
What is the meaning of the multiplier 100.0? By ((float)bit_data[0] * mag_scale) we have a right value or no? This sensor have a gauss unit.
µT = 1e-6 T = 1e-2 Gs, if LSM9DS1 sensor had a unit of measurement for the µT, then it would be obvious. But this sensor have a gauss unit… Sounds like a issue. Sorry if not right.

Thank you in advance for your help.

P.S.
Datasheets
http://www.st.com/content/ccc/resource/technical/document/datasheet/1e/3f/2a/d6/25/eb/48/46/DM00103319.pdf/files/DM00103319.pdf/jcr:content/translations/en.DM00103319.pdf
https://www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf

@gmsanchez
Copy link
Contributor

I think the multiplication by 100.0 is made to convert the measured Gauss from the LSM9DS1 to µT. In that way, the driver makes both the MPU9250 and the LSM9DS1 report the magnetometer values in the same units (µT)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant