### Author Topic: IR rangefinder minimum range problem  (Read 3068 times)

0 Members and 1 Guest are viewing this topic.

#### cybcode

• Jr. Member
• Posts: 18
##### IR rangefinder minimum range problem
« on: August 07, 2007, 07:08:12 AM »
Hi,

I'm trying to build a robot similar to the 50\$ robot with an IR rangefinder. I have a Sharp IR rangefinder with a range of 100cm-500cm (GP2Y0A700K0F). In order to solve the minimum range problem it has been suggested that the sensor be placed at the back of the robot. Unfortunately with a minimum range of 100cm I don't think this would be helpful.
My question is: would it be a good idea to use the derivative of the output (as a function of distance), in addition to the output itself, in order to measure distances under 100cm? I only need the sign of the derivative. If I understand correctly, it's positive if the object is inside the minimum range, and otherwise it's negative. Can anyone suggest an elegant way of estimating the derivative?

Thanks.

• Robot Overlord
• Posts: 293
##### Re: IR rangefinder minimum range problem
« Reply #1 on: August 07, 2007, 07:51:45 AM »
How did you get this one? Because if you bought it specifically for the robot then you bought the wrong guy. I think the only solution is buy the right one: GP2D12.
A.I.(yes those are my initials)

• Supreme Robot
• Posts: 11,673
##### Re: IR rangefinder minimum range problem
« Reply #2 on: August 07, 2007, 08:16:43 AM »
Yea Tsukubadaisei  is right, there is no computational solution to this problem. You will need a different sensor.

#### cybcode

• Jr. Member
• Posts: 18
##### Re: IR rangefinder minimum range problem
« Reply #3 on: August 07, 2007, 08:25:19 AM »
It's true, I bought the wrong one, but I was still hoping to make some use of it anyway.

Is there no computational solution because the sensor gives unreliable/noisy readings inside the 100cm range? After looking at the distance-voltage graph, it seems that the sensor does give readings inside the minimum range, but they seem to indicate a very long distance instead of a very short one. Maybe I could make the robot move back and forth in order to estimate the derivative of the voltage, and if it's positive, I'd know I'm inside the minimum range. Why would this not work?

Thanks.

• Supreme Robot
• Posts: 11,673
##### Re: IR rangefinder minimum range problem
« Reply #4 on: August 07, 2007, 08:50:24 AM »
Quote
Maybe I could make the robot move back and forth in order to estimate the derivative of the voltage, and if it's positive, I'd know I'm inside the minimum range. Why would this not work?
It will work . . . but it would also make your robot look very silly . . .

#### Soeren

• Supreme Robot
• Posts: 4,672
##### Re: IR rangefinder minimum range problem
« Reply #5 on: August 07, 2007, 01:56:02 PM »
Hi,

Apart from moving back and forth, which would be very clumsy, there's no way you can descide if it's inside or outside the 1m mark.
Imagine you're turning and say a chair leg is seen - how would you, without the back'N'forth know if it was somewhat under or over 1m ?

If you need up to 5m range, you could add another one sensor, with a smaller range, cover up to a bit past 1m out.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Engineering is based on numbers - not adjectives

#### Robotboy86

• Robot Overlord
• Posts: 139
##### Re: IR rangefinder minimum range problem
« Reply #6 on: August 07, 2007, 04:12:13 PM »
DISCLAIMER: This is completly useless and overly complicated, but damnit it will work.

Within the "bad" region it gives kinda insane readings.   Notice the following image:

Please note the first part, which is indeed a very bad reading.  Notice it goes up some, and dies some.  You will also note that it has a region where several values are repeated(1.8v-2v).

So how on gods green earth can we determine if the value of 2.2v is actually 10cm or 16cm?!  Pretty easy:

The range that this particular sensor is completly insane is 10cm's.  Take a SECOND sensor(you wanted this sensor to work, but you will have to buy a second one to correct the first lol) of equal design.    Now place it 5cm behind the first one.  Just above it, barely... now set your MCU to hit the first sensor off, hit the second one on and take a reading.  Now hit it off, and first one back on.  Take a reading.

Lets pretend there was an object 3cm infront of you(which is in the bad region).  One sensor would see it as a 3cm, the other as 8cm.  So sensor 1(closer) would give us a reading of:
1.4v, the other as 1.8v or something.  Now if you take that into the standard reading set, you would get readings such as:

16 and 20cm away.  The first one(20cm) is from the closer sensor while the second sensor gives 16cm.   Obviously wrong.  How can the farther back sensor reading closer then the closer sensor?  Something is a wry.

Switch it to a SECOND formula(the crazy one) and it would read out as 3cm and 8cm.. the 5cm distance is right and something we already knowt  be true.

Now I know this has flaws, and in NO way what so ever to I actually encourage this..  but if you wanted to think outside the box and find someway to make the 100cm range it has as bad, to be useful.. this would work  probaly.  the key would be to hit the sensors off as the other one worked.. or you would get wrong readings.

so party on.