ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Connecting two GPS on VOXL2

    VOXL 2
    2
    16
    384
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by

      @Eric-Katzfey Thank you for the update. Any quick guide for software configuration which you can suggest for this dual gps setup? My hardware connections would be as follows :

      • GPS1 on VOXL2 J19 pins 1 to 6 (UART and I2C for GPS and Mag)

      • GPS2 UART over J18 (Modalai ESC port) and I2C over J19 pins 7 and 8.

      • I have VOXL2IO also integrated over J19 10,11 and 12 number pins.

      By this configuration I can ensure all UART and I2C connections are going to DSP directly.
      Here are my queries :

      • With above mentioned connections I would have to change QUP settings in firmware I guess. Can you mention those places?

      • Can I follow this link to enable dual GPS as per PX4 mainline or is some other settings would be essential for dual GPS enabling over ModalAI PX4 version?

      Eric KatzfeyE 3 Replies Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @Guest
        last edited by

        @Aks Those connections look reasonable. Let me do a little digging to see what would be required to use pins 7 and 8 on J19 for the new magnetometer.

        1 Reply Last reply Reply Quote 0
        • Eric KatzfeyE
          Eric Katzfey ModalAI Team @Guest
          last edited by

          @Aks I looked through the code and I don't see any obvious roadblocks to using pins 7 and 8 on J19 for the second magnetometer. The current magnetometer driver uses -b 1 to specify the i2c bus on pins 4 and 5 of J19. For pins 7 and 8 I think you would need to specify -b 4. I'll try to wire something up and try it on those pins in the next couple of days.

          1 Reply Last reply Reply Quote 0
          • Eric KatzfeyE
            Eric Katzfey ModalAI Team @Guest
            last edited by

            @Aks I hooked up a magnetometer to pins 7 and 8 and it didn't work. But I found the issue in PX4 and was able to get it working by changing a couple of files. Here is the required diff:

            voxl-px4-1.12/px4-firmware$ git diff
            diff --git a/boards/modalai/rb5-flight/src/board_config.h b/boards/modalai/rb5-flight/src/board_config.h
            index d205d7b124..479fb95652 100644
            --- a/boards/modalai/rb5-flight/src/board_config.h
            +++ b/boards/modalai/rb5-flight/src/board_config.h
            @@ -54,7 +54,7 @@
             #define PX4_I2C_BUS_EXPANSION   3  // I2C3: J14 / Power
             #define PX4_I2C_BUS_EXPANSION2  9  // I2C9: J15 / Radio Receiver / Sensors
             
            -#define PX4_NUMBER_I2C_BUSES    3
            +#define PX4_NUMBER_I2C_BUSES    4
             
             #define PX4_I2C_OBDEV_BMP280  0x76
             
            diff --git a/boards/modalai/rb5-flight/src/i2c.cpp b/boards/modalai/rb5-flight/src/i2c.cpp
            index ce4b99a20c..49e361a877 100644
            --- a/boards/modalai/rb5-flight/src/i2c.cpp
            +++ b/boards/modalai/rb5-flight/src/i2c.cpp
            @@ -36,6 +36,7 @@
             constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
                    initI2CBusExternal(1),
                    initI2CBusExternal(2),
            +       initI2CBusExternal(4),
                    initI2CBusInternal(5)
                    //initI2CBusExternal(3),
                    //initI2CBusExternal(9),
            
            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by A Former User

              @Eric-Katzfey Thank you for this information. I highly appreciate this. How about using J18 for GPS UART? What changes would be essential for this? Also any idea about EKF configuration for using dual GPS?

              Eric KatzfeyE 2 Replies Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @Guest
                last edited by

                @Aks Should be no problem using J18 for GPS instead of ESC.

                1 Reply Last reply Reply Quote 0
                • Eric KatzfeyE
                  Eric Katzfey ModalAI Team @Guest
                  last edited by

                  @Aks We've never done a dual GPS configuration so not sure what is required for PX4.

                  1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User
                    last edited by

                    @Eric-Katzfey All the points noted. Thanks alot for all the detailed digging into this. I would try out this configuration. One point which I missed is, In order to connect GPS to J18 UART, we need to change some port number / QUP number right? If you can clarify this it would be great.

                    Eric KatzfeyE 1 Reply Last reply Reply Quote 0
                    • Eric KatzfeyE
                      Eric Katzfey ModalAI Team @Guest
                      last edited by

                      @Aks Unfortunately, there seems to be a bug in the handling of options in the gps driver. The standard uart ports are 2 for the ESC (J18), 6 for the GPS (J19), and 7 for RC (Also on J19). The default port in the gps code is 6. You should be able to pass a different port to the gps driver using the -d option. However, px4_getopt in gps.cpp isn't parsing it if I pass it a different port with the -d option. In fact, you can see that the Holybro gps start line includes -d 7 and -b 115200. The code seems to parse the baudrate fine but not the port which is a good thing because port 7 is for RC, not GPS! Anyways, long story short, in order to put the gps on port 2 you would need to figure out why the gps driver is not parsing the d option correctly first.

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by

                        @Eric-Katzfey Cool thank you. This gives me some lead to think on. I will debug this further. One small query. Can I run two gps driver with different 'd' options from config file or their can be conflict of same name services running? Just checking for clarity.

                        Eric KatzfeyE 1 Reply Last reply Reply Quote 0
                        • Eric KatzfeyE
                          Eric Katzfey ModalAI Team @Guest
                          last edited by

                          @Aks You should be able to run two. But, again, we have never tested.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Powered by NodeBB | Contributors