ArduPilot simpleRTK2B+heading configuration

Ardupilot yaw

Looking at the official Ardupilot forum we found many users having problems configuring their simpleRTK2B+heading kit with their ArduPlane / ArduCopter / ArduRover software.
After some testing we prepared this tutorial to make the process easier.

Important things before start:

  • This tutorial is based on the simpleRTK2B+heading Basic Starter Kit, if you have a different hardware you may need to apply some changes in this tutorial.
  • The configurations files (see Step 2 and Step 3) for the GNSS receivers will set them at an output rate of 10Hz, with UBX-RELPOSNED and UBX-PVT sent to the autopilot.
  • simpleRTK2B (big board) acts as a rover in the moving base configuration
  • simpleRTK2Blite (small board) acts as a base in the moving base configuration
  • We have validated the tutorial with these autopilots:
    • Holybro Pixhawk4
    • mRo Pixhawk Flight Controller (aka Pixhawk 1)
  • We have validated the tutorial with these firmware versions:
    • ArduRover 4.1.0-dev
    • ArduCopter 4.1.0-dev
    • ArduPlane 4.1.0-dev
  • Ardupilot programmers introduced restrictive conditions to let your autopilot use GNSS based heading, here a few of them:
    • You need good RTK fix so it is mandatory to place both antennas in a good location (outdoors, no trees, no high buildings around).
      If you try to follow this tutorial inside your house with the antennas close to your window, it will not work.
    • Place both antennas 1m away of each other (I will use this distance later, you can change it but should be >30cm and <5m).
      If you place the antennas next to each other, it will not work.
      Place the antennas in the X axis of your rover (forward direction). You can change this later.
    • Place both antennas in a plane parallel to your autopilot plane (i.e. if your autopilot is horizontal, place both antennas at the same height above ground).
      If the antennas are not placed at the same height level with respect your plane/rover/copter, it will not work
  • Do not connect the GNSS receivers with the autopilot yet, we will configure everything independently and connect everything afterwards

Step 1: load simpleRTK2B (aka big board) configuration

  • Connect the simpleRTK2B to your PC via the POWER+GPS microUSB connector
  • Run u-center and connect to the receivers
  • Go to Tools > Receiver Configuration … > Select configuration file simpleRTK2B_FW113_HeadingKit_Rover_10Hz_Ardupilot.txt
  • Click Transfer file -> GNSS
  • Go to View > Messages View > UBX > CFG > CFG > Select Save current configuration and click Send button

Step 2: load simpleRTK2Blite (aka small board) configuration

  • Make sure the simpleRTK2Blite board is mounted on top of the simpleRTK2B board
  • Connect the simpleRTK2Blite to your PC via the POWER+XBEE microUSB connector
  • Run u-center and connect to the receivers
  • Go to Tools > Receiver Configuration … > Select configuration file  simpleRTK2B_FW113_HeadingKit_MovingBase_10Hz_Ardupilot.txt
  • Click Transfer file -> GNSS
  • Go to View > Messages View > UBX > CFG > CFG > Select Save current configuration and click Send button

Step 3: load configuration file
Since the firmware versions may be different to yours, here is a list of all the parameters modified with respect to the default configuration:

COMPASS_ENABLE,0
COMPASS_USE,0
COMPASS_USE2,0
COMPASS_USE3,0
EK3_MAG_CAL,5
EK3_SRC1_YAW,2
GPS_AUTO_CONFIG,0
GPS_AUTO_SWITCH,0
GPS_POS1_X,-1.25 *This value must contain the distance in meters between antennas. Change sign if heading has a 180deg offset (or swap SMA connectors in simpleRTK2B+heading).
GPS_PRIMARY,1
GPS_RATE_MS, 100
GPS_RATE_MS2, 100
GPS_TYPE,0
GPS_TYPE2,18
SERIAL1_BAUD,115
SERIAL1_OPTIONS,0
SERIAL1_PROTOCOL,5

Step 4: reset your autopilot

  • After saving all the parameters make sure you remove the power from your autopilot

Step 5: connect the heading kit to your autopilot

  • Use the JST connector on the simpleRTK2B (big board) and connect it to the Telem1 port.
  • Power the autopilot and check the AHRS heading value, it should match the direction between your antennas.
  • As an additional check to see if it is working, the heading value of the AHRS should be the same as the one in CTRL+F > MAVlink inspector > GPS2_RAW > yaw
  • Notice that the EKF will take into account the gyroscope readings so if you turn the autopilot without turning the whole vehicle frame where the antennas are mounted the heading will change, although after a few seconds it will go back to the GNSS calculated heading.
Ardupilot ardusimple heading check

Again, remember if:

  • Fix type is not RTK fix
  • Antenna distance is not within 20% of the GPS1_POS_X parameter
  • Autopilot attitude does not match antenna height difference

The GNSS based yaw will not work properly.