Читать книгу Engineering Autonomous Vehicles and Robots - Shaoshan Liu - Страница 33
2.3.2 The FlexRay Communication Protocol
ОглавлениеThe FlexRay communication protocol is a time-triggered protocol that provides options for deterministic data that arrive in a predictable time frame (down to the microsecond) as well as CAN-like dynamic event-driven data to handle a large variety of frames. FlexRay accomplishes this hybrid of core static frames and dynamic frames with a pre-set communication cycle that provides a predefined space for static and dynamic data. This space is configured with the network by the network designer.
While CAN nodes only need to know the correct baud rate to communicate, nodes on a FlexRay network must know how all the pieces of the network are configured in order to communicate. As with any multi-drop bus, only one node can electrically write data to the bus at a time. If two nodes were to write at the same time, you end up with contention on the bus and data become corrupt. There are a variety of schemes used to prevent contention on a bus. CAN, for example, used an arbitration scheme where nodes will yield to other nodes if they see a message with higher priority being sent on a bus. While flexible and easy to expand, this technique does not allow for very high data rates and cannot guarantee timely delivery of data.
FlexRay manages multiple nodes with a Time Division Multiple Access (TDMA) scheme. Every FlexRay node is synchronized to the same clock, and each node waits for its turn to write on the bus. Because the timing is consistent in a TDMA scheme, FlexRay is able to guarantee determinism or the consistency of data delivery to nodes on the network. This provides many advantages for systems that depend on up-to-date data between nodes. Embedded networks are different from PC-based networks in that they have a closed configuration and do not change once they are assembled in the production product. This eliminates the need for additional mechanisms to automatically discover and configure devices at run time.
Table 2.1 Comparisons between CAN and FlexRay.
CAN | FlexRay | |
Bandwidth | 1 Mbps | 10 Mbps |
Number of channels | 1 | 2 |
Frame data length | 0~8 | 0~254 |
Communication | Dynamic arbitration | TDMA |
Complexity | Low | High |
Composability | No | Yes |
Flexibility | One topology | Many different topologies |
By designing network configurations ahead of time, network designers save significant cost and increase reliability of the network. For a TDMA network such as FlexRay to work correctly, all nodes must be configured correctly. The FlexRay standard is adaptable to many different types of networks and allows network designers to make tradeoffs between network update speeds, deterministic data volume, and dynamic data volume among other parameters. Every FlexRay network may be different, so each node must be programmed with correct network parameters before it can participate on the bus.
Table 2.1 provides a summary of comparisons between CAN and FlexRay [4]. For the rest of this chapter, we will focus on CAN as this is still the most popular protocol today and it is simple to use.