Not getting GPS satellite lock? Takes a long time to get a 3D fix? Here’s how I change configurations in my GPS modules to improve GPS performance on my FPV drones. If you are having the same issue you can give it a try.
Just to give you an idea how much improvement it gave me, I did it on one of my 5″ with BN220 GPS.
Before this mod, I used to get a 3D fix in around 2 minutes, with a maximum satellites of 14. After applying the settings described in this post, I now get a 3D fix in around 1 minute, with a maximum satellites of 23 (with VTX antenna blasting 1200mW 3cm on top of it!). I also used to get 0 satellite lock inside the house, now I get 8-10 on a good day!
Disclaimer: oscarliang.com is not responsible for any loss or damage caused by following instructions on this page, your use of the information on this page is at your own risk.
There are affiliate product links in this post, it doesn’t cost you extra but gives me a small commission when you buy from these links. It helps to keep the website going.
If you don’t want to go through any of these non-sense, just get a new GPS with M10 chip, they perform exceptionally well out of the box compared to M8 chip based GPS like the BN220 and BN880. Here is some testing I’ve done: https://oscarliang.com/gps-review-1/
Table of Contents
Which GPS Receiver?
You can configure the Beitian BN220 and BN880 using u-center. BN880 is larger, heavier and more expensive, but it has a built-in compass. Betaflight doesn’t require a compass, so BN220 is generally good enough.
Buy the Beitian BN220 here:
- AliExpress: https://s.click.aliexpress.com/e/_DENus9Z
- Banggood: http://bit.ly/2nD6QxP
- Amazon: https://amzn.to/3Xelr1F
Buy the Beitian BN880 here:
If you want to configure your GPS, then the BN180 is a no-go as it doesn’t save configuration changes due to the lack of flash memory.
The software used to program GPS modules is called u-center. For GPS with M8 chips (such as the BN220 and BN880), we need V22.07 (NOT the V2).
Download here: https://www.u-blox.com/en/product/u-center
You will need an FTDI adapter to program the GPS module, it’s only a few bucks.
Buy an FTDI adapter here:
You can use your flight controller to program your GPS (more later), but you can’t change baud rate. I still recommend getting an FTDI adapter, it’s a versatile and useful tool to have around. You can also use an Arduino board loaded with custom code, but it’s more complicated than using a plug-and-play FTDI adapter. Feel free to google it I won’t go into detail here.
The cable that comes with the BN-220 is plug and play with the FTDI adapter, no soldering required. If you need this cable, you can make it yourself with pre-crimped JST SH1.0 wires: https://amzn.to/3HFWXI8
The connections are:
- 5V to 5V
- GND to GND
- TX to RX
- RX to TX
Make sure to set the jumper to 5V in the FTDI adapter.
Open Device Manager in Windows and pay attention to Ports (COM and LPT). As you connect the FTDI to your computer via USB cable, a new COM port should appear.
Generally, you shouldn’t need to worry about driver if your computer is already working with your flight controller, which means driver is already installed. But if driver is needed, you will see a warning sign icon on that COM port.
Connecting GPS in U-Center
Open u-center, click “Receiver” and enable Autobauding.
In the same dropdown menu, click the first option “Connection“, and select your FTDI COM port. If it works, the connection icon on the top left should turn green. On the bottom, u-center will update the type of GPS chip, COM port, Baudrate and which protocol (NMEA or UBLX) it’s using at the bottom of the screen.
One way to know if the GPS is connected successfully, is to check this window if you are getting any data through. If not, wait a minute, if still nothing, try a different baud rate and check your wiring.
Backup and Restore Configurations
Make sure you backup your current GPS configurations before making any changes, if anything goes wrong you can go back.
Go to Tools, Receiver Configuration.
To backup, select a location to save the file and click “Transfer GNSS -> File“. A new window will pop up to show progress, ignore errors “message rejected” which is normal.
To restore configuration, go to Tools, Receiver Configuration, select the configuration file that you want to restore, and hit “Transfer file -> GNSS“.
If you have multiple GPS modules, you can also save the optimized configuration and just apply it to all of your GPS without repeating the whole process.
How to Save Configuration Changes
To see all the GPS options you can change, go to “View“, and “Configuration View“.
On the left hand pane are all the GPS settings, and on the right are the option values and parameters for that setting.
To save changes you made permanently, involves two steps:
- After you change a setting, click “Send” at the bottom of the screen. However this will only save it temporally.
- To permanently save the changes, you have to also go to “CFG (Configuration)“, then select “Save current configuration“, and click “Send” again.
Why is this?
The initial “Send” will apply the change to the GPS, however it’s not yet written to the GPS memory (non-volatile RAM, aka NVRAM), so when you restart the GPS (power cycle), all changes will be lost and revert to the original setting. Only when you go to CFG, select save current configuration and send, will write the changes to the NVRAM. This feature allows you to test settings without bricking your GPS.
The settings we want to change are:
- Baud Rate
- Refresh Rate
- Satellite Constellations
- Power Mode
Maybe your GPS already comes with optimal settings, in which case you don’t need to change it.
GPS modules might be pre-configured for different applications by the manufacturer, therefore you might want to do a factory reset before playing with the config. It’s up to you.
Go to View -> Configuration View, select “CFG (Configuration)” on the left, select “Revert to default configuration” on the right, and press “Send” at the bottom. This will restore the factory settings to your GPS (written to NVRAM), but you can always restore the original settings that I showed you how to back up earlier.
Go to “PRT (Ports)” in View -> Configuration View.
Select the following options:
- Target: 1- UART 1
- Protocol in: 0+1+2 UBX+NMEA+RTCM2
- Protocol out: 0+1 UBX+NMEA
- Baudrate: 57600
Then click on SEND at the bottom left of the window. Do not save it to NVRAM yet!
Since you have changed baud rate from 9600 to 57600, u-center is no longer communicating with the GPS. If you try to save this setting to NVRAM now, it won’t work (after a power cycle it will revert to the previous value 9600). You must disable “Autobauding” in the Receiver dropdown menu, and change your connection baud rate in u-center to 57600 before saving configuration to NVRAM.
Betaflight supports the following baudrate: 9600, 19200, 38400, 57600, 115200. A higher baudrate is required for faster refresh rate we want to increase later. Generally, setting baudrate to 57600 is enough for 5Hz refresh rate. Some even use 115200 with 10Hz refresh rate, but 5Hz and 57600 works great for me.
Increasing refresh rate will increase power consumption and use more resources in the GPS module. The default is 1Hz, but we can increase it to 5Hz for more frequent update.
Go to View -> Configuration View -> RATE (Rates).
Change the “Measurement Period” value from 1000ms to 200ms, it will update the “Measurement frequency” from 1Hz to 5Hz. Now save it to NVRAM.
You should also notice the blue LED on your BN220 flashes faster (5 times a second instead of once per second).
Adding Galileo Constellation
The M8 chip is capable of receiving signal from several constellations of satellites, including:
- GPS (USA) – 31 Satellites
- GLONASS (Russia) – 23 satellites
- GALILEO (Europe) – 24 satellites
- BEIDOU (China) – 44 satellites
You can select up to 3 systems, and usually Galileo isn’t enabled by default, so we want to use that to increase the number of satellite we can see.
Go to View -> Configuration ->GNSS (GNSS Config), and apply these settings. This is the config that came with one of the BN220 and it works really well (much better than others that weren’t using the same settings), so I just continue to use these settings on all my GPS.
Basically just check everything under Configure, under Enable uncheck Beidou, IMES, QZSS, and check everything under Signals. set the number of channels to use to 32.
The default power mode is set to “Balanced“, I prefer to set this to “Full Power“! I suppose it will use more power but it would be negligible for our drones since GPS uses very little power compared to the motors :)
Dynamic Platform Model
The different dynamic platform model settings adjusts the navigation engine for different applications. The settings improve the receiver’s interpretation of the measurements and thus provide a more accurate position output. Setting the receiver to an unsuitable platform model for the given application environment is likely to result in a loss of receiver performance and position accuracy.
In Nav5 (Navigation 5) => Dynamic Model, select “0 – Portable”, which supposedly has better accuracy than the Betaflight default (Airborne <4g).
Saving Optimized Config
Make sure you have written the settings to the flash memory as described in here.
Then save the optimized configuration as a file by going to Tools => Receiver Configuration. Enter a file name such as “BN220-optimized.txt”. Click the option “Transfer GNSS -> File“.
After you have finished setting up your GPS receiver, disconnect it by either clicking on the green connection icon on the top left, or the disconnect option in the Receiver menu before unplugging the USB cable or disconnecting the GPS from the FTDI adapter.
Betaflight GPS Settings
After configuring your GPS, you need to make some small changes in Betaflight.
- Set protocol to UBLOX
- Disable “Auto Baud” (in Configuration tab)
- Set the Baudrate to 57600 (in Ports tab)
- Enable “Use Galileo” (in Configuration tab), for older Betaflight that don’t have this option in the GUI, you can enter this in CLI: set gps_ublox_use_galileo = on
Configurating GPS via FC
Once you’ve mounted the GPS in the drone, it’s not easy to remove it or change the wiring to use an FTDI adapter. Fortunately you can also use your flight controller to program it. You just need to connect the USB cable to the FC, no need to touch the wiring. However you won’t be able to change Baud Rate this way, but that’s fine if you have already optimized baudrate previously with an FTDI adapter.
Connect USB cable to FC. If the USB cable isn’t powering the GPS, then you have to plug in a LiPo to power the drone, but make sure to REMOVE PROPELLERS FIRST! And consider using a fan to prevent the VTX from overheating
Open Betaflight Configurator, and hit the Connect button, remember the COM port for your FC. Go to the CLI tab and enter this command, gpspassthrough (uart number -1) (GPS baudrate).
For example, if your GPS is connected to UART6 with baudrate 57600:
gpspassthrough 5 57600
In Betaflight 4.4, “gpspassthrough” has been removed, use the command “serialpassthrough” instead.
Close the configurator (click the cross at the top right) to free up the COM port for u-center to connect. Open u-center, connect the flight controller COM port and set baudrate to 57600.
When you disconnect the LiPo and USB cable, your FC will automatically quit serial passthrough mode.
Betaflight Auto Config Rewrites Settings
Thanks to “A” in the comment section who pointed out the fact that Betaflight actually rewrites some of our GPS config when auto config is enabled, so we should disable auto config. However you cannot simply disable it without making a “compatible” configuration.
To do this, you have to
- Export your optimized config
- Connect the GPS to Betaflight (so it will auto config your GPS), export the config again
- Compare the two files and see what Betaflight changed
- We want to keep our optimized config and leave the rest the same as the Betaflight config
Here I will explain in a bit more detail.
Now that you have updated your GPS with optimized settings, connected the GPS to the FC (with Auto Config option enabled), Betaflight should have already overwritten your GPS config. That’s exactly what we want. Go back to u-center, and export the config file, give it a name like “BF-Autoconfig.txt”.
Now open the two config files we saved (optimized.txt and BF-autoconfig.txt), and do a compare (it’s a plugin in Notepad++), you can see exactly what settings Betaflight changed from our optimized config.
Copy all the lines starting with “CFG-MSG” from BF-autoconfig.txt file (the one that has been over-written by Betaflight) and replace them in our optimized config. Do not copy/replace any other lines!
Now back to u-center, and load this config file “optimized-final.txt”. Don’t forget to check the option “Store configuration into BBR/Flash” (or you could also go to CFG (configuration) and click the Send button there to save changes to the flash memory), otherwise your config will be lost when you power off the GPS.
Then disconnect the GPS and power off the quad.
We should now disable “Auto Config” in Betaflight GPS settings. But before we do that, make sure you disconnect the GPS from the flight controller so it doesn’t over-write our GPS again! Power cycle the flight controller.
You can now connect the GPS to the quad and check if it’s working by going to the GPS tab in Betaflight Configurator (also check the GPS icon on top).
That’s it. Let me know if this helped you get more satellites and faster lock. If you want you can always restore your original settings if you made a back up.