Go to Post What I am expecting is the unexpected (what that is I don't know). - mdiradoorian [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 29-01-2008, 22:53
RRA4LIFE2 RRA4LIFE2 is offline
Registered User
FRC #2595
 
Join Date: Jan 2008
Location: Los Angeles, California
Posts: 9
RRA4LIFE2 is on a distinguished road
ir sensor Board ??????????????????????


We are a rookie team. we do not know how to start up the sensor board. to what type of battery do you connect it, or do you need to buy that battery adapter or what we need help fast!!!!!!
  #2   Spotlight this post!  
Unread 29-01-2008, 23:05
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: ir sensor Board ??????????????????????

Whoa, calm down there now

There have been a ton of threads posted about this, there are a couple of images that show some of the wiring too.

http://www.chiefdelphi.com/forums/search.php

It will end up being wired to 4 digital ports on the robot and it will end up going into the main battery through one of the circuits. On another thread you posted someone linked you to the page that shows the pin-out of the actual board. Follow that.

There is also a pdf somewhere that shows how the wiring goes with the different panels and the controller etc.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 29-01-2008 at 23:08.
  #3   Spotlight this post!  
Unread 30-01-2008, 00:22
darkdwarven's Avatar
darkdwarven darkdwarven is offline
Registered User
AKA: Phantom
FRC #2348
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Hawaii
Posts: 8
darkdwarven is an unknown quantity at this point
Question Re: ir sensor Board ??????????????????????

I've been searching the forums for remedies to why we can't make our IR Board work. And i've found some that for me have had no effect on the performance of our motors. Right now to test if we can program anything to correspond with the signals that tie IR board reveives/gives, we inserted the following code:
Code:
if (rc_dig_in07 = 0)
{
	ButtonPressed = TRUE;
	if (ButtonPressed = TRUE)
		{
			pwm01 = pwm02 = 127;
		}
}
That is a function we are trying to put right before our autonomous program. The purpose was to allow the motors to run and if there is an interrupt from the IR Board, the motors would stop for the remainder. The autonomous program works fine without that 'if' statement but doesn't work at all with it. It compiles just fine with everything defined and all. Also, we are working off of port 7 because our advisor read something in the default guide about 1-6 being reserved for more advanced functions?

Any suggestions for resources or troubleshooting options??

Thanks,
Team 2348
__________________
I have nothing important to say here, thus I've wasted a few seconds of your life. Isn't that depressing?

Last edited by darkdwarven : 30-01-2008 at 00:25.
  #4   Spotlight this post!  
Unread 30-01-2008, 08:02
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: ir sensor Board ??????????????????????

Quote:
Originally Posted by darkdwarven View Post
Code:
if (rc_dig_in07 = 0)
This tries to assign the value 0 to the rc_dig_in07 variable. It also has the side effect of never being true. You want instead to test for equality.

In short, replace the = with ==.

Some people use the technique of always putting the constant on the left in a test like this. That way the compiler will notice and complain if you accidentally use a single equals sign.

Oh, and your test is backwards. The IR receiver board outputs 0 when nothing is detected, and gives a 100 millisecond 1 pulse when a valid signal is received.

Last edited by Alan Anderson : 30-01-2008 at 08:05.
  #5   Spotlight this post!  
Unread 30-01-2008, 16:03
Team2002 Team2002 is offline
Registered User
FRC #2002
 
Join Date: Feb 2007
Location: Tualatin OR
Posts: 6
Team2002 is an unknown quantity at this point
Re: ir sensor Board ??????????????????????

I was trying the following for our IR board and nothing seems to happen
if (rc_dig_in15 == 1)
{
pwm_13 = 256;
}

This was just to test if pressing a button on the remote did anything (the remote was already programmed etc,.)

is there anything wrong that we are doing?

This snippet was placed in the user_routines.c
is that the correct place or should it be under user_routines_fast.c?

Thanks for any help
  #6   Spotlight this post!  
Unread 30-01-2008, 16:19
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,381
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 sensor Board ??????????????????????

Quote:
Originally Posted by Team2002 View Post
I was trying the following for our IR board and nothing seems to happen
if (rc_dig_in15 == 1)
{
pwm_13 = 256;
}

This was just to test if pressing a button on the remote did anything (the remote was already programmed etc,.)

is there anything wrong that we are doing?

This snippet was placed in the user_routines.c
is that the correct place or should it be under user_routines_fast.c?

Thanks for any help

I am not 100% positive on this, but here is my thoughts and what to try.

The rc_dig_in7 - 18 are tied high when they are set as inputs. If they are considered active when a switch is closed across them to ground, and the output of the IR board goes high when it is active, then you need to test for a !rc_dig_inxx. So try:

Code:
if (rc_dig_in15 == 0)
{
    pwm_13 = 256;
}
OR

Code:
if (!rc_dig_in15)
{
    pwm_13 = 256;
}

Again, I am not a pro at this, just a learner at this point.
BTW, the signal will pulse, so hold the button down.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
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 ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #7   Spotlight this post!  
Unread 30-01-2008, 17:23
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: ir sensor Board ??????????????????????

Try this code on a post I made a few days ago. Use MPLAB and add it to the autonomous program. Put whatever you want the robot to do under mode 1 ,mode 2, or mode 3.

http://www.chiefdelphi.com/forums/sh...1&postcount=19
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
  #8   Spotlight this post!  
Unread 30-01-2008, 21:51
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: ir sensor Board ??????????????????????

Quote:
Originally Posted by Team2002 View Post
I was trying the following for our IR board and nothing seems to happen
Code:
if (rc_dig_in15 == 1)
{
    pwm_13 = 256;
}
This was just to test if pressing a button on the remote did anything (the remote was already programmed etc,.)

is there anything wrong that we are doing?
Yes. The valid range of values for a pwm output is 0-254. Since the pwm "variables" in the code are of type unsigned char, trying to set one to 256 will actually end up with it set to zero.

Quote:
This snippet was placed in the user_routines.c
is that the correct place or should it be under user_routines_fast.c?
You'll need to be a lot more specific about where you put the code. The filename is not really important. What matters is the name of the function in which it appears: Process_Data_From_Master_uP(), Default_Routine(), Process_Data_From_Local_IO(), etc.
  #9   Spotlight this post!  
Unread 30-01-2008, 22:37
AdmiralAllen's Avatar
AdmiralAllen AdmiralAllen is offline
Master of Computers and Robots
AKA: Allen Worcester
FRC #1662 (Raptor Force Engineering)
Team Role: Alumni
 
Join Date: May 2006
Rookie Year: 2005
Location: California
Posts: 37
AdmiralAllen will become famous soon enough
Re: ir sensor Board ??????????????????????

Quote:
Originally Posted by Alan Anderson View Post
Yes. The valid range of values for a pwm output is 0-254. Since the pwm "variables" in the code are of type unsigned char, trying to set one to 256 will actually end up with it set to zero.



You'll need to be a lot more specific about where you put the code. The filename is not really important. What matters is the name of the function in which it appears: Process_Data_From_Master_uP(), Default_Routine(), Process_Data_From_Local_IO(), etc.

no......the maximum pwm value is 256......its an extrema
  #10   Spotlight this post!  
Unread 31-01-2008, 17:29
Team2002 Team2002 is offline
Registered User
FRC #2002
 
Join Date: Feb 2007
Location: Tualatin OR
Posts: 6
Team2002 is an unknown quantity at this point
Re: ir sensor Board ??????????????????????

Quote:
Originally Posted by Alan Anderson View Post
Yes. The valid range of values for a pwm output is 0-254. Since the pwm "variables" in the code are of type unsigned char, trying to set one to 256 will actually end up with it set to zero.



You'll need to be a lot more specific about where you put the code. The filename is not really important. What matters is the name of the function in which it appears: Process_Data_From_Master_uP(), Default_Routine(), Process_Data_From_Local_IO(), etc.

I placed it under Default_Routine() is that the wrong place? I couldnt find a function called Process_Data_From_Local_IO(), in user_routines.c
  #11   Spotlight this post!  
Unread 31-01-2008, 18:22
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,815
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: ir sensor Board ??????????????????????

Quote:
Originally Posted by AdmiralAllen View Post
no......the maximum pwm value is 256......its an extrema
Actually, the maximum PWM value is 255, or 2^8 - 1, which is the maximum value that can be held in 8 bits of memory - the size of an unsigned char. Going above this will cause an overflow problem, where you'll loop around and start at 0 again.
  #12   Spotlight this post!  
Unread 31-01-2008, 22:46
darkdwarven's Avatar
darkdwarven darkdwarven is offline
Registered User
AKA: Phantom
FRC #2348
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Hawaii
Posts: 8
darkdwarven is an unknown quantity at this point
Re: ir sensor Board ??????????????????????

We were trying to find a way to program the Robot Cotroller so that when any of 2 inputs receive a signal, it will leave the autonomous code and enter a 'maual' autonomous code. The manual autonomous code would work based on 2 if statements that loop back to the other. The if statements would either say left or right and cotinue until our timer value ran out. Our code in the attached file, only makes the motors pulse for some other direction or go to one and continue straight without any further response. Any problems with our coding? Also does anyone know an easier way of accomplishing the same tasks?


Thanks always for the help,
Team 2348
Attached Files
File Type: txt manual_autonomous.txt (1.2 KB, 61 views)
__________________
I have nothing important to say here, thus I've wasted a few seconds of your life. Isn't that depressing?
  #13   Spotlight this post!  
Unread 31-01-2008, 23:16
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: ir sensor Board ??????????????????????

Quote:
Originally Posted by Team2002 View Post
I placed it under Default_Routine() is that the wrong place?
If your goal is to test the ability to use IR commands to control motors, that's probably the right place to put it.

But you need to make sure that the pwm outputs you set don't get set to something else later on. You can do that most easily by putting the IR sensing code near the end of the function, so it gets the last opportunity to force the motors to move as you want.
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
Wiring the IR sensor board govvijay Programming 9 05-02-2008 19:41
Technical Details for the IR sensor board tuzzer Electrical 1 19-01-2008 08:38
How to program ir sensor board?? RRA4LIFE2 Programming 1 11-01-2008 21:47
Perf Board = BS2-IC Carrier Board? indieFan Electrical 2 16-09-2004 08:28
Making a Sensor Board SpaceOsc Technical Discussion 11 15-05-2004 12:46


All times are GMT -5. The time now is 19:08.

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