PX4 Firmware

Today (10.2.2019) the firmware for the PX4 is a custom build based on the 1.8.2 release. The firmware is maintained in the github repository:

SearchWing PX4 Firmware

This is a fork from the PX4 Firmware maintained by PX4 team. I have contributed two commits to the firmware which landed in upstream

The above changes to the upstream firmware are after the 1.8.2 release. I cherry-picked the above changes and applied them to the stable (1.8.2) branch. All changes for searchwing are maintained in the

which branched off the stable branch from upstream. The changes for the reduced Telemetry2 activity are missing.

The build command for the 1.8.2 based firmeware is

make px4fmu-v4_default

Note the missing “_” compared to the official build description. You can find out the possible build targets via

make help
make list_config_targets

The firmware is installed on the PixRacer via the QGroundControl Software. You have to select the “Custom Firmware File” that you find in the folder “Firmware/build”. The name of the firmware file is “px4fmu-v4_default.px4”.

Find out Firmware version

The SearchWing Firmware version is displayed in QGC as 1.8.2dev, i.e. the internal 1.8.2-1 or 1.8.2-2 is not shown directly. This can be done via the Mavlink Console. You can figure out the firmware version via

ver all

You can then compare the git hash.

Mag Sensor Setup

Make sure that only the mag sensor in the GPS Module is enabled. The two mag sensors in the pixracer should be disabled, because there is too much disturbance from the power cable below the autopilot. When the mRobotics GPS Module is installed with the arrow showing forward, then the mag sensor has a rotation of 90 Degrees Yaw (yes, this is strange). The parameters have to be setup like this

  • CAL_MAG0_EN=1 (Enabled)
  • CAL_MAG0_ROT=2 (Yaw 90 Degrees)
  • CAL_MAG1_EN=CAL_MAG2_EN=0 (Disabled)

After the mag setup is changed, the mag sensors have to be calibrated. If you see a “Mag Inconsistent Error” in QGC, then this setup is wrong.

  1. Export parameter from QGC (.params file)
  2. Compare with the concurrent or for a new plane with an already existing file in searchwing-config, e.g. with git diff
  3. Optional: Delete the not needed parameter and push the new file.
  1. Low Battery Failsafe:
    1. BAT_CRIT_THR = 0.1 (capacity [%])
    2. BAT_EMERGEN_THR = 0.05 (capacity [%])
    3. BAT_LOW_THR = 0.2 (capacity [%])
    4. COM_LOW_BAT_ACT = 1 (return mode)
  2. RC Loss Failsafe:
    1. COM_RC_LOSS_T = 5 (time to detect RC-loss [s])
    2. NAV_RCL_ACT = 0 (no action)
  3. Data Link Loss Failsafe:
    1. COM_DL_LOSS_T = 10 (time to detect datalink-loss [s])
    2. NAV_DLL_ACT = 2 (return mode)
  4. Geofence Failsafe:
    1. GF_ACTION = 3 (return mode)
    2. GF_COUNT = -1 (counter limit to detect geofence breach)
    3. GF_MAX_HOR_DIST = 3000 (max horizontal distance home-plane [m])
    4. GF_MAX_VER_DIST = 250 (max vertical distance home-plane [m])
  5. Return Home Settings:
    1. RTL_DESCEND_ALT = 100 (altitude to loiter above home [m])
    2. RTL_LAND_DELAY = -1 (no land, just loiter [s])
    3. RTL_RETURN_ALT = 100 (altitude to flight to home [m])
    4. RTL_TYPE = 0 (direkt path to home)
  6. Land Mode Settings:
    1. COM_DISARM_LAND = 1 (disarm after delay [s])
  7. Position (GPS) Loss Failsafe:
    1. COM_POSCTL_NAVL = 1 (assume no RC → Land Mode with heigt, Termination without)
    2. COM_POS_FS_DELAY = 5 (time to detect GPS-loss [s])
    3. NAV_GPSF_LT = 10 (loiter time to recover GPS [s])
    4. NAV_GPSF_P = 0 (loiter pitch [deg])
    5. NAV_GPSF_R = 15 (loiter roll [deg])
    6. NAV_GPSF_TR = 0 (loiter thrust [%])
  8. Mission Failsafe
    1. MIS_DIST_1WP = 1500 (max distance home-wp1 [m])
    2. MIS_DIST_WPS = 2000 (max distance wp-wp [m])
    3. Set both values to -1, if more than 10km are needed.
  9. Traffic Avoidance Failsafe
    1. NAV_TRAFF_AVOID = 2 (Return Mode)


  • Based on upstream 1.8.2
  • Added X-UAV Mini Talon Airframe
  • Git Hash: 1172edd2a093e614b9ca77bee753c19262295be3

searchwing-1.8.2-2 (27.2.2019)

  • searchwing-firmware.txt
  • Last modified: 2019/05/05 11:57
  • by j0ge4622