Department of Electrical Engineering, Advanced Institute of Manufacturing with High-Tech Innovations, National Chung Cheng University, Chia-Yi 621301, Taiwan.
Sensors (Basel). 2022 Jul 3;22(13):5021. doi: 10.3390/s22135021.
In the industrial Internet of Things, the network time protocol (NTP) can be used for time synchronization, allowing machines to run in sync so that machines can take critical actions within 1 ms. However, the commonly used NTP mechanism does not take into account that the network packet travel time over a link is time-varying, which causes the NTP to make incorrect synchronization decisions. Therefore, this paper proposed a low-cost modification to NTP with clock skew compensation and adaptive clock adjustment, so that the clock difference between the NTP client and NTP server can be controlled within 1 ms in the wired network environment. The adaptive clock adjustment skips the clock offset calculation when the NTP packet run trip time (RTT) exceeds a certain threshold. The clock skew compensation addresses the inherent issue that different clocks (or oscillators) naturally drift away from each other. Both adaptive clock adjustment and clock skew compensation are environment dependent and device dependent. The measurement result in our experimental environment shows that the when the RTT threshold is set at 1.7 ms, the best synchronization accuracy is achieved.
在工业物联网中,网络时间协议(NTP)可用于时间同步,使机器能够同步运行,以便机器可以在 1 毫秒内执行关键操作。然而,常用的 NTP 机制没有考虑到链路中网络数据包的传输时间是时变的,这导致 NTP 做出不正确的同步决策。因此,本文提出了一种低成本的 NTP 改进方案,具有时钟偏差补偿和自适应时钟调整功能,以便在有线网络环境中,NTP 客户端和 NTP 服务器之间的时钟差可以控制在 1 毫秒内。自适应时钟调整在 NTP 数据包运行往返时间(RTT)超过某个阈值时跳过时钟偏移计算。时钟偏差补偿解决了不同时钟(或振荡器)自然漂移的固有问题。自适应时钟调整和时钟偏差补偿都依赖于环境和设备。我们在实验环境中的测量结果表明,当 RTT 阈值设置为 1.7 毫秒时,可以实现最佳的同步精度。