Help using Altitude Hold

Hey all,

I am trying to achieve altitude hold using my quadcopter. I have an apm 2.5 (no gps) and I have mission planner 2.0. I also have a sonar (EZ4). I am trying to get the quad to hold its altitude. I am trying to understand a couple of things:

  1. In brief, how does the altitude hold code work?
  2. What sensor data does the code use to do that? Is it the barometer and the sonar?
  3. How to disable the barometer and only use the sensor data from the sonar? I will be using my quad indoors and the barometer is not accurate enough.
  4. If I switch to altitude hold mode while in flight, does the code take the altitude at the moment of time and try to maintain it?

Thanks a lot for your help!

Hi theboss4545,

This information is from the wiki:
Warning: The flight controller uses a barometer which measures air pressure as the primary means for determining altitude (“Pressure Altitude”) and if the air pressure is changing in your flight area, the copter will follow the air pressure change rather than actual altitude (unless you are within 20 feet of the ground and have SONAR installed and enabled). Below 26 feet, SONAR (if enabled) will automatically provide even more accurate altitude maintenance.

copter.ardupilot.com/wiki/altholdmode/