This might be a common knowledge, but in the last months I haven't seen a similar post. Maybe someone new to barometers might be interested in this data.
The GPS receivers return altitude data, but this is inaccurate. The error margin depends on the satellite constellation geometry and whether or not you have SBAS DGPS on. I was under the impression that the error was 5-10 meters, but as it turned out, I was wrong.
Recently, I embedded a BMP085 barometer in my autopilot board and operated it with this library: http://code.google.com/p/bmp085driver/
Barometers can be and are effectively used to calculate altitude, once initialized and zeroed.
So the figure above displays a short manual flight whose altitude is measured both by a barometer and a GPS. The barometer is zeroed upon power-up. The GPS altitude is zeroed, based on the altitude returned before taxiing. It is the time between 20 and 30 seconds. The plane lands at 150 seconds in the exact same place it took off. However, the GPS altitude measurement has already drifted 16m away.
This goes to show that GPS should not be used for altitude measurement, unless a very coarse albeit offset-free measurement is required.
A barometer is a much more accurate and fast device to extract altitude, when operated correctly.
Comments
Oh, I didn't notice the x axis label. It is noted in Sample Number. It counts how many sample measurements the APM has taken. So, for you, the second flight happened at 24000 samples (or log lines).
How much time that is, depends on the APM's sampling frequency (the loop time essentially).
What's important is that, once again, barometer heat-up is lowering the measured altitude.
I have APM 1, around 24 was second fly. So there was reset to Zero.
I dont understant the time line in log graph, bud it was 15min flytime at all.
Sonar is undisputedly the better choice below 10-5m. But over that, just like in your graph, its measurements cap.
I 'm curious. Did you start flying and measuring right after you powered your multirotor (I presume you are flying a multirotor). Did you land and reset your system @24secs?
What barometer are you using?
This is my graph of Baro and Sonar Alt.
I prefer sonar and GPS calculation then baro.
@Tom Yotchum
I found these two helpful articles:
http://bhgcinfo.wikidot.com/tutorials:differences-between-pressure-...
http://www.xcmag.com/2011/07/gps-versus-barometric-altitude-the-def...
Both claim that in days where temperature at sea level is more than 15oC, barometric altitude will be lower than GPS altitude. However, airspace limits are defined and recorded in barometric altitude, so this number is the most relevant one.
@CrashingDutchman,
After further inspection, I believe that what you describe, measurement matching during climb, GPS lag during descent, isn't happening.
Instead, this is what happens: The GPS has a time lag of a few seconds while resolving the altitude. You can notice that by the time mis-match of the two peaks in the graph. That means that the GPS curve is offset horizontally by a few seconds to the right, exaggerating the difference during descent.
I see where you are getting at.
In the way I want to go about my project, here is a typical flight mission:
Now, since my flight mission will be localized over a short area, I assume that using barometric altitude is the way to go. Besides, AGL is the measure most countries limit the maximum allows flight height.
For the landing procedure, I am well aware that neither a barometer or a GPS give adequate resolution. Laser range finders are still quite heavy and expensive, so sonar is the way to go for now. Even though they 're notoriously noisy. This part will come after the summer, though.
Different altitude sources are best used for different things. For example, barometric altimetry (MSL) is great for keeping relative distance within an airmass, since everyone's sensors are affected by the local conditions by the same amount. For situations that require knowing your height above the ground (AGL), such as landing, the best source is something like radar, sonar, or laser altimetry. These usually only work over short ranges and some have poor accuracy.
GPS uses ECEF coordinates, which are not affected by the current conditions (temperature, etc.), but are also not correlated in any way to the terrain. If you need to operate relative to the ground, you can survey the geometric height of the terrain using a GPS receiver and then use your GPS to navigate relative to that geometric height.
You can also use tabulated geoidal separation data to try to convert between geometric and MSL altitudes, and then blend the two sources together. This has its own set of complications.
Tom
In case it is not known, the BMP085 barometer has an embedded temperature sensor, withing the same die. This is the temperature measurement I was referring to in the post above.
I was not aware of the discrepancy between the two measurement systems. I googled a few links and I 'll take a read.
About the extraction of altitude from barometric measurements, all the work is done by the library that I linked to. It does temperature compensation. Unfortunately, the BMP085 seems to heat up by at about 5 degC a few minutes after power-up. That means that for the best results, you have to zero its altitude measurement a few minutes after its power up, not necessarily a feasible option.
How would you suggest measuring AGL or MSL altitude for navigation reasons, given that GPS receivers aren't adequately accurate?