CN115580369A - EtherCAT and TSN fusion networking time synchronization method - Google Patents

EtherCAT and TSN fusion networking time synchronization method Download PDF

Info

Publication number
CN115580369A
CN115580369A CN202211282403.0A CN202211282403A CN115580369A CN 115580369 A CN115580369 A CN 115580369A CN 202211282403 A CN202211282403 A CN 202211282403A CN 115580369 A CN115580369 A CN 115580369A
Authority
CN
China
Prior art keywords
tsn
ethercat
time
link
propagation delay
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211282403.0A
Other languages
Chinese (zh)
Other versions
CN115580369B (en
Inventor
马彰超
王健全
徐浩
何维毅
蒋佳梦
孙雷
李卫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology Beijing USTB
Original Assignee
University of Science and Technology Beijing USTB
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology Beijing USTB filed Critical University of Science and Technology Beijing USTB
Priority to CN202211282403.0A priority Critical patent/CN115580369B/en
Publication of CN115580369A publication Critical patent/CN115580369A/en
Application granted granted Critical
Publication of CN115580369B publication Critical patent/CN115580369B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention provides a method for synchronizing EtherCAT and TSN fusion networking time, and belongs to the technical field of industrial internet. The method comprises the following steps: determining whether a TSN link is switched; wherein TSN represents a time sensitive network; once the TSN link is switched, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station; where DC denotes a distributed clock. By adopting the invention, the end-to-end high-precision time synchronization under the scene of the Ethernet CAT and TSN fusion networking after the TSN link switching can be realized.

Description

EtherCAT and TSN fusion networking time synchronization method
Technical Field
The invention relates to the technical field of industrial internet, in particular to a method for synchronizing EtherCAT and TSN fusion networking time.
Background
In 2017, an EK1000EtherCAT TSN coupler was automatically released by Beckhoff, and communication with a remote EtherCAT controller can be realized through a heterogeneous Ethernet network.
The current fusion Networking mode of EtherCAT and Time-Sensitive Networking (TSN) mainly comprises two types: direct networking using EtherCAT/TSN couplers.
As for the fusion networking mode using the EtherCAT/TSN coupler, as shown in fig. 1, the time synchronization mode is: and synchronizing the EtherCAT/TSN coupler with the TSN node in a mode of taking the EtherCAT/TSN coupler as a gPTP slave clock, and taking the synchronized coupler as a reference clock of the EtherCAT network segment to complete clock synchronization of the EtherCAT network segment.
As shown in fig. 1, the time synchronization of the system is divided into two steps:
1. gPTP (general precision Time Protocol): the TSN switch clock is used as a master clock, the clock of the EtherCAT/TSN coupler is used as a slave clock, and time synchronization of the two EtherCAT/TSN couplers and the TSN switch is realized in a gPTP synchronization mode;
2. DC (Distributed clocks) synchronization: in order to realize the time synchronization of the EtherCAT master station and the slave station with the whole system, DC synchronization is needed, and the clocks of the EtherCAT master station and the slave station are synchronized to the EtherCAT/TSN coupler by taking the EtherCAT/TSN coupler as a DC synchronous reference clock.
Through the time synchronization of the two steps, the clocks of all the devices are synchronized to the clock of the TSN switch.
As for the networking mode of the coupler without entity, as shown in fig. 1, the time synchronization mode is as follows: and taking the EtherCAT master station as a gPTP slave clock to synchronize with a certain node in the TSN, and taking the synchronized EtherCAT master station as a reference clock of the EtherCAT network segment to complete clock synchronization of the EtherCAT network segment.
As shown in fig. 2, the time synchronization of the system is divided into the following two steps:
1. gPTP (general precision Time Protocol): the TSN switch clock is used as a master clock, the clock of the EtherCAT master station is used as a slave clock, and time synchronization of the EtherCAT master station and the TSN switch is realized in a gPTP synchronization mode;
2. DC (Distributed clocks) synchronization: in order to realize the time synchronization of the EtherCAT network segment and the whole system, DC synchronization is needed, and an EtherCAT slave station clock is synchronized to an EtherCAT master station clock by taking the EtherCAT master station as a DC synchronous reference clock.
Through the time synchronization of the two steps, the clocks of all the devices are synchronized to the clock of the TSN switch.
In the scenario of fusion networking of EtherCAT and TSN, communication between an EtherCAT master station and a slave station will pass through an intermediate network (e.g., a factory backbone network) composed of TSN switches. In the system operation process, link switching can be generated inside the TSN network in consideration of factors such as link load, communication delay, switch state and the like. In EtherCAT DC synchronization, link propagation delay measurements are only made during the initialization phase of the synchronization, and the EtherCAT master stores each segment of link propagation delay in the corresponding EtherCAT slave register for use in the subsequent offset compensation and frequency compensation phases. After the TSN is introduced, when link switching occurs inside the TSN, link propagation delay between an EtherCAT master station and a slave station changes along with dynamic change of the TSN, however, the DC synchronization mechanism of the EtherCAT network segment still adopts link propagation delay measured in an initialization stage, which causes reduction of time synchronization precision of the whole system, reliability of an industrial field is not guaranteed, and thus production efficiency is affected.
Disclosure of Invention
The embodiment of the invention provides a method for synchronizing the time of EtherCAT and TSN fusion networking, which can realize end-to-end high-precision time synchronization under the scene of the EtherCAT and TSN fusion networking after the TSN link is switched.
The EtherCAT and TSN fusion networking time synchronization method provided by the embodiment of the invention comprises the following steps:
determining whether a TSN link is switched; wherein TSN represents a time sensitive network;
if the TSN link is switched, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station; where DC denotes a distributed clock.
Further, the determining whether the TSN link is switched includes:
the CNC carries out task scheduling in real time, and determines whether the TSN internal link is switched or not according to task scheduling conditions; where CNC stands for centralized network scheduler.
Further, the TSN configuration model includes: a centralized network/distributed user configuration model or a fully centralized configuration model;
if the TSN link is switched, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and the updating of the link propagation delay stored in each slave station comprises the following steps:
if the TSN configuration model is a centralized network/distributed user configuration model, when TSN internal links are switched, the CNC sends link switching conditions to a TSN sending node, the TSN sending node adds a signaling to inform an EtherCAT master station, the EtherCAT master station recalculates or acquires link propagation delay used for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated;
if the TSN configuration model is a completely centralized configuration model, when a link in the TSN is switched, the CNC sends the link switching condition to the CUC, the CUC sends the link switching condition to the TSN sending node, the TSN sending node adds a signaling to inform the EtherCAT master station, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated; wherein CUC represents centralized user configuration.
Further, recalculating the link propagation delay for EtherCAT DC synchronization after the EtherCAT master station receives the signaling, and updating the link propagation delay stored in each slave station includes:
after receiving the signaling, the EtherCAT master station starts a link propagation delay measurement mechanism, calculates new link propagation delay and stores the new link propagation delay in a system time delay register of each slave station; wherein, the link propagation delay between the slave station n and the reference device is recorded as t propagation delay And (n), the reference device is an EtherCAT master station.
Further, after the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station, the method further includes:
the EtherCAT master station sends FPRD to read a system time register, an EtherCAT processing unit receiving time register, a system time deviation register and a system time delay register of each slave station; wherein FPRD represents node addressing read;
the EtherCAT main station calculates the system time deviation t between each slave station and the reference equipment according to the read values in the register off Namely: the offset of the slave station local time and the system time;
the EtherCAT main station sends FPWR to obtain an offset t off Writing to a system time offset register of the slave station; wherein FPWR represents a node addressed write;
the EtherCAT master station sends a plurality of ARMW/FRMW commands to the system time register of each slave station, triggers the local time controller of each slave station to finely adjust the local clock based on the offset, and realizes offset compensation; wherein ARMW represents self-incremental multiple writes and FRMW represents node addressing multiple reads.
Further, the local clock trimming formula is:
t sys =t local time +t off (n)
wherein, t sys Is the system time, t localtime Is the local time of the slave station, t off (n) is the system time offset between the slave station n and the reference device.
Further, after the EtherCAT master station sends a plurality of ARMW/FRMW commands to the system time registers of the slave stations to trigger the local time controller of each slave station to adjust the local clock, so as to implement offset compensation, the method further comprises:
the method comprises the steps that an ARMW/FRMW command is added to a periodic data frame by an EtherCAT main station, and the clock of the EtherCAT main station periodically distributes system time from a reference clock to clocks of all slave stations; wherein, the ARMW/FRMW command is a time setting command;
the time controller of each slave station circularly obtains the lower 32 bits of the system time received from the reference clock, and compares the lower 32 bits with the local time to obtain the direct time difference delta t between the local clock of the slave station and the reference clock;
and judging whether the time difference delta t is greater than 0, if so, slowing down the local clock, and if not, speeding up the local clock to realize drift compensation.
Further, the time difference Δ t is expressed as:
Δt=(t local time +t off -t propagation delay )-t receive sysytem time
where Δ t is the direct time difference between the slave station local clock and the reference clock, t local time Is the local time of the slave station, t off As system time offset between slave and reference devices, t receive sysytemn time Time, t, read for ARMW/FRMW message passing through reference device propagation delay Is the link propagation delay between the slave and the reference device.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
according to the EtherCAT and TSN fusion networking time synchronization method, in the case of EtherCAT and TSN fusion networking, considering that TSN link switching will have adverse effects on system time synchronization precision, a mechanism for responding to TSN link switching is introduced, when TSN links are switched, an EtherCAT master station recalculates or obtains link propagation delay used for EtherCAT DC synchronization, and the link propagation delay stored in each slave station is updated, so that end-to-end high-precision time synchronization in the case of EtherCAT and TSN fusion networking after TSN link switching is achieved, normal operation of the whole system is guaranteed, production efficiency and reliability are improved, and the problem that system time synchronization precision is reduced due to the fact that TSN link switching is not considered in the existing time synchronization scheme is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a converged networking approach using an EtherCAT/TSN coupler;
FIG. 2 is a diagram of a direct networking approach;
fig. 3 is a scene schematic diagram of an EtherCAT and TSN fusion networking provided in the embodiment of the present invention;
fig. 4 is a scene schematic diagram of an EtherCAT and TSN fusion networking under a completely centralized configuration model according to an embodiment of the present invention;
fig. 5 is a scene schematic diagram of an EtherCAT and TSN fusion networking under a centralized network/distributed user configuration model according to an embodiment of the present invention;
fig. 6 is a schematic flow chart of the EtherCAT and TSN fusion networking time synchronization method provided in the embodiment of the present invention.
FIG. 7 is a schematic flow chart illustrating an improved synchronization mechanism for a fully centralized configuration model according to an embodiment of the present invention;
fig. 8 is a detailed flowchart of an improved synchronization mechanism for the fully centralized configuration model according to the embodiment of the present invention.
FIG. 9 is a schematic flow chart illustrating an improved synchronization mechanism for a centralized network/distributed user configuration model according to an embodiment of the present invention;
fig. 10 is a detailed flowchart of an improved synchronization mechanism for a centralized network/distributed user configuration model according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
As shown in fig. 3, protocol conversion between EtherCAT and TSN is required to be implemented between an EtherCAT master station and a TSN sending node, and between a TSN receiving node and an EtherCAT slave station, so as to implement fusion networking of EtherCAT and TSN.
As shown in fig. 3, in the scenario of fusion networking of EtherCAT and TSN, the global time synchronization implementation is divided into three steps:
(1) the TSN network realizes Time synchronization of a TSN domain by taking a master clock (GrandMaster) as a reference and a gPTP (general precision Time Protocol) synchronization mode;
(2) the EtherCAT master station is used as a slave node, the TSN sending node is used as a master node, and time synchronization of the EtherCAT master station and the TSN domain is realized in a gPTP synchronization mode;
(3) the EtherCAT master station is used as a reference clock, and the time synchronization of the EtherCAT domain is realized in a DC synchronization mode.
Under the scene of the EtherCAT and TSN fusion networking, link switching can be generated inside the TSN network in consideration of factors such as link load and communication delay. This will affect the above step (3) time synchronization, i.e. DC synchronization. In the conventional DC scheme, the link propagation Delay is measured only once in the initialization phase of synchronization, and after the measurement, the EtherCAT master transmits BWR (broadcast write) to write it into the System Time Delay (System Time Delay) register (0 × 0928. Link switching in the TSN will cause the link propagation delay used in DC synchronization to change, resulting in a decrease in time synchronization accuracy.
In this embodiment, a time synchronization method for ethernet cat and TSN fusion networking is proposed in a scenario based on ethernet cat and TSN fusion networking, where the method is a time synchronization mechanism adapted to TSN real-time link change, and once a link inside a TSN Network is switched, according to a difference of TSN Configuration models, that is, a Centralized Network/distributed User Configuration model or a completely Centralized Configuration model, a TSN Network Centralized Network scheduler (CNC) or a Centralized User Configuration (CUC) notifies a corresponding ethernet master cat of a link switching situation or a new link propagation delay, so that the ethernet master cat recalculates or obtains an accurate link propagation delay for ethernet cat herdc synchronization, thereby implementing end-to-end high-precision time synchronization and ensuring normal operation of the entire system.
Therefore, the embodiment of the invention provides a time synchronization mechanism for responding to TSN link switching, which introduces a completely centralized configuration model and a centralized network/distributed user configuration model respectively; wherein,
(1) Fully centralized configuration model
As shown in fig. 4, before the Network starts to operate, a Centralized User Configuration (CUC) initiates a request for retrieving a Network physical topology to a Centralized Network Configuration (CNC), and the CNC traverses the Network topology and returns a topology result to the CUC. The CNC realizes the functions of equipment monitoring management, network topology discovery, flow monitoring and adjusting, service modeling, scheduling model issuing and the like in a TSN domain; the CUC is responsible for the translation of network requirements and network information of users, and configures TSN characteristics in the terminal; user-Network Interface (UNI) is used for realizing the transmission and interaction between CUC and CNC of User requirements and service information, and TSN equipment (terminal and bridge) supports relevant on-line measurement protocol besides TSN relevant forwarding characteristic, and sends relevant state to CUC and CNC in real time. In fig. 4, the TSN switch directly connected to the TSN transmission/reception node is an edge switch.
And the CUC discovers and retrieves the terminal, makes a user periodic time-related requirement and transmits process data to the CNC, and the CNC performs dynamic port configuration on the TSN switch after performing global optimization decision to meet the requirement by considering factors such as link delay, node load and the like. When link switching occurs in the TSN, the CNC sends the link switching situation to the CUC, the CUC informs the TSN sending node of the link switching situation, the TSN sending node adds a signaling to inform the EtherCAT main station, so that the TSN sending node starts a link propagation delay measurement mechanism, and updates a system time delay register 0x0928 stored in each slave station: 0x092B, as indicated by the black arrow in fig. 4.
(2) Centralized network/distributed user configuration model
As shown in fig. 5, the TSN switch directly connected to the TSN transmission/reception node is an edge switch. The CNC is responsible for collecting information such as the state and the function of the switch, mastering the network topology and the function configuration of each switch node, calculating the gate control of the path node and each node according to the information, completing the configuration of the corresponding switch according to the result and ensuring the end-to-end transmission of the service. The CNC knows the address information of the edge switches connected with the terminal nodes, and uses the edge switches as proxy parties to transmit information such as service requirements, resource requirements and states of the transceiving nodes. Configuration information between the User and the Network is implemented via a User-Network Interface (UNI) protocol.
The CNC acquires the node state and functions of the switch, considers factors such as link delay and switch node load, carries out global optimization decision, and dynamically configures the TSN switch to meet the requirements. When a link in the TSN network is switched, the CNC informs a TSN sending node of the link switching condition, the TSN sending node adds a signaling to inform an EtherCAT master station, so that the TSN sending node starts a link propagation delay measurement mechanism, and updates a system time delay register 0x0928 stored in each slave station: 0x092B, as indicated by the black arrow in fig. 5.
As shown in fig. 6-10, an embodiment of the present invention provides a method for synchronizing ethernet cat and TSN fusion networking time, including:
s101, determining whether a TSN link is switched or not; wherein TSN represents a time sensitive network;
in the embodiment, the CNC carries out task scheduling in real time, and determines whether the internal link of the TSN is switched or not according to the task scheduling condition; wherein CNC represents a centralized network scheduler; specifically, the method comprises the following steps:
and determining a route by a TSN switch port dynamic configuration function of the CNC according to different task requirements, so that a link is switched.
S102, if the TSN link is switched, the EtherCAT master station recalculates or obtains the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station, which may be specifically classified into 2 cases:
if the TSN configuration model is a centralized network/distributed user configuration model, when TSN internal links are switched, the CNC sends link switching conditions to a TSN sending node, the TSN sending node adds a signaling to inform an EtherCAT master station, the EtherCAT master station recalculates or acquires link propagation delay used for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated;
if the TSN configuration model is a completely centralized configuration model, when TSN internal links are switched, the CNC sends the link switching situation to the CUC, the CUC sends the link switching situation to the TSN sending node, the TSN sending node adds a signaling to inform the EtherCAT master station, the EtherCAT master station recalculates or acquires link propagation delay used for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated.
In this embodiment, the EtherCAT master station starts a link propagation Delay measurement mechanism after receiving the signaling, calculates a new link propagation Delay (Delay), and stores the new link propagation Delay in the system time Delay registers of the slave stations; the method specifically comprises the following steps:
an EtherCAT Master station (EtherCAT Master) sends a BWR (broadcast write) command to a DC Recieve Time Port 0 (address 0x 0900), and each slave station latches the local Time of each Port (receiving Time Port 0-3 register) when receiving the first bit of an Ethernet preamble of a frame (the frame refers to the BWR sent by the EtherCAT Master station); the EtherCAT master station sends a BRD (broadcast read) command to read a time stamp, calculates new link propagation delay according to the read time stamp and by combining a topological structure, and stores the calculated new link propagation delay in a system time delay register (0 x0928:0x 092B) of each slave station; for each slave station, calculating the link propagation delay between the slave station and the reference equipment, and recording the link propagation delay between the slave station n and the reference equipment as t propagation delay (n)。
In this embodiment, the reference device is an EtherCAT master station.
The EtherCAT and TSN fusion networking time synchronization method provided in this embodiment is a time synchronization enhancement mechanism for dynamic change of links, and can achieve the purpose of guaranteeing the time synchronization precision of a system by calculating the link propagation delay.
In this embodiment, after S102, offset compensation is performed based on the obtained new link propagation delay, as shown in fig. 7 to 10, which specifically includes the following steps:
let the value of the system time offset register (0 x 0920: 0x 0927) be t off Plus the internal clock value t int Obtaining the system time value t sys
Figure BDA0003898679180000091
Wherein, t off Represents the system time offset between the slave and the reference device, i.e.: the offset of the slave station local time and the system time;
EtherCAT master station sends FPRD (Configured addressed Read) to Read the register (0 x 0910: 0x 092B) of each slave station, wherein the register (0 x 0910: 0x 092B) comprises: the system time register (0 x 0910: 0x 0917), the EtherCAT processing unit reception time register (0 x 0918: 0x 091F), the system time offset register (0 x 0920: 0x 0927), and the system time delay register (0 x0928:0x 092B)), and further calculates a new system time offset (refer: t is t off ) The result is that the system time should be compared to the master application time t app And (3) equality:
to make t sys =t app I.e. by
Figure BDA0003898679180000092
Figure BDA0003898679180000093
According to the formula, updating of the system time deviation is achieved;
EtherCAT Master sends FPWR (Configured Address Write) with offset t off System time deviation register for writing slave stationIn the storage (0 x 0920: 0x 0927);
the EtherCAT master station sends a plurality of ARMW (Auto Increment Read Multiple Write)/FRMW (node addressing Read Multiple Write) commands to a system time register (0 x 0910: 0x 0917) of each slave station, and triggers a local time controller of each slave station to finely adjust a local clock based on an offset to realize offset compensation.
In this embodiment, the local clock fine tuning formula is:
t sys =t local time +t off (n)
wherein i sys Is the system time, t local time Is the local time of the slave station, t off (n) is the system time offset between the slave n and the reference device.
In this embodiment, each secondary station can compensate for its offset by calculating the system time every 10ns (finger: t) off )。
In this embodiment, next, drift compensation is implemented based on the adjusted local clock, as shown in fig. 7 to 10, which may specifically include the following steps:
in order to keep the local clocks of the slave stations aligned in the running process, the EtherCAT master station adds an ARMW/FRMW command to a periodic data frame, and a master clock (referring to the clock of the EtherCAT master station) periodically distributes system time from a slave reference clock (the clock of a reference device) to all slave clocks (the clocks of the slave stations); wherein, the ARMW/FRMW command is a time setting command;
the time controller of each slave station circularly obtains the lower 32 bits of the system time received from the reference clock, and compares the lower 32 bits with the local time (specifically, the local system time) to obtain the time difference delta t between the local clock of the slave station and the reference clock:
Δt=(t local time +t off -t propagation delay )-t receive sysytem time
where Δ t is the direct time difference between the slave station local clock and the reference clock, t localtime Being slave stationsLocal time, t off As system time offset between slave and reference devices, t receive sysytem time Time, t, read for ARMW/FRMW message passing through reference device propagation delay Propagating a delay for a link between a slave station and a reference device;
and judging whether the time difference delta t is greater than 0, if so, slowing down the local clock, and if not, speeding up the local clock to realize drift compensation.
In this embodiment, if Δ t is positive, it is proved that the local clock is faster than the system time, and the local clock needs to be slowed down (for example, the original 10ns is adjusted to 9 ns); conversely, if Δ t is negative, it turns out that the local clock is slower than the system time, and the local clock needs to be adjusted faster (e.g., adjust the original 10ns to 11 ns).
In this embodiment, in the scenario of the fusion networking of EtherCAT and TSN, it is considered that the link switching of the TSN network will adversely affect the system time synchronization accuracy, and therefore, once the TSN link is switched, the CNC or the CUC immediately notifies the EtherCAT master station through the TSN sending node, and when the EtherCAT master station receives the notification signal, the EtherCAT master station recalculates or obtains the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station, thereby ensuring the end-to-end high-accuracy time synchronization in the scenario of the fusion networking of EtherCAT and TSN, and ensuring the normal operation of the entire system.
According to the EtherCAT and TSN fusion networking time synchronization method, under the condition that the TSN link switching can generate adverse effect on system time synchronization precision, a mechanism for coping with TSN link change is introduced, when the TSN link is switched, an EtherCAT master station recalculates or acquires link propagation delay used for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station, so that end-to-end high-precision time synchronization under the condition that the EtherCAT and TSN fusion networking are performed after the TSN link is switched is realized, normal operation of the whole system is guaranteed, production efficiency and reliability are improved, and the problem that the system time synchronization precision is reduced due to the fact that the TSN link switching condition is not considered in the existing time synchronization scheme is solved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A method for synchronizing Ethernet CAT and TSN fusion networking time is characterized by comprising the following steps:
determining whether a TSN link is switched; wherein TSN represents a time sensitive network;
if the TSN link is switched, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station; where DC denotes a distributed clock.
2. The EtherCAT and TSN converged networking time synchronization method according to claim 1, wherein the determining whether the TSN link is switched comprises:
the CNC carries out task scheduling in real time, and determines whether the TSN internal link is switched or not according to task scheduling conditions; where CNC stands for centralized network scheduler.
3. The EtherCAT and TSN fusion networking time synchronization method according to claim 2, wherein the TSN configuration model includes: a centralized network/distributed user configuration model or a fully centralized configuration model;
if the TSN link is switched, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and the updating of the link propagation delay stored in each slave station comprises the following steps:
if the TSN configuration model is a centralized network/distributed user configuration model, when a TSN internal link is switched, the CNC sends a link switching condition to a TSN sending node, the TSN sending node adds a signaling to inform an EtherCAT master station, the EtherCAT master station recalculates or acquires link propagation delay used for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated;
if the TSN configuration model is a completely centralized configuration model, when a link in the TSN is switched, the CNC sends the link switching condition to the CUC, the CUC sends the link switching condition to the TSN sending node, the TSN sending node adds a signaling to inform the EtherCAT master station, the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization after receiving the signaling, and the link propagation delay stored in each slave station is updated; wherein CUC represents centralized user configuration.
4. The EtherCAT and TSN fusion networking time synchronization method according to claim 1, wherein the EtherCAT master station recalculates the link propagation delay for EtherCAT DC synchronization after receiving the signaling, and updating the link propagation delay stored in each slave station includes:
after receiving the signaling, the EtherCAT master station starts a link propagation delay measurement mechanism, calculates new link propagation delay, and stores the new link propagation delay in a system time delay register of each slave station; wherein, the link propagation delay between the slave station n and the reference device is recorded as t propagation delay And (n), the reference device is an EtherCAT master station.
5. The EtherCAT and TSN converged networking time synchronization method of claim 1, wherein after the EtherCAT master station recalculates or acquires the link propagation delay for EtherCAT DC synchronization, and updates the link propagation delay stored in each slave station, the method further comprises:
the EtherCAT master station sends FPRD to read a system time register, an EtherCAT processing unit receiving time register, a system time deviation register and a system time delay register of each slave station; wherein FPRD represents node addressing read;
the EtherCAT main station calculates the system time deviation t between each slave station and the reference equipment according to the read values in the register off Namely: the offset of the slave station local time and the system time;
Etheroffset t calculated by transmitting FPWR by CAT master station off Writing to a system time offset register of the slave station; wherein FPWR represents a node addressed write;
the EtherCAT master station sends a plurality of ARMW/FRMW commands to the system time register of each slave station, triggers the local time controller of each slave station to finely adjust the local clock based on the offset, and realizes offset compensation; wherein ARMW represents self-incremental multiple writes and FRMW represents node addressing multiple reads.
6. The EtherCAT and TSN fusion networking time synchronization method of claim 5, wherein the local clock fine tuning formula is:
t sys =t local time +t off (n)
wherein, t sys Is the system time, t local time As local time of slave station, t off (n) is the system time offset between the slave station n and the reference device.
7. The EtherCAT and TSN converged networking time synchronization method of claim 5, wherein after the EtherCAT master station sends a plurality of ARMW/FRMW commands to the system time registers of the slave stations to trigger the local time controller of each slave station to adjust the local clock and realize offset compensation, the method further comprises:
the method comprises the steps that an ARMW/FRMW command is added to a periodic data frame by an EtherCAT main station, and the clock of the EtherCAT main station periodically distributes system time from a reference clock to clocks of all slave stations; wherein, the ARMW/FRMW command is a time setting command;
the time controller of each slave station circularly obtains the low 32 bits of the system time received from the reference clock, and compares the low 32 bits with the local time to obtain the direct time difference delta t between the local clock of the slave station and the reference clock;
and judging whether the time difference delta t is greater than 0, if so, slowing down the local clock, and if not, speeding up the local clock to realize drift compensation.
8. The EtherCAT and TSN fusion networking time synchronization method according to claim 7, wherein the time difference Δ t is expressed as:
Δt=(t local time +t off -t propagation delay )-t receive sysytem time
where Δ t is the direct time difference between the slave station local clock and the reference clock, t local time Is the local time of the slave station, t off As system time offset, t, between slave and reference device receive sysytemtime Time, t, read for ARMW/FRMW message passing through reference device propagation delay Is the link propagation delay between the slave and the reference device.
CN202211282403.0A 2022-10-19 2022-10-19 EtherCAT and TSN fusion networking time synchronization method Active CN115580369B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211282403.0A CN115580369B (en) 2022-10-19 2022-10-19 EtherCAT and TSN fusion networking time synchronization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211282403.0A CN115580369B (en) 2022-10-19 2022-10-19 EtherCAT and TSN fusion networking time synchronization method

Publications (2)

Publication Number Publication Date
CN115580369A true CN115580369A (en) 2023-01-06
CN115580369B CN115580369B (en) 2023-10-13

Family

ID=84587771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211282403.0A Active CN115580369B (en) 2022-10-19 2022-10-19 EtherCAT and TSN fusion networking time synchronization method

Country Status (1)

Country Link
CN (1) CN115580369B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116456450A (en) * 2023-06-13 2023-07-18 北京科技大学 EtherCAT and 5G fusion networking time synchronization method
CN118363345A (en) * 2024-06-20 2024-07-19 中科航迈数控软件(深圳)有限公司 Ethernet control automation system, method, equipment, storage medium and product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111585862A (en) * 2020-04-29 2020-08-25 烽火通信科技股份有限公司 Method and device for realizing network intercommunication between EtherCAT and TSN
CN114124616A (en) * 2022-01-25 2022-03-01 浙江中控研究院有限公司 Clock synchronization optimization method based on EPA bus structure
CN114389944A (en) * 2022-03-01 2022-04-22 重庆邮电大学 Industrial application-oriented time-sensitive network fully-distributed configuration method
US20220174625A1 (en) * 2020-03-23 2022-06-02 Tencent Technology (Shenzhen) Company Limited Method for implementing time synchronization and related device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220174625A1 (en) * 2020-03-23 2022-06-02 Tencent Technology (Shenzhen) Company Limited Method for implementing time synchronization and related device
CN111585862A (en) * 2020-04-29 2020-08-25 烽火通信科技股份有限公司 Method and device for realizing network intercommunication between EtherCAT and TSN
CN114124616A (en) * 2022-01-25 2022-03-01 浙江中控研究院有限公司 Clock synchronization optimization method based on EPA bus structure
CN114389944A (en) * 2022-03-01 2022-04-22 重庆邮电大学 Industrial application-oriented time-sensitive network fully-distributed configuration method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CANON RESEARCH CENTRE FRANCE: "R2-2100941 \"Propagation Delay Compensation for TSN\"", 3GPP TSG_RAN\\WG2_RL2 *
缪京霖等: "《一种EtherCAT与TSN网络互通的实现方法》", 《电子设计工程》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116456450A (en) * 2023-06-13 2023-07-18 北京科技大学 EtherCAT and 5G fusion networking time synchronization method
CN116456450B (en) * 2023-06-13 2023-10-10 北京科技大学 EtherCAT and 5G fusion networking time synchronization method
CN118363345A (en) * 2024-06-20 2024-07-19 中科航迈数控软件(深圳)有限公司 Ethernet control automation system, method, equipment, storage medium and product

Also Published As

Publication number Publication date
CN115580369B (en) 2023-10-13

Similar Documents

Publication Publication Date Title
CN115580369B (en) EtherCAT and TSN fusion networking time synchronization method
US9742514B2 (en) Method, apparatus, and system for generating timestamp
EP3188381B1 (en) Delay management for distributed communications networks
EP1427121B1 (en) Radio access network, radio communication method, synchronous server and node
JP5911601B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND TIME SYNCHRONIZATION METHOD
RU2489801C2 (en) System for synchronising clock pulses
JP3698074B2 (en) Network synchronization method, LSI, bus bridge, network device, and program
US9088376B2 (en) Method and system for synchronization
CN102006135A (en) Method and device for selecting synchronous clock source
CN101977104A (en) IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
CN111585862A (en) Method and device for realizing network intercommunication between EtherCAT and TSN
CN101689947A (en) Phase synchronization of nodes in a telecommunication network
KR20000071781A (en) Network synchronization system and network synchronization method
Zhou et al. An efficient configuration scheme of OPC UA TSN in industrial internet
CN113424466B (en) Method and device for clock synchronization
CN107508648A (en) Time triggered Ethernet substep time synchronized strategy based on functions of the equipments classification
CN114389735A (en) Clock synchronization method based on IEEE802.1AS redundant master clock
CN116260772A (en) Bridge end-to-end deterministic forwarding method, bridge transmitting end and receiving end
JP2020098974A (en) Time synchronization route selection device, and time synchronization route selection method
CN101420281A (en) Be used between network element, transmitting the method and apparatus of time value in a few days
US10334539B2 (en) Metered interface
WO2012162947A1 (en) Method and system for controlling transmission delay
CN114389733B (en) PTP master clock device, clock synchronization method, and storage medium
WO2018012480A1 (en) Management device, communication system, and method therefor
CN117278190B (en) Time synchronization unit, method, chip architecture, network device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant