Best way to connect 6 IMUs to Teensy 4

Status
Not open for further replies.
Hi,

Can someone point the differences or best possible way to connect 6 IMUs to a Teensy 4.0.

1. Connect them using a TCA9548A I2C Multiplexer (i2c multiplexer to create separate i2c buses for each of the sensors).

2. Or place two on each I2C bus of the teensy SL0*2 + SL1*2 + SL2*2 using the two addresses of the IMU

Example;
In I2C mode, this selects the LSb of the I2C address (SD0_M)
In I2C mode, this selects the LSb of the I2C address (SD0_AG)

#if SDO
#define LSM9DS1XG_ADDRESS 0x6B // Device address when SDO = 1
#define LSM9DS1M_ADDRESS 0x1E // Address of magnetometer = 1
#else
#define LSM9DS1XG_ADDRESS 0x6A // Device address when SDO = 0
#define LSM9DS1M_ADDRESS 0x1D // Address of magnetometerter = 0

3. Is it possible to switch between the 6 IMUs one bus USING digital pins?

IMU1
(SD0_M) + (SD0_AG) = 1

IMU2
(SD0_M) + (SD0_AG) = 0

IMU3
(SD0_M) + (SD0_AG) = 0

IMU4
(SD0_M) + (SD0_AG) = 0

IMU5
(SD0_M) + (SD0_AG) = 0

IMU6
(SD0_M) + (SD0_AG) = 0

Then,

IMU1
(SD0_M) + (SD0_AG) = 0

IMU2
(SD0_M) + (SD0_AG) = 1

IMU3
(SD0_M) + (SD0_AG) = 0

IMU4
(SD0_M) + (SD0_AG) = 0

IMU5
(SD0_M) + (SD0_AG) = 0

IMU6
(SD0_M) + (SD0_AG) = 0

Do this 6 times in a loop (using a digital pin to select), where the address that is high is of interest to me in the sequence?

I have read up on this. I'm a beginner with great interest. Can someone point out the best method for speed, consider using the same microcontroller? It would be deeply appreciated.

Thank you in advance.
Jeffrey
 
Which IMUs?

EDIT: nevermind, saw the code snippet of LSM9DS1.

I haven't worked with that IMU, but just based off the fact that SPI is available, my initial reaction would be to go with SPI. Put all the IMUs on one SPI bus with different chip select pins. Maybe someone with experience with that IMU can chime in...
 
Which IMUs?

EDIT: nevermind, saw the code snippet of LSM9DS1.

I haven't worked with that IMU, but just based off the fact that SPI is available, my initial reaction would be to go with SPI. Put all the IMUs on one SPI bus with different chip select pins. Maybe someone with experience with that IMU can chime in...

Hi, Thank you for your reply and advice. I'm familiar with I2C but haven't looked yet at SPI. Yes, I'm familiar with LSM9DS1, but MPU9250 is of interest to me also.
 
Using all three I2C ports may give you 3x the sampling rate that you would get with a multiplexer. Answering the following questions might get more complete responses:

1. What are your desired and minimum acceptable sampling rates?
2. Do all 6 IMUs need to be sampled at the same rate?
3. What level of precision do you need? (Will oversampling and filtering be needed?)
 
Hi, Thank you for your reply and advice. I'm familiar with I2C but haven't looked yet at SPI. Yes, I'm familiar with LSM9DS1, but MPU9250 is of interest to me also.

MPU9250 is way faster on SPI than I2C. It's been several years since I tested the performance, but if I recall correctly it's something around 22 us to get data from one IMU on SPI and around 200 us to do that over I2C. Which tends to be the case with most sensors, you typically will get much faster reads over SPI.
 
Using all three I2C ports may give you 3x the sampling rate that you would get with a multiplexer. Answering the following questions might get more complete responses:

1. What are your desired and minimum acceptable sampling rates?
2. Do all 6 IMUs need to be sampled at the same rate?
3. What level of precision do you need? (Will oversampling and filtering be needed?)
.

Hi, sample rates, I wouldn't be sure of as of yet. I wanted to run tests initially to come to a conclusion.
Yes, all devices need to be sampled at the same rate. Same project/ with same measurements of interest.
I was looking at one-degree accuracy, but I wanted to demo the sensor first? Yaw is of interest to me (z-axis rotation)

Thank you
 
MPU9250 is way faster on SPI than I2C. It's been several years since I tested the performance, but if I recall correctly it's something around 22 us to get data from one IMU on SPI and around 200 us to do that over I2C. Which tends to be the case with most sensors, you typically will get much faster reads over SPI.

Thank you, again. To be honest, I have always been backward when it comes to SPI. Maybe, I'm overthinking it or just use to I2C. I will look into it over the next few days. Some really good points :) cheers
 
.

Hi, sample rates, I wouldn't be sure of as of yet. I wanted to run tests initially to come to a conclusion.
Yes, all devices need to be sampled at the same rate. Same project/ with same measurements of interest.
I was looking at one-degree accuracy, but I wanted to demo the sensor first? Yaw is of interest to me (z-axis rotation)

Thank you

Just to be clear, IMUs don't measure angles, they measure angular rates (i.e. deg/s), acceleration (m/s/s) and sometimes magnetic field (uT). You'll need a filter to estimate the attitude from those measurements. Depending on the dynamics and the filter, pitch and roll accuracy around 1-2 degrees is possible. Yaw is much more difficult, typically you're happy if you get yaw angle to within 5 degrees.
 
Just to be clear, IMUs don't measure angles, they measure angular rates (i.e. deg/s), acceleration (m/s/s) and sometimes magnetic field (uT). You'll need a filter to estimate the attitude from those measurements. Depending on the dynamics and the filter, pitch and roll accuracy around 1-2 degrees is possible. Yaw is much more difficult, typically you're happy if you get yaw angle to within 5 degrees.

Hi, yes I have converted these rates already to Euler angles and through filters. Yes, I noticed Yaw is worst off. Pitch and roll are around 1 degree.
 
Some IMUs do conversion internally to DCM/quaternion/etc, which is very handy as all the complexity of combining sensors
is done for you and calibrated... But if you just have bare sensors on an IMU make sure there's a matching library that does
most of the work for you if possible.
 
Status
Not open for further replies.
Back
Top