MAVLINKHUD

Overview

The STAT parameter group configures the Flight Statistics tracking system. This system acts like an odometer for your drone, recording total flight time, number of boots, and total runtime across the life of the vehicle.

These values are stored in non-volatile memory and persist across firmware updates.

Key Concepts

1. Lifetime Tracking

  • STAT_FLTTIME: Total accumulated time the vehicle has been in the air (seconds).
  • STAT_RUNTIME: Total time the flight controller has been powered on.
  • STAT_BOOTCNT: Number of times the flight controller has been rebooted.

2. Resets (STAT_RESET)

Allows the user to clear the statistics (e.g., after a major rebuild or when selling the airframe).

  • Magic Number: Usually requires a specific value to be written to prevent accidental resets.

Parameter Breakdown

  • STAT_FLTTIME: Total flight time (seconds).
  • STAT_BOOTCNT: Boot counter.

Developer Notes

  • Library: libraries/AP_Stats.
  • Persistence: Statistics are saved to the "Parameter Storage" area periodically and on disarm.

STAT_BOOTCNT: Boot Count

Description

Number of times board has been booted.

Values

  • Default: 0

Description

This parameter serves as a persistent odometer for the flight controller hardware.

  • Function: Every time the board powers up or reboots, this counter increments by 1.
  • Usage: Useful for tracking the age of the board and identifying if uncommanded reboots (watchdog resets) have occurred during a mission or between flights.
  • Reset: Can be reset by setting STAT_RESET to 0.

STAT_FLTTIME

s
Default 0

STAT_FLTTIME: Total FlightTime

Description

Total FlightTime (seconds).

Values

  • Units: s
  • Default: 0

Description

This parameter tracks the cumulative time the vehicle has been "flying" (armed and active).

  • Function: It increments whenever the vehicle is armed and in a flying state.
  • Persistence: This value is saved to storage and persists across reboots.
  • Maintenance: Useful for scheduling maintenance intervals (e.g., motor bearing checks every 50 hours).

STAT_RESET

s
Default 1

STAT_RESET: Statistics Reset Time

Description

Seconds since January 1st 2016 (Unix epoch+1451606400) since statistics reset (set to 0 to reset statistics, other set values will be ignored).

Values

  • Units: s
  • Default: 1

Description

This parameter holds the timestamp of the last time the flight statistics (STAT_BOOTCNT, STAT_FLTTIME, STAT_RUNTIME) were reset.

  • How to Reset: To clear all accumulated statistics, manually set this parameter to 0. The autopilot will then reset the counters and update this parameter to the current system time.
  • Format: The value is the number of seconds since Jan 1st, 2016.

STAT_RUNTIME

s
Default 0

STAT_RUNTIME: Total RunTime

Description

Total time autopilot has run.

Values

  • Units: s
  • Default: 0

Description

This parameter tracks the total cumulative uptime of the flight controller, regardless of whether it was flying or just sitting on the bench.

  • Function: Increments continuously while the board is powered on.
  • Persistence: Saved to storage and persists across reboots.
  • Usage: Can be used to estimate total system life or debug "time since first power on" issues.