![]() |
Black jaguars: not working
I am trying to get the new black jaguars working and am getting errors when I attempt to use them. Here is the setup and the errors I am getting:
First, the jaguars have been updated (done by another member of our team). I put the file at http://firstforge.wpi.edu/sf/frs/do/...agbridgeplugin onto the cRIO via FTP according to the directions at http://firstforge.wpi.edu/sf/sfmain/...ects.canjaguar, under the heading "Getting Started." I got the Jaguar code from http://firstforge.wpi.edu/sf/frs/do/...anjaguar_for_c and modified it so that it compiles, as shown in this thread: http://www.chiefdelphi.com/forums/sh...ad.php?t=80706 The code I am using is: Code:
// This code has been simplified for the purposes of posting.Code:
>>>>ERROR: status == -52007 (0xFFF34D9) in sendMessage() in C:/windriver/workspace/Spy/CANJaguar.cpp at line 176Does anyone know what's going on? I would really appreciate any help. Thanks, Kevin |
Re: Black jaguars: not working
I'm realizing that this really isn't a C++ Windriver specific question. Would a moderator mind moving my thread into the general programming forum? Thanks.
|
Re: Black jaguars: not working
Quote:
TI recommends that you use addresses in the range 2 - 63. BTW, the error code is "Operation Timed Out". Also, have you tested your serial cable adapter with a PC serial port and bdc-comm to make sure it's functioning properly? Is your serial cable plugged into the left RJ-12 plug on the Black Jag? Does the plugin appear to be loading properly on the console (you would have to use a network console to see it since your serial port is in use!)? -Joe |
Re: Black jaguars: not working
Thanks for the reply. I talked to the control systems people on my team and they set the ID of the black Jaguar using the bdc-comm utility to 2. I tried the code again, however, with the ID given in the constructor of the black jaguar to 2, and I still get the exact same behavior.:confused: So, while it seems that I did have the wrong port, that isn't the reason I get these errors. Any advice?
Thanks, Kevin EDIT: yes, the driver loads correctly, as seen from the network console. The black jaguar utilities show that the Jaguar is functioning fine and the wiring is fine. I'm very confused... |
Re: Black jaguars: not working
What about the other list of suggestions in my last post? Also... if you have LabVIEW installed, you could run the voltage mode example to see what enumerates on your robot.
-Joe |
Re: Black jaguars: not working
Yes, we've tried the other suggestions. The cable is fine, it's plugged in on the left, there is a 100 ohm resistor on the left jack, and I can see the driver loading on the console when the cRIO boots.
EDIT: Here's the startup message from the cRIO's console: Code:
FPGA Hardware GUID: 0xAD(a bunch of hex digits)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 |
Re: Black jaguars: not working
If you just unplug the serial connector from the cRIO and plug it into a PC, does bdc-comm see the Jaguars?
|
Re: Black jaguars: not working
Hi, we had a seemingly similar problem with our CAN bus setup (using LabView). the driverstation would display an error regarding "CAN-Recieve.vi" and "operation not completed in time" (or something like that), so a timeout error of sorts. essentially, the cRIO was not getting a confirmation of initial setup from the black jag, or other jaguar- I forget exactly which. Anyway, we went into the code for initializing a 4motor robot drive system. and modified it such that it bypassed this error point (removing CAN-Recieve.vi). Then it worked perfectly. So my guess is that you may be able to do something similar in C++.
|
Re: Black jaguars: not working
Answering for ellisk and in answer jhersh's question... yes the same cable works fine off a PC to talk to the Jaguar via the command line and GUI interface. The firmware was updated and ID set. No other changes were made to the Jaguar's settings. Also, for what it's worth, different cRIOs exhibit the same problem.
Once thing we didn't do was wire any of the the RS-232 handshake lines in the connector, things like CTS, RTS, DTR, DSR. The manual didn't say anything about that so we're assuming the cRIO doesn't care. Is that true? |
Re: Black jaguars: not working
As a side thought, is your CAN bus properly terminated? To make the CAN bus work it is my understanding that you need approximately a 100ohm resistor joining CANH and CANL on the last Jaguar. The pin outs can be found in the data sheet available here: http://www.luminarymicro.com/products/mdl-bdc24.html. I don't know if this will fix the problem but it may be something in the right direction.
-Ian Programmer, Team 2022 |
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
We do have the 100 ohm terminator in place. We know the Jaguars only have TX and RX but I wasn't clear whether the cRIO needed to have the other handshake lines jumpered at it's end. ellisk will have to answer about the robot being enabled.
They were trying a 2CAN ethernet adapter when I left the lab tonight to see if that yields better results. We'd still like to get the "official" RS-232 solution working though. |
Re: Black jaguars: not working
Quote:
-Joe |
Re: Black jaguars: not working
2 Attachment(s)
Quote:
If I just send the Jags a constant max output value, they will run and then sputter, and then run, yada yada yada. It sounds as if I have a physical layer problem - i.e., signals not propagating properly. Also, I have obviously been able to connect with BD-COM to assign IDs and re-flash the firmware... So my questions are: Should the termination resistor be on the cable at the LEFT port of the Gray Jag, or is it correct the way I have it? Has anyone else been able to get a connection, but suffers from intermittent signal loss? - Bryce P.S. I have attached some pictures of errors that I am receiving in the NetConsole. P.S.S. This is somewhat of a bummer, because I have written code to make use of the Speed and Position modes, but can't test it until I at least have a reliable communication interface... |
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. |
Re: Black jaguars: not working
Quote:
|
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.
|
Re: Black jaguars: not working
Quote:
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? |
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.
|
Re: Black jaguars: not working
That could do it...
- Bryce |
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 |
Re: Black jaguars: not working
Quote:
Quote:
-Joe |
Re: Black jaguars: not working
BTW: NEW CANJag CODE IS AVAILABLE FOR DOWNLOAD!!!
Quote:
|
Re: Black jaguars: not working
Quote:
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 |
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.
|
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
Quote:
|
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" |
Re: Black jaguars: not working
Quote:
-Joe |
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.
|
Re: Black jaguars: not working
Quote:
|
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...
|
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? |
Re: Black jaguars: not working
Quote:
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" |
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.
|
Re: Black jaguars: not working
Quote:
- Bryce |
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.
|
Re: Black jaguars: not working
Quote:
-Joe |
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
Quote:
|
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 |
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??? |
Re: Black jaguars: not working
Quote:
-Joe |
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
Quote:
I think I was getting the same error. I believe the error had to do with saturating the serial port (or maybe the 2CAN in your case?). Put a wait statement in your main loop. Use the code Wait(x); where x is the number of seconds and is a float. If you try to send commands too quickly, you will end up with jittery motors and a lot of those errors because the serial port can't send the data out as fast as you can write to the serial port itself. - Bryce |
Re: Black jaguars: not working
@jhersh - The watchdog is the main watchdog in the FIRST code; it appears on the Driver Station PC as "Watchdog not Fed".
@Mike Copoli - We are able to access the web dashboard and the throttle values do what we set them to. @Bryscus - We did have a Wait function in our code set at 0.005. After playing with different Wait Value functions (0.02, 0.5, 0.08), we noted that the error dissapeared for higher values, but the Driver Station PC complained of the Watchdog not being fed. We do think it's a problem with the 2CAN being overloaded as the lower values (0.02) are the only ones that complains about the error. We could keep playing around with values until we find the magic number that makes it work. However, we are afraid of being disqualified during competition / losing command of our robot due to the Watchdog waiting too long. What was your Wait value and do you have any recommendations? |
Re: Black jaguars: not working
Quote:
|
Re: Black jaguars: not working
Just to close the loop in case everyone is wondering. After all the messing around with Jaguars, loading firmware, etc. somehow we didn't have the latest firmware on the Jaguar!!! Of all the mistakes.
We're still working on getting things working with RS-232 so we can make an informed choice vs the 2CAN but at least one of the two is working now. Thanks so much to everyone who helped us get this together! |
Re: Black jaguars: not working
QUOTE=hm29168;909397]@ We do think it's a problem with the 2CAN being overloaded as the lower values (0.02) are the only ones that complains about the error. ?[/quote]
This is not likely. The response time between commands sent and and aked over CAN using the 2CAN is sub mS and CAN is the bottleneck not Ethernet. Are you using Java, c++ or Labview? How many Jags are you using? Is the webhost running when you observe these issues? This should not cause a problem but it is good to rule it out. Any issues that are caused by "to much data" over Ethernet will only be worse over serial. |
Re: Black jaguars: not working
We are using C++ with 4 Grey Jags and 2CAN. We are not running the web interface when the robot exhibits these problems and we are using Ethernet, not serial. The cRIO, Jag's, and 2CAN firmware are updated to version 19, 87, and 1.5, respecitvely.
|
Re: Black jaguars: not working
Quote:
- Have you used the web dash to verify version number of the Jaguars and the 2CAN firmware? - Do you have a 120 ohm termination resistor on the CAN BUS? - Have you confirmed the ARB(Jag) IDs are set correctly and not conflicting? - Is the latest plugin being loaded? The latest can be found at www.crosstheroadelectronics.com/2CAN.htm - When your code is running and you are not changing throttle values, what state is the LED on the 2CAN and the Jaguars in. (color and solid/blink) The 007 ERROR is indicating that the 2CAN is awaiting a response from the Jaguar over CAN. This can happen for several reasons. It is usually due to the wrong firmware being loaded onto the Jag but can be caused by any of the afore mentioned problems. |
Re: Black jaguars: not working
After doing all of your suggestions, we realized that the problem was that in the code, we were not asking anything of the Jaguars in the code. So, the 2CAN was waiting for a response from the Jaguars, but the Jaguars weren't sending anything back. Thanks for all of your help! Can't wait to start playing with the CAN features.
|
Re: Black jaguars: not working
Quote:
- Bryce P.S. Also, just in case you didn't know, you can set the expiration time for the Watchdog. If for some reason your cannot feed the watchdog in time, make sure the current expiration time is not set too short. It should be initialized in your main robot code and should then be fed every iteration of the main loop. |
Re: Black jaguars: not working
We were coding in C++ and did play with the GetWatchdog.SetExpiration() as well as the Wait command. The fix (at least for us temporarily) was to get the Jaguars to do something every now and then, say GetOutputVoltage from the Jaguar. So glad to finally get this resolved and can finally work on more complex features of CAN.
|
Re: Black jaguars: not working
Quote:
- Bryce |
| 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