Shop OBEX P1 Docs P2 Docs Learn Events
Help Understanding IR distance detection — Parallax Forums

Help Understanding IR distance detection

alexopricealexoprice Posts: 20
edited 2005-01-07 01:30 in Robotics
I am going through Robotics with the Bod-Bot and had no problems until pages 272-273. My problem is regarding the last paragraph on page 272 and figure 8-3 on page 273.


The program determines which zone the detected object is in by counting the number of“No” occurrences. Notice that even though the two Debug Terminal test patterns inFigure 8-3 are different, they both have three “Yes” and two “No” occurrences.Therefore, “Zone 2” is the location of the object detected in both examples. - I think that i also attached fig 8-3, but im not sure if it worked.

What i don't understand is the right picture of the debug terminal in fig 8-3. I don't understand how the object can be detected at 38250,39500, and 40500 while not being detected by 37500 since that should be able to "see" the furthest according to the book. It also confuses me why this means that the object must be in zone 2. I hope this post makes since if there are any questions please ask, http://www.parallax.com/dl/docs/books/edu/Roboticsv2_2.pdf·- there is the link for the book. IF anyone can help explain this i would appreciate it, thanks - alex

·
8-3.bmp 293.2K
8-2.bmp 235.6K

Comments

  • edited 2005-01-07 00:08
    An excellent question. Here is an initial answer.

    Take a look at Figure 8-1 on page 270. The program is designed to start at the filter's center frequency (most sensitive at top of the graph) and climb down the right side (progressively less sensitive). As the program transmits frequencies that the detector is progressively less sensitive to, it makes the detector progressively more near sighted. The program counts the number of times the detector did not see the object's reflection, and calls that the relative distance (a.k.a the "zone"). If you want to compare the Debug Terminal on the left of Figure 8-3 to the obstacle in Figure 8-2, first, imageine the obstacle is in zone 2, not zone 3. When the IR sends 37.5 kHz (zone 4 = yes) the object is detected. When it sends 38.5 kHz, the object is still detected (zone 3 = yes). When it sends 39.5 kHz, the object is still detected (zone 2 = yes). When it sends 40.5 kHz, the object is not detected (zone 1 = no). When it sends 41.5 kHz, the object is not detected (zone 0 = no). That's 2 "no" results, which puts the object in zone 2. Next, move the object further away, to zone 3. There will be 3 "no" detects, and only 2 "yes" detects.

    OK, now what the heck is happening when zone 4 = no and zone 0 = no, but all the other zones say yes??? That's the pattern reported by the Debug Terminal on the right side of Figure 8-3, and it's still in zone 2. That's happening because the filter insdide the detector doesn't behave exaclty like the sensitivity profile in Figure 8-1. That profile can change due to both manufacturing variations and changes in temperature. In Figure 8-1, imagine that you slid that curve to the right so that the top of the curve is actually closer to 39.5 kHz. If this happens, 39.5 kHz is the most sensitive, then comes 40.5 and 38.25, and after that, 41.5 and 37.5. Whether 40.5 or 38.5 is more sensitive depends on your particular detector, likewise with 41.5 and 37.5. But, since we are just counting the number of "yes" vs "no" detections, the actual frequency doesn't matter. The series of frequencies that are transmitted STILL GIVE THE IR DETECTOR 5 DIFFERENT LEVELS OF NEARSIGHTEDNESS; they're just not all nice and linear like Figure 8-2 suggests. So, counting the number of "no" detections still gives you the right zone.

    Digital smoke and mirrors? Yeah, maybe so. When I found out that the programs still worked regardless of variations in the filter, it gave me a newfound interest in an electronics subspecialty called digital signal processing.

    The zone measurements don't have to be super precice for the applications in Chapter 8. In terms of the object's distance, some zones will be really narrow, while others will be pretty wide. Even so, it's good enogh for the upconging programs that make the Boe-Bot to lock onto and follow your hand, a book, etc.

    Post Edited (Andy Lindsay) : 1/7/2005 12:12:54 AM GMT
  • alexopricealexoprice Posts: 20
    edited 2005-01-07 01:30
    Thanks a lot for that very thorough explanation, it makes sense to me now. Thank you - alex
Sign In or Register to comment.