TIME SYNC IN A NETWORK

DE502022002010D1Active Publication Date: 2024-11-21ABB (SCHWEIZ) AG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE502022002010
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-09-07
Publication Date
2024-11-21
Estimated Expiration
2042-09-07

AI Technical Summary

Technical Problem

Current time synchronization methods in networks, particularly those using the IEEE PTP standard, face challenges in ensuring uniform clock synchronization across different clocks, leading to potential errors in timestamp accuracy and event sequencing due to differences in clock rates and frequencies, especially when dealing with multiple clocks for working time and global time.

Method used

The method involves using synchronization messages from multiple masters to adjust the clock rate and time difference of slave clocks, allowing both clocks to run at the same speed without time jumps, and utilizing the clock rate of one clock to set the other, ensuring synchronization through both synchronization and syntonization processes.

Benefits of technology

This approach ensures accurate and uniform time synchronization across various network participants, reducing errors in timestamping and event sequencing, and maintaining clock consistency even with different clock speeds, thereby enhancing the reliability of timing in complex production processes.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present invention describes a method for time synchronization in a network, wherein the network contains a plurality of masters and at least one slave, wherein the at least one slave receives synchronization messages from the plurality of masters for time synchronization of a first clock and a second clock of the slave via the network, wherein a first master sends a first synchronization message with a first timestamp for time synchronization of the first clock to the at least one slave, and the at least one slave compares the first timestamp of the first synchronization message with the first current time of the first clock and, based on this comparison, determines a clock rate and a time difference of the first clock to the first master and performs a time adjustment, whereby the first clock in the slave runs with a synchronized time.where a second master sends a second synchronization message with a second timestamp to at least one slave for time synchronization of the second clock.

[0002] In principle, a wide variety of hardware components, such as central processing units, bus modules, drive modules, bus couplers, I / O modules with integrated network connectivity, cameras, HMI devices, network-integrated sensors and actuators, network infrastructure (switches, bridges, etc.), and so on, can be considered network participants. Each network participant has at least one clock, which controls the workflows within the participant itself. This clock can, for example, specify the CPU processing time available for each process. Workflows between network participants are also synchronized via the clock. This enables the control of various processes within a network.

[0003] A fundamental distinction is made between hardware-based clocks and logic clocks. Hardware-based clocks are, for example, quartz oscillators with a counter register, where the quartz oscillator dictates regular oscillations that are then recorded by the counter register. These oscillations are dependent on physical quantities such as temperature, air pressure, and ambient humidity. Therefore, the location of a network participant can affect the quartz oscillator, and these changes can result in different clock or frequency rates of a hardware-based clock. While this often has no consequences for an isolated network participant, time synchronization between clocks of different network participants running at different clock rates may be necessary within a network.

[0004] In a logic clock, the clock signal comes from the hardware via an interrupt request, such as a hardware-based clock. Therefore, the logic clock must be set after a network device is powered on. A logic clock is a component of a computer system that can be used to assign a unique timestamp to events, such as workflows within a network.

[0005] A timestamp assigns a unique point in time to an event. The accuracy of this timestamp depends largely on the accuracy of a clock. Events can be, for example, various physical processes within a production plant, but can also be digital in nature, such as communication between different network participants. Physical processes can include, for example, the movement of machine parts or goods on a machine. These physical processes can be initiated or executed by network participants configured as actuators and detected by network participants configured as sensors. This allows, for example, precise identification of which machine was responsible for a production outage and when. This significantly simplifies troubleshooting in highly complex production systems.

[0006] Often, a network device can contain not just one clock, but multiple clocks. These clocks can be hardware-based, logical, or a combination of both. For example, two logical clocks can access the same hardware-based clock. Most network devices have at least one hardware-based clock built in, which displays at least one operating time. This operating time typically continues to count from an initial setup, for example, in fractions of a second. The quartz oscillator acts as the clock source in such a device. To prevent the clock from stopping when the device is switched off, it can be continuously powered by an energy storage device, such as a battery or rechargeable battery.In the event of a power loss, for example due to a dead button battery on the motherboard, this clock would start counting again when a new power source is inserted.

[0007] For example, a logical clock now uses the aforementioned hardware-based clock to control workflows and timestamp events.

[0008] In a network, unavoidable inaccuracies can occur, for example, because the built-in crystal oscillators do not oscillate at exactly the same frequency due to manufacturing inaccuracies. Furthermore, the different locations of network participants can cause frequency differences in the crystal oscillators to arise or increase due to external influences. Network participants may be located together in a machine hall or be geographically far apart. For example, temperature differences caused by varying ambient temperatures, air conditioning, or CPU heat can affect the crystal oscillator.

[0009] To enable time-controlled communication between different network participants, it is necessary to synchronize clocks that display different times. In the simplest case, one network participant is designated as the master, and the other network participants are designated as slaves. A network participant that is a master can be particularly powerful and reliable. The master then provides the time to the slaves in the network, thus controlling time synchronization. Typically, there are multiple masters in a network. There is one master for each time zone. Therefore, with two clocks, there are two masters. These can reside on the same physical network participant or be distributed across different network participants. It is also possible for the master role to rotate regularly between network participants.

[0010] Often, a network doesn't just have one master for a clock, but several masters, known as "standby masters." As long as the original master is handling the time synchronization for a clock, the standby masters behave like slaves. This way, if the primary master fails, one of the standby masters can take over and perform the time synchronization.

[0011] Network participants often use a so-called "working time" as their timekeeping mechanism, which runs continuously from system initialization. However, it's not only important for network participants to synchronize working time; they often also require a global time. Global time refers specifically to the time regularly perceived by humans, with a date and time. Such a global time can be important for users, such as employees in production facilities, for example, during maintenance, commissioning, and troubleshooting of a network participant. As with working time, one network participant can be designated as the master, and the others become slaves, receiving time synchronization from the master. For global time, a master can synchronize with either a Coordinated Universal Time (UTC) server or an International Atomic Time (IAT) server via the internet.TAI), or via radio or GPS.

[0012] Furthermore, masters for time synchronization with respect to other tasks can only be simple network participants or slaves. In the present invention, the terms "master" and "slave" refer exclusively to time synchronization within a network and not to other functionalities, such as in a production process.

[0013] The masters responsible for synchronizing working time and global time are typically not the same within a network. Therefore, each network participant can have separate time synchronization for working time and global time from different masters. Time synchronization methods based on extensive software stacks, such as those used in the Precision Time Protocol (PTP), are known for this purpose. Such protocols are specified, for example, in the IEEE 802.1AS-2020 standard. In these protocols, working time and global time are synchronized separately. Typically, multiple redundant masters can specify both working time and global time.

[0014] Typically, such synchronization occurs via a process called synchronization. This involves a complete adjustment of the time, either working time or global time, between the master and slave. The slave synchronizes both the clock rate and the time difference. The time difference refers to the actual difference between the clocks of the master and the slave. For example, a master has a global time of 13:02, and a slave has 13:05. The slave's time is then set from 13:05 to 13:02, and the slave, based on its knowledge of the master's time, adjusts its clock rate so that the clocks run at the same speed. Precise synchronization of the clock rates is only possible after a certain number of synchronization messages.

[0015] To avoid time jumps as much as possible, the slave's clock rate can be sped up or slowed down so that the clocks in the master and slave synchronize. However, this process can take a long time with large discrepancies between the master and slave, leading to persistent errors, especially in the clock rate. Conversely, if the time is adjusted abruptly, errors in the timestamps can occur. Events that actually occurred sequentially may have the same timestamps after time synchronization, or the recorded sequence of these events may even be reversed.

[0016] However, synchronization can also be achieved via syntonization. Syntonization refers to the adjustment of the clock rate between a master and a slave in a network without using a time difference adjustment, as in synchronization. Thus, the times, as in the example above, would not be corrected to the master's time by means of a jump, but would continue to run with the same difference or be synchronized with each other using an accelerated or delayed clock rate. This prevents jumps in the clock and also avoids the incorrect assignment of events. However, it at least prevents the difference from increasing when both clocks have the same clock rate. In the synchronization according to the invention, both synchronization and syntonization can be provided. This can depend on the difference between the at least one slave and the master, and on the application.

[0017] Working time and global time are typically synchronized via different masters. As a result, these two times may run at different speeds, i.e., have different clock rates. Events can have timestamps in both working time and global time, depending, for example, on whether an event represents a production process requiring communication between network participants or involves interaction with a user.

[0018] The current state of the art for time synchronization is the IEEE PTP standard. This standard stipulates that each clock in a network device is synchronized separately with a master over the network. For example, a work clock can be synchronized with other work clocks on the network based on this standard. The same procedure can be performed for a global clock. This means that the clock is given, for example, a clock rate and a time difference. However, this can lead to different clocks in a network device having different clock rates. If a network device communicates with other network devices, such as other slaves or a master on the network, this can lead to an untraceable accumulation of errors in the time logging.

[0019] Many existing applications use one of these two clocks to control timing (for example, as a timer for executing specific events). Since, in the current state of the art, each of these clocks is synchronized with the clock rate of a master, the timing control does not run at the clock rate of a single clock, which would be necessary for the network-wide, synchronized execution of events.

[0020] EP 2 544 389 B1 discloses a time synchronization method for working time and global time, whereby the difference between these two times is recorded and transmitted via message from a master to a participant in the system, and the slave corrects its time. The clocks are synchronized based on this difference. A disadvantage of this method is that a single master is required for both clocks. Furthermore, this method requires additional information to be transmitted. This means that all components in the network must use the same method.

[0021] From EP 3 288 200 A, a method for synchronizing master and slave clocks in a computer network is further disclosed, in which a first and a second slave clock of a local network node are each synchronized to a first and second master clock of a remote network node. The local network node receives information from the remote network node about a first time from a first master clock and about a second time from a second master clock. These times are then used to synchronize the first and second slave clocks, respectively.The second slave clock is used by determining the time for the first slave clock based on a current time, information about the first time, initial delay information characterizing the transmission time of the first time to the local network node, and initial compensation for a first frequency drift between the first master clock and the first slave clock, and by determining the time of the second slave clock based on the current time of the first slave clock, information about the second time, delay information characterizing the second transmission time of the second time to the local node, and a second compensation for a second frequency drift between the second master clock and the first slave clock.

[0022] The purpose of the present invention is to enable uniform time synchronization for various applications in operation.

[0023] The problem solved by the present invention is achieved by using the clock rate of the first clock to specify a clock rate for the second clock by setting the clock rate of the second clock to the clock rate of the first clock. Then, at least one slave compares the second timestamp of the second synchronization message with the second current time of the second clock, determines a time difference between the second clock and the second master based on this comparison, and performs a time synchronization such that the second clock in the slave runs with the synchronized time.

[0024] This is advantageous because standard mechanisms in hardware and operating systems often assign a fixed clock to an application on a network device. Especially on Linux-based systems, applications such as timers or monotonic clocks are associated with the global time. This can lead to problems, particularly in complex production processes, as many network devices use different clocks for applications like timers, or even have only one clock on the system, which is typically a work clock. Furthermore, the global clock can sometimes experience interruptions because it is synchronized with the associated master clock via GPS using TAI or UTC.

[0025] While it would be possible to manually set the preferred clock for each application, this is very time-consuming. Furthermore, this negates the advantage of a second clock, such as the global clock, which can be valuable for logging entries, certificates, or error messages. Therefore, it is advantageous that the network-critical processes are controlled by the work clock, but the global clock is still available and can be used.

[0026] The time synchronization according to the invention relates to a network with various network participants. A network participant can be, for example, a PC for controlling a test bench, a production machine, a transport system, but also bus modules, drive modules, bus couplers, I / O modules with integrated network connectivity, cameras, HMI devices, network-integrated sensors and actuators, and network infrastructure (switches, bridges, etc.). In every network, there are multiple masters for time synchronization. A master role is provided for each clock. The master roles can reside on a single physical network participant, or they can be distributed across different network participants.

[0027] Other clocks in the network participants then function as slaves with regard to time synchronization. According to the invention, there is at least one primary clock and one secondary clock in the slave. These can have different time bases, such as a classic clock displaying days and hours, or a clock can only count from an initialization point in seconds or fractions of seconds (e.g., microseconds or nanoseconds). The slaves receive synchronization messages from the majority of masters to perform synchronization. A master can often also be supported by other "standby" masters. As long as the master actively initiates time synchronization, the standby masters act like slaves. In the event of a communication failure with the master, the standby masters can take over the time synchronization. A network failure can, for example, have a data transfer-related cause or a physical cause, e.g.,by cutting a pipe, for example during construction work.

[0028] For example, a working time and a global time can be defined within a network. In this scenario, one clock might function as a working time clock, displaying a specific working time, while a second clock acts as a global time clock. However, other time formats are also possible, such as production time, batch time, and similar values. Working time is often represented as a scalar value that counts down from an initialization point. This can result in numbers that are cumbersome to read and interpret, as no standardized time representation can be applied to working time. Therefore, a global time, unlike working time, can often be designed to be user-friendly, displaying a readable time along with the date and time. Examples of global times that can be used within the network include Coordinated Universal Time (UTC) or International Atomic Time (TAI).In this process, a master device uses, for example, a GPS connection to synchronize with TAI or UTC. If different parts of a network use different global times, a conversion process can be used to translate between these different global times. This conversion can, for example, be performed using a Portable Operating System Interface (POSIX)-based algorithm. ISO 8601:2004, for instance, describes the conversion from TAI to UTC.

[0029] According to the invention, a slave receives an initial synchronization message from the first master, which is used to synchronize the slave's clock in a first step. A time jump may be necessary, for example, after a network participant starts up, as this results in a significant time difference. The synchronized clock rate of the slave's clock is used to set the clock rate for the global clock in the slave. The global clock is then updated by the second synchronization message from the second master and, for example, adjusted to the TAI (Time-Assisted Interaction). Consequently, the global time is correct at the times of the synchronization messages, but may exhibit slight deviations between synchronization messages due to the clock rate being set by the slave's clock. However, since the global clock is synchronized several times per second, this deviation may be irrelevant for applications with user interaction.Such differences are in the lower microsecond range and smaller, and are usually perceived by a person as simultaneous.

[0030] Advantageous time synchronization occurs in intervals between 10 and 200 ms.

[0031] For example, time synchronization is typically performed regularly within the preferred range of 10–200 ms. However, irregular intervals are also possible. For instance, time synchronization might be intensified during a production process and otherwise run at a different interval, or irregularities could arise due to a change in the master role within the network.

[0032] In an advantageous embodiment, a slave can also contain a timestamper, which is associated with a first clock and / or a second clock, and assigns a timestamp to a data packet.

[0033] Such timestampers assign a timestamp from the associated clock to an outgoing event. This can be advantageous, for example, for targeted data traffic using data packets in the production process, where an event then receives the timestamp of the associated clock, such as a work clock.

[0034] In an advantageous embodiment, time synchronization in at least one slave can be achieved via synchronization, and a clock rate and a time difference can be calculated, and the time difference between the first clock and / or second clock and the master can be compensated for via a time jump and / or a frequency adjustment.

[0035] Synchronization is advantageous when the clock rate and time difference of two clocks need to be aligned. Then, two clocks, for example, a work clock and a global clock, will display the same time.

[0036] In a further advantageous embodiment, time synchronization in at least one slave can be achieved via syntonization, a clock rate and a time difference can be calculated, and the time difference between the first clock and / or second clock and the master can be compensated for by adjusting the clock rate.

[0037] Synchronization can be sufficient if two clocks are to have the same clock rate, but it is not necessary to synchronize the difference. Various times can be synchronized in a network with a large number of network participants. Preferably, the majority of masters send a synchronization message for each clock, for example, 8 or 32 times per second.

[0038] In a preferred embodiment, a timer is associated with a first clock and / or with a second clock and issues an interrupt request (UA) at regular intervals.

[0039] A timer controls cyclical processes in a system by issuing an interrupt request at regular intervals (e.g., 1 millisecond, ms). This can be important for current and future events that are to be triggered by a predefined interrupt request from the timer. With the time synchronization according to the invention, a timer can be associated with both the operating clock and the global clock and issues correct interrupt requests.

[0040] The present invention is described below with reference to the Figuren 1 bis 5 In more detail, the invention is explained, and exemplary, schematic, and non-restrictive embodiments are shown. This includes showing Fig. 1 . a flowchart for time synchronization in the state of the art, Fig.2 . a flowchart for the time synchronization according to the invention, Fig.3 . a schematic time synchronization of the clocks in the slave in the state of the art, Fig.4 . a schematic time synchronization of the clocks in the slave according to the invention, and Fig.5 the functioning of a timer in a network with time synchronization according to the invention.

[0041] Fig.1 This document describes a prior art method for data transfer for time synchronization in a network 1 with network participants. Different roles for time synchronization are distributed within the network 1. Network 1 contains participants with the roles of master M and slave S. According to the invention, at least two clocks are provided. However, a plurality of clocks can also be present and subject to time synchronization. In the time synchronization according to the invention, there is at least a first clock and a second clock. The first clock runs with a first time, and the second clock with a second time.

[0042] For illustrative purposes, a work clock 3 is shown as a first clock and a global clock 5 as a second clock. However, entirely different clocks could also be running in a network and on network participants, for example, a production clock, a batch clock, etc. For synchronization, the role of a master M1 is assigned for working time and the role of a master M2 for global time. In principle, both masters M1 and M2 can run on the same network participant, but are often distributed across different network participants. All other work clocks 3 and global clocks 5 in a network are then considered slave clocks. According to the invention, a slave S contains a work clock 3, which outputs a first time as the work clock time, and a global clock 5, which outputs a second time as the global time.Global time can typically be the time of an atomic clock such as TAI or UTC, which should be the same everywhere in the world, regardless of time zones. However, it is also possible that a slave S contains only a single clock. This is often a work clock 3, and no synchronization to global time takes place. The clocks in the present invention can represent any combination of hardware-based and logical clocks. For example, both work clock 3 and global clock 5 can access the same hardware-based clock, or they can each access a separate hardware-based clock.

[0043] Network participants are connected to each other via network cables. These network cables often form a data bus for data communication between the network participants. Network cables can be LAN cables, network buses, fiber optic cables, and similar devices that enable communication within the network between participants. Any communication protocol can be implemented for data communication. Network infrastructure can also be provided to connect different networks or different sections of a network, such as switches, routers, etc. Wireless data traffic with time synchronization over a wireless network, such as Wireless LAN (WLAN), is also conceivable within a network or parts of a network.All network topologies for Network 1 that are familiar to experts and enable targeted data transfer with time synchronization between network participants are possible. In terms of data traffic, Network 1 allows (among other data messages) the bidirectional sending and receiving of synchronization messages between different network participants.

[0044] Synchronization messages are exchanged between network participants in network 1 for time synchronization. One of the masters, M1 or M2, regularly sends synchronization messages D1 and D2 to at least one slave, S. Master M1 sends a synchronization message D1 to synchronize the work clock 3, and master M2 sends a synchronization message D2 to synchronize the global clock 5. The synchronization messages D1 and D2 can be sent in a single data packet, i.e., a self-contained unit of data intended for network traffic. Alternatively, they can be sent independently in separate data packets within network 1. Preferably, the synchronization messages D1 for the work clock 3 are sent at a higher interval than the synchronization messages D2 for the global clock 5.The Work Clock 3 can often be synchronized four times as often as the Global Clock 5.

[0045] Synchronization message D1 contains a timestamp t1 from master M1, and synchronization message D2 contains a timestamp t2 from master M2. A timestamp t1, t2 is the time of a master's operating clock 3 or global clock 5 at the time a synchronization message D is sent. The synchronization messages D1, D2 are used to calculate the slave's clock rate r and a time difference dt to master M1, M2, and to set the operating clock 3 or global clock 5 so that the operating time and global time are the same as the master's and continue to run synchronously.

[0046] The clock rate r defines a periodic signal, determined by its frequency or period, and is often used for the temporal coordination of processes in a digital system. A clock rate r can, for example, be output by a quartz oscillator in a hardware-based clock. The time difference dt describes the absolute difference between two times. For example, the global time at master M might be 11:23 and at slave S 11:25. Then the time difference dt would be 2 minutes or 120 seconds.

[0047] Fig. 1 This shows the state-of-the-art synchronization process. At specific times, which can be predetermined or result, for example, from a change of master M1, the master M1 sends a synchronization message D1 across the network to at least one slave S. The synchronization message D1 receives a timestamp t1 and has a network propagation delay of Δt1. This delay can be considered known or at least estimated. By default, the propagation delay Δt1 can be measured using custom messages. The synchronization message D1 arrives at a slave S, for example, at a network port in slave S, and is forwarded to the master clock 3. Typically, a time synchronization mechanism 7, 8 in each slave S, for example, in a clock, calculates the deviations from the master M1, M2. The master clock 3, or...The time synchronization mechanism of master clock 7 now uses the timestamp t1 and the known propagation delay Δt1 to calculate the clock rate r1 and the time difference dt1 for its own master clock 3 and to perform a time synchronization. If there are large deviations between master M1 and master clock 3 in slave S, a time jump is performed and the clock rate rA is also adjusted. Adjusting the clock rate r means that the duration of a clock cycle in slave S and master is the same after the adjustment, and thus time progresses at the same rate. Such an adjustment of the clock rate r might only be possible after a certain number of synchronization messages D1. For example, with small deviations, it might only be necessary to adjust the clock rate rA, for example, by speeding it up or slowing it down.The clock rate r can be accelerated for a certain period of time to compensate for a difference, for example, allowing 1.2 seconds instead of 1 second to elapse per clock cycle. Of course, technically typical clock rates are in much smaller ranges, for example, 8-10 ns (nanoseconds). For small differences, adjusting the clock rate r (frequency adjustment) may therefore be sufficient.

[0048] Master M2 also sends a synchronization message D2 to Global Clock 5 in Slave S. Synchronization message D2 receives a timestamp t2 from Master M2 and has a propagation delay Δt2, which can again be considered known. Because the roles of Master M can be performed on different network participants, the propagation delays of synchronization messages D1 and D2 can differ. Different propagation delays can also arise, for example, if synchronization messages D1 and D2 are sent via different network paths. Global Clock 5, or rather the time synchronization mechanism of Global Clock 8, in Slave S calculates the clock rate rG and the time difference dt2, as described above for the first synchronization message D1. This can be done via a time jump or a frequency adjustment, depending on the deviation between Master M2 and Global Clock 5 in Slave S.

[0049] In the prior art, there is therefore no interaction between the work clock 3 and the global clock 5. Each is synchronized independently by its respective master M1, M2. Due to time synchronization via the first synchronization message D1 and the second synchronization message D2, it is possible for both the work clock 3 and the global clock 5 to perform time jumps forward or backward, and / or for the clock rate rA, rG of one or both clocks (i.e., work clock 3 and / or global clock 5) to be accelerated or decelerated in order to compensate for a time difference with one of the masters M1, M2. The prior art time synchronization can therefore result in the work clock 3 and the global clock 5 having different clock rates rA and rG.

[0050] Fig. 3 This shows an exemplary time course during regular time synchronization of the master clock 3 and the global clock 5 in the prior art. Time differences dt and clock rates r are always relative to a master M1, M2. The ordinate describes the time course of the timestamps t1, t2, and the abscissa the arrival of new synchronization messages D(t) from master M as a function of time and transit time t+Δt. The arrival of the synchronization messages is not constant, but depends on the synchronization intervals of masters M1 and M2. The master clock 3 and the global clock 5 initially run at clock rates rA and rG, respectively. Master M1 sends the first synchronization message D1.1 with timestamp t1.1, and this arrives at slave S after transit time Δt1. Slave S compares the timestamp t1.1 of the first synchronization message D1.1.The slave S receives a synchronization message D 2.1 from the master M2 for the global clock 5. Using the timestamp t 1.1 of the synchronization mechanism 7, a new clock rate r A 1 and a time difference dt 1.1 for the global clock 3 are calculated based on the deviations of the global clock 3 from the timestamp t 1.1. The global clock 5 has not yet received a synchronization message and continues to run at clock rate r G. Depending on the calculated time difference dt 1.1, the global clock 3 makes a jump as a result of the synchronization and changes its clock rate r A 1. Next, in this example, the slave S receives a synchronization message D 2.1 from the master M2 for the global clock 5. Using the timestamp t 2.1 of the synchronization message D 2.1, a clock rate r G 1 and a time difference dt 2.1 are calculated by the global clock time synchronization mechanism 8. This causes the Global Clock 5 to make a jump and change the clock rate r G.1 to . Fig.3 , which is due to the slope in Fig.3 is visible. In a preferred embodiment, a jump is performed only after the first synchronization message from both the working clock 3 and the global clock 5, and subsequent synchronization messages D1, D2 can only cause a change in the clock rate rA, rG. The process repeats at different times. The propagation times Δt can differ between the different synchronization messages, for example, if a different master M is determined, but are known to the slave S.

[0051] This process can repeat as long as synchronization messages D1, D2 are sent from the master M1, M2 to the slave S for time synchronization. Identical times on the ordinate, at the same clock with the same value, would have the same timestamp t and would then be indistinguishable. This is exemplified in Fig. 3 This is indicated at work clock 3 with the timestamps T1 and T2. Events that would have this timestamp t, i.e., T1 and T2, would generally no longer be distinguishable with regard to the time base.

[0052] Fig. 2 Figure 1 shows the time synchronization according to the invention in a network 1. A master M1, M2 sends, as described above, a first and a second synchronization message D1 and D2. The first synchronization message D1 also contains a timestamp t1 in the case of the invention, so that the slave S can synchronize the working clock 3. The second synchronization message D2 contains a timestamp t2 to synchronize the global clock 5. The global clock 5 always calculates the time difference dt2 to a global time specified by a master M2. Both of these calculations are performed via the time synchronization mechanisms 7, 8. Consequently, for each synchronization message D2, the global time between the master M2 and the slave S is synchronized. However, the clock rate rG of the global clock 5 is not synchronized via the synchronization message D2.

[0053] The clock rate rA of the working clock 3 is now used to specify the clock rate rG of the global clock 5. Thus, the clock rate rA of the working clock 3 corresponds to the clock rate rG of the global clock 5, i.e., rA = rG. This results in an internal synchronization of the clock rates rA and rG within the slave S via the setting of the working clock 3, and not, as previously, via a setting from the master M2, which sent a second synchronization message D2 to the slave S. Consequently, there are no differing clock rates rA and rG between the working clock 3 and the global clock 5, as was the case in the prior art. This is advantageous because applications such as a timer or a monotonic clock, which can be associated with either the working clock 3 or the global clock 5, now always access the same clock rate rA = rG.

[0054] In a highly illustrative example, the clock rate rA of the work clock, calculated based on the first synchronization message D1, can only run at 90% of the speed compared to the clock rate rG of a global clock 5. After a second synchronization message D2, for example at 01:00, the global clock 5 is synchronized with the master M2 to the global time. In this example, the clocks receive no synchronization messages for one hour until 02:00. Since the clock rate rA is synchronized to rG, only 56 minutes have passed in the global clock at slave S, and it would now display a time of 01:56, even though it is now 02:00. With the next second synchronization message D2 at 02:00, the global clock is set to the value 02:00 and is therefore synchronized with the global time again.

[0055] Global Clock 5 therefore often makes time jumps based on the second synchronization message D2. These jumps can be significantly smaller than the resolution of Global Clock 5, and of course not as large (4 minutes) as in the example above. For example, the resolution of Global Clock 5 might be in the range of 1 microsecond (µS), while the time jumps calculated based on the incoming second synchronization message D2 are in the range of less than 1 µS. Thus, such time jumps can be irrelevant for user-related applications because these small deviations are perceived as simultaneous by humans.

[0056] Fig.4 Figure 1 shows an exemplary time course during a time synchronization according to the invention, which can, for example, occur regularly or at certain defined time intervals. The ordinate describes the time course t and the abscissa the arrival of new synchronization messages D(t) from a master M1, M2 as a function of time and transit time t+Δt. Before the time synchronization according to the invention, for example after initialization of the network 1, the working clock 3 and the global clock 5 can run at different clock rates rA for the working clock 3 and rG for the global clock 5, which is not in Fig.4 The first synchronization message D 1.1 with timestamp t 1.1 arrives at slave S after a runtime of Δt 1.1, and the work clock 3 calculates a new clock rate r A.1. In a preferred embodiment, the work clock 3 can also calculate a working time difference dt 1.1 with the first synchronization message D 1.1 and performs a time jump, as described above. In most cases, subsequent time jumps are unnecessary because the deviation between master M1 and work clock 3 in slave S is small enough, and then only one

[0057] Frequency adjustment is performed. The clock rate rG of the global clock 5 in Fig.4 According to the invention, it is adapted to the clock rate r A of the working clock 3, as can be seen from the parallel slopes in Fig. 4 In this area, it is also possible that Global Clock 5 is running incorrectly, as described in the illustrative example above. However, the Global Time is accurate again by the time the second synchronization message D2 is received.

[0058] After a further period, the synchronization message D 2.1 from master M2 reaches slave S. The time synchronization mechanism 8, e.g., of the global clock 5, calculates the global time difference dt 2.1 using the second synchronization message D2. At the time of processing by the synchronization mechanism 8, the global time is identical to the global time received from master M2. It then continues to run at the clock rate r A of the working clock. This procedure is repeated with the arrival of each first and second synchronization message D 1.n and D 2.n from masters M1 and M2.

[0059] Slave S can also send data traffic to network 1, for example, via data packets Dp, which can control various events and are not limited to time synchronization. A data packet can use a network port for this purpose. For most applications, it may be necessary to assign a timestamp t to the data packet. This can be done via a timestamper in Slave S, which assigns a timestamp t from Slave S to an outgoing data packet. A timestamp t is the time recorded by the work clock 3 or the global clock 5 in Slave S at the time the data packet is sent. The timestamp t can also be important for regulating data traffic in network 1. Depending on the event, work clock 3 can access a work timestamper, or global clock 5 can access a global timestamper. If an event requires a timestamp t from work clock 3, this is performed by the work timestamper.In Global Clock 5, this functionality is handled by the Global Timestamper. For events closely related to a user, the global timestamp t5 of Global Clock 5 can be used, while for communication events between network participants, such as coordinated production interactions, the work timestamp t3 of Work Clock 3 can be used.

[0060] Fig. 5Figure 1 shows a preferred embodiment of a network 1 with timers 6, which uses the time synchronization according to the invention. For clarity, both master roles M1, M2 are arranged in a network participant. The network participants are arranged in a network topology. According to the invention, the first and second masters M1, M2 send the synchronization messages D1, D2 via the network 1 to a plurality of slaves S. Each network participant, i.e., both masters M1, M2 and the slaves S with respect to time synchronization, has a timer 6. A timer 6 issues an interrupt request UA at regular intervals, for example, every 1 millisecond (ms). This can be particularly important for cyclic applications that should run simultaneously on all network participants or in a predefined sequence.For example, systems for a production process access timer 6 and, in the simplest case, switch a valve to a predefined interruption request UA.

[0061] Therefore, a timer 6 on each device must issue the interrupt request UA after a certain time interval. If the clock rates in the slaves S differ, the interrupt requests UA will occur at different times. This can, for example, trigger errors and problems in high-precision production processes.

[0062] A network topology can contain a variety of different network participants, such as computing units, bus modules, drive modules, bus couplers, I / O modules with integrated network connectivity, cameras, HMI devices, network-integrated sensors, and actuators, and these may run on a wide range of operating systems, such as Linux / Unix, Windows, Android, and similar systems. Depending on the network participant and its operating system, Timer 6 accesses either a work clock 3 or a global clock 5 based on its predefined settings. Some network participants, such as S" or S‴, only have a work clock 3, and Timer 6 accesses this work clock accordingly.

[0063] In the current state of the art, each timer 6 in network 1 would have to be set to access a uniform clock, for example, the global clock 5. However, this would cause problems for network participants without global clock 5. Synchronization with the work clock 3 would, as described above, negate the advantages of the global time.

[0064] The time synchronization according to the invention enables a timer 6 in network 1 to access any clocks in the network participant, and the interrupt request UA occurs everywhere after the same time interval. This allows for highly precise planning and implementation of control processes, such as production processes.

Claims

1. A method for time synchronization in a network (1), the network (1) comprising a plurality of masters (M1, M2) and at least one slave (S), the at least one slave (S) receiving synchronization messages (D1, D2) from the plurality of masters (M1, M2) for the time synchronization of a first clock (3) and a second clock (5) of the slave (S) via the network (1), a first master (M1) sending a first synchronization message (D1) having a first time stamp (t1) to the at least one slave (S) for the time synchronization of the first clock (3) and the at least one slave (S) comparing the first time stamp (t1) of the first synchronization message (D1) with the first current time of the first clock (3) and, based on this comparison, calculating a clock rate (rA) and a time difference (dt1) between the first clock (3) and the first master (M1) and carrying out a time alignment in such a way that the first clock (3) in the slave (S) runs with the synchronized time, a second master (M2) sending a second synchronization message (D2) having a second time stamp (t2) to the at least one slave (S) for the time synchronization of the second clock (5), characterized in that the clock rate (rA) of the first clock (3) is used to specify a clock rate (rG) for the second clock (5), by setting the clock rate (rG) of the second clock (5) to the clock rate (rA) of the first clock (3), and in that the at least one slave (S) compares the second time stamp (t2) of the second synchronization message (D2) with the second current time of the second clock (5) and, based on this comparison, calculates a time difference (dt2) between the second clock (5) and the second master (M2) and carries out a time alignment in such a way that the second clock (5) in the slave (S) runs with the synchronized time.

2. The method according to claim 1, characterized in that time synchronization takes place at intervals of between 10 and 200 ms.

3. The method according to any of claims 1 or 2, characterized in that a time stamper (8) is associated with a first clock (3) and / or a second clock (5) in the slave (S) and assigns a time stamp (t) to a data packet.

4. The method according to any of claims 1 to 3, characterized in that time synchronization takes place in at least one slave (S) via synchronization and a clock rate (r) and a time difference (dt) are calculated, and the time difference (dt) between the first clock (3) and / or the second clock (5) and the master (M1, M2) is compensated for by a time jump and / or a frequency alignment.

5. The method according to any of claims 1 to 3, characterized in that time synchronization takes place in at least one slave (S) via syntonization and a clock rate (r) and a time difference (dt) are calculated, and the time difference (dt) between the first clock (3) and / or the second clock (5) and the master (M1, M2) is compensated for by adjusting the clock rate (r).

6. The method according to any of claims 1 to 5, characterized in that a timer (6) is associated with a first clock (3) and / or with a second clock (5) and issues an interrupt request (UA) at regular intervals.

7. A network (1) comprising of a plurality of masters (M1, M2) and at least one slave (S), the plurality of masters (M1, M2) and the at least one slave (S) both having a first clock (3) and a second clock (5) each, the first master (M1) being configured to send a first synchronization message (D1) having a first time stamp (t1) to the at least one slave (S) via the network (1), and the at least one slave (S) being designed to calculate a clock rate (rA) and a first time difference (dt1) relative to the first current time of the first clock (3) in relation to the first master (M1) on the basis of the first time stamp (t1) and carry out a time alignment in such a way that the first clock (3) in the slave (S) runs with the synchronized time, the second master (M2) being configured to send a second synchronization message (D1) having a second time stamp (t2) to the at least one slave (S) via the network (1), characterized in that the at least one slave (S) is designed to specify the clock rate (rA) of the first clock (3) as a clock rate (rG) for the second clock (5), and to set the clock rate (rG) of the second clock (5) to the clock rate (rA) of the first clock (3), and in that the at least one slave (S) is designed to calculate a second time difference (dt2) between the second current time of the second clock (3) and the second master (M2) on the basis of the second time stamp (t2) and carry out a time alignment in such a way that the second clock (5) in the slave (S) runs with the synchronized time.