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)

ellisk 27-01-2010 18:18

Re: Black jaguars: not working
 
I tried switching to CANJaguar as well, and I still get the errors I had before (status == -57002). This was using the CANJaguar class using the 2CAN attachment.

jhersh 27-01-2010 18:37

Re: Black jaguars: not working
 
Quote:

Originally Posted by ellisk (Post 908059)
I tried switching to CANJaguar as well, and I still get the errors I had before (status == -57002). This was using the CANJaguar class using the 2CAN attachment.

There was an update to the 2CAN plugin released just a day or two ago. Try updating that.

ellisk 27-01-2010 23:18

Re: Black jaguars: not working
 
I tried the update (http://crosstheroadelectronics.com/2...2CANPlugIn.out) and it still doesn't work. This is very odd...

ozrien 28-01-2010 09:38

Re: Black jaguars: not working
 
ellisk,

I just to confirm where you are...

You are using wind river c++ with "latest" checked out code from firstforge, or the last file release (zip under the file release link)?

You have latest FRC_2CANPlugin.out file from ctr website.

FRC_2CANPlugin.out is in the "ni-rt/system" directory on the ftp server in the cRIO.

ni-rt.ini is modified so that ";FRC_2CANPlugIn.out" is IMMEDIETELY after FRC_NetworkCommunication.out.
Note that FRC_2CANPlugIn.out now should be before FRC_UserProgram (in the past releases it would have been after but that was incorrect, causing all sorts of problems).

And also have you successfully viewed the web dashboard in the 2CAN and have confirmed that the Jaguar ID for your jag is the same one used in the constructor of CANJaguar?

Bryscus 28-01-2010 10:56

Re: Black jaguars: not working
 
Quote:

Originally Posted by ozrien (Post 908422)
ellisk,

I just to confirm where you are...

You are using wind river c++ with "latest" checked out code from firstforge, or the last file release (zip under the file release link)?

You have latest FRC_2CANPlugin.out file from ctr website.

FRC_2CANPlugin.out is in the "ni-rt/system" directory on the ftp server in the cRIO.

ni-rt.ini is modified so that ";FRC_2CANPlugIn.out" is IMMEDIETELY after FRC_NetworkCommunication.out.
Note that FRC_2CANPlugIn.out now should be before FRC_UserProgram (in the past releases it would have been after but that was incorrect, causing all sorts of problems).

And also have you successfully viewed the web dashboard in the 2CAN and have confirmed that the Jaguar ID for your jag is the same one used in the constructor of CANJaguar?

ozrien,

I've been using CAN control for over a couple weeks now, but I'm using the serial port. CANJaguar.h is necessary for the project to build. ellisk only shows 2CAN.h included. Could this be his/her problem?

- Bryce

P.S. ellisk, I would verify yourself that your Jaguars are set with the correct ID. Also, that they have the correct firmware. There are two firmware files, one for the black Jags and one for the gray Jags. TI just released a new version of the firmware, so you can take this time to reflash with the newest: http://www.luminarymicro.com/index.p...d&Itemid=59 1

P.S.S. Unless you just didn't show it, you're also missing START_ROBOT_CLASS(Spy); that comes after your class. If this line is not there, the cRio won't deploy your code. This line creates a new task with your program...

P.S.S.S. Here's an example of what my code would be using CAN over the serial port.

Code:

#include "WPILib.h"
#include "CANJaguar.h"



class Spy : public SimpleRobot
{
        CANJaguar *mtr;

public:
        Spy(void)
        {       
                mtr = new CANJaguar (5);  //or whatever ID you have set
                GetWatchdog().SetEnabled(false);
        }

        void Autonomous(void)
        {

        }

        void OperatorControl(void)
        {

                while (true) {
                        mtr->Set(0.5);
                        Wait(0.5);
                }
        }
};

START_ROBOT_CLASS(Spy);


basicxman 28-01-2010 13:14

Re: Black jaguars: not working
 
Make SURE you have toggled the Console Out DIP switch on the cRio. My team was having the exact same problem and it worked after toggling Console Out and a good ol' hard reboot.

Bryscus 28-01-2010 15:40

Re: Black jaguars: not working
 
Quote:

Originally Posted by basicxman (Post 908572)
Make SURE you have toggled the Console Out DIP switch on the cRio. My team was having the exact same problem and it worked after toggling Console Out and a good ol' hard reboot.

That's a good point for everyone trying to use the serial port, but it shouldn't matter for the 2CAN interface.

- Bryce

hm29168 28-01-2010 16:39

Re: Black jaguars: not working
 
We have been having a similar problem as ellisk. We have updated our Jaguars to the most current firmware (87) as well as our 2CAN (v.1.5) and have gotten the sample code to work. However, we can only move sporadically with error -52007 showing up on the target console. Likewise, the watchdog is flipping on and off sporadically. We are using 2CAN with gray Jaguars.

jhersh 28-01-2010 18:14

Re: Black jaguars: not working
 
Quote:

Originally Posted by Bryscus (Post 908480)
P.S.S.S. Here's an example of what my code would be using CAN over the serial port.

Code:

#include "WPILib.h"
#include "CANJaguar.h"



class Spy : public SimpleRobot
{
        CANJaguar *mtr;

public:
        Spy(void)
        {       
                mtr = new CANJaguar (5);  //or whatever ID you have set
                GetWatchdog().SetEnabled(false);
        }

        void Autonomous(void)
        {

        }

        void OperatorControl(void)
        {

                while (true) {
                        mtr->Set(0.5);
                        Wait(0.5);
                }
        }
};

START_ROBOT_CLASS(Spy);


And because of the unified architecture, the exact same code will work with the 2CAN with no modifications (or even rebuilding) by simply changing which driver plugin is configured to load on startup. It may be good to get a baseline with serial so you know the robot code is OK, then switch to the 2CAN plugin and see if there might be a problem with it.

-Joe

jhersh 28-01-2010 18:17

Re: Black jaguars: not working
 
Quote:

Originally Posted by hm29168 (Post 908701)
Likewise, the watchdog is flipping on and off sporadically.

Which watchdog?

Mike Copioli 28-01-2010 18:49

Re: Black jaguars: not working
 
Quote:

Originally Posted by hm29168 (Post 908701)
We have been having a similar problem as ellisk. We have updated our Jaguars to the most current firmware (87) as well as our 2CAN (v.1.5) and have gotten the sample code to work. However, we can only move sporadically with error -52007 showing up on the target console. Likewise, the watchdog is flipping on and off sporadically. We are using 2CAN with gray Jaguars.

Are you able to view the dashboard? If the answer is yes, are your Jaguars showing up in the dashboard view? If they are, and there are no faults displayed, it is possible the issue is somewhere in the code. One thing that you could do is leverage the dashboard feature of the 2CAN. When you are in the dashboard view, verify the throttle values that your code is requesting. For example if you are requesting a throttle value of 1, the throttle value in the dashboard view for that Jaguar should be 100%. Try this and post your results. The next release of the firmware will contain more diagnostic features that will help users to pinpoint problems.

ellisk 28-01-2010 19:33

Re: Black jaguars: not working
 
Update:

ozrien: Yes to everything.

I'm not sure what on the dashboard would appear for the Jaguar. However, everything looks dead (not seeing any relays, etc).

I also get error -63194 at the start when I run over the RS232 port, that is:
Code:

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

Dale 28-01-2010 23:18

Re: Black jaguars: not working
 
One other thing to add to ellisk's report. When using the BDC-COMM application over RS-232 via a PC we are able to control the Jaguar and it's attached motor. It was thrilling to see a motor actually move! That seems to indicate the problem is not a physical one, at least using RS-232.

I'm about ready to pull the plug, so to speak, on CAN. We'd really like to use the advanced features of Jaguars, and love the way it cleans up the board, but we also need to get on with things. Ellisk is one of the most talented programmers our team has ever had -- four years on the team, four years of CS classes, Intel Science Talent Search finalist, etc.

Do you folks have any final ideas???

jhersh 29-01-2010 01:00

Re: Black jaguars: not working
 
Quote:

Originally Posted by ellisk (Post 908839)
I also get error -63194 at the start when I run over the RS232 port, that is:
Code:

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

-63194 is kRIOStatusVersionMismatch. Update the Jaguar firmware.

-Joe

Mike Copioli 29-01-2010 08:21

Re: Black jaguars: not working
 
Quote:

Originally Posted by jhersh (Post 909070)
-63194 is kRIOStatusVersionMismatch. Update the Jaguar firmware.

-Joe

This makes sense. That explains the jittery behavior. Ellis I would not give up on CAN just yet. Try to verify the JAG firmware version number as 87 using either the 2CAN web dash or the BDC-com.


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