Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Black jaguars: not working (http://www.chiefdelphi.com/forums/showthread.php?t=80884)

Dale 25-01-2010 13:33

Re: Black jaguars: not working
 
It may not be your problem, but we ordered a RJ11 cable tester to test our CAN cables. We have 9 Jaguars on our board and can't have one of those cables being marginal if we can help it! You can get one for anywhere between $7 and $100+.

We still don't have our first Jaguar working on CAN so we'll see if we get to use that spiffy tester. For what it's worth we're getting this one because of it's good reviews and middle range price.

Mike Copioli 25-01-2010 13:46

Re: Black jaguars: not working
 
Quote:

Originally Posted by Dale (Post 906555)
There should be just one terminator...at the end of the chain. Have a terminator inside the shell of the DB9 defeats the purpose of reducing reflections. See this article.

Two 120 ohm resistors are required on a CAN bus. One at each end of the BUS. The 2CAN contains one of the resistors internally that can be removed via a jumper. The second jumper needs to be placed by the user. My suggestion is to use the second RJ-11/12 connector on the Jag for this. I do not know if the Jaguar has an internal 120 ohm resistor or not. Maybe Scott Emley can answer this. If it does not, you will need to place one at the beginning of the BUS as well.

Dale 25-01-2010 13:56

Re: Black jaguars: not working
 
I stand corrected on the terminator! In re-reading page 29 of the Jaguar BDC24 getting started guide it clearly says you need a 100 ohm resistor at both ends. I wonder if that's our problem with getting the Jaguars to work via CAN! It would seem unlikely given that we only have one Jaguar in our test setup but it's certainly worth a try.

Bryscus 25-01-2010 14:05

Re: Black jaguars: not working
 
Quote:

Originally Posted by Dale (Post 906561)
I stand corrected on the terminator! In re-reading page 29 of the Jaguar BDC24 getting started guide it clearly says you need a 100 ohm resistor at both ends. I wonder if that's our problem with getting the Jaguars to work via CAN! It would seem unlikely given that we only have one Jaguar in our test setup but it's certainly worth a try.

Dale,

The instructions in the Getting Started Guide show a 100 ohm connected between red and green (CAN_L and CAN_H) inside the RS-232 to CAN converter. If you did this, you should have the proper termination.

- Bryce

P.S. I wonder if the termination needs to occur closer the the black jag than at the converter. Our cable is only 5 inches or so, but maybe even that is too long?

Dale 25-01-2010 14:11

Re: Black jaguars: not working
 
We had a 100 ohm terminator in the empty RJ11 plug on the Jaguar but didn't have one in the left one where the serial data was coming in.

Bryscus 25-01-2010 14:18

Re: Black jaguars: not working
 
That could do it...

- Bryce

Mike Copioli 25-01-2010 22:11

Re: Black jaguars: not working
 
If I understand you correctly, you only have one Jag on the BUS. The Black Jag. If this is the case you should be able to get away with only one resistor for test purposes. We have six jaguars on our Kit bot with only the resistor that is in the 2CAN. We have been driving it around for the last two days without issue. See the link to the pic. I suspect the problem is elsewhere possibly in your code.


http://www.crosstheroadelectronics.c...res/Kitbot.JPG

jhersh 26-01-2010 03:57

Re: Black jaguars: not working
 
Quote:

Originally Posted by ellisk (Post 905558)
(the last line is odd, considering that it's not in LabVIEW mode...)

That line simply means that the system is up and running. When initially developed, the cRIO only ran LabVIEW.

Quote:

Originally Posted by ellisk (Post 905558)
When I run the aforementioned program, I get the following error at startup, presumably from the call to Init of the CANJaguar in the constructor of the program:
Code:

>>>>ERROR: status == -63194 (0xFFFF0926) in InitJaguar() in C:/windriver/workspace/Spy/CANJaguar.cpp at line 32

That error message is kRIOStatusVersionMismatch. Likely it means that you haven't updated your Jaguar to the latest version.

-Joe

Bryscus 26-01-2010 09:43

Re: Black jaguars: not working
 
BTW: NEW CANJag CODE IS AVAILABLE FOR DOWNLOAD!!!

Quote:

Originally Posted by Mike Copioli (Post 906903)
If I understand you correctly, you only have one Jag on the BUS. The Black Jag. If this is the case you should be able to get away with only one resistor for test purposes. We have six jaguars on our Kit bot with only the resistor that is in the 2CAN. We have been driving it around for the last two days without issue. See the link to the pic. I suspect the problem is elsewhere possibly in your code.


http://www.crosstheroadelectronics.c...res/Kitbot.JPG

If I were you, I'd add the termination resistor at the end. They aren't hard to make, and technically you're violating the spec of the CAN bus. If you drive under different circumstances, it isn't guaranteed to work...

Bryscus 26-01-2010 09:49

Re: Black jaguars: not working
 
Quote:

Originally Posted by Bryscus (Post 906541)
I have been having an issue with intermittent signals getting to the Jags...

Guys, I think I was swamping the serial port with commands. This was causing the intermittent glitches. Everything appears to work extremely well now! Joe Hershberger is one awesome guy.

Someone has already been running with 6 Jags hooked together, but I'm going to hook up a bunch tonight and verify everything.

Also, Joe has released a new version of the Jag code that implements all the closed loop modes! He also said there was a TI firmware update available (Version 87). I'll be playing with that tonight too. Cheers!

- Bryce

Dale 26-01-2010 11:51

Re: Black jaguars: not working
 
We continued trying to get either the 2CAN or RS-232 to work last night, still without any success in C++. The RS-232 version still throws the error, even when the robot is enabled. The 2CAN just sits there with a flashing orange light (the boot loader). It's probably some setup issue because the 2CAN seems to be a quality product. Work continues but so far it's been pretty frustrating. We've tried various RJ11 cables.

Mike Copioli 26-01-2010 11:51

Re: Black jaguars: not working
 
Quote:

Originally Posted by Bryscus (Post 907095)
BTW: NEW CANJag CODE IS AVAILABLE FOR DOWNLOAD!!!



If I were you, I'd add the termination resistor at the end. They aren't hard to make, and technically you're violating the spec of the CAN bus. If you drive under different circumstances, it isn't guaranteed to work...

I am aware of that. The intent of my post was to inform Dale that his problem was elsewhere. I assure you it performs adequately without the termination resistor in our specific configuration. This does not mean that I think it is ok to leave the resistor out of the BUS. It simply means that using our tools to monitor CAN traffic there were absolutely no CAN frame errors in our particular configuration. The termination resistor is to reduce signal reflection. Signal reflection is not influenced by external factors as much as it is based on bus length. If you keep the bus short and the utilization low, you should not have any issues. In Dales example he was only connecting one Black Jaguar(as I understood it) and no gray Jags. Since the Black Jaguar is the beginning and the end of the Bus it would be pointless to place a resistor on each end of the device since the traces inside the jaguar are the entire BUS.

Mike Copioli 26-01-2010 12:18

Re: Black jaguars: not working
 
Quote:

Originally Posted by Dale (Post 907170)
We continued trying to get either the 2CAN or RS-232 to work last night, still without any success in C++. The RS-232 version still throws the error, even when the robot is enabled. The 2CAN just sits there with a flashing orange light (the boot loader). It's probably some setup issue because the 2CAN seems to be a quality product. Work continues but so far it's been pretty frustrating. We've tried various RJ11 cables.

A slow orange light means that the 2CAN does not have communication or it is disabled. If you are able to view the 2CAN dashboard then the 2CAN is not in bootloader. We are currently working on updating the 2CAN plugin to be compatible with some changes made to the CANjaguar class. The update will be available soon. Thank you for your patience.

ellisk 26-01-2010 19:15

Re: Black jaguars: not working
 
I tried it with the 2CAN bus. Now, instead of giving me error messages, it just silently fails. I've updated the firmware on the 2CAN, but it still doesn't work. Any ideas? Here's the code I'm using:

Code:

#include "WPILib.h"
#include "2CAN.h"



class Spy : public SimpleRobot
{
        JaguarOverCAN  *mtr;

public:
        Spy(void)
        {
                GetWatchdog().SetEnabled(false);
        }

        void Autonomous(void)
        {

        }

        void OperatorControl(void)
        {
                mtr = new JaguarOverCAN (2);
                while (true) {
                        mtr->Set(0.5);
                        Wait(0.5);
                }
        }
};

EDIT: I tried visiting the 2CAN's web page at 10.15.40.10. I was able to see that both the 2CAN and the Jaguar are at least partially set up correctly, that the Jaguar is getting power and that it is on ID 2.

jhersh 27-01-2010 00:58

Re: Black jaguars: not working
 
Quote:

Originally Posted by ellisk (Post 907438)
I tried it with the 2CAN bus. Now, instead of giving me error messages, it just silently fails. I've updated the firmware on the 2CAN, but it still doesn't work. Any ideas? Here's the code I'm using:

Code:

#include "WPILib.h"
#include "2CAN.h"



class Spy : public SimpleRobot
{
        JaguarOverCAN *mtr;

public:
        Spy(void)
        {
                GetWatchdog().SetEnabled(false);
        }

        void Autonomous(void)
        {

        }

        void OperatorControl(void)
        {
                mtr = new JaguarOverCAN (2);
                while (true) {
                        mtr->Set(0.5);
                        Wait(0.5);
                }
        }
};


You are using the old JaguarOverCAN class that CTRE released before the season began and before the rules were released. You need to be using the unified CANJaguar class for it to work with the FRC 2010 control system.

-Joe


All times are GMT -5. The time now is 12:26.

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