Hi everyone,
I’m experiencing a strange behaviour with the GPS timestamps on my OrangeCube + Here 3 setup and I’m hoping someone here can shed some light on it.
Hardware:
-
OrangeCube (PX4 v1.17.0)
-
Here 3 GPS (via CAN)
What I observed:
I’ve been logging GPS data over periods of approximately 15 minutes via MAVLink. Specifically, I’m comparing the GPS timestamp (the time the GPS message arrives at the OrangeCube) with the internal system clock.
Two things stand out that I can’t explain:
1. The delta between GPS time and internal clock drifts significantly The difference between GPS-time and the internal HRT (High-Resolution Timer) fluctuates in the millisecond range over time, rather than staying constant. Since the GPS clock is supposed to be highly accurate and the internal IMU clock is the one expected to drift, I would expect the delta to remain small and relatively stable – or at most grow slowly in one direction. Instead, the drift is erratic.
2. GPS timestamps always arrive in exact 200ms intervals – without any jitter Every single GPS measurement arrives at exactly 200ms after the previous one. No variation whatsoever. This seems unrealistically precise. Is the timestamp perhaps not reflecting the actual measurement time, but rather being generated or rounded somewhere in the middleware/firmware?
What I already tried:
To capture the GPS arrival timestamp, I patched the PX4 firmware (GPS_RAW_INT.hpp) to write gps.timestamp into the alt field of the MAVLink message, so I could log it via QGroundControl without a custom parser:
cpp
// msg.alt = static_cast<int32_t>(round(gps.altitude_msl_m * 1e3));
msg.alt = gps.timestamp;
The logged data and graphs have also been posted in the PX4 forum here for reference: https://discuss.px4.io/t/gps-measurements-indicate-a-drift-in-gps-time-and-i-cant-explain-why/48889
My questions:
-
Is the 200ms interval a fixed output rate configured somewhere in the Here 3 firmware or the CAN driver?
-
Does anyone have experience with GPS time synchronisation on the OrangeCube and could explain the observed drift behaviour?
Any insight would be greatly appreciated!