Pixhawk Cube changing GPS altitude to barometer altitude without indication

It will depend on how you have this setting:
GPS_AUTO_SWITCH
https://ardupilot.org/copter/docs/parameters.html#gps-auto-switch-automatic-switchover-setting

Please correct me if I’m wrong, but I think this parameter is used to determine which GPS to use in case the primary GPS fails. My question is more on how to tell the autopilot which GPS to use as primary.

I think if you set:
GPS_AUTO_SWITCH,0 you’ll be using the first GPS
GPS_AUTO_SWITCH,3 you’ll be using the second GPS
and
GPS_AUTO_SWITCH,1 or 2 for Best or Blend

I’d probably set
GPS_AUTO_SWITCH,1 for Best and you’d be always using your highest quality GPS unless it fails

As far as I know you can’t set altitude (Z axis) and positioning (X,Y) to be derived from different GPS units. That would be very custom programming.

Thanks your explanation.

The way I read it, is a bit different. For example, if set to “3”, it would use GPS2 and switch to 1 if 2 fails.

In the description it says:

“Automatic switchover to GPS reporting best lock”.

So by setting this parameter, you determine how to switch, not which one to use by default. It doesn’t say which GPS is default.

But I must admit, I’m very confused.

@tridge Sorry to bother you, can you please shine some light on this?

The problem I see here is this:

2 GPS units do not report the same altitude. I know this from experience and it can be quite significant. So if I start and ARM, my home altitude is set to zero, using for example GPS1.

If, during flight, GPS2 reports a better lock, it will switch to GPS2 and consequently use the altitude from GPS2 as well. Which can be very different from GPS1.

So actually I would like to set a primary GPS, and only allow switchover in case the primary fails.

1 Like

@Eosbandi, @UAVSkies, @Corrado_Steri, @Verloop , @tridge, @Naterater.

Hi,
below there is a test result of two different GPS receiver; NEO-M9N and ZED-F9P. I think this result correlates earlier conclusions about GPS drifting.

During the test GPS receivers were standing still. Correct altitude was 8,50 meter.

NEO-M9N was tested 2 hours and altitude drifting is almost 30 meters.

ZED-F9P was tested 9 hours and altitude drifting / fluctuating is much less.

Sorry but without background info these two sets of data is not understandable. Location, sky view, satellite count, gnss configuration and raw data needed to interpret the data correctly. How long let you the gps to gather location, was it a clear sky view ? What kind of antennas did you use ! It is raw gps data or EkF data ?..

1 Like

Agree on everything @Eosbandi said. Also, was F9P linked to a cors? (i doubt since the error is pretty big).

I think what Darad means is trying to show a trend. And he did mention 2 hours.

A stationary gps location is not as accurate as a moving. But it does show there is a difference in gps a and gps b.

I do agree there should be a little bit more information on the setup, but it definitely proves a point.

Some time ago I recall discussion on implementing a ‘differential’ barometric altitude system where a barometer attached to the GCS would be used as a reference and the data sent to the vehicle to better allow for environmental changes in pressure. This still would not be as accurate as RTK GPS but would be much cheaper to implement if the the goal was just to increase height accuracy…

Some test data is in “GPS receiver tests” folder. There you can see results from three different GPS receiver NEOM8N, NEOM9N and ZED-F9P. There is also short description file about data protocol and test setup.

Some quick answers below

Location: Residential area of Finland / Oulu
Sky view: Good. GPS receivers top of a roof.
Setup Installation : GPS receivers were standing still on the roof as a stand alone system. No base-station corrections for the GPS position data

For some more info, see raw data sets and description.txt.

For me the interesting point was to realize what kind of drifting there can be. Like many people has mentioned: Use L1/L2 dual frequency GPS receiver if possible.

Is EK2_ALT_SOURCE set to 2 as the parameter for switching to GPS altitude?

Hi,

I just make a general answer to this whole topic from my side.

Our solution was to use Zed F9P GPS and good antenna with 30+ satellites (GPS, Glonass, Galileo and Beidu).

We dont use barometer anymore for fying, we just use better GPS unit, just like some people here adviced me.

Here 2 and Here 3 GPS units are not accurate for reliable realtime altitude info, according to my field experience. That was surprising to me.

After all Im pleased about the converstion here about this topic. We solved the alt problem so far and now our planes fly much more reliable now.

Hi, I see this problem on the stock firmware of the arducopter on the matek f765 . After fixing the home point, the barometer altitude is replaced with the GPS absolute altitude. It is not right. Everything is fine on the Arduplane firmware. I attach the log https://drive.google.com/file/d/17Y_-Rx7zVloooAIWIQMWaiPbSHCPYn_0/view?usp=sharing
video https://drive.google.com/file/d/1uAlp4GWxpgH8XhlpvvV1YYEUZ1t4Isq0/view?usp=sharing

2 Likes