Shop OBEX P1 Docs P2 Docs Learn Events
Sharp Analog IR Rangers : Linearization forumulas — Parallax Forums

Sharp Analog IR Rangers : Linearization forumulas

Danny22Danny22 Posts: 29
edited 2006-06-29 19:19 in Robotics
For those of you using Sharp Analog IR Rangers(ex:GP2D12) I have worked out linearization formulas utilizing Microsoft Excel and data from Sharp for three of the most popular devices. The formulas assume the following:

1) 8 bit resolution (ex:ADC0831)
2) +2.55 VDC referrence voltage
3) R = range in inches
4) Vadc = ADC output(0-255)
5) conv = $64C9

GP2D12: R = (($A9A/(Vadc - 10)) - 1) ** conv

GP2D120: R = (($766/(Vadc + 15)) - 3) ** conv

GP2Y0A02YK: R = (($1CB5/(Vadc + 2)) -9) ** conv

For range in Cm, eliminate the " ** conv" operator. I have bench tested the first two because those are the ones that I use. I would be interested to hear from anyone who has tried the formula for the GP2Y0A02YK. The ones I have tried are reasonably accurate.

Never distant,
Danny22

EDIT: Added a subject

Post Edited By Moderator (Ryan Clarke (Parallax)) : 6/27/2006 8:55:21 PM GMT

Comments

  • ZootZoot Posts: 2,227
    edited 2006-06-29 19:19
    Could you post your actual spreadsheet? My experience has been that every detector is different and a set of constants that is dead nuts on for one detector will be off for another detector of the same type.

    There's also link at the URL below to a pretty nifty Excel spreadsheet for tuning detectors and getting constants for a linearization formula.

    www.acroname.com/robotics/info/articles/irlinear/irlinear.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.