![]() |
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? |
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
|
Re: Set Jaguar device number via cRIO
I managed to dig up a USB to serial device, but I had the same problems.
|
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. |
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? |
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 |
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. |
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) |
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 :) ) |
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.
|
Re: Set Jaguar device number via cRIO
Quote:
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). |
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 |
Re: Set Jaguar device number via cRIO
Quote:
After crimping the resistor into the connector (and verifying that it works), take a little 2 part epoxy mixed well and cover the resistor and its legs. Once it is cured, the resistor won't be able move and the legs will not short each other out. |
Re: Set Jaguar device number via cRIO
Quote:
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. |
Re: Set Jaguar device number via cRIO
Could somebody unplug their termination resistor, and try enumeration (with the cRIO or the BDC-COMM utility)?
Does it say there's no no devices on the network at all, or does it say there's one device with a device number of 0? |
Re: Set Jaguar device number via cRIO
Quote:
I can still enumerate all 4 devices on the CAN bus. |
Re: Set Jaguar device number via cRIO
Is that with a single termination resistor, or with none whatsoever?
|
Re: Set Jaguar device number via cRIO
Quote:
|
Re: Set Jaguar device number via cRIO
Okay. The Getting Started guide said small networks may still work with a single termination. I'm not going to ask you to clip off your resistor.
|
Re: Set Jaguar device number via cRIO
Quote:
But, the only adapter that I have gotten to work is the digikey one, and we only ordered one of them. :rolleyes: |
Re: Set Jaguar device number via cRIO
Quote:
It is quite possible / easy to get small CAN networks to work with poor bus layout / terminations. |
Re: Set Jaguar device number via cRIO
I think if the enumeration worked, then the other CAN communications would work. However, I don't know what would cause the enumeration to respond like this.
What does it mean when it says there's only one device on the network, and its address is 0? Why doesn't it just say there are no devices there? |
Re: Set Jaguar device number via cRIO
Sorry if this is a dumb question, but I'm not clear on what behavior you're seeing.
How many Jaguars do you have connected to the CAN bus? If it's only one, and you are just seeing an enum response with device id 0, have you tried resetting the id of that Jag to something >=2 via bdc-comm? If not, follow the steps on page 10 of the bdc-comm user's guide and let us know the results. If you still have multiple Jags on the CAN bus, let us know what you see in bdc-comm.....do you see all the Jags except the one with device id 0? You may just need to assign a new id to the Jaguar that currently thinks it is id 0. - Ron Team #2607 controls mentor [EDIT: to answer your question, the enum responding that there's one device with id 0 is (I'm almost positive) a valid response, provided that's the actual situation on the CAN bus] |
Re: Set Jaguar device number via cRIO
Quote:
I'm pretty sure 0 is not a valid ID for a device on the CAN network, but I don't know if the host might appear as having an ID of 0 (regardless of whether the CAN bus itself is working or not). When I connect another Jaguar, the enumeration still only reports a single device with an ID of 0. Currently I am working with the BDC-COMM, and a USB to Serial device (Keyspan brand). Once I get that working, I'll move back to the cRIO. |
Re: Set Jaguar device number via cRIO
1 Attachment(s)
Quote:
It enumerates a Jaguar with an ID of 0. This means that you have a communication problem between your computer and the black jag. There are several points of failure, if one of them doesn't work, then none of it will. Chances are, if you couldn't connect with the cRio, or the computer that the problem lies either with the 6-pin cord from the adapter or the adapter itself. |
Re: Set Jaguar device number via cRIO
Okay, thanks!
Strangely, my setup enumerates nothing when I disconnect the black jaguar. However, I will recheck this when I have the chance. |
Re: Set Jaguar device number via cRIO
This title has become misleading, so I'm going to defer to another thread, and come back to this if this is actually an issue.
|
Re: Set Jaguar device number via cRIO
Nope, problem solved.
Thank you everyone for your help! |
| All times are GMT -5. The time now is 04:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi