Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Resilient on June 02, 2009, 01:01:08 AM

Title: GP2D120 woes with Axon
Post by: Resilient on June 02, 2009, 01:01:08 AM
I am trying to figure out whats going on with the GDP2D120s I am using.

I have two range finders, one on pin F0 and one on F1

If both are reading some reasonable value, all is well.

If the one on F0 is reading infinity, then it will take on the value of the one on F1. But if the F1 sensor is reading infinity, it will continue to do so and it will display a proper value for both F1 and F0.

I have .1uF capacitors on both (its the biggist I had, Ill get bigger ones if that is a possible cause).

So if F0 = F1 = Infinity, all is well.

If F0 is between 0 and 40 and F1 is any value, all is well.

But if F0 should be reading infinity and F1 is some value between 0 and 40 cm, then F0 will read some value close to F1.

What can I do here? What might be causing this?

Thanks!
Title: Re: GP2D120 woes with Axon
Post by: Webbot on June 02, 2009, 02:24:41 PM
The sensors aren't pointing in the same direction are they? If so then #2 may be seeing the reflected beam from #1 and vice versa.

Edit - what happens if you swap the devices. Does the problem move with the devices or does it depend on the IO pin.
Title: Re: GP2D120 woes with Axon
Post by: Resilient on June 04, 2009, 10:43:24 AM
It was solved by adding a delay between readings.

But prior to that, the problem was dependent on the pin. At first I was concerned they were seeing each other, but then I took one off and pointed it in the opposite direction and had the same problem.

I think it was some sort of "real world" problem, like you said,  where there is a residual reading that it was picking up.