MAVLINKGPS

Dealing with "Jitter"

The Problem with "Still"

GPS receivers are never truly still. Even if you glue the phone to a table, the calculated position will "wander" by a few centimeters every second, and the velocity report will flicker between 0.0 m/s and 0.2 m/s.

EKF Sensitivity

The ArduPilot EKF3 is highly sensitive to velocity innovations.

  • Input: GPS reports "Moving North at 0.2 m/s".
  • Reaction: EKF tilts the drone South to counter the movement.
  • Reality: The drone wasn't moving. Now it is moving South.
  • Result: A constant, twitchy "dance" as the drone fights phantom velocity spikes.

The Zero-Velocity Clamp

To solve this, MAVLink GPS implements a Zero-Velocity Clamp algorithm.

Logic

The app monitors the phone's internal accelerometer and the GPS speed.

  1. Condition A: Is the phone's physical acceleration near zero? (Stationary)
  2. Condition B: Is the GPS reported speed < 0.3 m/s? (Noise floor)

If both are true, the app assumes the vehicle is stationary (Loitering).

Action

It engages the clamp:

  1. Bitmask: It sets the GPS_INPUT_IGNORE_FLAG_VEL_HORIZ bit (Value 8).
  2. Data: It stops sending velocity vectors (vn, ve = 0).

The EKF Response

When the VEL_HORIZ ignore flag is set, the EKF stops listening to the GPS velocity completely.

  • It relies purely on Position Delta (Change in Lat/Lon over time) to estimate velocity.
  • Since position changes much slower than velocity jitter, the estimate smooths out.
  • Flight Behavior: The drone transitions from "twitchy" to "rock solid."