Page 1 of 1

IMU Sensor SEN-10183 I2C NXT

Posted: 03 Jan 2012, 17:15
by rsantoz
Hi, I am an Electrical Engineering Student, in the Autonomous Systems course, and I had to develop an Extended Kalman Filter for attitude estimation.

After the Filter development, I had to take measurements from the following sensor:

http://www.sparkfun.com/products/10183

using the NXT brick. Unfortunately i can't communicate with the sensor since i keep getting errors like:

error message 221: "Communication bus error"
and
error message 32: "Pending Communication transaction in progress"

We can get the measurements from the NXT sensors.

Does anyone have an idea of what can be done to take measurements, using I2C interface with Matlab, from this kind of sensor?

Thanks for your help,
Regards
RS

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 03 Jan 2012, 17:51
by mightor
The pull-ups may not be sufficient, they're only 4.7K and the NXT likes them around 83K for 5V and around 47K for 3V3.

- Xander

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 03 Jan 2012, 18:39
by rsantoz
First thank you for your reply,

We already tried a pull-up with 82k resistors for 5V, since we found that info somewhere in this forum...

Can you identify any other possible problem?

Thank you again,
RS

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 03 Jan 2012, 21:21
by mightor
Your IMU runs on 3V3, judging from the schematics on the product page. So why are you pulling up to 5V when a 47K to 3V3 will do fine. You may need a level converter like this one: http://www.sparkfun.com/products/8745

Also, don't cross post to multiple sub forums. I will delete the other one and move this thread.

- Xander

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 04 Jan 2012, 03:06
by mattallen37
Quick answer: expect it to be the hardest sensor you'll ever interface with the NXT (and hopefully it wont be too bad)!

Take a look at this topic for a more complete answer :?

I don't know what all you tried, or are capable of, but read through that topic for more info. I think the gyro and accel are the same for both IMUs, so expect the same issues.

Once you finish reading that topic (which explains some things), then click on the spoiler:
The one thing that I don't think was tested, and should work, is Philo's suggestion to use an I2C bus repeater (specifically the PCA9517). I would greatly recommend trying it, but unfortunately didn't know of such a device at the time of the other topic. Perhaps you will be successful much quicker than Aswin was.
Once you get the electrical right, and are able to communicate properly with the accelerometer and gyro, then it looks like communication with the magnetometer should be fairly straight forward.

Basically, make sure none of the pins on the IMU ever come in contact with a voltage >3.3v.

I also recommend you use a programming language that supports custom I2C calls. I don't know what all Matlab supports, but with a HW hack, you need to be reasonably sure that the SW isn't to blame for a lack of functionality (so you can focus on HW errors). I suggest you use NXC, as many people on these forums use it. ROBOTC is good as well, but not free (also not really supported here). If you are comfortable with Matlab, and confident with low level I2C (at a byte level), then I'd say give it a go.

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 04 Jan 2012, 07:00
by mightor
ROBOTC is good as well, but not free (also not really supported here)
Well, that's not really true. As long as I'm still around on these forums, it'll be supported. Don't forget about some of the other ROBOTC power users on these forums, there's quite a few of them :) However, there /is/ a ROBOTC specific forum, which you can find here: http://www.robotc.net/forums/.

These forums are language-agnostic, just as long as the subject is vaguely Mindstorms-related.

- Xander

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 04 Jan 2012, 16:28
by mattallen37
Oh, I know. I just meant that NXC is by far the most used on these forums (compared to ROBOTC), and more people here seem to use NXC than ROBOTC.

Re: IMU Sensor SEN-10183 I2C NXT

Posted: 05 Jan 2012, 14:13
by aswin0
I do not want to change this topic into a "what is the best environment" flame war. But in this case I would go for Lejos. It does have support for working with matrices, which is invaluable when doing Kalman filters.
I do have robotC and Lejos drivers for all three sensors on this board.

Do you have any documentation of the Kalman filter you designed? I am very curious to the state you modeled.