- 1. Introduction
- 2. FlexRay Communication
- 3. FlexRay Bus Access
- 4. FlexRay Framing
- 5. FlexRay Synchronization
- 6. Learning Objectives Test
The synchronization of local clocks in a FlexRay cluster is based on the fact that the send and receive time points of all static messages are known to each FlexRay node from the outset. This ensures that all nodes of a FlexRay cluster are able to correct both the offset and the rate. After just a few cycles all FlexRay nodes begin every communication cycle at the same time point and with the same rate.
In a FlexRay cluster, at least 2 and a maximum of 15 FlexRay nodes act as the sync nodes (synchronization node), which transmit a sync message (synchronization message) in a defined static slot of each cycle. These are not supplemental messages, rather they are static messages in which the sync frame indicator is set.
All FlexRay nodes compare the a priori known time points with the points at which the sync messages actually arrive. Then they create a sorted list of differences, from which they compute their offset correction value using the fault tolerant midpoint (FTM) algorithm.
The FTM algorithm tosses out extreme values from the list, so that seriously deviating local clocks do not bring communication in the FlexRay cluster out of step. In the pool of up to seven sync nodes, the minimum and maximum values are tossed out. If there are more than seven sync nodes, the second largest and second smallest measured values are also tossed out.
The remaining measured values are summed and an average is calcluated — the results represent the offset correction value. The method for calculating the rate correction value is identical, the only difference being that the FlexRay nodes measure the cycle lengths underlying the sync messages.
Both, the offset correction and rate correction, are performed based on the local clocks, whose smallest unit is the microtick. An offset adjusts a FlexRay node by adding or removing a certain number of microticks (corresponding to the offset) in the NIT at the end of each odd cycle. This is how a FlexRay node shifts its own start of the next cycle and adapts itself to the other FlexRay nodes.
To ensure that the rate correction does not act like an offset correction, a FlexRay node uniformly distributes the number of microticks of the rate correction value over the next even and odd cycles. So every FlexRay node is capable of either shortening or lengthening its cycle.