Sharp Analog IR Rangers : Linearization forumulas
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
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
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