I was looking for a way to have a robots head follow something or someone around. I've seen some robots that have a servo with an IR-sensor on top that finds either the left or the right edge of anything you put in front of it. I toyed around with that, but I got frustrated with a few things.
If you follow the left edge of an object, the robot allways seem to look slightly left past the object instead of in the middle. Also:When the edge is detected, the servo goes from left to right and back between detecting the object and looking past it.
So I came up with the idea to have two IR sensors inside the head that can move (rotate) by themselves: independant of the head.
Moved the content of this page to the tip/walkthrough section. here
Not only smoother & faster, but you can also see objects size in same go!
Are you not posting this a s a walkthrough? Then I will link to it from Locking on objects - and you can link to that, so it will be a good knowledge base all together.
Very, very nice thinking, hats off, 10 point, this one is original and new, this one will be copied
PS: I only think it is “2 eyes”, just to be more technical correct.
The effective range is about 60CM. not a lot: i know. But if I can fit it in a very small bot it’ll be enough.
I’m not really happy with the IR-rangefinders. They have a pretty narrow beam, but their ranging signal is somewhat unstable. the ultrasonic ones are much more stable, but have a very wide beam / detection angle.
BTW: if the combined angle is wide: There is either a large object at a distance or a smaller object very close.
I meant relative to previous sample of object. ie. If combined angle compared to previous sampled combined angle is larger - the object should be getting closer…
Great ! I have not used those before. It sounds like you are closer to a form of “Object Identification”!<o:p></o:p>
Where a particular object width @ a particular range could be listed or inventoried:<o:p></o:p>
For example, a soda can could be matched 4 cm wide @ 24 cm distance, and since your eyes are fixed points the ratio will be constant. Your soda can ratio will be 6 in this case. Now just make a table of things you want to identify.<o:p></o:p>
Object Width To Distance Ratio <o:p></o:p>
soda can 6 ball 3 cat 10 <-- ok non symmetrical objects will be prone to error <o:p></o:p>
There was some math bits that someone put together that took GP2D12 readnigs and made an output in inches. The formula was something like :
(e^(-(IR-VAL/8) / 555.4619) x 42.1806) + 4.6301
where the IR value returned was a value between 0 and 32767 for that processor. This would be a starting point on developing a similar formula for your micro (which may not have floating point or needs to substitue 2.718 for e) .
I think I’ve seen other formulas too, for linerizing Sharp IRs
I use the GP2D12 ( or the GP2D120), but those IR-sensors are hard to get a stable signal from. I’ve been searching the web for ways to stabelize them, but its not easy. I’ve tried a few cap configurations but they’re still unstable
In the setup here there connected directly to the PicAxe 28 board that also controls the 2 servos from one 4.8V power source. When an object is in sight, the reading can sometimes jump around between, for example, 120 and 130. That’s a lot in terms of inaccuracy. Especially if you’re going to use those values to calculate width.
I agree that one sensor should be upside down, because the detection is not in the middle between the LEDs. Its right at the little dot / dent on the rangefinder.
I’m still looking for good accurate range finders with a narrow beam. I like the laser rangefinder by Oddbot, but I’m not sure I can make one small enough. Right now I’m considering trying out lens configurations on a Frits!LDR setup.
Sharp IR orientation There is a Sharp App note that recommends (pg 4) the GP2 sensors to be mounted vertically if detecting targets with primarily vertical edges, to lessen any possible triangulation discontinuity errors.