Go to Post Almost as if there's...co-opertition? - Michael Hill [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 18-02-2008, 11:58
PhilM PhilM is offline
Registered User
FRC #0937
 
Join Date: Jan 2007
Location: Shawnee Mission North High School
Posts: 4
PhilM is an unknown quantity at this point
IR sensor corruption help

We have a problem with our IR chip. For some reason the fourth button we assigned to the IR chip is messing up. When we turn on our autnomous code using a paperclip in the competition spot in the controler, the fourth button's command starts going on it's own. The remote we have set up was not pointed at the sensor, and nothing was pressed. We quickly removed the paperclip, and things worked again tried it again, same thing happened.
So we tested again by commenting out what button four did on the program. The other three buttons and their reactions worked just fine. We put the missing part of the program back in and BAM! Same problem.

Then someone looked up the update from FIRST, and it said that the IR chip was becoming faulty under circumstances we had been doing. (Leaving the battery plugged in all the time and leaving it hooked up to the robot)

Is the IR chip our problem with the program, and is there any way to fix it?
Or is our problem with our program and the IR chip should be perfectly fine?
Please Help!
~Team 0937
  #2   Spotlight this post!  
Unread 18-02-2008, 12:38
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: IR sensor corruption help

If you're taking values incorrectly from the IR sensor, the fourth may be the last one being updated. The IR sensor returns zero if a button is hit and 1 if it is not. 0 is also the unattached value. I suggest first posting your code or shuffling the order of your ifs/cases and see if another button is being triggered. If the fourth button still triggers, your sensor may not be wired right.
  #3   Spotlight this post!  
Unread 18-02-2008, 12:51
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: IR sensor corruption help

I suspect the fourth output from the IR sensor is not electrically connected to the digital input and thus always reading 1 in the program. Check your electrical connection with a multimeter
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #4   Spotlight this post!  
Unread 18-02-2008, 12:54
PhilM PhilM is offline
Registered User
FRC #0937
 
Join Date: Jan 2007
Location: Shawnee Mission North High School
Posts: 4
PhilM is an unknown quantity at this point
Re: IR sensor corruption help

The programming leader here thinks that the order will have nothing to do with it. But we just started our lunch break, so when we get out of it, I'll change it and try that.
We also tried moving the IR chip's input from rc_dig_in04 to rc_dig_in05, but it's still causing the same problem.

Here's the autnomous code in question.
Quote:
if(rc_dig_in01 == 1 && rc_dig_in02 == 1 && rc_dig_in03 == 1)
{
EStop = 1;
Lap = TLt = TMd = TRt = 0;
printf("Chip Disconnected, Stopping system\n");
}
else if(rc_dig_in01 == 1)
{
Lap = 1;
TLt = TRt = TMd = 0;
printf("Activating Lap\n");
}

else if(rc_dig_in02 == 1)
{
TMd = 1;
Lap = TRt = TLt = 0;
printf("Activating Trackball Middle\n");
}

else if(rc_dig_in03 == 1)
{
TLt = 1;
Lap = TMd = TRt = 0;
printf("Activating Trackball Left\n");
}

else if(rc_dig_in05 == 1)
{
// May be infected. If so, do not use! T-virus

TRt = 1;
Lap = TMd = TLt = 0;
printf("Activating Trackball Right\n");
}

// Subroutines

if (Lap == 1)
{
// Run Laps

pwm02 = pwm04 = pwm05 = 127;

if(Timer_Lap < 273)
{
printf("Drive Straight\n");
pwm15 = pwm16 = 254;
pwm13 = pwm14 = 254*0.9;
Timer_Lap++;
}
else if(Timer_Lap < 378)
{
printf("Turn Left\n");
pwm13 = pwm14 = 254;
pwm15 = pwm16 = 160;
Timer_Lap++;
}
else
{
printf("Half Lap Finished\n");
Timer_Lap = 0;
}
}

if (TLt == 1)
{
// Trackball on Left


pwm04 = pwm05 = 127;

if(Timer_TLt < 18)
{
pwm15 = pwm16 = 0;
pwm13 = pwm14 = 254;
Timer_TLt++;
}
else if(Timer_TLt < 24)
{
pwm13 = pwm14 = pwm15 = pwm16 = 254;
Timer_TLt++;
}
else if(Timer_TLt < 42)
{
pwm13 = pwm14 = 0;
pwm15 = pwm16 = 254;
Timer_TLt++;
}

else if(Timer_TLt < 112)
{
pwm13 = pwm14 = pwm15 = pwm16 = 127;
pwm02 = 100;
printf("Arm Rising\n");
Timer_TLt++;
}
else if(Timer_TLt < 182)
{
pwm02 = 175;
printf("Arm Falling\n");
Timer_TLt++;
}
else
{
pwm02 = 127;
printf("Complete\n");
Timer_TLt = 0;
TLt = 0;
}
}

if (TMd == 1)
{
// Trackball in Middle

pwm04 = pwm05 = 127;
pwm13 = pwm14 = pwm15 = pwm16 = 127;

if(Timer_TMd < 70)
{
pwm02 = 100;
printf("Arm Rising\n");
Timer_TMd++;
}
else if(Timer_TMd < 140)
{
pwm02 = 175;
printf("Arm Falling\n");
Timer_TMd++;
}
else
{
pwm02 = 127;
printf("Complete\n");
Timer_TMd = 0;
TMd = 0;
}
}

if (TRt == 1)
{
// Trackball on Right

pwm04 = pwm05 = 127;

if(Timer_TRt < 18)
{
pwm15 = pwm16 = 254;
pwm13 = pwm14 = 0;
Timer_TRt++;
}
else if(Timer_TRt < 24)
{
pwm13 = pwm14 = pwm15 = pwm16 = 254;
Timer_TRt++;
}
else if(Timer_TRt < 42)
{
pwm13 = pwm14 = 254;
pwm15 = pwm16 = 0;
Timer_TRt++;
}
else if(Timer_TRt < 112)
{
pwm13 = pwm14 = pwm15 = pwm16 = 127;
pwm02 = 100;
printf("Arm Rising\n");
Timer_TRt++;
}
else if(Timer_TRt < 182)
{
pwm02 = 175;
printf("Arm Falling\n");
Timer_TRt++;
}
else
{
pwm02 = 127;
printf("Complete\n");
Timer_TRt = 0;
TRt = 0;
}
}

if (EStop == 1)
{
// Stop Everything!

pwm02 = pwm04 = pwm05 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
}
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
IR sensor???plz help bilal1219 Programming 3 12-02-2008 10:05
Sensor Help itzrobz Programming 1 05-02-2006 14:07
3DS File Corruption Capt. Slash 3D Animation and Competition 4 28-01-2006 13:21
table corruption... round 2 Brandon Martus Announcements 0 18-12-2001 23:57
table corruption Brandon Martus Announcements 2 20-11-2001 05:16


All times are GMT -5. The time now is 01:00.

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