|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? Any help will be immensely appreciated. |
|
#2
|
||||
|
||||
|
Re: CAN from scratch
There are two options for creating a CAN network:
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:
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. If you're using LabVIEW and the Black Jaguar CAN, I've put together a package to help you set up your Jaguars. http://kamocat.com/robot/electrical/CAN_resources.zip |
|
#3
|
|||
|
|||
|
Re: CAN from scratch
Thanks for the summary.
We are using C++, not Labview. The link you gave me seems to be broken, I'm getting a "404" type page. When you image the cRIO, it has an option for a CAN driver. Do I need to put anything there? |
|
#4
|
||||
|
||||
|
Re: CAN from scratch
Check out our team's wiki.
The wiki is a work in progress, but this article is complete. It goes over the basics of the CAN network. EDIT: Nevermind, apparently the website currently has messed up permissions. Last edited by big1boom : 01-27-2011 at 08:40 AM. |
|
#5
|
|||
|
|||
|
Re: CAN from scratch
Quote:
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) |
|
#7
|
||||
|
||||
|
Re: CAN from scratch
You're right, it is broken - I'm re-uploading the file right now.
At any rate, for C++ CAN, Radical Pi is the one to talk to. Unless you have hardware questions, I'll leave you in his capable hands. |
|
#8
|
||||
|
||||
|
Re: CAN from scratch
Quote:
EDIT: If you don't mind, could you try this. http://coolhub.imsa.edu/cybercollab/...rk%20%28CAN%29 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. Last edited by big1boom : 01-27-2011 at 09:41 AM. |
|
#9
|
||||
|
||||
|
Re: CAN from scratch
That link works.
Some other things to be aware about: 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. |
|
#10
|
||||
|
||||
|
Re: CAN from scratch
Quote:
This is being changed along with several other hardware features in the next revision of hardware. |
|
#11
|
||||
|
||||
|
Re: CAN from scratch
http://www.chiefdelphi.com/media/papers/2433
i wrote that document on how to make the black jaguar method work from scratch. hopefully that answers your questions. |
|
#12
|
|||
|
|||
|
Re: CAN from scratch
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?
Thank you. |
|
#13
|
||||
|
||||
|
Re: CAN from scratch
The Black Jaguar can also control a motor.
I've seen no data to indicate that using this Jaguar to control a motor will impact the performance of your CAN bus. |
|
#14
|
|||
|
|||
|
Re: CAN from scratch
Quote:
-Joe |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|