|
Hi David,
I am sorry that I did not clarify my question. Thank you very much for
taking the time out to help though!
I fully understand that variations that light sensor produces, and I do make
calibration the first thing to do before I run my bots. But my question
was" what" makes such large difference between 2 different light sensors on
the same area on the same RCX, during the same run time. Does the number
at the back of the light sensor indicator different resistor being used? If
it does, it most likely explains the difference.
Honestly, instead of keeping two different parameters, it will be just much
easier to grab two sensor with the same resistor IF the resistor is the main
cause of difference.
Again, thanks again!
----------------------------------------------------------------------------
--------
Best Regards,
Elizabeth Mabrey
> -----Original Message-----
> From: news-gateway@lugnet.com
> [mailto:news-gateway@lugnet.com] On Behalf Of David Schilling
> Sent: Monday, November 14, 2005 9:34 PM
> To: lugnet.robotics.rcx.robolab@lugnet.com;
> lugnet.robotics.rcx@lugnet.com
> Subject: Re: different light readings...
>
> In lugnet.robotics.rcx.robolab, Elizabeth Mabrey wrote:
> > Hi,
> >
> > I have these 2 different light sensors. One reads "41" vs another reads "34"
> > on the same area. I have troubleshoot it by switching ports, different RCX
> > brick. The reading different stays the same. Is this reasonable because
> > they might have a different resistors??? At the back of those two light
> > sensors, one reads G4, another reads H4. If it is, I guess there is no
> > trick that I can do to minimize the difference, isn't it?
> >
> > Suggestion is always appreciated!
> >
> >
> ----------------------------------------------------------------------
> > ------
> > --------
> > Best Regards,
> > Elizabeth Mabrey
>
> Different light sensors will produce different readings. The
> range of readings you get will also vary between different
> light sensors (for example, between the same white surface,
> and the same black surface, one light sensor might have a
> difference of 25, while another only has a difference of 12).
> In fact, the same light sensor will even return different
> readings depending on many variables, including the ambient
> light, battery levels, and even how long the RCX has been
> turned on. They aren't very exact.
>
> So what can you do? The solution is to calibrate each light
> sensor. Depending on what you are trying to do, there are
> different ways of doing this. Here's a couple. I'll assume
> you're trying to distinguish between something that is light
> and something that is dark. The easiest way then is to find a
> 'mid-point' value.
> If your reading is greater than this value, you can assume
> the object being examined is light, if less, then its dark.
>
> First, you could hard code the mid value. This is the easiest
> solution, and it will work if your robot doesn't change, the
> ambient light doesn't change, and you don't mind downloading
> the program again if anything should change.
>
> Second, you could get a pair of readings at the beginning of
> your program, and compute the average of the two. This
> requires that you know how to start up your robot, because
> every time you run it, you will have to show it a light
> object, and a dark object, and somehow let it know when it is
> seeing which one. You could make your code slightly more
> robust by spending the first five or ten seconds looking for
> the lightest object and the darkest object it sees. Then take
> the average of those two. But it still means you have to
> manually manipulate your robot (or write even more code to
> have the robot do it itself) to see these two.
>
> The third solution is to have a separate calibration program.
> The standard firmware shares variables between programs. If
> you are using NQC, then you could write one program that
> declares its first global variable as "mid", say. The main
> task would set the value of mid depending on the light and
> dark values that it sees. The your second program would
> declare its first variable as well (it doesn't need to be the
> same name, but it does need to be the first global variable
> you define), and *without* assigning a value to the variable,
> just use it. Then, as long as you run the calibration program
> first, your robot should work fine. The nice thing about this
> method is that if you forget to run your calibration program
> a few week later, your robot should still mostly behave.
> Also, if the lighting conditions change, or you put a new
> sensor on, or whatever, it's very simple to just run the
> calibration program again. I don't know if this is possible
> to do with the RCX Code environment (or Robolab, for that
> matter), so if you are using these, you'll probably have to
> settle for one of the other solutions.
>
> Note that if your robot has multiple light sensors, you'll
> have to calibrate each one individually. IE: store a
> 'midLeft' value for the left light sensor, a 'midRight' for
> the right light sensor, etc., and then use the appropriate
> value to compare each light sensor with.
>
> Hope that helps.
>
> --
> David Schilling
>
|
|
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|