inav icon indicating copy to clipboard operation
inav copied to clipboard

Investigate what default should be used for SBAS - NONE or AUTO

Open iforce2d opened this issue 10 years ago • 64 comments

Attempting to use ground assistance in regions with poor SBAS coverage can cause many satellites to be ignored (all GLONASS sats and even many GPS sats too). In the worst cases, this can cause GPS fix to be abandoned completely.

http://www.rcgroups.com/forums/showthread.php?t=2495732&page=384#post34725614

Currently there is no option in the configurator to disable the ground assistance type used by the GPS receiver. It's either auto, or a specific SBAS region.

By doing set gps_auto_config=OFF in the CLI, it is possible to skip all GPS module settings, but this is not ideal for two reasons:

  1. Skipping GPS config does not disable SBAS, it just does not enable it (ie. if it was already enabled it will remain enabled)
  2. Skipping GPS config also skips all the setup necessary to use UBX protocol for most modules which use NMEA by default.

I think it would be great to have a 'Disable' option in the 'Ground assistance type' combobox in the configurator.

iforce2d avatar May 09 '16 13:05 iforce2d

Shame on me! I forgot about SBAS! The recent complaints about sat loss might in fact be related to ground assistance - since this is the only thing that does not get enabled when doing manual config and is enabled in auto.

digitalentity avatar May 09 '16 13:05 digitalentity

0037380fc0e09ef2600eb82626cd4dee79867953 allows to disable SBAS. Settings changed - those who had it set to AUTO will now get DISABLED.

digitalentity avatar May 09 '16 15:05 digitalentity

Thanks! From a backwards compatibility point of view I would be more inclined to add the new option at the end of the enum so that existing installs are not affected.

iforce2d avatar May 09 '16 16:05 iforce2d

I think disabling SBAS is the wrong approach and here's why:

After reading the wiki this is my understanding of SBAS: A few ground stations with known locations receives the GPS satellites and measures/figures out a few different errors in the GPS signal/position etc, then this information is sent to a SBAS satellite that then broadcasts this correction information that our multirotors can receive to get a more accurate position reading. Sounds like a good thing to have.

I have been playing around in u-center, i have plenty of both gps and glonass sats used, but when i get a lock to a SBAS sat, all my GLONASS sats becomes unused, so this is the "gps dropout" problem we'll been having.

But, i think i found a solution that lets us have the cake and eat it too! :)

In u-center, there is a setting for SBAS called "apply integrity information", with inav default this is enabled, but it's disabled with ublox defaults. When i disabled this, i no longer lost my GLONASS sats! I have been bench testing for more than an hour and i have around 15 sats all the time while having SBAS lock, even though my gps unit is close to my house. Yay!

I think the code here https://github.com/iNavFlight/inav/blob/master/src/main/io/gps_ublox.c#L143 Should be changed to this, please confirm this though since i had some issues with hex stuff in u-center

EDIT: Checksums are wrong here, do not use these lines!

    { SBAS_AUTO,  { 0xB5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xE5}},
    { SBAS_EGNOS, { 0xB5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x51, 0x08, 0x00, 0x00, 0x8A, 0x41}},
    { SBAS_WAAS,  { 0xB5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x04, 0xE0, 0x04, 0x00, 0x19, 0x9D}},
    { SBAS_MSAS,  { 0xB5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x02, 0x02, 0x00, 0x35, 0xEF}},
    { SBAS_GAGAN, { 0xB5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0xB2, 0xE8}}

the 8th number should be 0x03 instead of 0x07 as long as i got everything right... I guess the last two are some error checking

theArchLadder avatar May 09 '16 17:05 theArchLadder

To clarify: I think it would be wrong to have "SBAS disabled" as the default, I'm not against a "disabled" option even though i don't see any use for it with my fix...

theArchLadder avatar May 09 '16 17:05 theArchLadder

I fear you have forgotten to update the checksums, and the hex strings should be (according to my tacky little ub_chk script):

0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0xc9
0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x51, 0x08, 0x00, 0x00, 0x86, 0x25
0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x04, 0xe0, 0x04, 0x00, 0x15, 0x81
0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x02, 0x02, 0x00, 0x31, 0xd3
0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0xae, 0xcc

or in terms of the new branch settings:

 {{ /* SBAS_NONE */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x02, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0xc1 }},
 {{ /* SBAS_EGNOS */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x51, 0x08, 0x00, 0x00, 0x86, 0x25 }},
 {{ /* SBAS_WAAS */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x04, 0xe0, 0x04, 0x00, 0x15, 0x81 }},
 {{ /* SBAS_MSAS */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x02, 0x02, 0x00, 0x31, 0xd3 }},
 {{ /* SBAS_GAGAN */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0xae, 0xcc }},
 {{ /* SBAS_AUTO */  0xb5, 0x62, 0x06, 0x16, 0x08, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0xc9 }},

stronnag avatar May 09 '16 17:05 stronnag

Yay... no more broken landing gear on emergency landing? Cool! And by the way I also agree with @theArchLadder that disabling "integrity check" might be better than forcing SBAS disabled in AUTO configuration

DzikuVx avatar May 09 '16 18:05 DzikuVx

I just did a flight test, almost all my logs from before look similar to the first graph, thats a flight from yesterday, last two graphs are with the fixed setting i talked about here, looks great! I guess it's to early to call out victory from just one test flight, but this feels promising since i did the testing in u-center with the same result earlier today.

sat_plot_blackbox_log_2016-05-08_120202_endurance-1300mah 05 csv sat_plot_blackbox_log_2016-05-09_211918_sbas-fix 02 csv sat_plot_blackbox_log_2016-05-09_211918_sbas-fix 03 csv

theArchLadder avatar May 09 '16 19:05 theArchLadder

@theArchLadder, @stronnag thanks for figuring the new ubx sentences! I've also switched AUTO and NONE, existing setups won't be broken.

digitalentity avatar May 09 '16 22:05 digitalentity

I noticed that the defaults for these settings are to disable the test satellites and integrity information: defaults This is a good hint from the manufacturer that the best typical setting is to have these disabled. It might also explain why the dropping satellites behavior stopped for some users when they turned gps_auto_config off, because the Cleanflight config enables everything.

By the way, it's pretty easy to get the hex strings and checksums from u-center, no need to calculate them yourself. Here's the setting that Cleanflight has been applying until now - everything on hehehe... allenabled And here is the default setting according to the Ublox docs: integrityandtestsatsdisabled This is what @theArchLadder has suggested above, but with test satellites disabled as well. I'm about to test this now, will update later.

Side note: isn't it great to be able to discuss a single topic in one thread without dozens of different conversations going on, across hundreds and hundreds of pages? I can't stand the way threads are done on RCGroups, which is why I hardly ever post there despite having an account for a long time. And the other suggestion I hear about asking on the IRC chat is even worse, don't get me started. I think a dedicated Cleanflight forum is long overdue... anybody else agree?

iforce2d avatar May 10 '16 03:05 iforce2d

I tested with settings as in the last screenshot of my post above, but I think for my geographical location this is not ideal either. The problem is that when SBAS kicks in the quad will suddenly re-position itself. It usually only moves about 2-3m in the cases that I saw, but the movement is very sudden and 2-3m is further than the 1.5m or so range that it stayed within when I had SBAS disabled completely. Position hold did seem slightly better, but not significantly.

I guess it will depend on how spotty the SBAS signal is in your location and what you're using your multi-rotor for, but I think for my situation I'll stick with the SBAS_NONE setting to be safe.

iforce2d avatar May 10 '16 04:05 iforce2d

@iforce2d Yes, IIRC SBAS is used to improve absolute accuracy that is only relevant when doing autonomous flights (missions). For poshold and RTH we use relative positioning and SBAS probably won't greatly improve perfomance

digitalentity avatar May 10 '16 04:05 digitalentity

I wonder if we can upgrade to 3 settings for GPS nav model: LOW_G = Pedestrian (better GPS reception, suitable for slower drones) MED_G = Airborne<1G (a balanced setting) HIGH_G = Airborne<4G (top-end performance at cost of higher sat quality requirement)

digitalentity avatar May 10 '16 07:05 digitalentity

@digitalentity Good idea, but I would be very carefull with Pedestrian.

Atleast not default, and with warning that this is mostly for only flying in GPS assisted modes with limited speed.

There are multiple of us having fly aways with Pedestrian.

I know other flightcontroller have success with Pedestrian, maybe there is an issue with iNav how it uses the GPS data ?

oleost avatar May 10 '16 08:05 oleost

@iforce2d I use linux (archlinux) so i run u-center in wine and i have also tried it in virtualbox on window7. In the settings window there is a small button in the bottom row called "show hex toggle", but it's grayed out for me do i can't click it. So i can't get u-center to show me the hex codes... How do i get that to show?

@digitalentity Sounds good but IMHO LOW_G should not be the default because of the fly-away risk. I have not tried <1G yet...

@digitalentity Do you think we could bbox log the SBAS status?

I took a closer look at the log from the graphs i posted here before, and GPS height seems very accurate! I just happend to stand next to a lake that i know is 88 meters above sea level, and i was standing around 5 meter above that lake, and indeed, the GPS height shows 93 meters! It only logs at meter-precision, but it looks like GPS height follows baro height really well, i need to start logging GPS height at centimeter-precision... scrot_20160510-101834 I'm curious if the GPS can be used for althold when it has a good HDOP/sat count and SBAS...

EDIT: Would be awesome if someone could tell me where i change from meter to centimeter for gps height logging... EDIT2: is it just here? https://github.com/iNavFlight/inav/blob/master/src/main/blackbox/blackbox.c#L992

theArchLadder avatar May 10 '16 08:05 theArchLadder

@theArchLadder I'm using u-center via wine in Fedora linux and the hex toggle button just works, don't know how to help about that. I did notice though, that when the hex panel is hidden, you don't need the button to show it, you can just drag the divider upwards from the bottom of the window. I also noticed that if I drag the divider all the way down when the hex view is showing, it sets the hex view size as zero so that subsequently the button appears to have no effect - perhaps you did this earlier?

iforce2d avatar May 10 '16 08:05 iforce2d

@iforce2d The divider works as you say for "full form toggle" (left side panel), and i can just drag that back, but there is no divider at the bottom... Same thing in both wine and windows7. What version of u-center are you running? I use v8.20

As for your side-note from before: Yes i agree, this is much better than RCGroups. I like how we all helped in our own ways to solve this together, even though you made most of the work... This really show the beauty of open-source development :) I think this issue tracker should be used more, and with wider topics for discussing possible solutions/improvements... Not just "Solve this specific bug with this solution".

theArchLadder avatar May 10 '16 09:05 theArchLadder

@theArchLadder LOW_G (Pedestrian) won't be a default, it would be a user-selectable option. I also think we need better names for these LOW_G, MEG_D, HIGH_G. Ideas, anyone?

We don't collect SBAS or SV data from GPS unit for the sake of minimizing the jitter of GPS data - that's why we have detailed satellite information removed.

GPS altitude is used for AltHold in airplanes and it works rather well.

digitalentity avatar May 10 '16 09:05 digitalentity

Has anyone been able to find any information on how big the improvement in accuracy usually is with SBAS? How can i tell in u-center if my GPS is using SBAS or not...?

theArchLadder avatar May 10 '16 10:05 theArchLadder

@theArchLadder I'm using u-center v8.13. In one of the docking panels with status display of lat/lon, HDOP, 3D Acc etc there is a 'Fix mode' which should display 'DGPS' when the fix is currently using differential GPS.

I would be surprised if the SBAS improvement is any more than a few meters. I think to be sure about that you need a location for which you know the absolute real lat/lon, not as easy as you might think :)

iforce2d avatar May 10 '16 10:05 iforce2d