Tuesday, January 21, 2020

Using ATGM336H GPS+BDS module with RC quadcopter drone in betaflight firmware

Recently I was in search of light and compact GPS module for my 3" build. I was looking for a replacement for go-to BN-180 module I usually use in my 5" copters. BN-180 is cheap Chinese drop-in replacement for UBLOX modules which is natively supported by Betaflight and works with GPS and Russian GLONASS. Basically, you solder it to your drone, hit "Auto config" in Betaflight configurator' GPS section and you good to go - no hustle with u-Center software required.
After some digging on Aliexpress I was buying ATGM336H-5N which works with both GPS and Chinese navigation constellation Beidou, for around 9 USD. I was hoping that it would be the same story as with UBLOX/BN-180 in configuration prospective. But when I've got the board and put it into the vehicle, she didn't recognized a thing. After some unfruitful googling (seems nobody uses ATGM336 in RC hobby) and playing with configuration I found that firmware at least start seeing module when I switch protocol from default UBLOX to NMEA. Further research revealed that despite module is capable 10 Hz position reporting (which is prerequisite for RTH functionality to work), module is in 1 Hz mode.

I haven't found any guide written in English on how to change settings for this GPS receiver to switch it into 10 Hz to use with with Betaflight, but finally managed to make it working. I'm putting down steps here if you want to do the same.
  1. You could get original GnssToolKit3 software on GitHub.
  2. By default software could start in Chinese, but you could switch that in the menu:

    After changing language settings, exit the application (do not run it again for the time being).
  3. You should have serial connection established with GPS receiver, therefore you should either use dedicated USB-TTL adapter based on CP2102, FTDI or any other alike, or have it connected to your flight controller board (FC) with Betaflight flashed. Connection should be done as following:

    FC/USB-TTL GPS module
    5V VCC
    TX RX
    RX TX
    GND GND

     ATGM336H-5N is 5V tolerant, so you safe to use either 3.3V or 5V supply/logic.
  4. If you use USB-TTL, you may need to install drivers (CP2102, FTDI):
    1. Connect adapter to USB port.
    2. Remember/write down COM port number.
    3. Go to the step 5.
    If you're connected via FC, you need to enable serial pass-through in Betaflight:
    1. Connect FC to USB.
    2. Open Betaflight Configurator (you also may need ImpulseRC driver fixer)
    3. Connect Configurator software to board (remember or write down COM-port number, this is important).
    4. Go to the CLI (bottom-left on the screen).
    5. Input serialpassthrough 5 9600 where 5 is your COM port number minus one (I have FC at COM6).
    6. Disconnect Betaflight Configurator from the board by pressing button in the upper-right corner of the software.
  5. Run GnssToolKit3.exe again.
  6. Select the COM port you have your USB-TTL/FC connected to.
  7. Select View - Configuration
  8. In NMEA section select PCAS01 and change baud rate to 112500, then Send, then Save at the bottom of the screen.
  9. Select PCAS02, select update rate 10Hz, Send and Save again.
  10. Disconnect from receiver and exit the application.
  11. The last thing to do left is open Betaflight Configurator, and in Configuration section tell FC to use NMEA protocol at 112500.

5 comments:

  1. Maybe you arent around anymore but i am looking at the same module. Did you have any issues with the satellite reception, did it work ok in your quad? Did you manage to weigh the module before you added it? Wondering if its less than the BN-180, since it looks a lot smaller...

    ReplyDelete
    Replies
    1. Anyway, i decided to take a chance and bought one myself. The steps here were great for getting it set up (havent connected it to a quad yet, but it is communicating at 115200bps with an update rate of 10hz). But it weighs 4.3g with the antenna, which is 3g on its own. So it is about 1g lighter than the BN-180. Still waiting on it to get its first fix, its been a few minutes now, seeing one or two satellites but also, i am in my apartment so it only has a very small window to see the sky out of.

      Delete
    2. Went out, came back, lots of satellites in view and a good lock. Disconnected power, reconnected and it regained the lock within seconds. Next step is to get it mounted in a quad to see how it performs. I like the external antenna, gives more mounting options, though its longer than i need it to be

      Delete
  2. This site helps to clear your all query.
    This is really worth reading. nice informative article.
    allahabad university bsc 3rd year Result
    allahabad university bsc 1st year Result

    ReplyDelete