为实现基于以太网的数控系统运动控制层的实时通信和精确时间同步,对避免时间片冲突的实时通信算法和基于精确时间协议的同步算法进行了优化处理。为提高处理效率,在实时通信的同时进行时间同步,并对实时通信和时间同步的报文结构进行了融合和简化处理。在以太网帧中,增加了时间域来存放时间信息,将报文分为同步报文、跟随报文和从站报文三类。采用时间片配置方法,配置了实验参数,保证了通信的实时性和时间同步的精度,满足了数控系统的需求。
To realize the motion control level communication and precision time synchronization of Computer Numerical Control (CNC) system based on Ethernet, real-time communication algorithm avoiding time slot collision and time synchronization algorithm based on Precision Time Protocol (PTP) was optimized. To enhance processing efficiency, the time synchronization process was run in the real-time communication cycle, and the packet structure of real-time communication and time synchronization was incorporated and simplified. A time domain was added to the Ethernet frame, and the data were classified as synchronization, following, and slave data packet. The time slot configuration method was proposed and used to configure the parameters of the experiment. And the result of realtime communication and time synchronization could meet the requirement of the CNC system.