Copter Altitude Accuracy

I have been analyzing the altitude reported by the autopilot to get an idea of its accuracy. In the plot, both MSL and the above ground level (AGL) as reported in the GLOBAL_POSITION_INT message are shown as well as the raw GPS altitude given in the GPS_RAW_INT message.

The MSL altitude seemed quite low for the field level where we were flying (according to google earth the altitude at our takeoff point is about 46 m msl). On examining the autopilot parameters I discovered there is a GND_ABS_PRESS parameter which is the ground pressure for the autopilot to calibrate to. It was set to 101880.9 Pa while the actual baro at the field was about 101626 Pa. Using those numbers I calculated a correction offset. Adding that to the MSL alt is also shown in the plot.

The last issue I’m curious about is there seems to be a scaling issue. According to the pixhawk raw gps alt, the initial climb was 35 m (from 51 m to 86 m), but according to the MSL altitude (or AGL too), that initial climb was 40 m. Is there a way to account for sensor scaling or is there another issue here?

1 Like

GND_ABS_PRESS is only used for calculating the relative altitude of the aircraft from where it was armed. The MSL altitude is based off of the GPS altitude, which for many systems will be quite poor accuracy.

If you are flying Copter 3.5 there have been some changes that reduce the baro reporting that the aircraft is higher then it actually is. The error term I tended to see when doing the correction was around 10% which aligns with your observation here. Technical details are available here: https://github.com/ArduPilot/ardupilot/pull/5930

Thanks for your response–I’ve wanted to upgrade to a newer version of Copter for a while, but not been able to due to project constraints. Hopefully this will give added impetus to upgrade.

When calibrating, why does it try to calculate a pressure offset instead of assuming sea level pressure and then calculating an offset between that altitude and gps altitude?

Would it be a terrible idea for me to calculate that offset after the calibration is complete (when arming) and then set the GND_ALT_OFFSET parameter to try to get better agreement between the two?

Without a GPS we will never calculate an absolute altitude, and using an ISA day’s guess for sea level is insufficient and will result in large errors (you would have 2000 to 3000 foot errors typically where I live).

The reason for using the current ground pressure and doing all calculations off of that is that it provides you with a very easy zero’d value. While you could try and model it as a a ISA day, this holds little to no value, as you will never be in an ISA day which means you would need an offset adjustment as you mentioned. However once you’ve gone through the extra effort to include an offset you will find that the math is identical for calculating the altitude.

The most useful thing you can do that would actually aide the baro (again this only applies to 3.5 is to provide the OAT to the copter during the preflight in the GND_TEMP parameter. http://ardupilot.org/copter/docs/parameters.html#gnd-temp-ground-temperature Almost no users will use this, but with out this we clamp the baro’s estimate of ambient temperature at 35C as it is rare to fly in warmer conditions, and the effect of self heating tends to introduce a larger error.