OCCRA
Go to Post Interestingly enough, I saw Shaun open his backpack for a moment during the Newton Alliance selection.... 4 Hours later Team 25 was on Einstein... - thefro526 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 03-31-2008, 02:01 PM
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
IR Board Programming/Wiring Problems

Alright, so our team wired up the IR to digital ins, saw the lights flash on the board. But the outputs we got were very wierd. no matter what we did, it always said command 1,2, and 4 were 0 (being used), and 3 was 1 (not being used). We wired to IR to ground, a 12V supply, and each cmd line to a signal on the microprocessor. In bench testing, this worked fine. We used WPILib and used the default and such and saw the lights on the OI light up along with the board when we hit buttons. Any help with general setup/use using the first four digital inputs would be great.
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
  #2   Spotlight this post!  
Unread 03-31-2008, 02:06 PM
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Send a message via Skype™ to Jimmy Cao
Re: IR Board Programming/Wiring Problems

I have no idea how WPILib does things, but did you make sure you're DIO pins were declared as inputs?
__________________
Jimmy Cao

Team 469 2006-2010 Student/Alumni
Team 830 2011-2012 Mentor
  #3   Spotlight this post!  
Unread 03-31-2008, 02:24 PM
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: 7,847
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
Send a message via AIM to Alan Anderson
Re: IR Board Programming/Wiring Problems

Quote:
Originally Posted by Ryan O View Post
...it always said command 1,2, and 4 were 0 (being used), and 3 was 1 (not being used).
Your comments in parentheses are precisely backwards. The IR board outputs are logic 0 when inactive, and logic 1 when active. Does that correction help you identify the problem?

Quote:
In bench testing, this worked fine.
If you saw multiple signals high and a single one going low while testing, there was something wrong. It sounds like you might not have had a common ground between the IR board and the RC.
  #4   Spotlight this post!  
Unread 03-31-2008, 02:29 PM
billbo911's Avatar
billbo911 billbo911 is offline
Registered User
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 1,873
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: IR Board Programming/Wiring Problems

Quote:
Originally Posted by Ryan O View Post
But the outputs we got were very weird. no matter what we did, it always said command 1,2, and 4 were 0 (being used), and 3 was 1 (not being used)....
The first thing I would note, a high output is generated by the board for 100ms when it receives one of it's programmed inputs, not a low. So what you describe indicates that "3" was "being used" and 1,2 and 4 were "not being used". EDIT: Bummer, Alan beat me to it.

So, this brings up a couple of questions, which Dig. input ports/connectors were your signals attached to? Were those ports declared as inputs? How does your code "latch" in those signals?
__________________
So long and thanks for all the fish!
CalGames 2009 Semi Finalist, CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist, 2010 Madtown Creative Design Award
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2013 Pow3rhou53 Pwnage Gracious Professionalism Award.
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division, Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up.
  #5   Spotlight this post!  
Unread 04-02-2008, 08:07 AM
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: IR Board Programming/Wiring Problems

According to the manual, and tests with microswitches, the input default high, aka backwards from normal
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
  #6   Spotlight this post!  
Unread 04-02-2008, 08:44 AM
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: 7,847
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
Send a message via AIM to Alan Anderson
Re: IR Board Programming/Wiring Problems

Quote:
Originally Posted by Ryan O View Post
According to the manual, and tests with microswitches, the input default high, aka backwards from normal
I'm not sure what you mean by this.

A digital input on the RC will be read as a high value, a logic 1, when there is nothing connected to it. An open switch gives a lack of continuity, which is electrically the same thing as nothing. A contact closure to ground will be read as a low value, a logic 0. That's "normal" for the digital inputs.

The IR sensor board outputs are not like switches. They are actual logic levels. When an output's associated LED is off, the output is at logic 0. When an output's associated LED is on, the output is at logic 1. That's "normal" for a TTL signal.

When you connect the IR board outputs to the RC digital inputs, the values do not somehow change to being "backwards". An inactive signal is still 0, and an active signal is still 1.
  #7   Spotlight this post!  
Unread 04-02-2008, 10:31 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Itinerant Programmer
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: 7,346
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: IR Board Programming/Wiring Problems

Back to one of Alan's original questions.
Describe to us the power source and how the power is wired up to your IR receiver.

Your description reflects what you'd see if the IR receiver were powered, say from a separate 9v battery or other source that isn't the same source of power that the Robot Controller uses (12v battery).
or
If command 3 is always high that would probably just be a bad connection.
__________________
Deduction is limited by knowledge, and knowledge is limited by preconceptions
358 Beta notes & results

Last edited by Mark McLeod : 04-02-2008 at 10:36 AM.
  #8   Spotlight this post!  
Unread 04-08-2008, 06:31 PM
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: IR Board Programming/Wiring Problems

Alright, so we connected the power inputs to a 12v 20 amp supply, just like the RC. on the bench, it worked fine, and default code lit up the switch LEDs on the OI when each was pressed, along with the LED on the IR itself. Now, only the LEDs on the IR light up as they are supposed to. the problem is the RC regonizing the signal. On teh bench, we hooked up only the signal wire the the "white" pin on the RC, and it worked. We never got the chance to test it on the robot itself. We got the code upgrade first thing at comp, and then tested things, which is when we found out it wasn't working.

So, the exact way we hooked up the signals is one pwm for the first three, (one signal per line, put across the three signal pins), and a single signal on another pwm, put in normally, without anything hooked up to the red and black wires. Once again, this setup had been tested on the bench. Maybe we connected to two unused wires, cleaning up the wiring, but even disconnecting these didn't change anything.

I'm really confused about the output. I might expect the input wired differently to be different, but input three wass the loner, not four. Also, it doeesn't matter which is which at this point, because they don't change at all. At comp, we got a couple to flicker once and while, but three was always one, and it was always for a very short time before going back to 0,0,1,0
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
  #9   Spotlight this post!  
Unread 04-08-2008, 06:59 PM
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: IR Board Programming/Wiring Problems

The way this little guy is supposed to be wired is one (IR board) output going to one (RC) input. That means that instead of connecting three wires to one "PWM" cable, you must use four PWM cables and connect each of the outputs to one yellow/white cable.
  #10   Spotlight this post!  
Unread 04-08-2008, 08:17 PM
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: 7,847
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
Send a message via AIM to Alan Anderson
Re: IR Board Programming/Wiring Problems

Quote:
Originally Posted by Mark McLeod View Post
Describe to us the power source and how the power is wired up to your IR receiver.

Your description reflects what you'd see if the IR receiver were powered, say from a separate 9v battery or other source that isn't the same source of power that the Robot Controller uses (12v battery).
Quote:
Originally Posted by Ryan O View Post
Alright, so we connected the power inputs to a 12v 20 amp supply, just like the RC. on the bench, it worked fine,...
How is it being powered when it doesn't work? We want to know what wires are connected to pins 1-4 of the ribbon cable, and where those wires go. Be specific. The answer will help us to either rule out or zero in on possible causes of your problem.
  #11   Spotlight this post!  
Unread 04-08-2008, 08:35 PM
popnbrown's Avatar
popnbrown popnbrown is offline
FRC Team 5125 - Mentor
AKA: Sravan S
FRC #5125 (Hawks on the Horizon)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: New Jersey & Illinois
Posts: 297
popnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond repute
Re: IR Board Programming/Wiring Problems

Quote:
Originally Posted by tdlrali View Post
The way this little guy is supposed to be wired is one (IR board) output going to one (RC) input. That means that instead of connecting three wires to one "PWM" cable, you must use four PWM cables and connect each of the outputs to one yellow/white cable.
I think what he meant is that they used a PWM cable, since it has three wires and hooked up each of the wires to a different ribbon wire, then connected the PWM cable to all signals on the digital input. The same way we did it. And the fourth command ribbon wire was on a seperate PWM cable going to a fourth digital signal input.
__________________

FRC Team 5125 Hawks on the Horizon Mentor
FRC Team 4096 Ctrl-Z Former Mentor
FTC Team 5203 #19@! Former Mentor
FRC Team 1403 Cougar Robotics Alumni
  #12   Spotlight this post!  
Unread 04-10-2008, 12:09 AM
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 59
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: IR Board Programming/Wiring Problems

We saw this kind of behavior when we didn't have a common ground connected to both the IR board and the controller. I.e. we had the IR board powered by a separate battery than the controller, without a connection between the IR board's ground connector and the controller's ground.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
  #13   Spotlight this post!  
Unread 04-10-2008, 09:34 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Itinerant Programmer
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: 7,346
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: IR Board Programming/Wiring Problems

Quote:
Originally Posted by Ryan O View Post
I'm really confused about the output. I might expect the input wired differently to be different, but input three was the loner, not four. Also, it doeesn't matter which is which at this point, because they don't change at all. At comp, we got a couple to flicker once and while, but three was always one, and it was always for a very short time before going back to 0,0,1,0
[correction] It sounds like the RC and IR Receiver are grounded to the same battery, otherwise you wouldn't see the zero (0,0,1,0) signals at rest, so to speak.

Just to be sure we're discussing the same connections I'm going to repeat back how you described your wiring in slightly different terms...

Using pin 1 on the IR receiver as wire 1, as I understand it you have:
- 1 connected to the same 12v+ that the RC is connected to
- 3 connected to the same 12v- that the RC is connected to
- 5 combined with 6 & 7 in one pwm cable connecting to three signal pins, say digital input 1,2,3 (this wire really corresponds to the third IR button LED)
- 6 with 5 above (this wire corresponds to the second IR button LED)
- 7 with 5 & 6 above (this wire corresponds to the fourth IR button LED)
- 8 is the loner connection, say to digital input 4 (this wire corresponds to the first IR button LED)

No other wires are used.
I picked digital inputs arbitrarily just to discuss them.

You see digital input 3 above staying always at "1"?

The momentary change you described before sounds normal. The pins stay high for only 100ms when the IR Receiver passes the signal along. Because it's so quick your code must catch and save the change. To get feedback try using the OI LEDs available to you to watch what the code sees (but be sure to turn off code elsewhere that may be changing the OI lights), e.g.,
Code:
static char command1=0, command2=0,command3=0;
 
if (rc_dig_in01 == 1) //Yes input 1 is really IR command 3
{
    command3 = 1;
    Switch3_LED = 1;
}
if (rc_dig_in02 == 1)//Yes input 2 is really coincidentally IR command 2
{
    command2 = 1;
    Switch2_LED = 1;
}
if (rc_dig_in04 == 1) //Yes input 4 is really IR command 1
{
    command1 = 1;
    Switch1_LED = 1;
}
The way this is written will turn the appropriate OI light on when the IR remote button is pushed, but will never turn it off. Ultimately, you might want to turn off the other lights when a new command is detected, but to get off the ground you wouldn't want a bad connection turning off the other lights. Just to test that part of the system is working.

For now try ignoring the failing connection and get your code to work with the other three signals. You can go back to the bad connection after you understand the behavior of the other three. A bad connection will always read as "1."
A good connection will normally read as "0", with a 100ms pulse at "1" when the IR remote button is pushed. If the button is held down you'll see it alternate between "1" and "0."
__________________
Deduction is limited by knowledge, and knowledge is limited by preconceptions
358 Beta notes & results

Last edited by Mark McLeod : 04-10-2008 at 10:55 AM.
  #14   Spotlight this post!  
Unread 04-11-2008, 09:53 AM
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,139
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: IR Board Programming/Wiring Problems

You will also want to add a line of code surrounding all of this that states if you see multiple inputs from the board simultaneously, it should disregard all input from the board.

Since a disconnected wire results in a "1", and a connected wire that sees a signal results in a "1", the only way to tell the difference is to make sure you see only one signal wire sending a "1". This will protect against a runaway or out of control condition where the IR board is left disconnected and ALL your values return as "1" - nasty things can happen if you don't protect against this.
  #15   Spotlight this post!  
Unread 04-11-2008, 09:59 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Itinerant Programmer
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: 7,346
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: IR Board Programming/Wiring Problems

True statement.
I only suggest using something like what I posted to test and debug the inputs, not to actually process commands on the playing field.
To debug this problem you want a direct readout on your OI of what signals are working and you want the lights to latch on the brief 100ms signal, so you don't have to hope to see a flicker. If you see one of the lights on without having pushed the corresponding IR remote button then it means your signal wire is disconnected. You can use a printf there as well to accomplish the same thing. The advantage of OI LEDs is you'll immediately see a disconnected signal wire in the pits and on the field without having a laptop hooked up.

For competition you'd have to add what Tom suggested, as well as turn off previous commands and OI lights when a new selection is made.

Quote:
Originally Posted by Tom Line View Post
You will also want to add a line of code surrounding all of this that states if you see multiple inputs from the board simultaneously, it should disregard all input from the board.

Since a disconnected wire results in a "1", and a connected wire that sees a signal results in a "1", the only way to tell the difference is to make sure you see only one signal wire sending a "1". This will protect against a runaway or out of control condition where the IR board is left disconnected and ALL your values return as "1" - nasty things can happen if you don't protect against this.
__________________
Deduction is limited by knowledge, and knowledge is limited by preconceptions
358 Beta notes & results

Last edited by Mark McLeod : 04-11-2008 at 10:25 AM.
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
Electronics Board Wiring Concern SpaceOsc Electrical 7 02-13-2008 11:15 AM
Wiring The IR Board joesmomh00haha Sensors 2 02-12-2008 02:30 PM
IR board wiring Brandon_L Electrical 1 02-11-2008 02:14 PM
Wiring IR board DarKCroNo Sensors 3 02-09-2008 09:20 AM
Wiring the IR sensor board govvijay Programming 9 02-05-2008 06:41 PM


All times are GMT -5. The time now is 11:31 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi