Relative Altitude is completly wrong on two different air frames

Before I take off, my Alt (Rel) is around 0, as expected, but as soon as I get 3D GPS lock it changes drastically to around -35m. The Alt (AMSL) is correct, in my case around 40m. In flight when I activate RTL the drone climbs to 100+m AMSL even though RTL height is set to 10m. What makes this problem more confusing for me, this is happening with two separate air frames, a Hex and a Quad, one with Cuav nano V5 (PX4 1.15) and the other Pixhawk 6C (PX4 1.16). I have tried adjusting QNH but this has little effect. The log also show barometric and GPS heights correct and with reasonable correlation. Both the GPSs and barometers also appear to show sensible values.

Having this problem with two separate air frames makes me think my fundamental understanding of a parameter which I have presumably changed is wrong or, QGC which I am using has something to do with this.

Any suggestions would be greatly appreciated.

Can you please share a log?

Here is the log https://review.px4.io/plot_app?log=91c5c5fc-0f59-4eb7-881c-7e98d80e1b11

I seem to recall the problem started after I set the RTL altitude to 100m and after setting it back to 10m the relative altitude was wrong, but this could be completely coincidence.

This is the log from a new Hexacopter I am building, having the same problem https://review.px4.io/plot_app?log=6e3d173c-7e4a-4ea5-97a0-e3d837cfe34f (I took thr FC from another quad where I also set the the RTL altitude to 100m and then back)

The home position is being set at 95m. Not sure why, but that’s the issue. It’s RTLing to 10m above the home position.

Thanks for looking at this. I have now solved the problem. Repeating the issue using two different airframes with the same transmitter, has focussed me to look at QGC. I re-loaded the maps for my area and, hey presto, the relative altitude is correct. Presumably, the terrain database had been corrupted.

It appears QGC was sending a false Home altitude and PX4 was using this to calculate the relative altitude which in my opinion it should not do. At take off, relative altitude is explicitly zero !

PX4 should be able to validate such inconsistencies as this can result, in the event of a RTL, in the vehicle climbing very high and then very slowly descending (at RTL descent rate). So when the RTL is triggered by low battery there may not be sufficient capacity/time to land safely.

In my opinion, the data used by PX4 to evaluate relative altitude at take off should be re-examined.

Nice catch! I agree with you, this is unintuitive and could be very dangerous. I wasn’t even aware that QGC would send terrain data that affects the home altitude, I would instead expect the GPS altitude would be used to set the home altitude upon takeoff. Can you open an issue ticket on PX4 github so we can trac kthis? Any way to reproduce so that we can get it patched? A PR to fix the bug would be even better.

This looks like an interface issue between QGC and PX4. I will open a PX4 github issue. A PR is beyond me at the moment !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.