Go to Post Well I guess that's better than some teams idea of team bonding which would be taping a wayward freshman to the wall with duct tape. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 22-01-2012, 12:46
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Jaguar Blinking Yellow

Hello everyone. This is our teams first year in FTC and we have run into some problems getting started on the programming side. I have read quite of few of the guides and the problem I have run into is that no matter what I try the Jaguar motor controller blinks yellow which indicated that it is not initialized in the code. These are the steps that I have taken so far:

1. Connected everything as shown in the "Getting Started with the 2012 FRC Control System pdf. (There is a small problem with the document. On page 13 it shows the motor controller connected to the white PWM pins on the sidecar while on page 11 it shows it connected to the black pins which I believe are for sensors or spikes from what I've read.)

2. My setup has one difference. There is only one Jaguar motor controller connected. It is connected under PWM 1 on the sidecar.

3. Flashed the cRIO successfully and assigned it the correct IP address.

4. Compiled a program after downloading the WPIlib file that was missing.
(I was using the simple robot template for this.)

5. Uploaded it to the cRIO.

6. Power cycle.

7. Run autonomous and driver control from the driver station.

After modifying the code in countless ways I still have had no success. I have tried changing the class to iterativerobot as well as using the Jaguar class with no success.

I was wondering if anyone could shoot some code my way with a few examples of how to get this working. I'm sure its something simple I'm overlooking. I was also wondering if anyone could tell me or point me to a document that explains what CAN is and what the advantages and disadvantages of it are?

Any help is appreciated!

Last edited by meltbox360 : 22-01-2012 at 14:01.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2012, 16:04
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,014
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Jaguar Blinking Yellow

According to this document, table 2-5 says:
Quote:
Solid Green Full-speed forward
Solid Red Full-speed reverse
Fault Conditions
Slow Flashing Yellow Loss of CAN or servo link
Slow Flashing Red Fault
Calibration or CAN Conditions
Flashing Red and Green Calibration mode active
Flashing Red and Yellow Calibration mode failure
Flashing Green and Yellow Calibration mode success
Slow Flashing Green CAN ID assignment mode
Fast Flashing Yellow Current CAN ID (count flashes to determine ID)
Flashing Yellow CAN ID invalid (that is, Set to 0) awaiting valid ID assignment
Flashing Yellow is almost always "no PWM input". Make sure the wiring is correct from the Digital Sidecar - white is always signal.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2012, 17:45
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

^Hah if only there was a like button. And a thanks one to add to that.

EDIT: To clarify the thanks goes to Don for the information provided

I've seen that table but I've also seen someone say it happens when the code never references the controller. I was just wondering if someone could throw code that ran a motor at 50% in autonomous. Default module positions and PWM 1 connected.

As for checking connections. I have a few times and that is exactly why I am perplexed. I have read in one other thread that someone had this problem with 3 out of 4 of their Jaguars. Nonetheless I will check again on Tuesday when I am in front of the setup. Thank for the help. If anyone has additional ideas or code they could share I would really appreciate it.

Last edited by meltbox360 : 22-01-2012 at 19:14.
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2012, 21:57
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: Jaguar Blinking Yellow

You've done Step 1: make sure everything is plugged in. How about Step 0.5: make sure everything has power?

Your Jaguar has power; otherwise its light would not be blinking.
Your cRIO has power; otherwise you would not have communication.

What about your Digital Sidecar? What is its 12 volt power input wired to? Are the BATT, +5v, and +6v LEDs lit? Is the Robot Signal Light blinking, and if so, in what pattern?
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2012, 13:03
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Jaguar Blinking Yellow

Did you rework your DB37 cable?
Reply With Quote
  #6   Spotlight this post!  
Unread 23-01-2012, 14:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,862
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by meltbox360 View Post
^Hah if only there was a like button. And a thanks one to add to that.
There is a Like button.
In the upper right on the bar topping each post is an icon of a set of scales that will say "Add to Don's reputation".
You can click on that and add a thank you.
Don will get any note from you and it will tell him the post you Liked.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 23-01-2012, 19:10
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by Joe Ross View Post
Did you rework your DB37 cable?
Is that the cable that's reminiscent of floppy disk drive cables?

I have checked power just by looking at the lights but I suppose poking around with a multimeter would not hurt.

I have actually rewired the whole thing once so the wiring should not be the problem but I will make sure to triple check it. Maybe try another controller to make sure I don't have a bad one.
Reply With Quote
  #8   Spotlight this post!  
Unread 24-01-2012, 17:14
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

I rechecked all the wiring and everything is correct. I'm not sure what the lights next to "RELAY" on the sidecar signify but they light up. Sometimes one of them is not lit up though. The motor controller continues to blink just as before. I will post my code here, perhaps someone can find something I did wrong.

Code:
#include "WPILib.h"

class WRobot : public SimpleRobot
{
	Jaguar WMotor;
	
public:
	WRobot(void):WMotor(2,1)
	{
		//WMotor.SetExpiration(0.1);
	}
	
	~WRobot(void)
	{
	}
	
	void Autonomous(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
	void Disabled(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
	void OperatorControl(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
	void RobotInit(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
	void RobotMain(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
	void StartCompetition(void)
	{
		WMotor.Set(1);
		Wait(2.0);
		WMotor.Set(0);
		WMotor.Disable();
	}
	
};

START_ROBOT_CLASS(WRobot);
The only other thing I can think of is possibly flashing the motor controllers but it did not say to do that unless you are using CAN.

EDIT: Just a note on the commented SetExpiration. I did have that in the code at one point. I commented it as it was unclear to me exactly what it did but I was just trying a few things.

Last edited by meltbox360 : 24-01-2012 at 18:40.
Reply With Quote
  #9   Spotlight this post!  
Unread 24-01-2012, 17:35
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by meltbox360 View Post
Is that the cable that's reminiscent of floppy disk drive cables?
Instructions for checking it and reworking the DB37 cable are on the FIRST KOP website. http://www.usfirst.org/sites/default...structions.pdf
Reply With Quote
  #10   Spotlight this post!  
Unread 24-01-2012, 18:38
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by Joe Ross View Post
Instructions for checking it and reworking the DB37 cable are on the FIRST KOP website. http://www.usfirst.org/sites/default...structions.pdf
I just ran the lab view demo program and the motor spins so I now know whatever I am doing wrong is in code or software configuration. I would appreciate it if someone could look at the code I posted and tell me what I am missing in there. Thank you for the link though, definitely something that could be very useful in the future.
Reply With Quote
  #11   Spotlight this post!  
Unread 24-01-2012, 19:08
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Jaguar Blinking Yellow

Uhhh -- If you just ran the LABVIEW demo program with no troubles, but your troubles are in C++, I gotta ask... have you RE-FLASHED your cRio in between? There are different images on the cRio for Java, C++, and Labview.

bob
Reply With Quote
  #12   Spotlight this post!  
Unread 24-01-2012, 20:16
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,014
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by meltbox360 View Post
I'm not sure what the lights next to "RELAY" on the sidecar signify but they light up.
They are telling you that the Relay outputs are being enabled and commanded into one or the other state (red or green). A Relay is also known as a Spike, you have one in the KoP and it should be used to run your air compressor if you are using pneumatics.

That is worrisome, because if you are not deliberately commanding them on, why are they on? They shouldn't be.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #13   Spotlight this post!  
Unread 24-01-2012, 20:57
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

I did make sure to change the firmware back to the c++ firmware and I found an example that runs the motor. I will look into it more to see what it is that I did differently. I believe the code I wrote only references the PWM pins but it does not make the Jaguar react. This is definitely a fault in my code I'm just unsure of what exactly it is.
Reply With Quote
  #14   Spotlight this post!  
Unread 24-01-2012, 22:21
meltbox360 meltbox360 is offline
Registered User
FRC #4302
 
Join Date: Jan 2012
Location: Chicago, Il
Posts: 32
meltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of lightmeltbox360 is a glorious beacon of light
Re: Jaguar Blinking Yellow

Quote:
Originally Posted by DonRotolo View Post
They are telling you that the Relay outputs are being enabled and commanded into one or the other state (red or green). A Relay is also known as a Spike, you have one in the KoP and it should be used to run your air compressor if you are using pneumatics.

That is worrisome, because if you are not deliberately commanding them on, why are they on? They shouldn't be.
The funny thing is that all of the red AND green lit up when I ran my code. That's very strange...
Reply With Quote
  #15   Spotlight this post!  
Unread 25-01-2012, 00:59
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Jaguar Blinking Yellow

Ok -- so I've taken a longer look at the code and there are a number of issues. Rather than going over each one individually, I'm going to ask why you don't start with the "FRC SimpleRobot" template instead of trying to write from scratch. The program you have here uses things that the SimpleRobot class doesn't use in the template. That's not a bad thing if you're experienced, but it appears you may be pretty new to this. One of the big items here, however, is that OperatorControl() is called ONCE and you need to have a "while isOperatorControl() { ... }" loop or else it'll call your code, you set a few things, and then a millisecond later, you're no longer running your robot code. It is quite possible that your function calls work on the Jaguar itself, but since SimpleRobot is not being used properly, it appears to be unsuccessful.

I would suggest starting with the template and modifying from there. It'll likely be much less problematic. Also, I'd suggest taking the SimpleRobot docs from the help file and print them out, STUDY them, and highlight/make-notes.

Then if it's still a problem, send me a PM with your phone number and we'll get on the phone and talk it through.

Thanks,
bob
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 13:38.

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