Go to Post Do not interrupt, do not defend yourself - just listen. After they are done, be sure to thank them for their honest feedback, and close the books. Arguing or defending is not how to accept feedback. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
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-01-2012, 23:58
ekgordon2 ekgordon2 is offline
Registered User
FRC #2022
 
Join Date: Jan 2012
Location: Buffalo Grove
Posts: 5
ekgordon2 is an unknown quantity at this point
CANJaguar timeout on cRIO startup

This is the third year out team is using CAN, but this problem has me stumped.

We just updated the firmware on a new black jaguar (v100 from ti.com/jaguar) and assigned it board ID 1. We have a new 4-slot cRIO imaged with the NI cRIO Imaging Tool, and we are using WindRiver C++ for programming with latest workbench/WPILib update from FIRSTForge.

The jaguar worked fine when controlled manually by BDC-COMM, but when connected to the cRIO, we are getting an error in sendMessage(), CANJaguar.cpp line 460: JaguarCANDriver timed out while waiting for a response.

Here is the code we used, basically the sample IterativeRobot with everything commented out:

Code:
#include "WPILib.h"
#include "CANJaguar.h"

class BuiltinDefaultCode : public IterativeRobot
{
	
	CANJaguar *motor;
	
	// Local variables to count the number of periodic loops performed
	UINT32 m_autoPeriodicLoops;
	UINT32 m_disabledPeriodicLoops;
	UINT32 m_telePeriodicLoops;
		
public:

	BuiltinDefaultCode(void)	{
		printf("BuiltinDefaultCode Constructor Started\n");

		// Initialize counters to record the number of loops completed in autonomous and teleop modes
		m_autoPeriodicLoops = 0;
		m_disabledPeriodicLoops = 0;
		m_telePeriodicLoops = 0;

		printf("BuiltinDefaultCode Constructor Completed\n");
	}
	
	
	/********************************** Init Routines *************************************/

	void RobotInit(void) {
		// Actions which would be performed once (and only once) upon initialization of the
		// robot would be put here.
		
		motor = new CANJaguar(1);
		
		printf("RobotInit() completed.\n");
	}
	
	void DisabledInit(void) {
		m_disabledPeriodicLoops = 0;			// Reset the loop counter for disabled mode
		
		// Move the cursor down a few, since we'll move it back up in periodic.
		printf("\x1b[2B");
	}

	void AutonomousInit(void) {
		m_autoPeriodicLoops = 0;				// Reset the loop counter for autonomous mode
		
	}

	void TeleopInit(void) {
		m_telePeriodicLoops = 0;				// Reset the loop counter for teleop mode
		
	}

	/********************************** Periodic Routines *************************************/
	
	void DisabledPeriodic(void)  {
		static INT32 printSec = (INT32)GetClock() + 1;
		static const INT32 startSec = (INT32)GetClock();


		// increment the number of disabled periodic loops completed
		m_disabledPeriodicLoops++;
		
		// while disabled, printout the duration of current disabled mode in seconds
		if (GetClock() > printSec) {
			// Move the cursor back to the previous line and clear it.
			printf("\x1b[1A\x1b[2K");
			printf("Disabled seconds: %d\r\n", printSec - startSec);			
			printSec++;
		}
	}

	void AutonomousPeriodic(void) {
		
		m_autoPeriodicLoops++;

		
	}

	
	void TeleopPeriodic(void) {
		// increment the number of teleop periodic loops completed
		m_telePeriodicLoops++;

		motor->Set(0.5);

	} // TeleopPeriodic(void)

};

START_ROBOT_CLASS(BuiltinDefaultCode);
We tried switching out CAN cables, re-imaging the cRIO, and rewriting firmware on the Jaguar. Oddly, PWM worked perfectly when we tested it out, only CAN is having problems.

Thanks in advance!
Reply With Quote
  #2   Spotlight this post!  
Unread 12-01-2012, 00:11
kccowan kccowan is offline
Registered User
AKA: Ken Cowan
FRC #1073
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Hollis, NH
Posts: 17
kccowan is an unknown quantity at this point
Re: CANJaguar timeout on cRIO startup

Are you using a 2CAN? Last year, we had CAN timeout errors when the 2CAN was plugged into the radio but not when plugged into the CRIO. I know the CRIO II only has 1 ethernet port. I asked elsewhere here on how to best configure it this year.

KC
Reply With Quote
  #3   Spotlight this post!  
Unread 12-01-2012, 04:06
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: CANJaguar timeout on cRIO startup

Make sure your console out is off.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-01-2012, 07:29
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 453
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: CANJaguar timeout on cRIO startup

Quote:
Originally Posted by kccowan View Post
Are you using a 2CAN? Last year, we had CAN timeout errors when the 2CAN was plugged into the radio but not when plugged into the CRIO. I know the CRIO II only has 1 Ethernet port. I asked elsewhere here on how to best configure it this year.

KC
CAN timeout errors are usually caused by poor CAN connectivity. Connecting the 2CAN to an Ethernet port on the radio vs. the cRIO does not cause CAN timeouts. Connect the 2CAN to the radio it should perform as expected. If you continue to have issues while connected to the radio contact support@crosstheroadelectronics.com
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
Reply With Quote
  #5   Spotlight this post!  
Unread 12-01-2012, 11:12
ekgordon2 ekgordon2 is offline
Registered User
FRC #2022
 
Join Date: Jan 2012
Location: Buffalo Grove
Posts: 5
ekgordon2 is an unknown quantity at this point
Re: CANJaguar timeout on cRIO startup

Quote:
Originally Posted by jhersh View Post
Make sure your console out is off.
Thanks! Turning off the console solved the problem.

BTW I was using Serial, not 2CAN.
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 02:55.

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