My primitive Google-fu has failed me, and searching Chief Deplhi has proved futile. So I’ll ask the question that so many beginners have asked before.
My team is in its second year. Last year, we controlled our (brown) Jaguars through PWM. This year, having acquired two black Jaguars, we want to try using the CAN bus to control drivetrain.
The only problem is, that we have no idea where to start.
First of all, how do I start the CAN bus? Is that port on the Digital I/O sidecar a CAN port? Or do I need a serial-CAN cable? Can I have brown Jaguars on the bus?
How do I interface to the CAN bus? Do I need to flash the cRIO with a new image? Does WPILib support CAN out of the box?
You can use a 2CAN as your CAN bus master (connecting to the cRIO via an ethernet cable)
OR
You can use a Black Jaguar as your CAN bus master (connecting to the cRIO via an RS232-CAN adapter).
Here’s an overview of the differences:
2CAN provides access to the CAN bus at 5x the rate of the bridging Black Jaguar
You can update firmware directly from the 2CAN, whereas with the Black Jaguars, you must upate the firmware using an RS232 port (or converter) on your computer
2CAN is more expensive
Using a black Jaguar will require you to make or buy RS232-CAN cable, wheras the 2CAN uses a common ethernet cable to connect to the cRIO
Now, picking one doesn’t prevent you from switching. You can always start with a bridging Black Jaguar, and switch to 2CAN if you decide you need a greater communication rate.
However, we can help you better if you decide which one to go with for now.
You can have a tan Jaguar on the bus. Any Jaguar on the bus requires a firmware update to be fully functional with CAN.
In software, it’s a very easy change. MotorDevRefs include PWM- and CAN-based controllers in the same typedef. You can convert to CAN just by changing how the motor is opened. (In LabVIEW, this is in Begin.vi. Make sure to replace the “DriveMotorOpen” with the one from the functions palette, so you can just use the polymorphic selector to change it to a CAN open.
The link seems fine to me, perhaps you should try again
To switch C++ software to CAN, instead of creating Jaguar objects you should create CANJaguar objects. The only other change needed is updating the port numbers in the constructors with the CAN IDs of the jaguars.
In the cRIO imaging software you should select the method of connecting to the CAN bus you are using. If you are going with a serial-jaguar connection, select BlackJaguarBridge. If you’re using a 2CAN, select 2CANBridge (I’m not 100% sure those are the exact names)
Interesting… The site is currently in Beta and we have been having a lot of trouble with permissions. Thanks for actually showing me what is wrong with it.
I may have given you a link for people who are logged in. If this link doesn’t work then I am going to have to get in contact with the development team.
CAN cable is pretty much standard phone cable (some small differences) so there is industry support for it. By that I mean we got a crimper that can make a cable in seconds, as opposed to PWM (don’t get me started).
The 2CAN has 2 ethernet and 1 CAN port on it; one ethernet goes to the c-RIO, the other goes to either the bridge or the camera (depending on what c-RIO port you plugged it into) and the CAN goes to a jaguar. It has a really nice web interface, which shows you, among other things, input and ?output voltages, temperature, fault condition (internal circuit breakers), current, and lots of other great stuff. It also makes it dead easy to do other fun stuff (setting IDs, reflashing firmware (which didn’t actually work for me…)) and is generally cool.
The only problem is it has a really short power cable coming out of it.
The black jaguar converter is also really nice, and much cheaper if you care about that.
If we use the Black Jaguar method, can we let that Jaguar have a function like controlling one motor? Or is it required that that Jaguar be left alone only as the CAN Bus Master?
The only exception to this is I would recommend against using the bridging Jag to control a high current motor (like a drive motor) that may potentially trip a breaker. If any other Jag trips a breaker, the rest of the Jags on the bus continue to function since the CAN bus is wired through on the PCB. If the bridge Jag’s breaker trips, the rest of the CAN bus is isolated from the cRIO so all motors will stop.