This application claims priority of European Patent Office application No. 07017615.1 EP filed Sep. 7, 2007, which is incorporated by reference herein in its entirety.
The invention relates to a method for transmitting synchronization messages in a communication network and a corresponding communication network.
Communication networks are used in a very wide range of areas to control work sequences in a decentralized manner. In industrial automation systems in particular it is particularly important for the automatic work processes to be coordinated with one another. This is achieved in that the individual communicating network nodes in the communication network have internal clocks, with synchronization messages being transmitting to synchronize all the internal clocks. The internal clock of a respective network node hereby operates at a corresponding node clock frequency, which may in some instances be different for the individual network nodes. The clocks are synchronized on the basis of a predefined synchronization clock frequency, with the synchronization messages being transmitting as a function of the synchronization frequency. This means that synchronization messages are sent at fixed clock intervals according to the synchronization clock frequency. The individual synchronization messages transmitted in the communication network contain the pulse counter status of the synchronization clock. Each network node updates this pulse counter status by estimating the number of pulses of the synchronization clock between transmission of the synchronization message at the preceding network node and receipt of the synchronization message at the respective network node. This estimate is generally carried out by estimating the pulse ratio (also referred to as the Rate Compensation Factor RCF) between the synchronization clock frequency and the node clock frequency of the respective network node. The estimated pulse ratio can then be used to convert the time interval between receipt of a synchronization message at the preceding network node and receipt of the synchronization message at the respective network node, measured in node clock frequency pulses, to synchronization clock frequency pulses. The resulting number of pulses is then added to the pulses of the received synchronization message and a correspondingly updated synchronization message is sent out again from the corresponding network node. It is problematic here that fluctuations can occur in the synchronization clock frequency, which result in an imprecise estimation of the pulse ratio and therefore incorrect determination of the pulse counter status of the synchronization clock in the individual network nodes.
The Profinet standard is known from the prior art in the field of industrial automation, this being an Ethernet which meets industrial requirements. This standard operates according to the principle set out above, according to which the pulse counter statuses in the synchronization messages are updated in the network nodes. Profinet-based systems generally use the standard IEEE 1588 to synchronize the internal clocks of the network nodes, said standard updating the pulse counter statuses of the synchronization messages according to the principle set out above. According to this standard synchronization messages are transmitted in succession from one network node to the next in a logical sequence or tree structure. The synchronization messages originate from a master element, which is the first element in the sequence or in the tree structure. The synchronization messages originally contain a time stamp of the counter of a synchronization clock in the master element when a synchronization message was transmitted. The network nodes in the sequence or tree structure process and forward this information. A network node here adds all the estimated time delays between transmission of a synchronization message from the preceding network node and its own transmission of the synchronization message as content to the synchronization message.
As set out above it is problematic with the communication networks known from the prior art that when the synchronization clock frequency of the synchronization clock is changed, errors occur in the determination of the pulse counter status in the network nodes, which in turn results in imprecise synchronization of the internal clocks of the network nodes.
An object of the invention is therefore to create a method for transmitting synchronization messages in a communication network, which allows precise synchronization of the individual internal clocks of the network nodes.
This object is achieved by the independent claims. Developments of the invention are set out in the dependent claims.
The inventive method is deployed in a communication network, which comprises a plurality of network nodes communicating with one another, each containing an internal clock, which is timed at a node clock frequency assigned to the respective network node, the synchronization messages serving to synchronize the internal clocks of the network nodes.
In the inventive method the synchronization messages are sent in succession from a preceding network node to a subsequent network node as a function of a synchronization clock frequency predefined by a synchronization clock, the synchronization messages containing the pulse counter status of the synchronization clock. A respective network node hereby detects the change over time in pulse ratio between the synchronization clock frequency and its node clock frequency at predefined time intervals based on synchronization messages received in the past. On the basis of this detected change over time in pulse ratio the respective network node approximates the pattern over time of the pulse ratio by means of a function so that there is a mathematical relationship between time and the behavior of the pulse ratio. On the basis of the pattern over time of the pulse ratio approximated using the function the respective network node updates the pulse counter status of a received synchronization message to the pulse counter status on transmission of the synchronization message to the next network node.
The inventive approximation of the behavior over time of the pulse ratio using a function takes into account a change in the pulse ratio due to a change in the synchronization clock frequency and/or the node clock frequency when determining the pulse counter status. In particular the pulse ratio at the time of transmission of the synchronization message to the next network node can be predicted using the function, thereby achieving significantly more precise determination of the current pulse counter status.
In a preferred embodiment of the inventive method the pulse counter status of the synchronization message is updated in such a manner that the number of synchronization pulses is determined between transmission of the synchronization message at the preceding network node and transmission of the synchronization message at the respective network node, with the approximated pattern over time of the pulse ratio in combination with a predefined time delay being used to determine this number of synchronization pulses, with the time delay including the transmission time for a synchronization message from the preceding network node to the respective network node and the processing time for a received synchronization message in the respective network node.
In one embodiment of the inventive method the approximated pattern over time of the pulse ratio is used to determine the pulse ratio at the time of transmission of a synchronization message at the preceding network node, this pulse ratio in combination with the predefined time delay being used to determine the number of synchronization pulses between transmission of the synchronization message at the preceding network node and transmission of the synchronization message at the respective network node. The pulse ratio is therefore assumed to be constant between transmission of the synchronization message at the preceding network node and transmission of the synchronization message at the respective network node. This does not always correspond to actual circumstances but it has proven that the resulting error is very small. One advantage of this variant is the simple calculation of the number of synchronization pulses within the predefined time delay, which can in particular be determined by multiplying the pulse ratio, which is assumed to be constant, by the time delay.
More precise determination of the number of synchronization pulses within the time delay can be achieved in one variant of the invention by integrating the approximated pattern over time of the pulse ratio over the time delay and using this integration to determine the number of synchronization pulses between transmission of the synchronization message at the preceding network node and transmission of the synchronization message at the respective network node. In particular the integration result here represents this number of synchronization pulses within the time delay.
In a further variant of the inventive method the change over time in the pulse ratio in a respective network node is determined based on the mean values of the pulse ratio between past successive synchronization messages.
The function used to approximate the pattern over time of the pulse ratio is preferably a linear function, i.e. the determined change over time in the pulse ratio represents a straight line gradient. In a particularly preferred embodiment, the linear function, referred to as RCF(t), is as follows:
RCF(t)=Δm·(t+Tsync/2)+p2
where t is measured from transmission of a synchronization message at a network node preceding the respective network node and where Tsync is the time interval between two successive synchronization messages.
Δm is also a straight line gradient, corresponding to the change over time in the pulse ratio, which was detected based on synchronization messages received in the past and p2 is the mean pulse ratio between two successive synchronization messages at the time of transmission of the synchronization message at the preceding network node.
As can be seen from the detailed description in the application, it is possible with the above linear function RCF(t) to avoid errors in the determination of the pulse counter status in the event of a linear change in the pulse ratio.
In some instances instead of a linear function a polynomial function can also be used to approximate the pattern over time of the pulse ratio. This can increase the accuracy of the method in the event of non-linear changes in the pulse ratio.
In a further embodiment of the inventive method the synchronization clock frequency is generated in a synchronization element in the communication network, it being possible to see the synchronization element as a further network node, which contains the synchronization clock and sends the synchronization messages as a function of the synchronization clock frequency to at least one of the other network nodes of the communication network.
In a particularly preferred embodiment of the inventive method the network nodes in the communication network communicate with one another according to the Profinet standard. The inventive method is also preferably deployed in a communication network in an industrial automation system, in particular in a production line.
As well as the method described above the invention also relates to a communication network with a plurality of network nodes, which communicate with one another, each containing an internal clock, which is timed at a node clock frequency assigned to the respective network node, wherein:
The communication network is hereby preferably embodied so that each variant of the method described above can be implemented in the communication network.
Exemplary embodiments of the invention are described in detail below with reference to the accompanying figures, in which:
The inventive method is preferably deployed in an industrial automation system, in which distributed components of the system communicate with one another, to control manufacturing sequences, e.g. in automobile production. To this end the individual components communicate with one another wirelessly and/or wired by way of a communication network. The components thus represent network nodes of the communication network.
In the embodiment according to
The master element M and the individual network nodes S1 to SN communicate in sequence with one another, with synchronization messages being transmitted from the master element M to the node S1 and from this to the node S2 etc. to the node SN. To achieve precise synchronization in the individual slaves, the pulse counter status in the synchronization messages SM must be updated in the individual slaves. Therefore the time delay, required between transmission of a synchronization message from the preceding slave (or from the master element) and transmission of the synchronization message from the respective slave to the next slave, is known in each slave. This time delay is made up of the time interval LDi and BDi (i=1, . . . , N), it being possible for said time interval to be different for each slave. LDi here is the time interval required to transmit the message from the preceding slave Si-1 to the next slave Si (LD=Line Delay). BDi is the processing time required in the slave Si to process a received synchronization message before transmission of the synchronization message to the next slave (BD=Bridge Delay). This delay time is indicated in the respective slave in pulses according to the slave clock frequency.
In order now to update the pulse counter status of a received synchronization message SM, it is necessary to estimate the pulse ratio between the synchronization clock frequency fm and the respective slave clock frequency fs in the respective slave. This pulse ratio is also referred to below as RCF and in the embodiment described here is the quotient of fm and fs. Multiplying the estimated pulse ratio by the time delay gives the number of counter pulses on retransmission of the previously received synchronization message. This number is added to the pulse counter status of the received synchronization message and a synchronization message with this current pulse counter status is transmitted from the respective slave. As described below with reference to
tM: time of transmission of a synchronization message at master element M;
tS1: time of transmission of a synchronization message from slave S1 to slave S2;
tS2: time of transmission of a synchronization message from slave S2 to slave S3.
In the embodiment of the inventive method described here each slave estimates the change over time in the pulse ratio RCF via the change in the pulse counter statuses of a number of received synchronization messages. The slave S1 thus determines the gradient Δm of the straight line resulting from time t0. The slave S1 can also determine the pulse ratio at time tM by determining the difference between the pulse counter statuses of the synchronization messages transmitted by the master element M at the start and end points of the interval Tsync. This value is shown as RCF0′ in
Like the slave S1 the slave S2 can determine the pulse ratio at time tS1. The resulting value RCF1′ again does not correspond to the actual value RCF1 of the pulse ratio at time tS1. If the number of pulses within the time periods D1 and D2 were to be determined on the basis of values of the pulse ratios RCF0′ and RCF1′ assumed to be constant, this would produce an error, shown in
The error according to the hatched region is divided here into two triangles T1 and T2 and two rectangles R1 and R2. The error can be calculated mathematically as follows:
Error=Δm/2·((LD1+BD1)2+(LD2+BD2)2+(LD1+BD1)·Tsync+(LD2+BD2)·Tsync)) (1)
To compensate for this error, the behavior over time of RCF is approximated. To this end the change over time in RCF is determined at regular intervals, by detecting the change over time in RCF0′ and using it to calculate Δm. In the example in
RCF(t)=Δm·(t+Tsync/2)+p2 (2)
Here t is measured from transmission of the synchronization message from the master element M, Δm corresponds to the straight line gradient and p2 corresponds to the value of RCF0′.
By determining the above-mentioned straight line function it is now possible to predict the value of the pulse ratio RCF at time tS1, and by corresponding integration over the time interval D1 it is possible to determine the precise number of pulses according to the synchronization clock frequency and to update the synchronization message accordingly. In practice the integration is such that the error according to the above equation (1) (without the terms dependent on D2) is added to the value, which results from multiplying the pulse ratio RCF0′ originally determined incorrectly by the slave S1 by the time interval D1. The method is implemented in an identical manner for the next slave S2 and further following slaves, so that overall the error according to the hatched region of
The representation in
Also the pattern over time of the pulse ratio does not have to be approximated using a linear function but polynomials can also be used, thereby achieving a more precise estimation of the pattern over time of the pulse ratio.
As can be seen from the above, an appropriate functional approximation of the pattern over time of the pulse ratio allows the pulse ratio at the time of transmission of the synchronization message in the respective slave to be predicted. This allows effective error compensation, said errors being shown as a hatched region in
Number | Date | Country | Kind |
---|---|---|---|
07017615.1 | Sep 2007 | EP | regional |