Skip to content

Dropix Pixhawk Integration

klopezal edited this page Jun 29, 2016 · 15 revisions

Dropix/Pixhawk

Drotek has added some modifications to RTKLIB so its output is compatible with Dropix/Pixhawk. SMARTNAV RTK can be directly plugged to Pixhawk's GPS port using a DF13 cable (included in our package, otherwise here).

drotek-smartnav-rtk-iris-pixhawk-dropix-integration

Configuration for rover :

drotek-smartnav-rtk-iris-pixhawk-dropix-integration2

"ubx" type has been added by Drotek, code is available in our GitHub here. Port ttyMFD1 is dedicated to serial output, it is multiplexed with U-Blox UART output, so the system can also work as a "classical" GPS. This way, whenever corrections from a base are available, a precise position is computed. Otherwise, the Edison is completely bypassed.

Pixhawk/Dropix work at 5 Hz (this parameter sets the frequency at which the RTK solutions will be calculated) and at a baudrate of 38400 (important for multiplexing) :

drotek-smartnav-rtk-iris-pixhawk-dropix-integration3

Be aware that your flight controller might not configured to react to such precision. You might need to tune your PIDs for that. Generally increasing I and P helps reducing static error, but this has to be done very gently in order to avoid instabilities.

You might also work on other parameters such as :

  • INAV_TC_XY : time constant for GPS and inertial measurements mixing
  • EKF_POS : Kalman filter parameters for position estimation
  • EKF_VEL : Kalman filter parameters for velocity estimation

It might happen that when base signal is lost or recovered GPS error is triggered. This is because flight controller will see a sudden drop in number of satellites, a sudden change in HDOP or a position offset. It is completely harmless as positions will still be output from the board, either from the Edison or from U-Blox chip.

Mission Planner/MAVLink integration

Differential data from base station can be encapsulated in MAVLink protocol to avoid using two separate links between GCS and the UAV. First, base is configured for TCP server function that streams raw data on port 2424. Base can also be connected to GCS with a UART/USB converter.

Drotek SMARTNAV RTK Mission Planner MAVLINK 1

The computer running Mission Planner must then be connected to base's Wifi network. Connect your Pixhawk/Dropix to SMARTNAV (with DF13 or JST only) as usual, using the telemetry. Once connected, press Ctrl + F and select the Inject GPS function.

Drotek SMARTNAV RTK Mission Planner MAVLINK 2

Then select TCP Client and click Connect :

Drotek SMARTNAV RTK Mission Planner MAVLINK 3

Enter the IP adress (192.168.42.1 if connected to SMARTNAV's Access Point) :

Drotek SMARTNAV RTK Mission Planner MAVLINK 4

And then port number (2424 in this example) :

Drotek SMARTNAV RTK Mission Planner MAVLINK 5

This function will forward differential data to flight controller's GPS TX port. In SMARTNAV 1.2.6, this port is directly multiplexed to the Edison (in previous versions, multiplexors are controlled by one GPIO only, so when the code switches to "classical" mode, differential data is no longer received by the Edison. However this issue can be solved by changing the cable). That means that all corrections will pass exclusively through DF13 or JST cables, without the necessity of adding another datalink or cable.

SMARTNAV is configured to receive data from the USB port by default. So the paramater inpstr2-path needs to be changed in rover's WebConsole :

Drotek SMARTNAV RTK Mission Planner MAVLINK 7

MFD1 is Edison's UART1 (the one connected to DF13 and JST) and the baudrate of 38400 must correspond to outstr1-path (baudrate at which flight controller receives GPS data). Once everything is set correctly you should see the DGPS flag in the HUD :

Drotek SMARTNAV RTK Mission Planner MAVLINK 6

This has been achieved with ArduCopter 3.4.

U-Blox protocol resolution

Flight controllers use UBX-NAV-POSLLH and UBX-NAV-SOL messages in order to get position from the GPS. Position is encoded in 4 bytes, that means that maximum resolution can be up to 7 decimals in latitude/longitude and up to millimeters in height.

UBX_PROTOCOL_RESOLUTION

As shown in the picture above, this means that globally U-Blox protocol resolution is centimetric.