MAVLINKHUD

Overview

The RTC parameter group configures the System Clock management. Maintaining accurate UTC time is essential for logging, timestamping mission waypoints, and ensuring GNSS synchronization.

Since most flight controllers do not have a dedicated battery-backed clock chip, the autopilot must synchronize its time from external sources.

Key Concepts

1. Time Sources (RTC_TYPES)

Defines which sources the autopilot is allowed to trust to set the time.

  • Bit 0 (GPS): The most accurate source. Sets time once a 3D lock is achieved.
  • Bit 1 (MAVLink): Receives time from the Ground Control Station.
  • Bit 2 (Hardware): Internal clock chip (if present).

2. Timezone (RTC_TZ_MIN)

Allows setting a local time offset (in minutes) for the OSD or logging.

  • Note: Internal logs are always kept in UTC; this only affects displayed time.

Parameter Breakdown

  • RTC_TYPES: Bitmask of allowed sources.
  • RTC_TZ_MIN: Offset from UTC (minutes).

Developer Notes

  • Library: libraries/AP_RTC.

RTC_TYPES

Bitmask
Default 1
Range 0 7

Allowed sources of RTC time (RTC_TYPES)

Description

This parameter controls which external sources are trusted to set the autopilot's internal Real Time Clock (RTC). Maintaining accurate UTC time is essential for log timestamping and GNSS operations.

The Mathematics

Bitmask.

The Engineer's View

Defined in libraries/AP_RTC/AP_RTC.cpp.

  • Bit 0: GPS (Preferred).
  • Bit 1: MAVLink SYSTEM_TIME messages (from GCS).
  • Bit 2: Hardware RTC (on-board backup battery).

Tuning & Behavior

  • Default Value: 1 (GPS Only)
  • Recomendation: Enable Bit 2 if your board has a backup battery for the RTC. Enable Bit 1 if flying indoors without GPS but connected to a Ground Station.

RTC_TZ_MIN: Timezone offset from UTC

Description

Adds offset in +- minutes from UTC to calculate local time.

Values

  • Range: -720 to +840 (minutes)
  • Increment: 1
  • Default: 0

Description

This parameter adjusts the autopilot's internal clock to match your local time zone.

  • Usage: Set this if you want the logs or the On-Screen Display (OSD) to show local time instead of UTC.
  • Example: For Eastern Standard Time (EST, UTC-5), set this to -300. For Central European Summer Time (CEST, UTC+2), set this to 120.
  • Effect: Primarily affects the SYSTEM_TIME MAVLink message and the time displayed on OSD widgets. It does NOT affect the EKF or navigation, which always use UTC.