Go to Post No matter what you do and how well you try to protect them, some people are just out there to be candidates for the Darwin Awards! - Jay H 237 [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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-02-2004, 20:53
uvabrad825's Avatar
uvabrad825 uvabrad825 is offline
Registered User
#0825 ('swi-va-gus 'mak-sa-mus)
 
Join Date: Feb 2004
Location: Pulaski, VA
Posts: 10
uvabrad825 has a little shameless behaviour in the past
Optical Sensors Used as Encoders?

I'm sure on past robots teams have tried to use their optical sensors as an encoder by placing bits of reflective tape on a wheel/sprocket and counting the number of times a sensor mounted to read the pieces of tape was 'activated' (I'm not a programmer so I don't exactly know the correct terms).

Our team is considering pursuing this idea once we uncrate our robot at regionals, having the programs pre-written. We are planning on putting 8 evenly spaced pieces of reflective tape on the rims of our back wheels, and mounting two optical sensors to appropriately interact with the pieces.

I was wondering if any teams in the past have had success (or lack of) with this procedure, and if so, what the optimal setup(s) are (tape spacing, distance from sensor to wheel, etc..). Our programmers are very good at what they do, so I don't think that will be a problem. Any advice would be greatly appreciated!
__________________

('swi-va-gus 'mak-sa-mus)
  #2   Spotlight this post!  
Unread 29-02-2004, 21:15
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Optical Sensors Used as Encoders?

we put 2 pieces of tape on the black couplings between the motor and the gear box, and we have one banner sensor on each side. lol we just need the code, because it works perfctly electricly... the light blink, the osiliscope has a beutifull trace. i was planing on using intrupts to count revolutions, and then every 10 program loops compare counts and adust PWMs accordingly. if you find any good code PLEASE post! thanks
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
  #3   Spotlight this post!  
Unread 29-02-2004, 21:21
Greg's Avatar
Greg Greg is offline
Registered User
FRC #1075 (Sinclair Sprockets)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2003
Location: Whitby, Ontario, Canada
Posts: 108
Greg is on a distinguished road
Send a message via ICQ to Greg Send a message via MSN to Greg
Re: Optical Sensors Used as Encoders?

I dont think this use of tape is allowed by the rules. Last year we used some white paint on a black gear. This year we drilled holes in the gear and put an aluminum plate behind the hole opposite the sensor. It works very well (and we took some weight off doing that )

As for code... Wire the sensors to interrupts (digital pins 1 and 2). You can find some examples in the IR beacon tracker code. Last year I polled the sensors every program cycle and it did not work too well (not fast enough). The interrupt method works perfectly.

And dont forget to use the normally high output of the sensors
  #4   Spotlight this post!  
Unread 29-02-2004, 21:24
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by Greg
I dont think this use of tape is allowed by the rules.
lets not over interpet the rules here... the "tape" in question is special 3m opto reflective tape that is not making any mechanical connections with anything else. therefore it can be said to be decrotive.

anyway. yeah i get to have fun learning how intrupts work the day we get down to reagonals. what great fun
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
  #5   Spotlight this post!  
Unread 29-02-2004, 21:25
Greg Needel's Avatar Unsung FIRST Hero
Greg Needel Greg Needel is offline
REVving up for a new season
FRC #2848 (All-sparks)
Team Role: Engineer
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Dallas, TX
Posts: 3,110
Greg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond repute
Re: Optical Sensors Used as Encoders?

we are using this method on both wheel units and our lifter....

our sprockets have holes milled in them and the banner senor reads off the alluminum on our wheel units

and for our lifter we have electrical tape on the black connecter for the chip motor and that works fine....


if you need some code i can see what i can do about getting it.......
  #6   Spotlight this post!  
Unread 29-02-2004, 21:28
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by uvabrad825
I'm sure on past robots teams have tried to use their optical sensors as an encoder by placing bits of reflective tape on a wheel/sprocket and counting the number of times a sensor mounted to read the pieces of tape was 'activated' (I'm not a programmer so I don't exactly know the correct terms).

Our team is considering pursuing this idea once we uncrate our robot at regionals, having the programs pre-written. We are planning on putting 8 evenly spaced pieces of reflective tape on the rims of our back wheels, and mounting two optical sensors to appropriately interact with the pieces.

I was wondering if any teams in the past have had success (or lack of) with this procedure, and if so, what the optimal setup(s) are (tape spacing, distance from sensor to wheel, etc..). Our programmers are very good at what they do, so I don't think that will be a problem. Any advice would be greatly appreciated!
RAGE used optical sensors and retroreflective tape pieces for their autonomous last year and it worked well enough (watch video of 2003 UTC Regional and 2003 Newton Division Elims for a demo).. the optical sensors are very hard to deal with at times (they have random spats during which they don't work).. Good luck with them.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #7   Spotlight this post!  
Unread 29-02-2004, 21:28
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by Greg Needel
if you need some code i can see what i can do about getting it.......
any help would be greatly appreciated
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
  #8   Spotlight this post!  
Unread 29-02-2004, 21:36
ErichKeane ErichKeane is offline
Registered User
FRC #3210
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2004
Location: Hillsboro, OR
Posts: 113
ErichKeane is just really niceErichKeane is just really niceErichKeane is just really niceErichKeane is just really niceErichKeane is just really nice
Send a message via AIM to ErichKeane
Re: Optical Sensors Used as Encoders?

Really, the code to this is not that hard. I would not use interrupts, only because getting them to interface correctly with the code can sometimes be a problem. Now, i forget whether the Banner sensors Run at full speed or not, but this is how i would code this segment. Note: If banner sensors do run correctly In FAST mode, place this code in the user_routines_fast.c, otherwise, just put it in your regular segment

Assumes banner sensors are wired as Normally Closed, and are wired to rc_dig_in01&02, and pwm01&pwm02 are the left and right wheels respectively. If you got questions, ask away.

FIRST: at the header (for variable data)
Code:
int leftcount=0,rightcount=0;//note, is signed to care for backward variables
unsigned char leftlast=0,rightlast=0,roundcount=0;//only cause we dont have a bool class
Secondits kinda apparent)

Code:
void Process_Data_From_Local_IO(void)
{
	if(rc_dig_in01==1 &&leftlast==0)//left wheel counter 
		if(pwm01>127)
			leftcount++;
		else if(pwm01<127)
			leftcount--;
	leftlast=rc_dig_in01;		


	if(rc_dig_in02==1 &&rightlast==0)//right wheel counter
		if(pwm02>127)
			rightcount++;
		else if(pwm02<127)
			rightcount--;
	rightlast=rc_dig_in02;

	if(roundcount>12)
	{
		if(leftcount>rightcount)
			//whatever you want
		else if(rightcount<leftcount)
			//whatever you want
		else
			//take a guess?
		
		rightcount=leftcount=roundcount=0;
	}



	roundcount++;

}
Thats the quick, easy, and fun way to do it.



side note, i wrote this just right now, so if you find a problem with it, just post a correction below. Anyone may use this however they want, think of it as a mixture between the OpenSource in me and the Gracious Professionalism. As another side note, if anyone else needs coding help, i have become quite good at it, just send your questions my way.
  #9   Spotlight this post!  
Unread 29-02-2004, 23:18
bigqueue bigqueue is offline
Registered User
#0811 (A.R.C.)
 
Join Date: Dec 2001
Location: Nashua, NH
Posts: 231
bigqueue will become famous soon enough
Send a message via AIM to bigqueue Send a message via Yahoo to bigqueue
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by uvabrad825
I'm sure on past robots teams have tried to use their optical sensors as an encoder by placing bits of reflective tape on a wheel/sprocket and counting the number of times a sensor mounted to read the pieces of tape was 'activated' (I'm not a programmer so I don't exactly know the correct terms).

Our team is considering pursuing this idea once we uncrate our robot at regionals, having the programs pre-written. We are planning on putting 8 evenly spaced pieces of reflective tape on the rims of our back wheels, and mounting two optical sensors to appropriately interact with the pieces.

I was wondering if any teams in the past have had success (or lack of) with this procedure, and if so, what the optimal setup(s) are (tape spacing, distance from sensor to wheel, etc..). Our programmers are very good at what they do, so I don't think that will be a problem. Any advice would be greatly appreciated!

We did this exact thing last year and ot worked out pretty well. We split the coupling on our motor with tape. (half tape) and then made a quadrature encoder by using two optical Banners at 90 degrees from each other. THis way we knew of the wheel was spinning forward or reverse.

This worked out well, and given the ratio of this motor coupling to the output wheels, we had about a 3" resolution on out drive position.

It all worked out pretty well, but the thing that killed us was momentum when we stopped driving the motor. We had much overshoot at first, and much oscillation when we tried to impliment feedback.

Good luck,
-Quentin
__________________
Team 4987: Megarams
  #10   Spotlight this post!  
Unread 29-02-2004, 23:23
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Optical Sensors Used as Encoders?

Just me 2 cents, but if you are going to go through the trouble to do all this, then why not just use encoders or gear tooth counters?

If you use reflective tape and banner sensors, it will work, but i don;t see how you can possibly get much resolution.
__________________
1139 Alumni

Last edited by Rickertsen2 : 29-02-2004 at 23:26.
  #11   Spotlight this post!  
Unread 29-02-2004, 23:38
uvabrad825's Avatar
uvabrad825 uvabrad825 is offline
Registered User
#0825 ('swi-va-gus 'mak-sa-mus)
 
Join Date: Feb 2004
Location: Pulaski, VA
Posts: 10
uvabrad825 has a little shameless behaviour in the past
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by Rickertsen2
Just me 2 cents, but if you are going to go through the trouble to do all this, then why not just use encoders or gear tooth counters?
Mostly because our team has a serious lack of $$$ and time, and since we have the banner sensors and can easily acquire some tape or white paint to put on our wheels, it's worth the try. And we're hoping that with enough 'markers' we can get it accurate enough for our purposes....

Thank you everyone for all of your help....
__________________

('swi-va-gus 'mak-sa-mus)
  #12   Spotlight this post!  
Unread 29-02-2004, 23:42
Random Dude Random Dude is offline
Oregon State Head FTA
AKA: Chris
no team (Oregon Robotics Tournament & Outreach Program)
 
Join Date: Aug 2002
Rookie Year: 1998
Location: Oregon
Posts: 142
Random Dude will become famous soon enoughRandom Dude will become famous soon enough
Re: Optical Sensors Used as Encoders?

Quote:
Originally Posted by Greg
I dont think this use of tape is allowed by the rules.
Q/A:

ID: 657
Q: I'm looking for clarification on the question about using reflective tape to count wheel revolutions. You said this was OK, but since the rules say electrical tape only, I'm wondering if other kinds of tape would be OK for this same use?
A: Other kinds of tape are okay for this use only.
  #13   Spotlight this post!  
Unread 01-03-2004, 00:44
Greg's Avatar
Greg Greg is offline
Registered User
FRC #1075 (Sinclair Sprockets)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2003
Location: Whitby, Ontario, Canada
Posts: 108
Greg is on a distinguished road
Send a message via ICQ to Greg Send a message via MSN to Greg
Re: Optical Sensors Used as Encoders?

Personally, I think unless the bot is very slow, the extra resolution wont matter. You still cant stop the bot theres just too much inertia. And we are not using the sensor on the actual wheel. We have it on a gear that is in a ratio of about 18:1 to the wheel. So that increases the resolution. And about the tape... The rules say "no adhesive-backed tape on the robot. The only exception is electrical tape, and it can only be used as as insulator". So a "decorative" explanation might not go over with the inspectors too well. White paint works very well, and is completely legal.
  #14   Spotlight this post!  
Unread 01-03-2004, 07:59
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,798
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Optical Sensors Used as Encoders?

We used Banner sensors last year for wheel encoders and have included them this year as well. We use a custom wheel so when the wheel was being assembled we just slipped a piece of dark papaer between the spokes of the wheel. By using two encoders (outlined above) you can tell direction and distance traveled. Last year we were able to get accurate down to at least an inch which made auto mode pretty easy. You need to couple the wheel sensors with a direction device to really know where you are.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #15   Spotlight this post!  
Unread 01-03-2004, 16:41
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Optical Sensors Used as Encoders?

Last year we used banner sensors and tape marks, but this year we went ahead and spent a whopping $80 for shaft encoders (300 clicks per revolution ... as opposed to the 8 at best we had before).
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
Q&A Discuss: Optical sensors with EduBot CD47-Bot Extra Discussion 2 01-03-2003 18:37
Q&A Discuss: optical sensors CD47-Bot Extra Discussion 0 15-02-2003 22:58
optical sensors great_one411 General Forum 1 15-02-2003 19:54
optical sensors acting strangely rosebud Electrical 10 03-02-2003 00:29
optical sensors majormusic2005 General Forum 1 28-01-2003 20:37


All times are GMT -5. The time now is 06:09.

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