Hi all,
I’ve connected the analog Ultrasonic Range Finder - HRLV-MaxSonar-EZ4 to the pixhawk’s RNGFND_PIN = 14. It has a max range of 500 cm with a V range of 2.5-5.5V.
I cannot understand the range finder scaling formula from this page: http://copter.ardupilot.com/wiki/common-optional-hardware/common-rangefinder-landingpage/common-rangefinder-maxbotix-analog/. It seems to be defined like: RNGFND_SCALING=max range / ADC V. But the example shown is unclear.
It says: RNGFND_SCALING = “2.04” (i.e. 7m / 5v) if using EZ0 or EZ4, “4.08” (i.e. 10m / 5v) if using EZL0.
But 7m/5V is not 2.04 m/V, nor 10m/5V = 4.08m/V.
Besides, with the pixhawk, pin 14 is connected to the ADC 3.3V, not 5V nor 6.6V
However in this page: http://planner.ardupilot.com/wiki/other-project-and-common-topics/common-optional-hardware/common-rangefinder-landingpage/common-rangefinder-sf02/, albeit using a different type of range finder, the example with the same formula is correct: RNGFND_SCALING = “12.12” (ie. 40m / 3.3v = 12.12), using pin 14 in the ADC 3.3V
I tried to use the max range/ADC v formula (in my case 5m/3.3V = 1,51 m/V), but the distance measured is wrong.
I believe there are some mistakes, or at least the formula is not that clear, in http://copter.ardupilot.com/wiki/common-optional-hardware/common-rangefinder-landingpage/common-rangefinder-maxbotix-analog/.