# Society of Robots - Robot Forum

## Electronics => Electronics => Topic started by: Tomas on May 21, 2009, 02:44:28 AM

Title: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Tomas on May 21, 2009, 02:44:28 AM
Does anyone know or even better, have any good source? Im writing my bachelor thesis on a robot, and I want to include this subject. But I can't seem to find any good sources for anything more than just saying "uses triangulation". I find the whole triangulation-bit of this kind of confusing, it raises more questions than it answers.

The sharp IR sensor shoots out a concentrated (by the lens) IR-light beam

The beam hits an object, and reflects back in all directions.

The CCD-chip on the Sharp IR sensor tells where the light hits on the sensor, and by this, it calculates the distance by triangulating.

(http://www.skjermskudd.com/out.php/i4136_ir.jpg)

but how does it actually calculate this information into an actual distance? Anyone know this?

(http://www.skjermskudd.com/out.php/i4137_ir2.jpg)

The further away the object is from the transmitter/reciever, the more of the CCD chip will be covered in light (but less intensity, of course). Am I right?
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: SmAsH on May 21, 2009, 02:58:05 AM
(http://www.acroname.com/robotics/info/articles/sharp/triangle.jpg)
the triangulation works by saying the angle is x degrees so the object must be y distance away.
have you read the sharp ir tutorial on the main site yet?
it explains mainly how they work. they contain electronics that are very complex apparently..
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Tomas on May 21, 2009, 04:07:12 AM
According to the image you provided (and of course I've read whatever I could find, including the "tutorial" on this site) my drawings are correct. The further the object is away from the sensor, the steeper the angle will be. And there is probably two factors going into the distance the sensor can read, mainly the angle must be very difficult to read because the very small angular differences when the distance is approaching the maximum values the sensor is supposed to read. For example, the sensor sharp ir GP2Y0A02YK, which measures from 20 to 150cm. When this goes around 150cm or above, the angle of the returning beam must be nearing 180 degrees, or covering nearly the full areal of the CCD chip. But the intensity of the light must become very small now as well.

Yes, I think Im starting to understand the sensor now. I'll see what sources I can come up with, and I'll post the part about the sensor here if wanted.

And the electronic components of the sensors is not that complex. Its a CCD which basically measures WHERE the light returns! Not the intensity. This is then processed in the DSP chip in the sharp sensor, and it returns an voltage depending on what it discovered. Also, the sensor used 48 ms to calculate this value.. That means, that the update frequency has a direct relation with the DSP chip and its power. Interesting reading :)

Also, the reason the sensor cant read under 20cm, is because the angle becomes to steep, so the returning light does not even reach the CCD sensor.

Now, if I could only get some good sources for this information, then I'm good to go...
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Soeren on May 21, 2009, 07:04:09 AM
Hi,

Here is a crude diagram of how it works (the "triangulation" bit).
(http://That.Homepage.dk/Img/GPxx_how.jpg)
(Drawn in a few minutes so bare with the wrong angles etc. ;D)

Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Tomas on May 21, 2009, 07:52:13 AM
thanks for the table :) I understood that concept as well, but I am wondering if anyone know what kind of CCD chip that is inside any of the sharp sensors, or perhaps just what resolution these have?
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Soeren on May 21, 2009, 12:18:04 PM
Hi,

I'd assume 264 pixels or something like that, as there is often a few pixels "thrown away" in each end and they're 256 pixels/levels out IIRC.

Sorry I can't open one, since I'm not at home.
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: fiflak666 on May 22, 2009, 10:20:33 AM
SmAsH and Soeren your pictures are wrong

1. SmAsH: in your picture llight goes under different angle depending on distance to the target, nice ... and what would you draw when object isn't parallel to the sensor ? as we know, SHARP readings doesnt depend od object angle

2. Soeren:  in your picture infrared beam is getting wider with distance - this beam is collimated with one of lens that SHARP has inside, so its almost strainght (almost, because in fact, radius of this beam gets a little bigger)

I've some work with this sensor and it works like this:

IR LED is working (light is of course modulated) and first lens collimate its light (that LED is placed exactly in focal length) - we can say that behind that lens there is only ONE single ray of light without any radius (of course it's simplification)

that single ray gets to the object and the it's dispersed (NOT reflected as many people say but DISPERSED) as in that picture above

then another simplification - the object is so far from the sensor that any ray that gets to the second lens is parallel to any other - as a result light is focused on the PSD sensor which is placed again in focal plane

so distance can be calculated with this formula (Triangle similarity):
D=f * L/x

this formula also demystify SHARP distance/voltage characteristic
simple: it's hyperbola :)

sorry for my english  :P
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Soeren on May 22, 2009, 12:43:04 PM
Hi,

2. Soeren:  in your picture infrared beam is getting wider with distance - this beam is collimated with one of lens that SHARP has inside, so its almost strainght (almost, because in fact, radius of this beam gets a little bigger)
So, you apparentlydidn't read my disclaimer  :(
I know it's drawn too wide, it was meant only to show that it's not like the common misconception of a collimated pencil beam.

I've some work with this sensor and it works like this:
I've done quite a bit of work with the Sharp sensors as well, including looking at the beam spread through a b/w CCTV, which is quite revealing.

IR LED is working (light is of course modulated) and first lens collimate its light (that LED is placed exactly in focal length) - we can say that behind that lens there is only ONE single ray of light without any radius (of course it's simplification)
Look at it through a cam and say that again please.

that single ray gets to the object and the it's dispersed (NOT reflected as many people say but DISPERSED) as in that picture above
You don't understand a term like "illustration of principals"?
The "position focusing" bit lies in the CCD that "looks" at different angles.

then another simplification - the object is so far from the sensor that any ray that gets to the second lens is parallel to any other - as a result light is focused on the PSD sensor which is placed again in focal plane
Just like in your drawing, which is not (pseudo-)parallel at all either. We have to simplify some things and exaggerate other to make them visually comprehensible.

By the way, do you buy Sharps locally in Poland and if so, how much are they?
I just returned from Warsaw and I'm still pretty amazed of how cheap everything is (booze, tobacco, dames, opera tickets, food, you name it), so perhaps I should get a load of components next time I go there ;D
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: fiflak666 on May 22, 2009, 02:48:59 PM

By the way, do you buy Sharps locally in Poland and if so, how much are they?
I just returned from Warsaw and I'm still pretty amazed of how cheap everything is (booze, tobacco, dames, opera tickets, food, you name it), so perhaps I should get a load of components next time I go there ;D

hehe for people from the West things are really cheap ... except for electronics :)

for example SHARP sensor costs approximately 15\$ (without shipping) - but people earn less than in the West sa it's expensive for us (for example, when you are young Master of Science - Engineer and you gets your first job with 900\$ salary - you are lucky man)
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Tomas on May 23, 2009, 01:52:08 PM
(http://www.skjermskudd.com/out.php/i4161_IR.png)

Here is my very simplified explanation of the IR sensor. As the length increases, the returning lights degree will be steeper. You can then use the height of the IR sensors "wall" to calculate the degree of the returning light, and by using the total distance between the IR sender and reciever, you can calculate the actual distance.

I know there are lenses as well, but the prinsip is right, isnt it? I will work out the simple formulas as well :)

edit: yes fiflak666, great picture you provided. Exactly what I meant, and I REALLY think the "tutorial" on this site on how the sensor works is lacking very much important basic information.

I will post my full report on this sensor when Im finished, maybe admin can update the tutorial with some new information.
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Soeren on May 24, 2009, 06:25:26 PM
Hi,

[...] You can then use the height of the IR sensors "wall" to calculate the degree of the returning light, and by using the total distance between the IR sender and reciever, you can calculate the actual distance.

I know there are lenses as well, but the prinsip is right, isnt it? I will work out the simple formulas as well :)
Yes, if you by walls are portraying the effect of the focus point shifting on the CCD, but it sounds a bit off I'd say.

It would be better, for understanding the concept, saying that each pixel of the CCD looks in a different direction/line and the one that spots it, represents a certain distance. Won't go in a thesis of course, but too many people is hung up on the light going from the LED to the CCD to comprehend the action. Turn it a bit around and it instantly becomes so much clearer.

[...] I REALLY think the "tutorial" on this site on how the sensor works is lacking very much important basic information. [...]
The kind of info you want for a report/thesis is not needed to use it, it's more or less Plug'N'Pray.
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: Tomas on May 25, 2009, 02:30:51 AM
Hi,

[...] You can then use the height of the IR sensors "wall" to calculate the degree of the returning light, and by using the total distance between the IR sender and reciever, you can calculate the actual distance.

I know there are lenses as well, but the prinsip is right, isnt it? I will work out the simple formulas as well :)
Yes, if you by walls are portraying the effect of the focus point shifting on the CCD, but it sounds a bit off I'd say.

It would be better, for understanding the concept, saying that each pixel of the CCD looks in a different direction/line and the one that spots it, represents a certain distance. Won't go in a thesis of course, but too many people is hung up on the light going from the LED to the CCD to comprehend the action. Turn it a bit around and it instantly becomes so much clearer.

[...] I REALLY think the "tutorial" on this site on how the sensor works is lacking very much important basic information. [...]
The kind of info you want for a report/thesis is not needed to use it, it's more or less Plug'N'Pray.

You are correct about the not needed in tutorial part, I can agree with that. But the whole explanation on how it works is not logical at all. Heh.. But people dont seem to mind :)

I also see what you are trying to explain. If the light is to narrow for the lens, it will not project it onto the CCD chip, which is pretty small. :) But the prinsiple of my drawing is correct, thats what I am looking for. Just the whole prinsiple on how you can use triangulation to calculate the distance.
Title: Re: How does IR distance sensor triangulation actually work? (Sharp)
Post by: RoboticsProfessor on May 25, 2009, 09:32:42 PM
Take a look at: