Pressure, Temperature, and Altitude, Oh my!

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

AllDigital

Well-Known Member
TRF Supporter
Joined
Jun 14, 2013
Messages
618
Reaction score
774
Location
SoCal
Last week, my son and I launched a two stage sugar rocket to about 25k feet using our flight computer and a backup StratoLogger on the sustainer. On this launch, the GPS data and velocity data indicated much lower altitude than the barometer, so we pulled the data from the StratoLogger, and to our surprise it confirmed a 4K foot difference. We checked our raw pressure data and formulas twice and still couldn't figure out why they would be different. So we put them both in a vacuum chamber, lit it up, and again they were way off at the higher altitudes. So then we put three more commercial altimeters in the vacuum chamber with our board and all three commercial altimeters matched in altitude, but ours was the odd man out at 10-20% higher depending on altitude.

Six months earlier, we had switched to a MS5607 barometer and switched out our libraries. Our MS5607 library is a mix of custom and open source, but we decided to swap our old “standard” pressure-altitude formula in the library for a new one, as it used the “barometric formula”, incorporating temperature. We assumed that formula would be more accurate. Flying at 10K to 12K feet regularly, we didn't see much difference, but at 25K there was a huge difference.

When we switch back to the “standard” pressure-altitude formula, not incorporating temperature, we align perfectly to all the commercial altimeters. Since the sensor is already integrating temperature, I assume our error was integrating temperature a second time in the code using the barometer output. I suppose if we had a primitive sensor that only measured pressure and another only measuring temperature, then our “barometric formula” might work fine.

Is this correct or are we missing something? Excluding integration of velocity and GPS data into pressure data, is there a better formula for calculating altitude based on the pressure/temp data coming out of the sensor?

For reference here is the “standard” pressure-altitude formula we are now using: https://en.wikipedia.org/wiki/Pressure_altitude

And the “barometric formula” we were using: https://en.wikipedia.org/wiki/Barometric_formula


Thanks,

Mike


Vacuum chamber results w/old formula compared to three commercial altimeters.

Screen Shot 2021-10-14 at 9.51.33 PM.png
 
My suggestion is that you verify your model and implementation with 2-3X assumption that you are wrong. Once you don't find this correlation, question the devices you are comparing to.

You obviously are approaching this more than an average hobbiest and have found a deviation. You may not be wrong, but in my world, when your observations differ than those expected from other sources, you have to prove why. I'd say 50-75% of the time in my job the OEM says "well in that case, you're right, but that's not normal implementation etc." We win more often than not. . .

You've found an anomaly, so you have to figure out if it is in your code/devices or the commonly used code/method. I hope trying to resolve that is a fun experience, as it will likely make you an expert you never wanted to be. But resolving the discrepancy regardless of where it is will be cool.

You obviously know more about this subject than I do, but seeing your observations makes me want to see the resolution. Very cool to see the question and for me to learn more about the realities you high-fliers go through. Also very cool you're building your own avionics.

My main point was to question yourself a bunch and if you don't see the fallacy, then question the accepted information. Sometimes your perspective moves the ball forward and resolves previously unknown false-assumptions by the experts.

Sandy.
 
Where are you getting the temperature from? Most sensors have an on-chip temperature that is required to correct the pressure data. This is usually a bit warmer than atmospheric so you may have the math right but just over correcting with the wrong temp.
 
If you want to match several commercial altimeters use the SAM model and do not include temperature. The temperature versus altitude is already baked into the SAM.
 
Back
Top