Altitude based on pressure sensor

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

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    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.
  • 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).
  • 3D Robotics
    What a "QNH"?
This reply was deleted.

Activity

Gremsy liked Gremsy's profile
Mar 12
DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
More…