NXTMMX Daisy Chaining

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

NXTMMX Daisy Chaining

Postby icemadsen » Wed Mar 02, 2011 5:35 pm

Hi!

As a further development from a previous thread (http://lejos.sourceforge.net/forum/viewtopic.php?t=2521) about the NXTMMX multiplexer from Mindsensors, where we got it working with the release version (0.8.5) of LeJOS, we are now having problems with daisy-chaining 3 of them.

We have downloaded the RXE-files on Mindsensors website and using them we have successfully changed adresses on every MUX in the chain.

Using just one MUX (without a sensor attached), everything works fine and daisy-chaining another MUX also works fine. However, when we add the third mux they all stop working, which is strange, since Xander Soldaat has a post on his blog (http://mightor.wordpress.com/2010/04/28/mindsensors-motor-multiplexer-nxtmmx/) claiming that it supports upto 5 MUX's in a daisy-chain (using RobotC) - and knowing Xander, he would not make a such a claim without testing it first ;-)

So we don't know whether this is due to some error in LeJOS or what is causing this?

The project using these MUX's is due to be ready on Monday, so a fast reply is very much appreciated!

- Kenneth
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby gloomyandy » Wed Mar 02, 2011 6:20 pm

I've no idea how these devices work but if by daisy chain you mean operate several of them on the same i2c bus, then here are a few things (in order of desperation) to try...
1. use the shortest cables that you have.
2. Make sure you have disabled the pull up resistors on all but one of the devices. You do this using the ADPA function that some mindsensors devices support (no idea if this one does).
3. Try the latest leJOS snapshot to see if that helps (I fixed some things that can cause problems with multiple i2c devices on the same bus). But note that many many things have changed since 0.8.5 and using the snapshot may break your existing code.
4. Use RobotC...


Perhaps it would have been a good idea to test something like this a little earlier in your project...

Good luck

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3881
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby icemadsen » Wed Mar 02, 2011 6:40 pm

Thank you for your response Andy and yes it would have been a good idea to test this earlier in the project, but we did not know at that time they would be daisy-chained - unfortunately we just realized today that the standard LEGO ColorSensor is not an I2C sensor, so we needed to "free" two extra sensor ports on the NXT... Since it had 3 MUX's taken up 3 sensor ports, daisy-chaining looked like a perfect solution.

1. We already have used the shortest cables we have (the shortest one from the HiTechnic cable set).
2. This sure sounds like a probable cause for the error - could you elaborate more about this and how to check whether the MUX supports this or not?
3. Our latest experiences with the snapshot turned out to crash with our current program (as described in the last thread), however we will try to see if only daisy-chaining works in the snapshot version and then see what to do.
4. Not an option, since this project is an extension to a previous project, which uses LeJOS and the two projects is communicating heavily with eachother.
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby kirkpthompson » Wed Mar 02, 2011 6:50 pm

Can you get Mindsensors to provide technical info on their daisy chain addressing scheme?
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby icemadsen » Wed Mar 02, 2011 7:41 pm

kirkpthompson wrote:Can you get Mindsensors to provide technical info on their daisy chain addressing scheme?


Well, according to what we know about the MUX, it has a pass-through to the sensor port, so as long as the same type of devices has different adresses (and no two devices has the same) it should work...

Or are you thinking on something else?
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby kirkpthompson » Wed Mar 02, 2011 8:02 pm

have you tried all permutations of connecting the three MUXes to see if a certain one causes a problem in the chaining?

i.e. a>b works
b>a works
a>c works
a>b>c doesn't work
c>a doesn't work

Tried changing the sensors connected to each MUX around to determine if there is a sensor issue?

So all three have different addresses and work when they have their own NXT sensor port... hmmmm...

Basically, try to isolate if a particular MUX or sensor has "issues"

-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby icemadsen » Thu Mar 03, 2011 8:28 am

kirkpthompson wrote:have you tried all permutations of connecting the three MUXes to see if a certain one causes a problem in the chaining?

i.e. a>b works
b>a works
a>c works
a>b>c doesn't work
c>a doesn't work

Tried changing the sensors connected to each MUX around to determine if there is a sensor issue?

So all three have different addresses and work when they have their own NXT sensor port... hmmmm...

Basically, try to isolate if a particular MUX or sensor has "issues"

-K


We did some permutations, but did not manage to find a chain of 3 MUX's working together out of the 12 MUX's we have available.

All three works fine when they are on their own NXT sensor port!

Andy: We've tried to install the snapshot version from SVN, but it seems like there is a problem with the current snapshot version, since we are getting the same error as http://lejos.sourceforge.net/forum/viewtopic.php?t=2580, and we are using the same approach for installing as last time, where we succeeded to install the snapshot. Do you know which revision we could use instead, where your fixes and improvement of I2C is implemented and the snapshot is working?
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby mattallen37 » Thu Mar 03, 2011 8:39 am

It sounds like a pullup issue. Three 82k's in parallel is about 27k. That may be too strong. The NXT "protection" resistors (4k7) in series with the IO lines, and the pullups, form a voltage divider when the NXT sends a LOW. The stronger the pullups, the higher the "LOW" signal the sensor will see. Probably the strongest pullups you can use with the NXTMMX is something between 27k and 41k. This would explain why two work, but not three.

Can you configure your sensors differently? Can you have two NXTMMX's on one port, and have one on another (with an analog sensor connected to the through port)? You said you were using a Lego color sensor, but what other sensors are you using?
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Re: NXTMMX Daisy Chaining

Postby skoehler » Thu Mar 03, 2011 8:43 am

icemadsen wrote:So we don't know whether this is due to some error in LeJOS or what is causing this?


If the Lego two-wire bus would be proper I2C, then attaching multiple devices to the same bus would be no problem. However, it is not a proper I2C bus. Sensors contain pull up resistors. Attaching too many of those sensors to the same bus is bad. This whole MUX and daisy chaining thing is very experimental. Might work, might not work - it depends on a lot of things.

Don't blame it on leJOS. Blame it on false advertising.
skoehler
leJOS Team Member
 
Posts: 1387
Joined: Thu Oct 30, 2008 4:54 pm

Postby icemadsen » Thu Mar 03, 2011 10:51 am

mattallen37 wrote:It sounds like a pullup issue. Three 82k's in parallel is about 27k. That may be too strong. The NXT "protection" resistors (4k7) in series with the IO lines, and the pullups, form a voltage divider when the NXT sends a LOW. The stronger the pullups, the higher the "LOW" signal the sensor will see. Probably the strongest pullups you can use with the NXTMMX is something between 27k and 41k. This would explain why two work, but not three.

Can you configure your sensors differently? Can you have two NXTMMX's on one port, and have one on another (with an analog sensor connected to the through port)? You said you were using a Lego color sensor, but what other sensors are you using?


We are currently in contact with Mindsensors to give us a firmware edition with pull-ups disabled, such that in a 4-chain, we can use the first 3 MUX's - at least this is what they told us, but we will see how it goes when we gets the modified firmware edition.

On the sensor part, the MUX only supports I2C sensors and since we just found out that the LEGO Color sensor is not an I2C sensor and the Ultrasonic sensor has a non-standard I2C implementation, we did not have another type of I2C sensor present yesterday, but we will try using an accelerometer later today to see if we can get that to work.
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby mattallen37 » Thu Mar 03, 2011 10:57 am

I think it is just a through port, so you should be able to use almost any sensor on that port. Even though the ultrasonic sensor is weird, I think it should still work. What sensors do you need on the robot?
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Postby icemadsen » Thu Mar 03, 2011 11:02 am

mattallen37 wrote:I think it is just a through port, so you should be able to use almost any sensor on that port. Even though the ultrasonic sensor is weird, I think it should still work. What sensors do you need on the robot?


We are using Color sensors, Touch sensors and Ultrasonic sensors on the robot, but will try attaching a Color sensor to it later today, to see if it is a through port.
User avatar
icemadsen
Novice
 
Posts: 31
Joined: Tue Dec 08, 2009 11:41 am

Postby mattallen37 » Thu Mar 03, 2011 11:10 am

The color sensor uses one of the IO lines as an analog line (ADC), so it probably won't. The pullup (if nothing else) will effect it. The touch sensors or ultrasonic sensors should work though.

I haven't ever used leJOS yet, so I am not sure about how to do specific things, but if you use touch sensors (analog sensors) on the same port as I2C devices, you will probably need to switch how your port is configured between each interaction/reading. I know that in NXC, you have to put it into analog mode, read the sensor, put it in I2C mode, do the transaction, and keep repeating this cycle.
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Postby gloomyandy » Thu Mar 03, 2011 11:13 am

You do not need to switch the port between modes to allow access to analogue and i2c data. However many sensors use the digital lines as well as the analogue line so you have to check this on a case by case basis. You will probably be Ok mixing touch and i2c, but you may need to take care with the order that you create the devices...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3881
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby mattallen37 » Thu Mar 03, 2011 11:15 am

The touch sensor doesn't use the digital pins, only Gnd and Analog.
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Next

Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff