GPS altitude hold is good for +-5m, but what if you want more precision than that, closer to the ground. ArduCopter team member Randy Mackay. He explains what it takes (this is also in the manual):
To give it a go do this:1. get yourself one of these Sonars and attach to the bottom of your quadhttp://www.sparkfun.com/products/8504 <-- the cheaper LV ($28)http://www.sparkfun.com/products/9495 <-- the slightly more XL ($50)2. attach it up to AN1 (the Analog2Digital port on the very back
right of the oilpan near the CLI switch. AN5 is the outmost, so count
in from there to AN1).3. comment out this line in ArduCopterNG.pde://#define UseBMP4. make sure this isn't commented out just below in ArduCopterNG.pde#define isRANGEFINDER5. if you're using the LV sonar you will need to change this line in ArduCopterNG.pde:AP_RangeFinder_MaxsonarXL AP_RangeFinder_down;to be like this:AP_RangeFinder_MaxsonarLV AP_RangeFinder_down;6. you'll need to reset your EEPROM values or go into the CLI menu and select 'o' and set your Sonar PIDs to 0.8;0.3;0.7I had to make one change though that affects the existing functionality
... if you're UseBMP (i.e. using baro for altitude hold) it's now
possible to do altitude hold even though you're not doing GPS hold (I.e.
if you don't have a GPS lock). I think this is ok.So the Barometer altitude control and sonar altitude control continue
to be quite separate functionality that can't be used at the same time.
Clearly we need a nice transition from one to the other when you go out
of sonar range. anyway still, thinking about how to do that.