PDA

View Full Version : [Project] GP2D12 IR sensor..



kishy22
01-09-2009, 08:52 AM
hi!
I and my groupmates are making a Biped Robot.We're using GP2D12 IR sensor to detect the obstacle around the robot.We tried first to test the IR sensor alone to know its accuracy by putting a block/obstacle at a fixed distance but the output is inconsistent.why is that so?Is there any way to have consistent values?

Hope you can help us.Thank you!:veryhappy:

lnxfergy
01-09-2009, 10:15 AM
Define inconsistent. The output is always gonna change a small amount (plus or minus 10% wouldn't surprise me for a $15 sensor) - no measurement device is perfect.

One thing to be sure of is that you have good capacitance near the sensor. They have a fairly large current draw every time they fire the LED, which is about 30Hz, I find that a 10uF cap right near the sensor works pretty good, but I've also gotten away with one 10uF cap between several GP2D12s, each 12" of wire away from the capacitor.

-Fergs

jes1510
01-09-2009, 10:47 AM
Yeah Inxfergy is absolutely right. If they are way off then check your power supply. Put it on a scope if you can.

kishy22
01-09-2009, 01:08 PM
These are the sample values that we obtained from our testing.We test our 3 sensors (IR1,IR2,IR3 respectively)-having same distances and position,from a single block.We also vary the distance of the block from IR as we go on with our test.As we move the block the output values also increased to thousands etc..having the same distances and position of the sensors,IR1,IR2,and IR3 supposedly have the same values but why they came up to these values?what are we going to do to obtain the accurate readings especially when it will be attached to the walking biped robot?


IR_value = 126, 9, 37
IR_value = 35, 277, 36
IR_value = 8, 8, 1384
IR_value = 8, 8, 231
IR_value = 8, 8, 24
IR_value = 1384, 1384, 36
IR_value = 14, 8, 99
IR_value = 33, 0, 36
IR_value = 198, 69, 37
IR_value = 35, 77, 346
IR_value = 1384, 154, 154
IR_value = 138, 77, 63
IR_value = 30, 63, 44
IR_value = 231, 69, 277
IR_value = 14, 8, 231
IR_value = 10, 8, 8
IR_value = 9, 9, 8
IR_value = 10, 9, 8
IR_value = 9, 9, 8
IR_value = 10, 9, 8
IR_value = 9, 9, 8
IR_value = 10, 9, 8
IR_value = 10, 9, 8
IR_value = 10, 9, 8
IR_value = 10, 9, 8
IR_value = 10, 9, 8
IR_value = 10, 9, 8


Thank You very much.:veryhappy:

lnxfergy
01-09-2009, 01:22 PM
What are these values? Raw 12-bit ADC? Some converted number - is your conversion function correct?

-Fergs

lnxfergy
01-09-2009, 01:28 PM
Also how are your sensors mounted? Are they right next to each other? If so, they might be intefering with each other. Try moving them apart by about 3-4 inches, and turning them upright so that are like this:

http://forums.trossenrobotics.com/attachment.php?attachmentid=988&stc=1&d=1231529271

If they are turned 90 degrees to their side, they are more likely to interfere with one another (because of how the optics work).

-Fergs

BIGBUG
01-10-2009, 07:39 PM
How about posting some code? A picture of the bot so that we may see the orientation of the sensors? Better code output?

Give us -Brick at xx distance / IR =xx

A little more info will sure go along way to solving your problem.

kishy22
01-14-2009, 10:27 PM
we haven't yet mounted the IRs to the robot when we tested them.so maybe the inconsistencies of the values we gathered was really due to the orientation of the IRs we had.we put them in horizontal manner and somewhat close to each other.the values we had were in centimeters,adc8bit.

we'll try to experiment again with the IRs and we'll be mounting it already to the robot.Hope we'll get the desired values.

thank you..:happy:

robologist
01-15-2009, 12:35 AM
Another curious method I'd heard of, for reducing noise in the Sharps, is by grounding the case. I remember reading that the plastic is conductive, and having a good mount to a metal ground will help. THere is also a good informational analysis of the Sharps (http://www.gorobotics.net/articles/sensors/effectively-using-the-sharp-gp2d12-rangefinder) at gorobotics.net, but DNS does not appear to be resolving it at the moment.

Adrenalynn
01-15-2009, 02:22 AM
http://209.85.173.132/search?q=cache:rvV4uz4-aUsJ:www.gorobotics.net/wordpress/articles/sensors/effectively-using-the-sharp-gp2d12-rangefinder+gorobotics+using+the+sharp+gp2d12+rang efinder&hl=en&ct=clnk&cd=2&gl=us

Google Cache is your friend. :)

lnxfergy
01-15-2009, 09:01 AM
Another curious method I'd heard of, for reducing noise in the Sharps, is by grounding the case. I remember reading that the plastic is conductive, and having a good mount to a metal ground will help. THere is also a good informational analysis of the Sharps (http://www.gorobotics.net/articles/sensors/effectively-using-the-sharp-gp2d12-rangefinder) at gorobotics.net, but DNS does not appear to be resolving it at the moment.

I've never seen the case grounding to really improve the accuracy of the sensor, and I think I have about 35 of the GP series of sensors in various bots. The three main areas I have seen that make big improvements are: keep sensors from interfering with each other by mounting them as shown above, decouple the power supply nearby (the sensor can easily turn your power supply into a 30Hz triangle wave with a 500mv peak-to-peak when it is firing), and shield them from light. I don't think I have mentioned the last one yet. Although the IR is modulated, the sensors still suffer from a wash-out condition if there is just too much light coming in and they can no longer see the IR. I like to hide the sensors an inch or two under a deck to hide them from excess light.

-Fergs

robologist
01-15-2009, 09:16 AM
Yep, Google works, sort of, but I really wish they were somewhat better on archiving and displaying the graphics of that site, they helped clarify the operation of the Sharps better. Sadly archive.org isn't much better.

Adrenalynn
01-15-2009, 12:18 PM
It's a PITA I know, but you can pull the images from the cache too with a little work. If I have time at some point, I'll do just that and reassemble the page for you.

robologist
01-15-2009, 04:30 PM
Wow, Adren, that would be cool. I really thought the description on that page was well thought out and detailed, sad to see it disappearing. Is there some trick you can reveal on getting the images out of cache?

Adrenalynn
01-15-2009, 04:48 PM
Yeah, I would view source, then look in google images cache for the images, and reassemble.

However, the document seems to be resolving now. I'm going to mirror it real quick before it goes down again.

Adrenalynn
01-15-2009, 06:45 PM
Ok - I mirrored the text and images. Any links still point back to GoRobotics (a respect-thang), but the documentation w/illustration has been preserved in this mirror:

http://www.jlrdesigns.com/mirror/www.gorobotics.net/Effectively-Using-the-Sharp-GP2D12-Rangefinder.html

I will, of course, remove the mirror upon verified author request.

SteamBoat
01-15-2009, 07:41 PM
Did you notice the TrossenRobotcs.com add at the end of the article? I wonder if it's the original.

MArk B.

Adrenalynn
01-15-2009, 07:43 PM
The ad was there when I yanked it from cache. I didn't check the date on the cache, but Trossen does do some targeted google advertising - and gorobotics does have google-ads on their site, so it would make sense.

robologist
01-16-2009, 12:16 PM
Thanks Lynn, seems involved getting the cached images but makes sense. You seem to be a very productive person, it would be great to learn that skill somehow too.

Adrenalynn
01-16-2009, 02:49 PM
I cheat. [shhhh!] I write scripts to do everything.

kishy22
02-15-2009, 07:57 PM
Hello,
Sorry for not keeping in touch for a few weeks,my group mates and I spent these weeks for smoothing the walk of our robot.
But this time we're trying to use 3 IR sensors simultaneously and output their readings in hyperterminal. We are using axon microcontroller and the sensors were already attached to our biped robot. We are having problems making the 3 sensors work at the same time. First, it was "Failed" when we upload the code to axon and the green LED lights. Though there was this one time when it loaded successfully, the green led still lights on and no readings are seen on the hyperterminal. After a successful load again, it did output values on the hyperterminal but for a short period only. Below is the readings we got:

System Warming Up.................Initialization Complete
front, right, left = 29, 18, 26
front, right, left = 30, 18, 25
System Warming Up.................Initialization Complete
front, right, left = 30, 18, 26
System Warming Up.................Initialization Complete
front, right, left = 30, 19, 26
front, right, left = 34, 18, 25
front, right, left = 30, 18, 25
System Warming Up.....

We tried to test each IR sensor separately and it went well, all sensors are in good condition. Once we attached the other sensors, the problem comes in. Even if no codes were used and just plug in the sensors then turn on the axon, the green led still flashes. Is this unusual? What could be the problem?

Any help would be greatly appreciated..Thanks

societyofrobots
02-19-2009, 04:37 AM
The reason why you see inconsistent results is that the Sharp IR is missing an output filter. I don't know why Sharp Didn't have one built into the design . . . but anyway the solution is to add some caps and a resistor.

For full details, an analysis, oscilloscope data, and the solution, see this post:
http://www.societyofrobots.com/robotforum/index.php?topic=2712.0

Now if you are too lazy to read all that, just read this summary to learn how to fix it:
http://www.societyofrobots.com/axon/axon_FAQ.shtml#sharp_ir_reset

That last link will also solve your problem, kishy22.

Adrenalynn
02-19-2009, 02:26 PM
Thanks for that, SoR - +Rep!

kishy22
02-23-2009, 03:10 AM
Thank you for your response.by the way,I read the link that you've given and it says to use ceramic capacitor and resistor to have stable voltage and to have accurate readings of IR.would it be okay if we use electrolytic capacitor instead of ceramic?
Thank you..

kishy22
02-25-2009, 08:55 AM
hi..

From the problem I posted a week ago regarding the error we encountered during the testing of 3 IR sensors simultaneously reading values.With the link given by societyofrobot,we tried placing a 10uF electrolytic capacitor across the adc power and ground, and the axon stopped resetting when connected with 3 IRs. It works fine already..

societyofrobots
02-25-2009, 09:50 AM
Electrolytic will work, its just ceramic is better for higher frequency noise.