Flexray Slots
The in-vehicle networking concepts are being used in safety systems such as collision avoidance ones. Nowadays automotive networks are Hybrid and allow communication functions between different in-vehicle subsystems which can improve the safety and comfort of driving.
Safety-critical driver assistance functions with electronic interfaces to the chassis require reliability, safety and real-time capability of the communication system. What is needed is a communication system which is able to guarantee deterministic and fault tolerant data communication whatever is the bus load.
Dynamic Segment Symbol Window Network Idle Time Static Segment Static Slot 1 Static Slot 2 Static Slot n Fig. 1 The FlexRay communication protocol consisting of 64 communication cycles with a de- tailed illustration of the static segment. The focus of this chapter is put on new techniques for scheduling the static segment. An unequivocal number of a FlexRay Slot, ranging from 1 to a configurable maximum number ≤ 2047.Synonym: “FlexRay Slot Identifier”, “FlexRay Slot ID”.
The FlexRay nodes assigned to the static slots can transmit the static messages assigned to the static slots during periodic communicative operation. The precondition for this process are synchronized local counters, each of which are incremented at the beginning of a static slot.
Overview:
The FlexRay communications bus is a deterministic, fault-tolerant and high-speed bus system developed. FlexRay delivers the error tolerance and time-determinism performance requirements for x-by-wire applications (i.e. drive-by-wire, steer-by-wire, brake-by-wire, etc.).
FlexRay Protocol Conformance Test Specification DISCLAIMER This specification and the material contained in it, as released by the FlexRay Consortium, is for the purpose of information only. The FlexRay Consortium and the companies that have contributed to it shall not be liable for any use of the specification. FlexRay Protocol Specification Version 3.0.1 October 2010 Disclaimer Page 2 of 341 Disclaimer This specification and the material contained in it, as released by the FlexRay Consortium, is for the purpose.
Figure 1: Example of an in-vehicle network with FlexRay bus (Source: Electronic Design)
BMW and DaimlerChrysler in 1999 agreed to work together to advance the specification and development of a future, uniform, time-triggered and fault tolerant communication technology. This cooperative effort resulted in the first rough requirements specification for FlexRay.
Bit rate:
The CAN network has reached its performance limits with a maximum speed of 1 Mbps. With a maximum data rate of 10 Mbps available on two channels, giving a gross data rate of up to 20 Mbit/sec, FlexRay potentially offers 20 times higher net bandwidth than CAN when used in the same application.
Topology:
A FlexRay communication system (FlexRay Cluster) consist of a number of FlexRay nodes and a physical transmission medium (FlexRay Bus) interconnecting all of the FlexRay nodes. FlexRay communication is not limited to any specific physical topology. A point-to-point connection is as feasible as a line topology, passive star topology or active star topology.
Figure 2: FlexRay topologies (Source: Vector)
- Point-to-Point topology: two FlexRay nodes are directly interconnected.
- Passive Star topology: If the FlexRay bus is composed of three nodes, those ones are interconnected via a central but passive star node. Such a topology is referred to as a passive star. No more than 22 FlexRay nodes should be connected in a passive star according to Electrical Physical Layer Specification (EPL Specification).
- Line topology: Starting from four FlexRay nodes, the topology of the designed bus could be even a passive star or a line topology. In the line one, the FlexRay nodes are connected to the bus via separate tap lines (stubs). Here also, and according to FlexRay specification, a maximum of 22 FlexRay nodes could be connected.
- Active Star topology: An active star coupler receive signals via a communication branch, amplifies them and broadcast them to the rest of branches. Such topology avoids propagation of errors by dropping faulty communication branches from the active star coupler. It also gives the ability to implement FlexRay clusters with larger extensions and more stable electrical conditions.
- Hybrid topology: A mix of previously explained topologies
Bus access and communication cycle:
In a FlexRay cluster, the FlexRay nodes are given access to the communication medium in two different ways during communication cycle: first by the TDMA method (Time Division Multiple Access) in Static Segment, and second by the FTDMA method (Flexible TDMA) in Dynamic Segment.
Figure 3: FlexRay communication cycle components (Source: Vector)
- Static Segment: organized into a number of time slots (static slots) of equal length. The FlexRay nodes affected to static slots can transmit static messages assigned to these slots periodically using TDMA.
- Dynamic Segment: enable to transmit event driven messages that does not require determinism using FTDMA which enables flexible communication flow.
- Symbol Window: used for network maintenance and signaling for starting the bus.
- Network Idle Time (NIT): used to synchronize the local clocks. No data communication occurs during it.
A communication cycle is composed of a defined number of macroticks, which are assigned to the individual segments. The macroticks are composed of microticks. Due to differences in crystal oscillator frequencies, the macroticks of different FlexRay nodes may be composed of different numbers of microticks. FlexRay controllers actively synchronize themselves and adjust their local clocks so that the macrotick occurs at the same point in time on every node across the network.
Slot and Frame formats:
A pulse on the FlexRay bus is based on voltage differences (differential signal transmission). Therefore, the FlexRay bus consists of two lines: Bus Plus (BP) and Bus Minus (BM).
Figure 4: Determination of the logical level on the bus (Source: Vector)
The EPL Specification defines four bus levels. The recessive bus state is identified by a 0 Volt differential voltage. On the other hand, the dominant bus state is characterized by a differential voltage different than zero Volt.
Each slot in the static or dynamic segment contains a FlexRay Frame. The frame is basically composed of three segments: Header, Payload, and Trailer.
Figure 5: FlexRay frame format (Source: Vector)
Header:
The Header is 5 bytes long and could be dissected to the following fields:
- Status Bits: used to specify a message more precisely.
- Frame ID: used to identify a message corresponding to a slot. All IDs may be used exception 0 (invalid message).
- Payload Length: identify the payload size in word (16 bits).
- Header CRC: value based on the identifier, payload length, sync frame indicator and startup frame indicator.
- Cycle Count: correspond to the cycle in which the message is sent. The cycle counter goes up to 63.
Payload:
The payload contains the data to be transferred by the current frame. The payload length should be the same for all frames sent in the static segment. This field could be dissected into signals which could be extracted and interpreted in reference to the Database (such a Fibex file).
Trailer:
The trailer contains the CRC calculated based on the header and payload and a generator polynomial defined by the FlexRay specification. The receiver of the message can detect any transmission error with very high reliability.
Time synchronization:
FlexRay has the ability to sync up nodes without reference to any external synchronization clock signal. To do so, it uses 2 special types of frames: Startup Frames and Sync Frames. To start a FlexRay cluster, at least 2 different nodes are required to send startup frames. The action of starting up the FlexRay bus is known as a cold-start and the nodes sending the startup frames are usually known as cold-start nodes. The startup frames are analogous to a start trigger, which tells all the nodes on the network to start.
Figure 6: Simplified Synchronization process of a FlexRay network (Source: National Instruments)
Once the network is started, all nodes must synchronize their internal oscillators to the network's macrotick. This can be done using two more more synchronization nodes. These can be any two separate nodes on the network that pre-designated to broadcast special sync frames when they are first turned on (maximum of 15 FlexRay nodes act as the sync nodes). The rest of the nodes wait for the sync frames to be broadcast, and measure the time between consecutive broadcasts in order to adjust their internal clocks to the FlexRay time.
Once the network is synchronized and on-line, the Network Idle Time (NIT) is measured and used to keep clocks adjusted from cycle-to-cycle.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thank you for reading my article! If you enjoyed reading this or found useful, please let me know, provide your feedback or just click the like button. If you have any remark, please let me know also via comments or messages.
There will be future articles on the rest of commonly used automotive buses systems such as CAN, LIN and Ethernet.
Flexray Slot
If you would like to read my future posts, please click 'Follow' or even better, send me a LinkedIn invitation, I'm glad to expand my network with new connections.