hey ,I’m trying to replace some wires with a CAN in my team’s Robot , I’ve been surfing the net looking for a way to connect the Can jaguar (and I mean how to wire it not how to program it ) so if you could help me it would be great
thanks
What programming language are you using? In the WPIlib (Java or C++) libraries, a CANJaguar class exists just for that. I’m not sure about Labview.
Here is the FIRST guide to CAN with cable and wiring instructions.
2011 CAN Getting Started.pdf (973 KB)
2011 CAN Getting Started.pdf (973 KB)
This might help, but I can’t personally vouch for it:
http://www.chiefdelphi.com/media/papers/2433
*"A tutorial on the hardware (electronics) aspect of CAN wiring using the black jaguar out of the 2011 (and later) KOP. Made from the experiences of a veteran wiring student who had no previous knowledge of CAN bus and had to ask a lot of questions and do some experimenting to make CAN work while keeping to a tight budget. Includes previously undocumented (as far as I know of) methods and quick tricks.
Also included is a pinout spreadsheet. If you are trying the “use your own serial cable” method or using an rj-12 adapter with different pinouts than described, feel free to add a new column for your pinouts and delete the ones you are not using. I keep a copy for this exact reason… you never know when it may need to be edited."*
I’m fairly sure it does. However, be careful with CAN. It’s been incredibly unreliable for us.
Although I’ve worried a little about reliability, CAN has always worked very well for our team. PWM has proven more unreliable than CAN. My main concern with CAN is that it’s a single point of failure: one module fails or gets disconnected, and the whole chain may be offline. So, we are very careful with the cables we make, we perform tension tests before and after installation, and we fasten the cables to something near each end. Making the software fault-tolerant is also important.
Good luck!
The referenced how tos are good. So here is a list of hidden gotchas in CAN. Avoid them, follow the how tos & it works well. Other feel free to add to the list.
Bad wiring- make sure your cable connections are good. This includes crimps in the plug & the female connector on the Jag. Do not have strain on the connectors, but don’t let the wiring flop loose either.
Use terminating resistors. I not sure this is really needed in the short cable runs, but why tempt fate. Besides the first on the list of troubleshooting is to check the wiring.
Avoid running can comm cables parallel to power wires, especially motors.
Do not flood the canbus with commands. You can fill the bus up and have data drops. Make sure the programmers understand what the Jag really needs.
Do not send commands to non existing Jags. The comm driver does not like that.
I’ve never seen a short CAN bus (the shortest I ever ran was ~3’ with two nodes) work without a terminating resistor. I have seen short CAN busses work with only one 120ohm resistor somewhere on the bus instead of the spec’d one at each end, and I’ve also seen long busses with 1 60ohm resistor instead of 2 120ohm resistors.
I’ve also seen long busses with a 120ohm near one end and no other terminating resistor do really strange things with reflections (we had a node that was actually wired inverted and was reading the reflections instead of the actual message… that was weird)
Bottom line: You need both resistors for reliable performance. On a short enough bus, you can get away with just one.
I guess you do need at least one resistor to make the voltage drop. A good point. Having one on each end is for reflections you do not see on short runs as you said. Also as you said, it is always best just to follow the spec which requires terminating resistors on the ends. I have borrowed a termination resistor off one end the canbus & did not see a difference. I would not try this in a competition.
People also get away with using star topologies, which in not in the specification. It has the advantage of not depending on the through jag connection although it makes for a lot more wire terminations & raises a question on where the resistors should be. Having not tried this, I do not have an opinion on how well it works.
Termination resistors are required for any cable length per the CAN standard. The spec is for 120 Ohm at each end, either as a single resistor or as a 2x 60 Ohm split termination with midpoint bias and/or noise filtering. Since the bus length on a typical FRC robot isn’t long enough to cause a significant noise problem, the FRC documentation uses the simple single resistor option. But, if you had a 100 meter long CAN bus, then those noise considerations come into play.
CAN uses differential signaling, and those termination resistors provide the proper load (60 Ohm DC) for the drivers as well as an impedance match (120 Ohm at each end of a nominal 120 Ohm transmission line) to limit reflections on the bus. While a short cable length might not need the termination from a reflection perspective, the drivers still need a proper load regardless of the length.
The implication here is that you want a bus with the termination resistors at either end, and the shortest possible stub lengths (distance from the bus wire to the transceiver chip…which is some short distance on the Jaguar circuit board that you don’t have to worry about). So, don’t try to mitigate the single point of failure…if you don’t have all of the jaguars in ‘series’ then all of the transmission line math breaks down and you’ll have bus failures.
For more gory technical details here’s a TI application note that goes into the bus operation and termination particulars:
http://www.ti.com/lit/an/slla270/slla270.pdf
And here are Scott McMahon’s videos on how to wire a Jaguar from TI (scroll to the bottom of the page):
http://www.ti.com.cn/mcu/cn/docs/mcuorphan.tsp?contentId=100442
Don’t ask me why it’s on TI’s china site, but those are definitely Scott’s videos.
Although daisy-chaining obviously creates this impression, do note that the CAN ports on the Black Jags (I won’t vouch for the Greys, having not touched them for multiple years now) are hardwired together, so if one Jag in the line fails, it does not necessarily shut the entire system down. If you’re using serial-to-CAN, however, and the converting Jag dies, then your system will shut down.
I’d also like to point out that, as an expensive alternative (provided you have the funds), the 2CAN offers a much more sophisticated CAN interface than a serial-to-CAN can offer, and also provides better performance (if you don’t plan to rely heavily on CAN during the season, you won’t need its advantages - but it never hurts to know more!).
With reference to the star topology that Ether mentioned, here’s a backbone setup that you can try out for yourself.
Good luck!
The wiring of CAN ports on grays is the same as on the blacks.
I agree that one failed Jag in the middle of the line won’t usually cause problems for downstream Jags. But I’ve seen and heard of problems with the wiring, such as a connector breaking or coming out, and then all of the downstream Jags are out, plus often the upstream ones as well. A short circuit will usually disable all the devices on the bus.
I mention these only as a concern, and something to guard against. As I posted earlier, we’ve been very careful with our wiring, and we’ve never had any problem using CAN.
C++ ,but I want to know how to wire it on the robot ,
Mark’s post referenced an how to paper. It gives a step by step. Basically you need to make adapter to go from the serial port on the CRIO to RS232 port on the jag. This will also have the canbus terminating resistor in it. Then you daisy chain through the rest of the Jags with cables you buy or make with a terminating resistor on the end Jag.
Not really wiring but you have also to set the addresses of all the JAGs using the instructions in the how to.
The firmware in the CRIO also needs to be downloaded with the JAG option set.
Go back and read posts 3 and 4 in this thread.