Go to Post There is a really bad trap most people fall into, when presented with data they tend to trust it. This is dangerous. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2007, 14:24
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Unhappy Coder Error Light

Now that our encoders count, we have other problems. PWM's one and two have enabled encoders. Sometimes when i run those motors they suddenly stop responding and the code error light starts blinking on the OI . could this be caused by faulty encoders? Or is it an infinite interrupt loop? The code compiles fine, with not even a warning (Using MPLab). What could be causing the problem? Thanks in advance
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #2   Spotlight this post!  
Unread 10-02-2007, 15:31
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Coder Error Light

There are a number of possible causes for this. One possibility is that your encoders are generating too many interrupts per second, which is keeping the rest of the code from completing its task in a timely manner. Can you give us more information about what encoders you're using, where they're attached to your drivetrain, and when the problem occurs (only when you're driving fast, or sporadically)?
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #3   Spotlight this post!  
Unread 10-02-2007, 15:36
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Coder Error Light

the generate 128 clicks per revolution, at about 400 RPM (i think) we have an encoder divider board, do you suggest we implement that? generally it happens when i drive fast, but not always. i have it rigged right now so that it prints 1 when the first encoder fires, and 2 when the second one fires. the last line it prints is, "----2------------"
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #4   Spotlight this post!  
Unread 10-02-2007, 15:38
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
Re: Coder Error Light

...Are you printing out those inside the interrupts? If so, that's most likely your problem. printf takes too long to execute inside an interrupt.
__________________
xXx.S3nS31-h4nz0.xXx
  #5   Spotlight this post!  
Unread 10-02-2007, 15:39
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Coder Error Light

Actually, i just realized: when it hits the violation, the motors were running, and the print statements were activated. What i mean is that we have a function , PrintData():
Code:
PrintData(){
	printf("\r------------------------- USER INPUTS -------------------------------\r");
	printf("Joystick 1 Y-axis: %d\t Joystick 1 Trigger: %d\r", left_joy, p1_sw_trig);
	printf("Joystick 2 Y-axis: %d\t Joystick 2 Trigger: %d\r", right_joy, p2_sw_trig);
	
	printf("\r------------------------- PWM OUTPUTS -------------------------------\r");
 	printf("Left Motor: %d\t Right Motor: %d\r",  (int)left_motor, (int)right_motor);
 	printf("Relay 1 Forward: %d\t Relay 1 Reverse: %d\r", relay1_fwd, relay1_rev);
 	printf("Relay 2 Forward: %d\t Relay 2 Reverse: %d\r", relay2_fwd, relay2_rev);

/*	printf("\r------------------------- SENSORS -------------------------------\r");
*/
	printf("\r------------------------- VARIABLES -------------------------------\r");
	printf("Alt Left Encoder: %dl\t Alt Right Encoder: %dl\r", Encoder_1_Counter, Encoder_2_Counter);
	
}
i think maybe the encoders fired during the print statement, which would explain the hyphens. Do you think that could cause problems
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #6   Spotlight this post!  
Unread 10-02-2007, 15:40
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Coder Error Light

Quote:
Originally Posted by Eclipse View Post
...Are you printing out those inside the interrupts? If so, that's most likely your problem. printf takes too long to execute inside an interrupt.
i'm actually using puts("1"); which my dad said would work... could that be the problem?
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #7   Spotlight this post!  
Unread 10-02-2007, 15:42
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Coder Error Light

That's a lot of clicks. I can't promise you that your problem is oversaturating the interrupts, but it's the first thing I would investigate. Plug in your divider board, and use the highest divider you can. If that eliminates the problem, you can go to finer resolution as long as it's still working. I'm sure there are other possible causes for this problem, but they would be impossible to find without seeing your code, and maybe still impossible then. In any case, try that first.

EDIT: Now that I see your latest post, you definitely shouldn't be doing anything in your interrupt handler other than incrementing a variable or something. That would be the first thing I would fix, if you are indeed doing a puts or something in there.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #8   Spotlight this post!  
Unread 10-02-2007, 15:52
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Coder Error Light

YAY that fixed it. thanks! I only had them cuz the encoders weren't working before, so we put prints on everything that had anything to do with it
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Green light same color as overhead light Ethulin Programming 13 02-08-2007 15:24
Multiple Light Tracking with Distinct Light Boxes MaHaGoN Programming 30 19-02-2007 10:46
camera trouble,cant tell the green-light from regular white light Nimmy Programming 26 14-01-2007 14:53
GTS Code Error (the red light of doom!) Denz Programming 9 07-04-2006 17:39
stupid Array error: Error [1300] stack frame too l Validius Programming 7 27-01-2006 10:53


All times are GMT -5. The time now is 04:12.

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