Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   CAN Installation Details (http://www.chiefdelphi.com/forums/showthread.php?t=89536)

duane 19-01-2011 00:46

CAN Installation Details
 
We are having trouble with CAN controlling a motor with the cRio. When the same serial connector is connected to the computer directly and using BDC-COMM, the Jaguar and motor work fine. That seems to eliminate wiring.

We have assigned a different address to the Jaguar (10).

We have updated the Jaguar firmware to v.92.

We get error -52007 on the CANReceive.vi. (could be spelled wrong).

I'm concerned that we have not updated all the pieces properly.

The FirstForge website now says that the CAN LabView components and drivers are all Obsolete. All of the files are now supposed to be part of the regular distribution.

What does that mean and how are all of the pieces installed?

The cRio needs the CAN driver? Is that included with the 2011 update for the cRio?

CAN vi's for LabView are obviously required. Are those installed by default? We are using the vi's that are in the "User VIs" section. We found other VIs under WPI. Which should we be using?

We can we find details or project examples.

Thank you for the help,
...Duane

Bot190 19-01-2011 08:17

Re: CAN Installation Details
 
Everything necessary for the use of CAN is included in the updates. When the imaging tool is installed, BDC-Comm and the latest firmware versions are also installed. Then, when you go to reimage your cRIO, there is a new option for the CAN plugins. The language update includes the CAN library.

Make sure you have reimaged your cRIO.

I don't use labview so I can't help you with that part.

duane 19-01-2011 11:39

Re: CAN Installation Details
 
Quote:

Originally Posted by Bot190 (Post 1003376)
Everything necessary for the use of CAN is included in the updates. When the imaging tool is installed, BDC-Comm and the latest firmware versions are also installed. Then, when you go to reimage your cRIO, there is a new option for the CAN plugins. The language update includes the CAN library.

Make sure you have reimaged your cRIO.

I don't use labview so I can't help you with that part.

Thanks Bot190.

I don't understand part of this statement "When the imaging tool is installed, BDC-Comm and the latest firmware versions are also installed."

I need more reference. I don't understand which imaging tool you are referring too. Is this the cRio imaging tool? Is BDC-COMM the application or the firmware drivers?

It seems that details are important in this case.

Bot190 19-01-2011 22:14

Re: CAN Installation Details
 
Sorry, Yes, by imaging tool I was referring to the cRIO Imager. I don't remember which update it came with, but when it's installed BDC-COMM, the firmware, and some documentation. It used to be put in Public documents, but it might be put in the installing users documents folder.

I assume you know that you use BDC-Comm to load the firmware onto the jaguars? They need to be running version 92 to be used with Image v25 on the cRIO.

duane 19-01-2011 22:54

Re: CAN Installation Details
 
Thank you. That makes more sense.

We updated the Jaguars to v92 and the cRio is using v25.

What is left is which CAN vi's we should be using. I get the idea that we are using last years vi's because they are in the "User Library" section of the LabView.

We need to figure out where the correct VIs to use are.

Right now we are just trying to do basic a SetSpeed on the Jaguars. Not driving yet.

Suggestions?

Bot190 20-01-2011 12:50

Re: CAN Installation Details
 
As I said, i don't know much about labview but it would make sense to me that, the VIs in the user section are what you've added to the project. Given that, it would seem that they are the old version of the library. Try switching all the Can VI's for the ones from WPILib.

jhersh 20-01-2011 21:56

Re: CAN Installation Details
 
Quote:

Originally Posted by duane (Post 1003969)
What is left is which CAN vi's we should be using. I get the idea that we are using last years vi's because they are in the "User Library" section of the LabView.

We need to figure out where the correct VIs to use are.

The VIs you need to use are in vi.lib\Rock Robotics\WPI\. The VIs in user.lib are old and should no longer be used.

You should find them in the Robotics Library palette. Robot Drive and Actuators/Motor Control have integrated CAN support now.

-Joe

duane 22-01-2011 01:53

Re: CAN Installation Details
 
Quote:

Originally Posted by jhersh (Post 1004672)
The VIs you need to use are in vi.lib\Rock Robotics\WPI\. The VIs in user.lib are old and should no longer be used.

You should find them in the Robotics Library palette. Robot Drive and Actuators/Motor Control have integrated CAN support now.

-Joe

Thanks Joe! We found these today! We were quite happy to find that the Open Motor VI had an choice for CAN Jaguar! Woohoo. We used that VI into a while loop, into a SetOutput into a GetOutput out of the while loop and into a Close Motor. Downloaded to the cRio and .... nothin. Nada.

There are no errors indications. The error connections do not indicate any errors. The single Jaguar is still blinking yellow. :-(

I'm looking for suggestions on diagnosing the problem. We'll spend some more time on this tomorrow.

An example posted vi would be great to ensure that we are doing everything correctly. Without examples we are in the blind.

Thanks for your help!

kamocat 22-01-2011 02:18

Re: CAN Installation Details
 
The easiest test of your CAN network is enumeration. If you can enumerate the Jaguars, then your cabling works. (You can test this with the cRIO or with BDC-comm. Enumeration is in the functions pallette under "WPI Robotics Library">Communications>CAN. The BDC-comm enumerates automatically when you open it up - the Jaguars you can select from the drop-down menu are the ones it enumerated.)

If enumeration works on the cRIO, then the issue is probably the Jaguar firmware; the Jaguar firmware must be updated (using the BDC-COMM) for using CAN in FRC.
If enumeration works on the BDC-COMM, but not on your cRIO, then there's probably an issue with your CAN plugin, or your code.

Now, it's entirely possible that your CAN network and code is working correctly, and you are simply not enabled or do not have DS communication. Make sure you have a "StartCommunication" on your block diagram. (This can be found in the DriverStation subpallette of the "WPI Robotics Library" functions.)

EDIT:
You asked for an example. I have a repository with a default project modified to CAN here:
https://github.com/kamocat/ThunderTech_3213/tree/CAN
If you'd like something specific, you can upload your code or state exactly what you're testing.

duane 22-01-2011 11:02

Re: CAN Installation Details
 
Quote:

Originally Posted by kamocat (Post 1005531)
Now, it's entirely possible that your CAN network and code is working correctly, and you are simply not enabled or do not have DS communication. Make sure you have a "StartCommunication" on your block diagram. (This can be found in the DriverStation subpallette of the "WPI Robotics Library" functions.)

EDIT:
You asked for an example. I have a repository with a default project modified to CAN here:
https://github.com/kamocat/ThunderTech_3213/tree/CAN
If you'd like something specific, you can upload your code or state exactly what you're testing.

Thank you for the pointers. We'll see if we can do an enumeration from the cRio. Enumeration works from BDC-COMM just fine with all the same connections.

Why is the DS communication required? We have a StartCommunication in the vi, but have not turned on or connected the DriverStation.

We're just trying to see if we can control a single motor. Seems like this should be pretty easy. :-)

Thank you for the examples, we'll give them a look. I'm concerned that the example expects an entire set of motors, etc. All we have connected to the cRio is one Jaguar and one motor. The idea was to demonstrate the minimum requirements for using the Jaguar.

jhersh 22-01-2011 18:17

Re: CAN Installation Details
 
Quote:

Originally Posted by duane (Post 1005679)
Why is the DS communication required? We have a StartCommunication in the vi, but have not turned on or connected the DriverStation.

We're just trying to see if we can control a single motor. Seems like this should be pretty easy. :-)

Thank you for the examples, we'll give them a look. I'm concerned that the example expects an entire set of motors, etc. All we have connected to the cRio is one Jaguar and one motor. The idea was to demonstrate the minimum requirements for using the Jaguar.

The reason you need the driver station to test is the Jaguars have a safety system integrated that only allows them to operate when the driver station enables the robot. This way the robot can always be disabled from the driver station remotely.

-Joe

duane 22-01-2011 19:30

Re: CAN Installation Details
 
Somehow, I didn't remember requiring the DS to be connected last year, but that was last year. Better notes this year for next year.

We had some success today and we have discovered at least one problem with the cRio. Ethernet port 2 does not work on the cRio. We cannot connect both the DS and the LabView computer at the same time. We have since connected Ethernet Port 1 to a hub and connected the both computers to the hub.

We can now download and run code from the LabView system after the robot is enabled with the DS.

However we are still having trouble with CAN. We can only address the first CAN Node. That is whatever CAN device is attached to the serial port works just fine. The other devices are not recognized (they continue to blink yellow).

Addressing the devices is a problem even with the BDC-COMM program. So it seems like wiring. We have gone through every possible combination of Jaguar, wire connection, and terminator. We've swapped all the different components (save the Jaguars) with parts from last years robot.

It seems like the serial to CAN translation is not occurring. The serial interface is working but the next device does not see any signal.

Is there any way to verify that the signal is on the bus?

We can get one Jaguar to work. Last year we had 10 all on CAN. I know this works. I must be missing something.

Greg McKaskle 22-01-2011 19:41

Re: CAN Installation Details
 
Port 2 on the cRIO is a separate NIC, and is on a separate subnet from port 1. You normally attach the camera to port 2, although if you have other devices that are supposed to be isolated to the robot, they can be connected via a hub. Port 1 is the outside port, and you should be able to have both the programming and DS laptops join the wireless AP on the robot. You can also wire both computer to the AP which is connected to port 1.

Greg McKaskle

jhersh 22-01-2011 19:51

Re: CAN Installation Details
 
Quote:

Originally Posted by duane (Post 1005929)
Somehow, I didn't remember requiring the DS to be connected last year, but that was last year. Better notes this year for next year.

It was required last year too.

Quote:

Originally Posted by duane (Post 1005929)
We had some success today and we have discovered at least one problem with the cRio. Ethernet port 2 does not work on the cRio. We cannot connect both the DS and the LabView computer at the same time. We have since connected Ethernet Port 1 to a hub and connected the both computers to the hub.

Port 1 and Port 2 are on different networks. Both the deployment and the driver station packets need to be on the Port 1 network. You can use a camera or 2CAN or other Ethernet device on Port 2, just not the 2 functions you were trying.

Quote:

Originally Posted by duane (Post 1005929)
However we are still having trouble with CAN. We can only address the first CAN Node. That is whatever CAN device is attached to the serial port works just fine. The other devices are not recognized (they continue to blink yellow).

Addressing the devices is a problem even with the BDC-COMM program. So it seems like wiring. We have gone through every possible combination of Jaguar, wire connection, and terminator. We've swapped all the different components (save the Jaguars) with parts from last years robot.

It seems like the serial to CAN translation is not occurring. The serial interface is working but the next device does not see any signal.

Make sure all your cables are straight through. Make sure you have 100 Ohm terminators installed. Make sure there aren't any shorts on the CAN bus (especially in the DB9 serial adapter).

Quote:

Originally Posted by duane (Post 1005929)
Is there any way to verify that the signal is on the bus?

Sure, if you have a scope or a differential DAQ system.

-Joe


All times are GMT -5. The time now is 10:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi