Hello all,

I've been trying to get accurate altitude readings from my ardupilot mega using the pressure sensor. Since there doesn't seem to be any way to input the current qnh into the APM to get an accurate reading, I decided to dive into the code to see whats really going on.

It seems as though 29.271267 inches Hg is hard coded into the software, making the pressure altitude constant near ISA. It does however look like the altitude reading is being adjusted for temperature, giving us an accurate density altitude based our near ISA pressure altitude. I guess my question is, are there plans on making a QNH (sorry we used qnh in nz, I believe other countries use other figures) value configurable from something like the wireless com port? and if not, if I were to modify the code to add this feature, would you be interested in adding it to the code base?

If I've misinterpreted the code please let me know.

Any thoughts are appreciated, Cheers.

    -Jon

Views: 356

Reply to This

Replies to This Discussion

What a "QNH"?
Chris, it's mostly used term on aviation for pressure

Three references for barometric pressure are in common usage: QNH, QFE and Standard Pressure (also referred to as QNE).

With QNH set, an aircraft altimeter indicates height above mean sea level. The QNH may be the pressure observed at the airfield, or the lowest pressure observed throughout a specified geographical area
QNH is also called the "altimeter setting" in civil aviation. It is the local barometric pressure, which provides an offset to the indicated altitude. This offset allows the altimeter to show the actual altitude of the ground on the altimeter, compared to mean sea level (MSL). Often this is set in the "Kollsman window" of the altimeter. A civil aviation technique is to do it backwards, adjusting the altimeter setting until the altimeter reads the field altitude (which is published).
Hi Chris,

As the others said, its basically the ambient air pressure at sea level for a given area. Generally read in hectopascals. On a perfect "standard" day, the sea level air pressure should be 1013 (29.92ish inches mh) hectopacals, and 15 degrees C.

Obviously things are often not standard, and as weather systems change, ambient air pressure changes. 1 hectopascal counts for about 30 feet of altitude, and qnh can generally range from 900 to 1040 hectopascals depending on where you live, and this gives us a range of error of around 1500 feet. Quite a large margin, so being able to set the qnh would be handy to have.
Got it. We've been talking a lot about the best altitude strategy in APM. Right now you can set the GPS/Baro mixing in the config file. Right now we default to 100% GPS, but we've been really impressed with the onboard (temp compensated) pressure sensor, so we may change that default to 100% baro.

One question is whether we can sample the GPS alt long enough to get a pretty good absolute figure after launch and then use that to calibrate the pressure sensor, using baro entirely from there on. Not sure if that addresses your question, but it's what we're currently thinking about.
Jon,

The equation we are using is based on the pressure difference between the ground pressure and the pressure at altitude. We measure and record the ground pressure at startup. This is equivalent to dialing the current QNH pressure into an altimeter. We also record the ground MSL altitude as reported by the gps. Using the two values recorded at startup we can produce MSL from the pressure reading at altitude.

Of course we are mostly interested in AGL altitudes and in having the system as automated as possible, so the approach of just measuring the ground pressure at startup seems best. The most critical use of altitude is in landing and the vast majority of our users will be trying to land at their launch location versus elsewhere. By basing everything on the measured ground pressure at startup we get the most repeatable and accurate AGL data for the launch location. Also, since mission time is typically short, say a hour or less, we have not seen it as a requirement to be able to change the ambient pressure during a mission.
Hi Chris, Doug

That does indeed sound like the best way to do it, AGL is surely what everyone is after. Can you point me towards the code that does this? I guess the reason i dove into the code to begin with was my altitude (agl or amsl) has been quite a ways off when using the pressure sensor, so I'd like to do some debugging.

I'm assuming then that at startup, the telemetry should report altitude as zero? currently what I'm getting is anywhere from 200-1200ft.

I'll also take this chance to say that the ardupilot hardware and software is great. Everyone involved in creating this little device and it's software has done a great job. Getting back into my uav hobby has been very enjoyable and much less frustrating than it was in the past with other hardware.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service