-
Notifications
You must be signed in to change notification settings - Fork 14
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
Using the library for internal and external LSM9DS1 #14
Comments
Somebody used it on an external IMU using a classic Aduino UNO with only 5% of the memory, so yes it can be done. I don't know if he had to modify any internal register addresses. |
Thank you.
I turns out on the Arduino BLE sense there are two different I2C busses.
Glenn
…On Mon, Feb 1, 2021 at 12:56 PM FemmeVerbeek ***@***.***> wrote:
Somebody used it on an external IMU using a classic Aduino UNO with only
5% of the memory, so yes it can be done. I don't know if he had to modify
any internal register addresses.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKRQJUVTY2L3UAY4LSDS44IOPANCNFSM4VETNBFA>
.
|
I'm not a specialist on the I2C busses. AFAIK that communication is in the wire library. |
Correct, there are two instances on the BLE sense.
Wire and Wire1.
I do have it partially working with two LSM9DS1.
I can give you the examples code when I finish it.
Glenn
…On Mon, Feb 1, 2021 at 1:13 PM FemmeVerbeek ***@***.***> wrote:
I'm not a specialist on the I2C busses. AFAIK that communication is in the
wire library.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKTTGAFU7UOWYQTQPJ3S44KRHANCNFSM4VETNBFA>
.
|
I'll probably never use it myself, but perhaps for others reading this. |
Femme,
Thanks for your library. I use it on the BLE Nano sense.
So can you confirm that the accel and gyro always are at the same output
data rate?
I think you say that you can only utilize the accel, which is what I want
to do.
So, I just need to disable or not enable the gyro.
IMU.setGyroODR(0); // switch off gyro
IMU.setAccelODR(2); // 50 Hz ODR
I did confirm that there are two I2C interfaces - internal and external.
Use with Wire or Wire1 - or both.
So theoretically, you can use up to three devices (one internal, two
external).
thanks,
glenn
…On Mon, Feb 1, 2021 at 1:43 PM FemmeVerbeek ***@***.***> wrote:
I'll probably never use it myself, but perhaps for others reading this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKSSYSUDN6I3XAVJIODS44OAVANCNFSM4VETNBFA>
.
|
Hi Glenn, Note that the ODR values in the documentation tables are not acurate, not good enough for navigation purposes. The library measures the actual ODR at every setting change and stores it internally, but this was not designed to serve multiple IMU's. If you need the acurate number per IMU, you must store it yourelf. You can get the values by calling getAccelODR() getGyroODR() and getMagnetODR() Femme |
Femme,
Thank you so much.I owe you a beer.
I am working on a commercial product and am not sure based on high volume
pricing which one is best.
We are working on a proof of concept prototype and the LSM9DS1 was the
easiest to acquire.
Do you have an opinion on which IMU is the best based on accuracy and price.
thanks,
glenn
…On Sat, Feb 6, 2021 at 4:09 PM FemmeVerbeek ***@***.***> wrote:
Hi Glenn,
Correct, and yes that's how to disable the gyro. There are three
operational modes 0=off , 1= Accel only , 2= Gyro +Accel, see int
getOperationalMode();
When both are working they always share the same ODR.
Note that the ODR values in the documentation tables are not acurate, not
good enough for navigation purposes. The library measures the actual ODR at
every setting change and stores it internally, but this was not designed to
serve multiple IMU's. If you need the acurate number per IMU, you must
store it yourelf. You can get the values by calling getAccelODR()
getGyroODR() and getMagnetODR()
Femme
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKRZDPOYCDVQMJ6RH6TS5XK2LANCNFSM4VETNBFA>
.
|
No, sorry. The LSM9DS1 is a big seller. If the specs are good enough for you it is probably a good choise. The ODR is a bit disappointing. The makers promised 952Hz, but in reality it is closer to 500Hz. They say you need 2000 for drone flight orientation. |
Ok, thanks.
I only need 10/second and does not work with the default code.
I know your code works because I blink the LED and it works as stated.
thanks,
glenn
…On Sat, Feb 6, 2021 at 4:27 PM FemmeVerbeek ***@***.***> wrote:
No, sorry. The LSM9DS1 is a big seller. If the specs are good enough for
you it is probably a good choise. The ODR is a bit disappointing. The
makers promised 952Hz, but in reality it is closer to 500Hz. They say you
need 2000 for drone flight orientation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKQUSRX4D3UIJT73CELS5XM5ZANCNFSM4VETNBFA>
.
|
Femme,
I was able to get the external LSM9DS1 to work on the NANO33BLE.
Unfortunately, I had to modify the code to force the use of Wire, not Wire1.
I tried declaring IMUexternal separately, but it didn't work.
See the code below.
thanks,
glenn
#ifdef ARDUINO_ARDUINO_NANO33BLE
///LSM9DS1Class IMU(Wire1);
LSM9DS1Class IMU(Wire);
// By default on the NANO33BLE, the code uses the internal I2C bus.
// If needed, also enable using the LSM9DS1 on the external I2C bus.
LSM9DS1Class IMUexternal(Wire);
#else
LSM9DS1Class IMU(Wire);
#endif
…On Sat, Feb 6, 2021 at 4:36 PM glenn swonk ***@***.***> wrote:
Ok, thanks.
I only need 10/second and does not work with the default code.
I know your code works because I blink the LED and it works as stated.
thanks,
glenn
On Sat, Feb 6, 2021 at 4:27 PM FemmeVerbeek ***@***.***>
wrote:
> No, sorry. The LSM9DS1 is a big seller. If the specs are good enough for
> you it is probably a good choise. The ODR is a bit disappointing. The
> makers promised 952Hz, but in reality it is closer to 500Hz. They say you
> need 2000 for drone flight orientation.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#14 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABBXCKQUSRX4D3UIJT73CELS5XM5ZANCNFSM4VETNBFA>
> .
>
|
It does not make sense to me. If you want to use a second chip you should declare it yourself in your sketch. #endif That should give you two objects |
Femme,
Yes I agree. I just needed a quick fix to keep moving forward on my project.
I will do as suggested and update you when it is working.
I will also provide you with some working code for pitch and roll
processing based on the IMU acceleration.
thanks,
glenn
…On Sun, Feb 7, 2021 at 2:07 PM FemmeVerbeek ***@***.***> wrote:
It does not make sense to me.
The declaration you refer to is in the private section, so IMUexternal
should not be visible outside the library.
Didn't you forget to init the new Object?
The idea of OOP is that you reuse code, not rewrite it.
The library predeclares and inits one object of the LSM9DS1Class called
IMU.
If you want to use a second chip you should declare it yourself in your
sketch.
e.g.
#ifndef ARDUINO_ARDUINO_NANO33BLE
LSM9DS1Class IMUexternal(Wire);
IMUexternal.begin(); // don't forget to init your object.
...
...
#endif
That should give you two objects
IMU which was already predeclared connected to Wire1
IMUexternal connected to Wire
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBXCKQGOMUOIACWGSRC3PTS54FKFANCNFSM4VETNBFA>
.
|
The BLE Sense has an internal IMU. I need an additional one at a different address.
Both SparkFun and Adafruit sell an external version.
Does this library support the alternate address of an additional IMU?
The text was updated successfully, but these errors were encountered: