Go to Post Dedication to FIRST gets more challenging as life gets more complicated but the rewards are SOOOOO worth it! - Sean Schuff [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 06-01-2003, 18:44
Ephi Ephi is offline
Registered User
#0144 (WHO?)
 
Join Date: Jan 2003
Location: Cincinnati, OH
Posts: 6
Ephi is an unknown quantity at this point
Send a message via ICQ to Ephi Send a message via AIM to Ephi
Optical Sensor Manual/Function list?

Hello,

I am fairly new the the Pbasic program but somewhat familiar with the langauge itself. I'm wondering if there are any manuals on the sensor programming, just a list of possible functions, variables, actions etc. I've browsed through the 350 some page manual and couldn't find anything on it.

Any clues?

Thank you in advance!
__________________
Brian J. Celenza
Team 144 - WHO?
Cincinnati, OH

Webmaster - http://team144.mdreamworks.net
  #2   Spotlight this post!  
Unread 06-01-2003, 18:53
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
I haven't come across any manuals.

But, you just hook up the light sensors to the rc digital inputs, and check whether the input is 1 or 0, one corresponds to the signal being sent back, ours is 0 for some reason.

Well basically with that you can do an if statement and do something based on that input. There's a knob thing on the back of it to change the sensor threshold.

I'm using reference to last year's sensors, because we DIDN'T receive this years sensors yet...
__________________
R
  #3   Spotlight this post!  
Unread 06-01-2003, 19:12
Ephi Ephi is offline
Registered User
#0144 (WHO?)
 
Join Date: Jan 2003
Location: Cincinnati, OH
Posts: 6
Ephi is an unknown quantity at this point
Send a message via ICQ to Ephi Send a message via AIM to Ephi
I can see the light!

Okay, just a digital output, that's easy enough to work with.

Thanks for the info, proves i need to do some more research on the programming.
__________________
Brian J. Celenza
Team 144 - WHO?
Cincinnati, OH

Webmaster - http://team144.mdreamworks.net
  #4   Spotlight this post!  
Unread 06-01-2003, 20:38
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
Cool optical sensor


i am still a little confused. there are four wires on last year's optical sensor. one for power, one for ground, but what do the last two do?
  #5   Spotlight this post!  
Unread 06-01-2003, 20:41
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Re: optical sensor

Quote:
Originally posted by rosebud

i am still a little confused. there are four wires on last year's optical sensor. one for power, one for ground, but what do the last two do?
The other two are the sensor outputs...keep in mind that they are exclusive, so whenever one is on, the other is off...basically, one of them is on when the sensor sees something, and the other is on when it doesn't see anything...
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #6   Spotlight this post!  
Unread 06-01-2003, 20:41
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
This falls under the category of "search before you post".

I answered this question yesterday
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #7   Spotlight this post!  
Unread 06-01-2003, 20:51
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
ahhhhh. and thanks for including the link. missed that one.
  #8   Spotlight this post!  
Unread 06-01-2003, 23:07
Caleb Fulton's Avatar
Caleb Fulton Caleb Fulton is offline
Z = Z^2 + C ......WHEEEE!
AKA: aXvXiA
#0461 (West Side Boiler Invasion)
Team Role: College Student
 
Join Date: Dec 2002
Location: West Lafayette, Indiana
Posts: 205
Caleb Fulton has a spectacular aura aboutCaleb Fulton has a spectacular aura aboutCaleb Fulton has a spectacular aura about
Send a message via AIM to Caleb Fulton
Hmmmm

I was wondering about how a digital signal could be used to create a sort of "rating" on the strength of the optical sensor's reading. I was thinking that a BYTE variable could be used to store the eight previous readings from the sensor in its bits. Each loop would push the bits back one and get rid of the oldest reading. Would he sum of the eight bits be a rating, from one to eight, of how "strong" the sensor's reading is?

I haven't had a chance to test how accurate these things are, and I was figuring that a robot could start to do stupid things if it reacted to an extraneous reading of "1" from the sensor when there really was no reflective tape at all in its line of sight.
__________________
  #9   Spotlight this post!  
Unread 07-01-2003, 01:05
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
well, everytime you check lets say the light sensor is on...for all 8 bits.
It tells you its been there for a long time, or however long your cycles for each bit are.

Combining the bits and using that integer wouldnt really help, example input

assuming your doing right to left bit logic

all 8 bits are 1...signal 255(254 rounded down automatically in debug at least), then lets say you shift over one bit, 254(no signal 1 bit), no signal for 2 bits consecutively, 252...248...240...224....192....128....0....
I guess that would work, lets show going up input from no lights to ful lights
1...3....7...15.....31.....63.....127....255(254 rounded)

so lets say you get 3 in a row, and then 5 consecutive no signals

128+64+32+0+0+0+0+0
224... you get 224 for a run with no signal

if you have any questions about this let me know, this is just some bit logic, might help understand it

1...2...4..8.16.32.64.128.256.512.1024.2048.4096

goes right to left
each 1 in binary counts as first num and moves up
to find sum its (2^n)-1 = 256-1 = 255, its 254 on the default code because two 255's consecutively is a reset

- Ryan
__________________
R

Last edited by rwaliany : 07-01-2003 at 01:38.
  #10   Spotlight this post!  
Unread 07-01-2003, 01:18
yaman's Avatar
yaman yaman is offline
Registered User
#0691 (Hart Burn)
 
Join Date: Nov 2002
Location: Santa Clarita, CA
Posts: 9
yaman is an unknown quantity at this point
Send a message via AIM to yaman
Wink Errr

It sounds to me like you want to measure the intensity of the light returned? If so, read ahead, otherwise, skip this post.

Quite frankly, this is <i>impossible</i>.

Why?
Because, the light sensor is a switch. It has two valid outputs: on or off. In essence, this means that it is a digital sensor, representing a binary 1 or 0: on or off.

In order to measure the intensity of the light, the sensor would have to output some value that fits into a range; say 0 to 255. That would qualify it as an analog sensor.

Hence, whenever you have something that is either on or off, it is labeled as a digital signal/sensor.

Glancing above it looks like you're trying to keep some sort of record of the last 255 states of the light sensor... I dont see how this could assist much. The resulting byte will not be an intensity measure.

To sum it all up, you can not measure the intensity of the light (no way reliably).

This can also be seen by the little schematic on the side of the light sensor (LAST YEAR BECAUSE WE HAVENT GOTTEN THIS YEAR'S GRR).

It details four connections: two inputs (V+, V-), and two outputs.

The two outputs are in a switch circuit... one is on the other is off, or vice versa.

Although some sort of variable resistor <b>may</b> be used in the circuitry of the sensor, <b>no</b> variable resistor is detailed in the schematic.

Bleh, all this rambling has gotten me off topic... it's a digital sensor, on or off, no way to measure intensity.... only to measure the intensity at which the switch flips (which reminds me there must be a variable component in there because of the wheel on the back....).

Time to explore the other threads. Hope this helps clear things up.
__________________
Linux is the answer, now what was your question?
  #11   Spotlight this post!  
Unread 07-01-2003, 01:21
Noah's Avatar
Noah Noah is offline
Code Monkey
#0861 (The Gondobots)
Team Role: Programmer
 
Join Date: Apr 2002
Location: Venice, California
Posts: 139
Noah has a spectacular aura aboutNoah has a spectacular aura about
Send a message via AIM to Noah
you could sum the values of the bits...
--------------------code-------------------
sensorPower = sensorReadings.bit0 + sensorReading.bit1 + ... + sensorReading.bit8

This would yeild a value between 1 and 8 that would increase and decrease in a linear fashion.
__________________
"It's broken? NOOAAHH!!! This is your doing, isn't it!"

"We can fix it in the software!"
"It's a BROKEN GEAR!"
  #12   Spotlight this post!  
Unread 07-01-2003, 01:27
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Quote:
Originally posted by Noah
you could sum the values of the bits...
--------------------code-------------------
sensorPower = sensorReadings.bit0 + sensorReading.bit1 + ... + sensorReading.bit8

This would yeild a value between 1 and 8 that would increase and decrease in a linear fashion.
Technically, that doesn't really measure the "strength" it measures the duration. The sensor will give off a constant ON signal if it is directed in the right place and the robot doesn't move. The summation might be problematic when your moving, say you move, you have a raw count, it could be 11111000. Unless you count the individual bits and their chronological order, this information would be useless. You could tell when your getting closer and farther away, but it doesn't specify a direction. Without chronological order or doing each bit separate, it seems useless to count the bits.
__________________
R

Last edited by rwaliany : 07-01-2003 at 01:38.
  #13   Spotlight this post!  
Unread 07-01-2003, 04:34
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
There's a miniature dial you can turn to change the sensitivity of the optical sensor. Theoretically, if you had multiple optical sensors directed towards the same area, you could determine the intensity of the light which you're viewing with a very crude resolution. The kit comes with three optical sensors, so you can have three different intensities of light to measure, in theory.

Keep in mind that I have not tested this at all, it's just a thought that's floating around in my head, and this seemed like the best place to share it.

<edit>

But alas, this is not a photosensor. It is measuring whether or not it can see (for lack of a better term, at the moment) the reflection of its own emitted light.

This post is entirely irrelevant, and should be disregarded by anyone interested in programming for the optical sensor.

</edit>
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos

Last edited by FotoPlasma : 07-01-2003 at 04:37.
  #14   Spotlight this post!  
Unread 07-01-2003, 05:05
yaman's Avatar
yaman yaman is offline
Registered User
#0691 (Hart Burn)
 
Join Date: Nov 2002
Location: Santa Clarita, CA
Posts: 9
yaman is an unknown quantity at this point
Send a message via AIM to yaman
Hmm

You're right, that should work...

Your idea could be used to measure intensity/distance... roughly anyways...

But, I dont think it would be very practical/accurate with only 3 sensors.. also need to consider that you might be using sensors for line following.. oh well i guess that's what the $200 for electronics is for... an array of light sensors :-)

Props on the very creative idea.
__________________
Linux is the answer, now what was your question?
  #15   Spotlight this post!  
Unread 07-01-2003, 09:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
You aren't limited to the 3 optical sensors in the kit. First, you can use an unlimited amount of the banner optical sensors, per the list formerly known as the additional hardware list. You also have the $200 from digikey or Future. I'm sure you can find an optical sensor that will give you an analog signal based on the intensity.
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
TEAM CONTACTS: SIGN UP HERE!!! archiver 2001 2 24-06-2002 03:51
Wheres the list, whats the secret? archiver 2001 3 24-06-2002 01:31
Full list of teams & competitions archiver 2001 14 24-06-2002 00:52
Team list & Events archiver 2000 2 23-06-2002 22:39
Suggested list of things to bring to the regionals Andrew Wyatt Technical Discussion 1 06-03-2002 14:41


All times are GMT -5. The time now is 02:05.

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