12-19-2011 02:03 PM
I'm a beginner programmer with Labview and the cRio. I wanted to get some info on the CAN bus and how to use it to control the Jaguar Speed Controllers. Do I need to by a CAN I/Ocard for the cRio or can I use the serial port already on the cRIO. After that, are there any documents that show how to use CAN in Labview? Are there any best practices for CAN such as using a CAN-to-Ethernet converter like they sell on AndyMark?
12-19-2011 02:11 PM
Hey wimmiam_edds,
This tutorial will give some information on getting started with using CAN to control the Jaguar speed controllers:https://decibel.ni.com/content/docs/DOC-14865. That being said controller the Jaguars using CAN is something I would only recommend for advanced LabVIEW users. If you are just getting started I think you will be better off controlling the Jaguar controllers using the PWM inputs for the motors. This method is described here:https://decibel.ni.com/content/docs/DOC-14723
12-19-2011 02:23 PM
I appreciate the docs, they will come in handy. However, the thing I'm kind of confused about is whether we need to use the serial port on the cRio, the
NetConsole (which I'm not sure what the interface for that is) or if we need the CAN IO card. I guess I'm trying to wrap my head around the physical cabling of CAN. I read in the doc about using the Black Jaguar as a "Serial to CAN Bridge" and I'm not sure what that means as they black jaguars have two RJ12 connector ports on them.
If I'm right (please correct me otherwise), all I need to do is make the adapter, plug it into the serial port on the cRIO and connect the other end to a Black Jaguar, daisy-chain the rest of them, put a terminator in the last one and then everything else is in Labview. Am I correct?
12-19-2011 02:31 PM
Hey william_edds,
You are correct you will be connecting to the cRIO serial port and not a CAN IO card. Since the FRC cRIO's use a custom FPGA image using a CAN IO module is not really an option for competition use. Please post back with any additonal questions.
01-06-2012 08:37 PM
Another option for doing CAN bus on the CRIO is to use the 2CAN module that Andymark sells http://www.andymark.com/2-CAN-p/am-0993.htm
This module uses the ethernet to interface into the CAN bus.
The advantage of this interface over the Serial Bridge is that it's considerably faster (5X I think).
We used the serial bus last year, and with 4 motors all running on CAN, we had several instances where we started dropping packets.
For drive motor contol, this isn't too bad, but with closed loop manipulator control is was devastating at times.
If we go CAN bus this year I think it's ethernet interface for sure.
The CRIO image can support either type of CAN interface.
Phil.