Page 2 of 3

Re: ESP32 and LSM9DS1 not compiling

Posted: Wed Feb 28, 2024 9:01 am
by stefan.erni
Hi to All

There is a nice Breakoutboard wit a LSM9DS1 and two qwii connector.
Adafruit LSM9DS1 Accelerometer + Gyro + ... F Breakout

It's working with FC10 on an ESP32 simple and stable.
Another big advantage is that two sensors can be connected with one cable and the address of the second sensor can be changed with two small solder bridges. FC10 supports both addresses very comfortable. Also a long Qwii cable can go to the first board and from there a short Qwii cable to the second board. Each board has two Qwii connectors.

Unfortunately, there are two problems

1.
After saving and opening the project, the information about the channel of the LSM9ds1 is lost. This is not pleasant, especially with several LSM9ds1s.
2.
The 16 bit values from the Accelerometer/Gyro are in the wrong order, high byte and low byte are swapped. So I have to swap them myself back.
(Magnetometer is correct)

Maybe that can be improved and it would be a very practical component

regards

Stefan

Swap the A/G byte order:
Snag_56a23de.png
Snag_56a23de.png (37.82 KiB) Viewed 801 times

choose Ground if you use the bridge to ground:
Snag_561792d.png
Snag_561792d.png (49.33 KiB) Viewed 801 times
Just solder a bridge:
Snag_55fd87d.png
Snag_55fd87d.png (754.97 KiB) Viewed 801 times

Re: ESP32 and LSM9DS1 not compiling

Posted: Wed Feb 28, 2024 3:05 pm
by medelec35
Thanks for the information, Stefan.
We will look into this and sort it out for you as soon as we can.

Re: ESP32 and LSM9DS1 not compiling

Posted: Wed Feb 28, 2024 3:32 pm
by stefan.erni
Hi Martin

At this opportunity:
I have another small problem.
If I connect both LSM9DS on one bus, all 18 axes work perfectly.
But if only one LSM9DS is connected I want to know which one.
I tried to evaluate the return value from initialize the component
but no matter if the LSM9DS is connected or not, the return value is always 0.
With the MPU6886 this works very well.

So I tried to read a register from the LSM9DS.
Register 15 should always return the value 61 at the AG or 104 M.
But both times it reads the register from the first LSM9DS used. There is something small wrong

regards
Stefan

How I did it when the ret_byte were always 0:

Re: ESP32 and LSM9DS1 not compiling

Posted: Wed Mar 06, 2024 3:16 pm
by stefan.erni
Hi Martin

I tried to make a macro to read the register values. I want to use it to read the values and change them later, for example to switch filters on or off.
But I have a little problem with the I2C master. Do I have to initialize the transaction and then deinitialize it again?
And is the I2C master the right component for this?

Init all:
Snag_2ad9d613.png
Snag_2ad9d613.png (31.9 KiB) Viewed 756 times
use the macro:
Snag_2ada3162.png
Snag_2ada3162.png (105.21 KiB) Viewed 756 times

Re: ESP32 and LSM9DS1 not compiling

Posted: Tue Apr 09, 2024 7:51 am
by stefan.erni
Hi Martin

I still have small problems with the sensor and also with the I2C bus to read and write the registers.

regards

Stefan

Re: ESP32 and LSM9DS1 not compiling

Posted: Tue Apr 09, 2024 8:27 am
by medelec35
Thanks Stefan.
Sorry for the delay, this has slipped under the net.
I will see if I can find out what's going on.

Re: ESP32 and LSM9DS1 not compiling

Posted: Thu May 02, 2024 10:34 am
by stefan.erni
Hi Martin
Filters
I do not use filters with Flowcode. However, it would be easy and convenient to install such filters.

This is not a simple sensor. There are two sensors in one housing. 3D accelerometer, 3D gyroscope, is one and the3D magnetometer is the another one.

However, the sensor itself has built-in filters.
I do not yet have access to what these filters are set to. But I will try to read and configure these filters. Would it be possible to update the sensor?
So the register reading and wri􀆟ng works

regards

Stefan

Re: ESP32 and LSM9DS1 not compiling

Posted: Mon May 13, 2024 2:05 pm
by BenR
Hi Stefan,

Sorry for the delay and many thanks for reporting your findings on the various issues.

I beleive I have now fixed all of the following...
1.After saving and opening the project, the information about the channel of the LSM9ds1 is lost. This is not pleasant, especially with several LSM9ds1s.
2.The 16 bit values from the Accelerometer/Gyro are in the wrong order, high byte and low byte are swapped. So I have to swap them myself back.
3. I tried to evaluate the return value from initialize the component but no matter if the LSM9DS is connected or not, the return value is always 0.
4. Update the component so register read/write works.
So you will probably need to switch the bytes back in your program or simple disable the icons that do the switching.

For point 4 I've added a new SetAddress macro that allows you to specifically target either the Accel or the Magnetometer and this should hopefully allow the read/write register macros to work correctly by ensuring you're talking tot he right IC inside the device.

Re: ESP32 and LSM9DS1 not compiling

Posted: Mon May 13, 2024 3:13 pm
by stefan.erni
Hi Ben

That's good news. I'll test it right away

but there is a small mistake
I have made the update but then there is a fail when compiling, if I undo the update I can compile again without errors.

I use the latest version FC10
2024-05-13_16-07-53.PNG
2024-05-13_16-07-53.PNG (8.05 KiB) Viewed 88 times
here my program:
L24_1.fcfx
(175.84 KiB) Downloaded 1 time

Re: ESP32 and LSM9DS1 not compiling

Posted: Mon May 13, 2024 4:09 pm
by BenR
Hi Stefan,

Thanks for that, hopefully resolved now.