CANJaguar vi's

Do the CANJaguar vi’s from FirstForge/WPI send signals to the jaguars from the cRIO’s ethernet port 2 or it’s serial/RS232 port? I need to know so my team can buy the correct adapter. Thanks in advance.

The VIs can do either. It depends on whether you install the 2CAN or Serial plugin on the cRIO.

The following is my opinion based on observation and the current devices in use in FRC as of today. This opinion could change in a moment if circumstances change.

When considering whether to go with 2-CAN or serial, consider this:
1)Both Ethernet ports are needed on the cRio IF you intend to use the vision system.
2) There are multiple flavors of “serial” available on the current FRC control system, RS232, I2C, TTL (with a little support hardware).

Serial will be much less expensive to implement AND no specific devices require it’s use currently. So, IMHO, serial is the way to go.

Just my $.02.

Also, serial will get you CAN with no extra weight since you just need to replace a gray jag with a black one

  1. 2CAN has a 2nd ethernet port and acts as a switch as well as a CAN adapter, so you can use the camera and 2CAN at the same time
  2. The Serial CAN plugin is built only to work with the RS232 port on the cRIO

Well, that is info I was not aware of. That is the kind of information that would influence my opinion. As you said though, replacing one Jag for another is a zero weight gain.

Thanks for the info Pi. Good stuff.

Before you ask how to connect CANbus, think if you need CAN. What does it give you that you can’t already get? You can already do feedback on position or speed with the cRio, and get open voltage control, using PWM. CAN provides you with constant current control and feedback on current usage, which may or may not be useful. Unless you really really want constant current control, you don’t need CAN. And, if you are using it for position feedback, all it provides you is code implemented to do PID. You can already use LabVIEW PID to do it easily. Either way you still have to tune the gains, which is probably the hardest part. If you don’t understand what advantage CAN gives you and don’t know if you need it, you probably don’t. We decided this year that we would rather use the IFI Victors because they are far more reliable than the Jaguars (we had 12 Jaguars on last years robot and more failures that year then the past few years combined), and we don’t need any current control.

Closed-loop position and speed control at 1000 Hz. No worries about jitter/overruns messing up 20Hz PID tuning on cRIO.

Motor current and motor voltage (can be used to monitor motor internal temperature via resistance).

Current feedback can be used to implement torque limiting for traction control.

~

What’s the going price for a black jag ? Cheaper than a 2CAN ?

~

Much cheaper than a 2CAN. At FRC discount, a black jag is $85 (plus like $5 for the other parts needed). 2CAN will run you $116 at discount.

Plus (when we ordered our black jag), according to digikey gray jags are no longer available. Not sure if that means discontinued or just sold out when we tried to buy one

Do you honestly need to run any code faster than 50hz? The radio packets are timed to aprox. 20hz, so anything faster than that is working off old data. I have no loops running faster than every 20ms (50hz), most run at 40ms, and have no problems with PID timing at that rate.

Need to? No.

I believe they’re 50Hz.

The point you are trying to make is a valid one, but your argument is not complete as it stands. When evaluating the frame rate for a closed loop digital control, it’s not just the update rate of the set point that must be considered. The dynamics of the plant must be taken into account also. In this case, the response of the wheel velocity is likely much less than 50Hz, due to its mass (and the mass of the robot as long as the wheel is not slipping).

You probably know what you are doing and have well-written code. Closing the loop in the Jag is more forgiving because the loop closure is immune to programming errors in other areas of the code that could cause realtime overruns - errors like I see discussed quite often here on Chief Delphi.

~

This one doesn’t seem to get mentioned very often:
Jaguars also tell you their temperature, which you can monitor to predict or troubleshoot failures.

I haven’t been able to find a LabVIEW driver for 2can. Could somebody point me towards it?

It’s not part of the 2010 FRC LabVIEW installation.
It’s 3rd-party:

http://firstforge.wpi.edu/sf/projects/canjaguar

Yes, add that to the list.

~

Isn’t that for the black jaguar?
I’ve seen the C++ 2can driver, back around the start of the build season, and I remember seeing it received the data from the CAN functions and forwarded them to the 2CAN via UDP datagrams.

Assuming that project is for BOTH 2CAN and the serial CAN, how do I configure the firmware/framework for one versus the other? Is it sent over both by default?

Both VIs are used identically between 2CAN and Serial, however there is a cRIO software plugin that can be swapped for 2CAN or Serial mode (not both at the same time though). The seial version is on firstforge under the canjaguar project as BlackJagBridgePlugin. The 2CAN version can be downloaded here (the source is in the firstforge repository, however a build has not been posted on firstforge).

Thank you.
That wasn’t very clear in the 2CAN documentation. The last time I talked to them, it was C++ only.