ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to reduce drift in system time using Chrony?

asked 2022-09-19 05:25:23 -0500

bc524 gravatar image

I currently have 2 devices communicating with one another. A Roscube-X acting as the master and a Jetson Orin as its slave.

I'm running an NTP server on the roscube with the Orin acting as a client using chrony.

However, there is a drift in the system time as the duration goes on.

Time drift at launch after restarting chrony using chronyc tracking:

image description

Time drift after a few minutes:

image description

While extremely minor, the drift increases over time. Is there a way to further reduce/delay the drift?

My chrony.conf has the following:

server <roscube ip> minpoll 0 maxpoll 5  maxdelay .000000005
initstepslew 2 <roscube ip>
dumponexit
dumpdir /var/lib/chrony
pidfile /var/run/chronyd.pid
logchange 0.5
sched_priority 1
local stratum 10
allow 127.0.0.1/8

It is only connected to the ROSCube's NTP terminal as a source.

edit retag flag offensive close merge delete

Comments

1

ros works fine if the host time-of-day clocks are within 0.001 second. Please explain what ros problem you are having that requires synchronization many orders of magnitude better than 1e-3.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-09-19 07:42:30 -0500 )edit
1

Isn't 0.000000003 seconds, 3 nanoseconds?

I'd agree with @Mike Scheutzow: unless you are dealing with very fast mobile robots (or sensor data which encodes phenomena where delta-t must be very small as state variables change very fast), a 3 nanosecond difference between two clocks would seem like it should be OK.

gvdhoorn gravatar image gvdhoorn  ( 2022-09-19 11:22:33 -0500 )edit

@Mike Scheutzow@gvdhoorn

Sorry, I'm still new to to ros. Planning to link multiple sensors (camera, lidar) to the two devices for use in mapping, so I was unsure if the drift would cause an issue in the long run as it kept increasing over time. Would this still be ok?

bc524 gravatar image bc524  ( 2022-09-19 20:25:37 -0500 )edit
1

Not really an answer, but only you would be able to determine whether a drift of 3 nanoseconds over 3 minutes would be acceptable.

If you don't have any requirements which tell you otherwise right now, I'd suggest to perform some tests and determine whether the performance is sufficient for whatever use-case(s) you have. I doubt anyone here would be able to tell you whether things "would [..] be ok" like this.

Although, 3 ns per 3 minutes drift would lead to 60 ns per hour, which is still well below what would probably become problematic for almost all use-cases. And typical time-synchronisation setups implement periodic syncing, so there would likely not even be the cumulative drift you appear to expect.

gvdhoorn gravatar image gvdhoorn  ( 2022-09-20 02:00:16 -0500 )edit

@gvdhoorn

alright, thanks for the information. I only left it at max a few hours and it kept going up, so I thought it was cumulative.

I tried to test it out and play a bagfile on one device and is played on the other. Having some issue when it comes to IMU data, but all the other types seems to be working fine.

Thanks.

udpate: the imu issue was solved lowering the rosbag play rate.

bc524 gravatar image bc524  ( 2022-09-20 22:16:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-09-20 07:22:52 -0500

Mike Scheutzow gravatar image

updated 2022-09-20 07:24:25 -0500

If your time service is working, the time difference will not keep increasing forever. On my network, the tools report time-of-day differences of up to tens of microseconds.

For typical ros activities, I would not be concerned unless the difference grows larger than 1e-3. If the difference exceeds that, you need to debug why the time service is not working.

edit flag offensive delete link more

Comments

@Mike Scheutzow

Having some issues with IMU data in testing, but the rest seem to be transmitting ok. Thanks for the info.

bc524 gravatar image bc524  ( 2022-09-20 22:21:36 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-09-19 05:25:23 -0500

Seen: 620 times

Last updated: Sep 20 '22