Myself and another member on my team were discussing whether to shoot for CAN or PWM for the jaguars next year.
we do not plan on using any victors, as we were rookies in 2009 and all we have are a few stray ones on a donated prototype chassis. We also plan to program using labview.
as i understand from the table at nationals, next year’s KOP has solely black jaguars in it.
a little gracious advice would be helpful as my last 3 years of FRC wiring have been pwm only.
We used CAN last year, and though it’s a little temperamental, when it works it works well.
Be warned, our problems included difficulty in making the cables, a higher sensitivity to slowdowns in your robot code (We cannot safely enable the bot until the camera feed starts at the driver station), jags randomly resetting their IDs (this has been fixed), and under last year’s code the system cannot handle more than 2 jaguars being unpowered (if all goes well that won’t be a problem again this year).
On the plus side, the wiring is infinitely simpler with CAN (assuming you can make the cables), as there is only one wire going to the cRIO. I also would have been gutted by the drive team if I pulled the robot apart trying to get at the two jags which power our kicker so I could switch the coast/brake jumper on the day before shipping (true story). Instead, I was able to override it through code. And if there are any problems, you can quickly plug the bus into a computer and check if any jags are not operating properly.
Overall the decision of if to switch should be based on whether you have a use for the extra abilities of the CAN bus and whether you can devote the resources to the problems that will most likely arise from the bus.
disclaimer: I’m a C++ programmer so I may have a different experience with the CAN bus than the LV teams
Try it out before the season. We’re happy to support you on any issues you run into, but this is NOT something you want to have to figure out when you should be testing your robot design.
I have data on the performance of CAN using the Black Jaguar plugin at this thread:
2CAN should provide better performance, but I have not tested it.
if what i remember from the demo at nationals is right, do you use rg45 patch for the lead in and rg11 2 line phone cord (4 wires) for the rest? or do you use all six rg11 pins?
i know the extra pins of the black are what make it a black (and hence why using all blacks next year works)
ok then. by lead in i meant from cRIO to the first black jag. the rest sounds like stanard phone wire which 2 or 4 wires, fits in an RJ-45 socket just fine… they do that in office buildings a lot.
sounds like making the wires requires modular phone cord, RJ-11 (phone) jacks, the proper crimp tool, and a CAT 5e patch cable. i think i saw the crimp tools for phone wire at Lowe’s cheap…
so i guess the wiring side is established. now for the programming side, which is not quite my thing… i know labview basics, i imagine the place to find the jags is not pwm with CAN…
my team might try it… since we will end up buying a black jag anyway, all it is to us is a db9 plug and a some rj11 parts (we already have the crimper).
i fiund a good pdf by 116 on the subject, but the programming instructions are for C++. we are using labview.
two questions:
what all does the programmer need to know to convert the code written for pwm to CAN?
is the cRIO FTP thing the same?
the electrical and firmware thing i have down… I was made electrical subteam leader today and i read the pdf and my laptop is set to be a reflash device (you use the homemade serial dongle to do that, right?).
I’m a C++ programmer, so this may not be 100% accurate, but from my understanding of the LabVIEW API you just need to replace the references to the regular Jaguar VIs with CANJaguar VIs
Nothing changes in the stuff to upload from C++ to LabVIEW
Side note: Your PDF may not have said this, but you need to make sure to undo the change to ni-rt.ini before attempting to re-image the cRIO. For some reason it fails if the CAN plugin is loaded.
Yep, the serial dongle is all you need to reflash the jaguars.
Make sure you have plenty of extra cables. One broken cable will most likely take the entire network down. We have 2 or 3 spare jag-jag (2 wire) cables, and an extra jag-cRIO (6-wire) cable. We also found it useful to make a second serial dongle and keep the spare jag-cRIO cable with it so we don’t have to dig the connection out of the robot if anything goes wrong (like last year’s device number reset bug). A spare termination resistor is also a good idea.
Also, be extra careful about disconnecting power to jaguars. Even though the bus can still travel through an unpowered jaguar, C++ had a (hopefully fixed) bug that would cause glitches if it didn’t receive responses from a jaguar. Not sure if LV had that same bug.
ok… luckily I have a bunch of 100 ohm resistors thanks to some junk power supplies i desoldered as soldering practice… already have the end terminator made.
If you’re just converting PWM control to open-loop voltage mode in CAN (also called percent Vbus), it’s pretty easy.
There should be an example drive project in the CAN release.
If you’re using speed or position mode, you should understand PID and how to use encoders.
If you’re using Current mode, you should know that the sensor is only accurate within 1 amp, and is not suitable for small motors.
From the cRIO to the first (black) jaguar, 5 wires are used. 3 for the serial chatter, 2 for the CAN bus with a 100 ohm resistor at the end connected between them.
After that, only 2 wires are used by the bus. It doesn’t hurt though to have more wires in the cable.
for some reason the TI program fails to see the jag… and the cable and terminator are good (the terminator on the serial cable is good too)
any advice?
edit- some things that might matter:
i am trying to flash a new black jag.
the cable was made from a chopped serial cord from the 2009 KOP. I used a multimeter to probe the wires to obtain the correct wires. I then crimped 5 wires into the rj-12 and soldered the 3 correct serial wires and the term. resistor to the plug cables. i verified correct pinouts with my multimeter.
the cable is about 6 ft long… maybe it is too long?
edit2- nope, shortening it to 2 ft didn’t help (i was sent home with the goods to try and fix the issue)
somewhere it was mentioned that a specific vs. of the bdc-comm was needed… any truth to that?