-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Added atmospheric tables for high altitude flight #17984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cc670bb
to
cac5cee
Compare
583679c
to
292dcbd
Compare
Id like to suggest that you find a way to reduce the flash cost of the table for the average user. i understand its currently 'around' 1k. Perhaps gating this feature behind some #defines and/or gating some or all of the table behind a #define (say, perhaps leaving out the upper 50% of it that's not really used by "normal users" ?) makes sense to me. if you do this, then i think its good-to-merge. |
|
||
#if HAL_BARO_ATMOSPHERIC_TABLE || CONFIG_HAL_BOARD == HAL_BOARD_SITL | ||
/* | ||
MIL-STD 3013 (1962 U.S. Standard Atmosphere) in Tabular Form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the International Standard Atmosphere as adopted by ICAO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've used the one recommended for the high altitude testing as recommended by a aerodynamics specialist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A stated goal was to give the same reading as calibrated sensors in manned aircraft give. I believe they're calibrated against that ICAO standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ICAO according to wiki (famous last words) says it uses the USA 1976 model up to 85km which is what I used for my model of this.
Unfortunately, I cant find a copy of the ICAO that doesnt cost $$ to compare constants and such.
Do we need a collection of 'extreme' autotests, eg high alt, long dist from home, etc? |
One other note is that you don't need all three of these in the table [pressure, temperature, density]. If flash space is an issue, I'd really suggest using the linear discretized equations for temperature & pressure by layers. |
have you got a reference for those? If they are a good match and not too complex then we would like to use them |
So I can't find my aerodynamics textbooks they are in boxes :( Here is the link to the USA 1976 model. It is the same as the 1962 up until 51 km except for natural constants used. I reference this one as it is more widely used by my knowledge (for simple modeling used in aircraft design and flight sims) See page 6 Eq 4: https://ntrs.nasa.gov/citations/19770009539 That differential is then solved depending of whether the temperature layer is gradient or isothermal. Here are some lecture slides that go through the derivation (not University of Michigan but Virginia Tech is cool too :) ): |
Here solves the differentials with all the work shown (pg 5): http://www.dept.aoe.vt.edu/~lutze/AOE2104/3atmosphere.pdf I'm working on simplifying the c++. |
@hendjoshsr71 this seems like a reasonable base: |
@tridge I already have them in matlab done. I am just translating and then needs a simplification. Pressure Error: (< 80 Pa): probably linearization errors, significant digit differences, and slight differences in constants |
d0014d7
to
6fba281
Compare
6fba281
to
e7c1f57
Compare
this gets altitude and EAS2TAS much more accurately up to around 150k feet AMSL. Enabled on boards using EKF double
use EAS2TAS consistently between frames, fixing airspeed at high altitudes
now uses 8 bytes per entry instead of 16 bytes
e7c1f57
to
152b8b6
Compare
@hendjoshsr71 I've redone the table to use half the space, by removing pressure_Pa and making height and temperature int16_t |
I'd really still advocate using the functions that these tables got generated from originally. I pinged you on this branch, but perhaps you didn't see it. I implemented these functions for the US1976 model. Total space for this PR then is around 500-700 bytes. hendjoshsr71#5 I tested and compared it to the table and vs. a few online tools. Any difference to your tables is linear interpolation error. Traveling till Monday. but I can post the graphs of the error between the two then. |
I didn't see it, sorry. I'll have a look |
@tridge Would you mind rebasing this? We'd like to do some high-altitude flight tests as a ride-along to compare against the existing implementation |
replaced by #26915 |
This adds a set of atmospheric tables for accurate pressure altitude and EAS2TAS for high flight up to 150k feet. This was tested on a glider at 75k feet and worked well.
The PR also fixes the EAS2TAS calculation to be consistent within SITL, which fixes problems with wind speed estimates at high altitudes.
The new tables are only used on boards also using the double precision EKF
This is part of a broader "Extreme ArduPilot" project to allow ArduPilot to work correctly at very long distances, high altitudes and high speeds.