Remix.run Logo
sgillen 8 hours ago

We don't use NTP, but for robotics, stereo camera synchronization we often want the two frames to be within ~10us of eachother. For sensor fusion we then also need a lidar on PTP time to be translated to the same clock domain as cameras, for which we also need <~10us.

We actually disable NTP entirely (run it once per day or at boot) to avoid clocks jumping while recording data.

wpollock 8 hours ago | parent | next [-]

> We actually disable NTP entirely (run it once per day or at boot) to avoid clocks jumping while recording data.

This doesn't seem right to me. NTP with default settings should be monotonic. So no jumps. If you disable it Linux enters 11-minute mode, IIRC, and that may not be monotonic.

sgillen 4 hours ago | parent | next [-]

You are correct, NTP prefers to jump first (if needed) and then slew afterwards (which is exactly what we want!), although it can jump again if the offset is too large.

In our case the jumps where because we also have PTP disciplining the same system clock, when you have both PTP and NTP fighting over the same clock, you will see jumping with the default settings.

For us it was easier to just do a one time NTP sync at the beginning/boot, and then sync the robots local network with only PTP afterwards.

ComputerGuru 5 hours ago | parent | prev [-]

Pedantically, a monotonic function need not have a constant first derivative. To take it further, in mathematics it is accepted for a monatomic function to have a countable number of discontinuities, but of course in the context of a digital clock that only increments in discrete steps, that’s of little bearing.

But that’s all besides the point since most sane time sync clients (regardless of protocol) generally handle small deviations (i.e. normal cases) by speeding up or slowing down the system clock, not jumping it (forward or backward).

opello 6 hours ago | parent | prev [-]

In your stereo camera example, are these like USB webcams or something like MIPI CSI attached devices?

sgillen 4 hours ago | parent [-]

MIPI CSI, with USB cameras I usually am getting jitter in the millisecond range.