Go to Post I wasn't pouting; just cowering in fear because I actually thought you were mad at me... I didn't want a clipboard to the head like Billfred here. - Jon K. [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-08-2010, 10:24 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Set Jaguar device number via cRIO

So I finally got the time to try out CAN. However, I can't seem to address my black Jaguar.
Here's the setup:
1 black jaguar, connected to cRIO via serial
1 120 ohm resistor between CAN_H and CAN_L
Here's the code I'm using:


The enumeration command returns one element with a value of 0. If I interrupt the CAN or serial communication in any way (unplugging a cable, removing the termination resistor, or removing power to the jaguar), it returns an empty array.
There's a couple documents saying that the default device number for a Jaguar is 1. Sounds like my results are a little strange.
Pressing the "user button" on the Jaguar doesn't have any effect on the return of the enumeration command.

Is there anything I'm doing wrong?
__________________
-- Marshal Horn
Reply With Quote
  #2   Spotlight this post!  
Unread 05-09-2010, 12:10 AM
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Set Jaguar device number via cRIO

Have you set an ID and updated the firmware of the black jag through BDC-Comm (on a PC)? I'm not sure how cooperative an unprogrammed jag is with the FRC code
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #3   Spotlight this post!  
Unread 05-09-2010, 12:46 AM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Set Jaguar device number via cRIO

I managed to dig up a USB to serial device, but I had the same problems.
__________________
-- Marshal Horn
Reply With Quote
  #4   Spotlight this post!  
Unread 05-09-2010, 11:57 AM
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Set Jaguar device number via cRIO

Is the LED on the jag blinking yellow? If not you may be stuck in bootloader. There should be a recover device option in BDC-COMM, which should fix it.

I believe ID 0 means broadcast to all (or it may be host device, not sure). If the jag is somehow assigned to that ID, I'd expect the system to not work properly. Have you tried holding the user button while you turn the power on to the robot? That is supposed to reset the ID to 1.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #5   Spotlight this post!  
Unread 05-09-2010, 02:18 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Set Jaguar device number via cRIO

Yes, the LED is blinking yellow. If I plug in a PWM cable, Normal PWM operation works perfectly (including the LED, brake, coast, and the limit switches).
If I connect another Jaguar on the CAN bus, it shows no change.
However, I think I made a mistake in a previous test. It makes no difference whether the termination resistor is present or not. It should be 120 ohms, and connecting the CAN low and CAN high, correct?
__________________
-- Marshal Horn
Reply With Quote
  #6   Spotlight this post!  
Unread 05-09-2010, 07:21 PM
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Set Jaguar device number via cRIO

The data sheet says to use 120 ohm resistors, but in the cable assembly guide it says that 100 ohm work just fine.

Also, since you are using serial mode, there should be 2 resistors. One of them is in a jack at the end of the chain, and the other is inside the serial adapter, bridging the green and red wires.

I guess the only thing left to check is your wiring. Are you using a 6-conductor wire between the cRIO and the black jag? Have you tried a different wire? Are you sure you made the apapter properly? The end result inside of it should have been the red and green wires connected to a resistor, 3 more going to the DB-9 connector, and one left free. I remember I didn't have the bus working for a while because I didn't push the pins all the way into the DB-9 port
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #7   Spotlight this post!  
Unread 05-09-2010, 09:13 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Set Jaguar device number via cRIO

Thanks, I forgot to put one on both ends.
I'm using bdc-comm right now, for superstitious aid.
I've tried both 120 ohm and 100 ohm resistors, but no change. I've even measured the resistance between CANL and CANH after assembly, but it's around 50 ohms, just as you'd expect.
I guess the next thing is to take out an O-scope and see if there's any data being sent on the bus at all. There should be a heardbeat from bdc-comm.
__________________
-- Marshal Horn
Reply With Quote
  #8   Spotlight this post!  
Unread 05-09-2010, 10:58 PM
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Set Jaguar device number via cRIO

Are you using the DB-9 to RJ14 (6p-6C) adapter that was specified in the instructions?
I have had bad luck in trying other adapters (like the ones at frys), you are using the one from digikey?

(Btw. all the part numbers from digikey can be found in this document http://firstforge.wpi.edu/sf/go/doc1030?nav=1)
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
Reply With Quote
  #9   Spotlight this post!  
Unread 05-09-2010, 11:49 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Set Jaguar device number via cRIO

Buy the cable? It's just a female RJ25 connected to a female DB9. Is the digikey part specially shielded? I don't have shielding over any of my CAN bus.

I tried to find a periodic signal on the CAN bus (the heartbeat), but I couldn't find anything that would qualify for much more than periodic noise. (only a couple of microvolts, really noisy, and extremely unreliable. However, it didn't seem to appear when I didn't have bdc-comm running or I didn't have my hand resting on my computer, if that makes any difference )
__________________
-- Marshal Horn
Reply With Quote
  #10   Spotlight this post!  
Unread 05-10-2010, 12:21 AM
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Set Jaguar device number via cRIO

Perhaps you aren't using a proper wire. A standard 6-pin cable most likely won't work for the same reason you need a crossover cable. A standard phone wire will swap the conductors and not work with CAN.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #11   Spotlight this post!  
Unread 05-10-2010, 12:31 AM
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Set Jaguar device number via cRIO

Quote:
Originally Posted by kamocat View Post
Buy the cable? It's just a female RJ25 connected to a female DB9. Is the digikey part specially shielded? I don't have shielding over any of my CAN bus.
No, there is no shielding in the digikey adapter.

It seems that in other adapters (maybe only the ones I bought), that the spacing between the side of the adapter and the pins was slightly off.
The slot was large enough to allow the 6 pin cord to fit in and latch, but the off spacing would make the pins not line up causing no comms in either direction.

Try a continuity test between the pins of the 6 pin cord and the cords inside the adapter (or the DB9 pins).
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
Reply With Quote
  #12   Spotlight this post!  
Unread 05-10-2010, 02:08 AM
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Set Jaguar device number via cRIO

Watch out for the 100 Ohm resistor legs if you tried to put the resistor into the 6P6C connector itself. I experienced many problems with the resistor shorting itself out if I tried building it like the manual says. I found that connecting the resistor to a wire pigtail coming out of the modular connector to be much more reliable.

HTH,

Mike
Reply With Quote
  #13   Spotlight this post!  
Unread 05-10-2010, 08:54 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Set Jaguar device number via cRIO

Quote:
Originally Posted by biojae View Post
It seems that in other adapters. the spacing between the side of the adapter and the pins was slightly off.
The slot was large enough to allow the 6 pin cord to fit in and latch, but the off spacing would make the pins not line up causing no comms in either direction.

Try a continuity test between the pins of the 6 pin cord and the cords inside the adapter (or the DB9 pins).
Yes, it seems fine. Less than 0.5 ohms per wire. (The leads on my meter are about 0.2 ohms)
I also double-checked my wires, and they are straight-through.
I've tried the terminating resistor both with and without a pigtail. I think with the pigtail is both more reliable, and easier to create.
__________________
-- Marshal Horn

Last edited by kamocat : 05-10-2010 at 08:56 PM.
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
Set computer to receive it's IP via DHCP? grosh FRC Control System 21 05-28-2010 04:33 PM
Set Jaguar device number via cRIO kamocat FRC Control System 0 05-08-2010 08:41 PM
CAN Jaguar code set up as a VxWorks Library taichichuan CAN 0 02-21-2010 10:16 PM
Unable to set team number Erebos FRC Control System 4 01-27-2009 05:00 PM
Can not set team number on DS TekClaz FRC Control System 2 12-23-2008 02:25 PM


All times are GMT -5. The time now is 03:58 AM.

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