View Single Post
  #111   Spotlight this post!  
Unread 06-04-2011, 01:21
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Unexplained intermittent CAN / 2CAN Jaguar problems at GSR

Quote:
Originally Posted by kamocat View Post
Yes, in updating all your motors every 10ms, you will see many timeout issues. Setting the output takes 5-10ms (often 8ms) for a single Jaguar.
You wouldn't happen to have any numbers of what parts of the system these times are coming from, would you? I've been digging through the jaguar source code again and found some interesting stuff in the CAN interface.

CAN/Serial have the lowest priority interrupts, being called whenever new data is on the bus. This interrupt also has the responsibility of interpreting the message and either returning an ACK or any relevant data over the bus. Above that is an interrupt timed every 1ms which reads in any queued commands over CAN, runs a PID tick, checks limit switches, updates LED, and updates the outputs. At an even higher level is the ADC data reader. At the top of the regularly called interrupts is an interrupt for an edge on either the PWM or encoder lines. Obviously above that is the internal watchdog.

So, from what I gather, if a message is sent at an unlucky time, the internal interrupts could be slowing down the response over CAN, with some system conditions increasing the chance of this than others. (ex. PID makes the 1ms run a little longer, an encoder causes more interrupts to be called, etc).

Jumping back to the cRIO, a jaguar has 10ms to ACK before an error is returned. Judging by the 8ms (that was without PID, right?) average posted by kamocat, there isn't much wiggle-room in the system. Here's another interesting fact: last year the timeout was 50ms.

Now, here's a test I'd run if I had the hardware to do so. Connect a jaguar over CAN, attach an encoder and a motor to it. Record an average response time of the jaguar with and without the encoder being spun. If the response time increases by a significant figure with the encoder attached, then possibly the interrupts in the jaguars are causing these problems.

Sorry if I rambled a bit up there, time for sleep
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote