Go to Post I also hate it when I keep seeing this message: "You must spread some Reputation around before giving it to Andy Baker again." - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 20-03-2010, 21:00
ajd ajd is offline
Registered User
FRC #3238
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Mount Vernon, WA
Posts: 46
ajd will become famous soon enough
I2C Cable Length issue?

Our team is using a HiTechnic color sensor made for the Lego NXT. We are able to use it with a standard NXT cable plugged into the jack on the digital sidecar.

We wanted to put the sensor somewhat farther away from the sidecar than our NXT cables could reach, so we cut an NXT cable in half and soldered PWM-gauge wires across corresponding colors. However, when we plugged it in and rebooted the robot, the cRIO reported that the sensor did not respond when it was asked for its name and manufacturer.

We are fairly certain that our solders are good and that the right cables are soldered together - we used a multimeter to check continuity, etc. Since the wiring is essentially identical to the original cable, the only thing we can think of being a problem is the high cable length interfering with the signal. Has anyone else had any problems with trying to extend NXT cables?

Also, when we tried our soldered NXT cable with an ultrasonic sensor on a real NXT, things seemed to work fine (i.e. the sensor was usable). We haven't tried a color sensor on the real NXT yet; we will when we get back to the lab on Monday.

Thanks for any advice, information or experiences anyone can share.
Reply With Quote
  #2   Spotlight this post!  
Unread 29-03-2010, 04:05
Danny Diaz's Avatar
Danny Diaz Danny Diaz is offline
Smooth Operator
AKA: FrankenMentor
None #0418
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Manchester, NH
Posts: 545
Danny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond repute
Send a message via AIM to Danny Diaz
Re: I2C Cable Length issue?

Quote:
Originally Posted by ajd View Post
We wanted to put the sensor somewhat farther away from the sidecar than our NXT cables could reach, so we cut an NXT cable in half and soldered PWM-gauge wires across corresponding colors. However, when we plugged it in and rebooted the robot, the cRIO reported that the sensor did not respond when it was asked for its name and manufacturer.

We are fairly certain that our solders are good and that the right cables are soldered together - we used a multimeter to check continuity, etc. Since the wiring is essentially identical to the original cable, the only thing we can think of being a problem is the high cable length interfering with the signal. Has anyone else had any problems with trying to extend NXT cables?
I'm using a different I2C sensor (a compass with tilt compensation) and I am getting the same problem - though I have not yet tried to plug into an NXT since I actually need the 5v from the digital sidecar (and not 4.3v from NXT). I am using the longest NXT cable, with an end cut off and I attached about 3-4 inches of additional PWM cable to break out the power vs the I2C data/clock lines. I am also running into a problem with the cRIO where the device seems to "not respond" when asking for its address and other information. Not sure if it's the exact same problem, but it seems similar. I'm going to look into this further, and let you know what I find - I'd hope it isn't the cable length, I2C is supposed to be able to handle 10 meters of cabling (which I'm nowhere near even 1 meter).

-Danny
__________________
Danny Diaz
Former Lead Technical Mentor, FRC 418

Last edited by Danny Diaz : 29-03-2010 at 04:08. Reason: added info
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2011, 12:52
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: I2C Cable Length issue?

Be aware that i2c has a limitation on maximum bus capacitance of 400pF (Source: http://en.wikipedia.org/wiki/I2c#Design) and that you may have inadvertently exceeded that with your wire splicing connections. If you don't have access to the an LCR Bridge to read the capacitance, you can get creative with some resistors and an oscilloscope to see what your cables capacitance is.

The capacitance becomes a problem because i2c relies on pull-up resistors to stabilize the bus when it's idle. Whenever a device outputs a logical 1 (or the start of a clock pulse) the line is disconnected and because of the pull-up resistor, goes to 5V (in this case, other busses may have different IO voltages). However any capacitance in the line slows that process down as it needs to build a charge, too much capacitance, the line doesn't reach a 1 state by the time something expects it to, and communications break down.

Wires running parallel to each other have some capacitance, which increases as distance increases, this is what typically causes cable length problems for i2c. I'm not sure off the top of my head because I typically use very short busses, or something more robust for my projects, but twisted pair wiring (such as that in Ethernet cabling) may be suitable for this.

I hope my explanation made sense, if not, feel free to reply to me or PM me for more information.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2011, 13:03
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: I2C Cable Length issue?

I'm putting my vote behind Matt's suggestion. However, just be sure to check that there aren't any shorts between the wires first.

If you have an oscope available, take a look at the wave forms. If they look a bit too curvy (as opposed to square), your RC time constant is too long. You can fix this by reducing C (shortening the cables), or reducing R.

To reduce R (increase pull up strength), the header just behind the NXT connector is a convenient place to do it. Try putting a 2k or 3k resistor in parallel to start. Check the schematic for details.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2011, 20:25
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: I2C Cable Length issue?

Quote:
Originally Posted by EricVanWyk View Post
I'm putting my vote behind Matt's suggestion. However, just be sure to check that there aren't any shorts between the wires first.

If you have an oscope available, take a look at the wave forms. If they look a bit too curvy (as opposed to square), your RC time constant is too long. You can fix this by reducing C (shortening the cables), or reducing R.

To reduce R (increase pull up strength), the header just behind the NXT connector is a convenient place to do it. Try putting a 2k or 3k resistor in parallel to start. Check the schematic for details.
I hadn't thought of that, clever trick.

For those not sure what Eric is referring to, putting resistors in parallel lowers the resistance of the circuit, unlike putting them in series, which adds up all the resistances.

If you have two resistors in parallel, you can calculate their resistance as:

Code:
Rp = (R1 * R2) / (R1 + R2)
This means with the 10k (I believe) pull up in the sidecar, putting a 2k in parallel with it (by connecting the resistor to the +5V and the signal line on the sidecar) you'd get:

Code:
Rp = (10k * 2k) / (10k + 2k) = (20k / 12k) = 1.67k approximately
This would give you considerably more driving power and may be enough to overcome the bus capacitance.

Be warned though, I'm not sure on the legality of this, and I'd make sure to look up the technical specs on the digital sidecar to ensure your new resistors don't exceed any maximums on the output. (I'm still catching up on the new control system, I was an IFI guy back in the day...)

EDIT:

According to section 3.4.3 Specifications in this document: http://www.usfirst.org/uploadedFiles...Rev1_enc .pdf
the sidecar is capable of supply 3A continuous current nominally with a 5V supply. I would try not using all of that current on one GPIO it should be more than enough to drive any reasonable resistors you pick for your i2c bus. However I'd still be wary of the rules on this, I'm not sure how it falls
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)

Last edited by Matt Krass : 17-01-2011 at 20:40. Reason: Clarified current availability
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple I2C sensors ajd Sensors 7 20-02-2011 00:55
Sidecar cable length AdamHeard Electrical 7 29-01-2010 10:53
i2c output virtuald Programming 16 18-01-2009 19:20
I2C tutorials John Gutmann Electrical 3 30-07-2005 10:44
I2C? John Gutmann Electrical 3 19-07-2005 22:52


All times are GMT -5. The time now is 08:01.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi