Go to Post My most distinct memory was watching Tom fix our robot's frame... by whacking it with the hammer. - Jaine Perotti [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2013, 18:02
topgun's Avatar
topgun topgun is offline
Registered User
FRC #2846 (FireBears)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Minnesota
Posts: 229
topgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant future
CAN and Jaguars, any limits?

We seem to have run into an issue with CAN and Jaguars at the regional last weekend. We had the NI people and the FTA look at it. Basically we suspect that we are timing out on the CAN bus.

Last year we ran CAN with 9 Jaguars (all black). This year we are running CAN with 11 Jaguars (all black).

Our code has been sent to FIRST for further analysis.

I am wondering if other teams have run into a limit of the number of Jaguars when using CAN. Anything else we should be looking at specifically? Any java programs that test the CAN bus that people are willing to share?

Thanks.
__________________
-T

Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2013, 18:12
Andy A. Andy A. is offline
Getting old
FRC #0095
Team Role: Coach
 
Join Date: Jun 2001
Rookie Year: 2001
Location: New Hampshire
Posts: 1,015
Andy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond reputeAndy A. has a reputation beyond repute
Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by topgun View Post
We seem to have run into an issue with CAN and Jaguars at the regional last weekend. We had the NI people and the FTA look at it. Basically we suspect that we are timing out on the CAN bus.

Last year we ran CAN with 9 Jaguars (all black). This year we are running CAN with 11 Jaguars (all black).

Our code has been sent to FIRST for further analysis.

I am wondering if other teams have run into a limit of the number of Jaguars when using CAN. Anything else we should be looking at specifically? Any java programs that test the CAN bus that people are willing to share?

Thanks.
What sort of CAN network topography are you using?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-03-2013, 18:20
gurellia53's Avatar
gurellia53 gurellia53 is offline
word up
AKA: Andrew G
FRC #1736 (Robot Casserole)
Team Role: Engineer
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Peoria, Illinois
Posts: 151
gurellia53 is a splendid one to beholdgurellia53 is a splendid one to beholdgurellia53 is a splendid one to beholdgurellia53 is a splendid one to beholdgurellia53 is a splendid one to beholdgurellia53 is a splendid one to beholdgurellia53 is a splendid one to behold
Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by topgun View Post
we are timing out on the CAN bus.
We were having this issue during testing and it was due to a bad battery. We had 6 Jaguars and when we would drive with the shooter on the battery couldn't support the current and the battery voltage dropped. This caused a CAN timeout on some of the Jags. This occurred with a "fully charged" battery that was 4 years old.
__________________
FRC
Robot Casserole 1736: 2007 - 2008, 2013 - present
Team Neutrino 3928: 2012
Reply With Quote
  #4   Spotlight this post!  
Unread 11-03-2013, 21:16
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CAN and Jaguars, any limits?

If you're using a Jaguar as a serial-to-CAN gateway, you're probably pushing the limits of communication bandwidth with 11 devices to talk to. A 2CAN would not be as constraining.
Reply With Quote
  #5   Spotlight this post!  
Unread 11-03-2013, 22:59
Mike9966's Avatar
Mike9966 Mike9966 is offline
Mentor Mike
FRC #2846 (Fire Bears)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Minnesota
Posts: 62
Mike9966 is an unknown quantity at this point
Re: CAN and Jaguars, any limits?

Hi, I'm from the same team as Topgun. The configuration is cRio serial to black TI jag with 107 on it, and from there it chains from jag to jag, some tan with 101, some black TI with 107, and during our efforts to fix it, one new Vex Black unit with 107 is now also in the loop. It is terminated on the last jag.

At our regional, we with the help of Nick L (one of the NI guys) scoped it out both at the end of the chain, and in the middle and found little noise, and a basically nice looking signal. Of course, this doesn't capture all of it, but it was nice to know that there wasn't a bunch of noise on the line swamping everything.

The software somewhat randomly will claim that a jag isn't responding, usually one of the higher IDs.

If we restart the code, sometimes it works fine, but about 1 of 4 times, it won't go, and it may be timing out as indicated by jerkyness in the driving. This is really hard to tell though.

Any thoughts are much appreciated, we have 2 weeks to nail it down.

Thanks much,
Mike
__________________
Do the best you can! Always
Go FireBears
2009 10000 Lakes Finalists, thanks 2825 & 2177
2010 10000 Lakes quarter finalists
2011 Duluth and 10000 Lakes
2012 Superior, and 10K Lakes, Qt finals, MRI
2013 Northern lights, 10K Lakes-Semi finalists, MRI, River Rendezvous, Minne Mini
2014 Northern Lights, 10K Lakes
Reply With Quote
  #6   Spotlight this post!  
Unread 11-03-2013, 23:18
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,782
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: CAN and Jaguars, any limits?

If nothing else, get some code set up so you can move a few of the Jags over to PWM control instead of CAN... maybe that'll help!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote
  #7   Spotlight this post!  
Unread 11-03-2013, 23:49
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: CAN and Jaguars, any limits?

There are wiring limits - 16 Jaguars with a maximum of 20 ft of cabling, although I have seen communication problems increase as cabling gets to 14-15 feet.

Quote:
Originally Posted by Alan Anderson View Post
If you're using a Jaguar as a serial-to-CAN gateway, you're probably pushing the limits of communication bandwidth with 11 devices to talk to. A 2CAN would not be as constraining.
To put some numbers around Alan's comment, Q22 of the Jaguar FAQ gives the practical capacity using the RS232 interface of about 930 packet/s each way.
But with a 50Hz polling frequency that means under 19 messages each way per period, shared across 11 Jaguars.
Think about how many messages you pass in a typical teleop period.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-03-2013, 01:00
innoying innoying is offline
Registered User
FRC #2264 (inceptus)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Plymouth, MN
Posts: 18
innoying is an unknown quantity at this point
Re: CAN and Jaguars, any limits?

We had some issues with 10 Jaguars and the 2CAN. We ended up increasing the delay in our main teleop loop and it eliminated the timeouts for us.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-03-2013, 11:33
Mike9966's Avatar
Mike9966 Mike9966 is offline
Mentor Mike
FRC #2846 (Fire Bears)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Minnesota
Posts: 62
Mike9966 is an unknown quantity at this point
Re: CAN and Jaguars, any limits?

Well, we put 2 bots side by side to get enough Jags around, and tried communicating with them with 9,10,11, and 12 Jags.
Remember, this is going through the cRio, to a black Jag, and then to a mix of black and tan Jags via CAN.

The long and short of it is that we were able to get 9 and 10 to work fine, no timeouts that we could see, but 11 or up would fail in unpredictable ways.

For now, we are going to put our pickup arm and roller on PWM and the other 8 Jags on Can. Hopefully that will lead to uneventful driving and playing.

Thanks for your thoughts everyone,

Mike
__________________
Do the best you can! Always
Go FireBears
2009 10000 Lakes Finalists, thanks 2825 & 2177
2010 10000 Lakes quarter finalists
2011 Duluth and 10000 Lakes
2012 Superior, and 10K Lakes, Qt finals, MRI
2013 Northern lights, 10K Lakes-Semi finalists, MRI, River Rendezvous, Minne Mini
2014 Northern Lights, 10K Lakes
Reply With Quote
  #10   Spotlight this post!  
Unread 15-03-2013, 17:16
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: CAN and Jaguars, any limits?

We had a similar issue around 7 Jaguars on our practice robot before we realized we had a "bad" termination resistor. We swapped it out, after much other troubleshooting, and it resolved the issue. I can't explain the failure, but I'm sure changing the termination resistor is what fixed it. Typically, no termination results in only 1 Jaguar showing up on the CAN.

I put "bad" in quotes above because we were able to use the "bad" termination resistor on a different CAN bus with 2 Jaguars without issue.

You might give it a try; it's easy enough.
Reply With Quote
  #11   Spotlight this post!  
Unread 15-03-2013, 17:37
jvriezen jvriezen is offline
Registered User
FRC #3184 (Burnsville Blaze)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Burnsville, MN
Posts: 637
jvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond repute
Wink Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by Mike9966 View Post
Hopefully that will lead to uneventful driving and playing.
Mike
I think you really want 'eventful' driving and playing... events like scoring discs, driving, turning, hanging..
__________________
John Vriezen
FRC, Mentor, Inspector #3184 2016- #4859 2015, #2530 2010-2014 FTC Mentor, Inspector #7152 2013-14
Reply With Quote
  #12   Spotlight this post!  
Unread 16-03-2013, 13:01
gbonehead gbonehead is offline
Registered User
FRC #0571
 
Join Date: Jan 2012
Location: Windsor, CT
Posts: 2
gbonehead is an unknown quantity at this point
Re: CAN and Jaguars, any limits?

TL;DR - If you're having trouble with a CAN bus with a lot of Jaguars ("a lot" probably means 5-6+), try rewriting your code to only send commands to the CANJaguar when you actually have a speed change. That will reduce CAN traffic significantly.

--

We had what I believe is an issue with the CAN bus as well. We are using a CAN bus with 7 Jaguars - 2 drive, 2 lift, and 3 to control Frisbee feed/push/shooter wheel.

Our competition 'bot (with a cRIO II) was working fine, but after we bagged it and went to use our practice 'bot (with a cRIO I) we started getting extremely erratic behavior ... the movement was horribly jerky, if it moved at all, and there were huge delays in responding to simple commands.

After some bisection debugging (remove half the code, see if it works ) we finally came to the conclusion that it wasn't related to the code at all, but instead to how many Jaguars we were trying to control.

As it had been written, our loop would simply send the motor speed commands to each Jaguar during each loop. I added some timing code in there and saw the man loop degenerate horribly to 4-8 iterations per second, if that.

We re-wrote the code to only send commands to the Jaguars upon change (though not the drive code; that still uses the standard RobotDrive calls every iteration) and I saw the main loop speed increase to something just under 1000 iterations/sec.

The same code works just fine on our cRIO II, and has *probably* increased performance there as well, but it made the cRIO I usable. It will probably help our image processing code as well, though we haven't done our final merge of the target recognition code yet.

All our code is in C++; if you have any questions feel free to email me at bonehead@acm.org - I'm very rarely on Chief Delphi (in fact, I only knew about this thread because one of the other mentors mentioned it to me).

Or you can poke around on SourceForge; all our code is published there at http://paragon571-2011.svn.sourceforge.net ... this year's code is in the robot-2013 directory, amazingly enough
Reply With Quote
  #13   Spotlight this post!  
Unread 16-03-2013, 16:50
Todd's Avatar
Todd Todd is offline
Software Engineer
FRC #1071 (Team Max)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Connecticut, Wolcott
Posts: 51
Todd is just really niceTodd is just really niceTodd is just really niceTodd is just really niceTodd is just really nice
Re: CAN and Jaguars, any limits?

In general you can start running into trouble trying to send lots of CAN commands in your teleop loop. We offload our CAN messages into other processing loops and run them with lesser periodicity. Many motors shouldn't really need to have their speed changed more rapidly than 10-20 hz, and if you had a motor that you wanted to control the speed of more frequently than that, you could have that motor alone operate faster.

You didn't actually say whether or not you're actually doing something like this already, but in case you're not.

The same basic issue is relevant and correctable regardless of what programming language you're using.
Reply With Quote
  #14   Spotlight this post!  
Unread 16-03-2013, 18:13
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by Todd View Post
We offload our CAN messages into other processing loops and run them with lesser periodicity.
Would you be willing to provide some sample code of how you accomplish this?
Reply With Quote
  #15   Spotlight this post!  
Unread 17-03-2013, 23:25
Todd's Avatar
Todd Todd is offline
Software Engineer
FRC #1071 (Team Max)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Connecticut, Wolcott
Posts: 51
Todd is just really niceTodd is just really niceTodd is just really niceTodd is just really niceTodd is just really nice
Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by Jefferson View Post
Would you be willing to provide some sample code of how you accomplish this?
What programming language are you using?

As a trivial example, if in LabVIEW one were to determine in each robot mode (disabled, teleop, autonomous, etc) the command they wanted to send a motor and store it in a global variable, they could then read that global variable in timed tasks in a loop at whatever frequency they wished and call the set motor VI from there.

This can help free your Teleop loop to run as fast as ds packets are received.

Similar trivial examples can be constructed in C++ and Java.

There are a lot better ways that this could be handled, like using an action engine in LabVIEW, or a class in any other language rather than a global variable, but the general principle remains the same.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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