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)

Bryscus 29-01-2010 11:13

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.

hm29168,

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

hm29168 29-01-2010 15:20

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?

ellisk 29-01-2010 19:20

Re: Black jaguars: not working
 
Quote:

Originally Posted by Mike Copioli (Post 909148)
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.

Thank you so much! It works now over 2CAN!

Dale 29-01-2010 22:11

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!

Mike Copioli 30-01-2010 07:48

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.

hm29168 30-01-2010 10:29

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.

Mike Copioli 30-01-2010 12:06

Re: Black jaguars: not working
 
Quote:

Originally Posted by hm29168 (Post 909795)
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.

I know some of this may seem redundant but I am going to ask anyway.

- 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.

hm29168 30-01-2010 17:09

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.

Bryscus 01-02-2010 09:36

Re: Black jaguars: not working
 
Quote:

Originally Posted by hm29168 (Post 910061)
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.

So just to satisfy my morbid curiosity, to which code are you referring and what was the fix? Thanks.

- 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.

hm29168 01-02-2010 17:53

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.

Bryscus 02-02-2010 11:14

Re: Black jaguars: not working
 
Quote:

Originally Posted by hm29168 (Post 911373)
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.

I'm glad you have it working, but you shouldn't have to request any information from the Jags to get them to work.

- 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