Subject:
|
Re: light sensor
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Fri, 31 Dec 1999 07:48:08 GMT
|
Viewed:
|
951 times
|
| |
| |
Ben Jackson <ben@ben.com> wrote in message news:FnKnA7.J93@lugnet.com...
> In lugnet.robotics, Bertil Boers writes:
> > Can you make the lightsensor do more then act on 'more' or 'less' light
> > (0-50 do this, 51-100 do that.
> > Or can you let it do this to:
> > 0-10 do this
> > 10-20 do something else
> > 20-30 do something else,
>
> Can't you just drag multiple light sensing blocks onto your workspace? I know
> that it works for counters.
Yes, I believe that works in RCX, though I do most of my programming in
RoboLab
because my intent is to work with an elementary school.
>
> If you have expectations of seeing results so neatly spread out across the
> range from 0-100, prepare to be disappointed. It's hard to get a difference of
> 100 in RAW mode, were the sensor varies from 0..1023! In percentage mode it
> seems to hover around 50-60 all the time. The only way I've found to break out
> of this range is with a lot of IR. IR LEDs are on my shopping list today.
There are a couple of simple (non destructive) modifications you can make to
the
stock light sensor to improve its dynamic range (the problem is the light
emitter
tends to saturate the sensor due to their close proximity). Ralph Hempel
has a
nice explanation of using thin black vinyl from a binder to shadow the
sensor
from the emitter, I could not get my strip of vinyl to slip in, so I used a
little bit
of copper wire to apply a *small* amount of Testor's flat black model paint
to
the side of the emitter closest to the sensor... VOILA, reading of ~10 in a
completely
dark room, reading of ~95 six inches from a 60 watt frosted halogen bulb,
when
used in a line follower, I get a reading of 15-25 on the test pad's black
line and
a reading of just under 50 in the white area of the test pad in a well-lit
room (just
above 40 in a dimly lit room). Using the "follow the edge of the line"
algorithm I
do extremely well in just about any lighting conditions by setting the "too
bright"
threshold to 40 and the "too dim" threshold to 28.
Regarding line following algorithms, I've played with several algorithms
over the
past 3 weeks for using 1 light sensor to follow a line (the first attempt
worked but
my daughter challenged me "Daddy, can you make it follow the line faster?").
My
initial solution was a tricycle style robot with direct drive from the
motors to the
gears, and I followed the "swing back + forth until you re-find the line"
algorithm and
had to slow the power down to the lowest level in order to ensure that I
didn't miss
the line when swinging, so the robot took several minutes to traverse the
line. Altering
the drive mechanism with a 3:1 gear reduction improved the speed slightly.
I improved
the line seek algorithm slightly by retaining a directional guess based on
the direction I
had to swing on the previous seek (in RoboLab, which has 3 variables) but I
still wasn't
happy. Then I came up with using the edge of the line and responding to
"too bright" and
"too dark" to determine which direction to swing back to the edge (which I
was pleased to
see about 3 days later in Dave Baum's excellent book), after several
missteps related to
the actual coding in RoboLab, I now have a line follower that is geared 2:1
and can traverse
the loop on the test pad in under a minute. (My daughter was impressed
enough by the
whole process to become interested in the programming aspects of the robots
(before
building was her primary interest)).
Such fun!
-Peter
--
Peter A. Vogel
Release Engineering Manager
iReady Corporation
http://www.iready.com http://www.iready.net
|
|
Message is in Reply To:
| | Re: light sensor
|
| (...) Can't you just drag multiple light sensing blocks onto your workspace? I know that it works for counters. If you have expectations of seeing results so neatly spread out across the range from 0-100, prepare to be disappointed. It's hard to get (...) (25 years ago, 30-Dec-99, to lugnet.robotics)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|