What is FlexRay
FlexRay is a high performance communication protocol in the rough automotive environment. Learn more about FlexRay here
We have already covered two of the most popular communication protocols in automotive vehicles, CAN and LIN, in CAN Protocol Overview (opens in a new tab), CAN Transceiver Protection (opens in a new tab) and What is LIN (opens in a new tab). Both these protocols have different purposes: LIN is cheaper and slower, making itself a great candidate for low priority functionalities, such as controlling the climatization and the windows of your car, while CAN is enough for the powertrain functions of your vehicle, where your data will come in fast enough to make it all work, so you are looking at ABS, airbags, powertrain, etc, while only using two wires and termination resistors. Both these options are cheap and reliable, but what options are you looking at if you need better performance? FlexRay is your starting point!
Let's look at FlexRay. What is it and why do we need it? As vehicles are getting smarter, with new advanced functionalities to increase autonomy, safety and improve the driving experience, CAN is starting to not be enough for all these new features coming in, when it comes to performance. The communication requirements of some applications, such as state of the art, high-performing powertrains and safety features, are starting to go past what CAN provides us, also creating the need to scale up the number of CAN networks in newer vehicles.
This is the space where FlexRay is creeping in, to meet these demands, and why the FlexRay consortium was created (although dismantled in 2009 to become the ISO-17458-1 and ISO-17458-5 standards). As a curiosity, the first production vehicles incorporating FlexRay were 2006's BMW X5 and 2008's BMW 7 Series. Nowadays, cars such as the BMW 1 series, Audi A4 and Mercedes-Benz C-Class already make use of FlexRay.
Now that we got the history lesson out of the way, let's take a look at the nitty-gritty. Its premise is to deliver high performance in a rough environment, at a cheap price. The hardware connection is pretty much straightforward after seeing the CAN bus. It's comprised of an unshielded twisted pair of cables, one or two pairs, depending on the configuration, which can be of single or dual channel, where the dual channel configuration can improve fault-tolerance and bandwidth, of a maximum of 10Mbps (but the cost increases, of course). The same tactic of twisting the pairs is used as in CAN to reduce noise on the differential signal. Aside from the twisted pair, FlexRay can also include two cables, for power and ground, which is used to power small modules, such as microcontrollers or transceivers. Aside from the cables, there are termination resistors at both ends, for the same reason as CAN, where the resistor values sit around 80 and 110 ohms.
Regarding network topology, one of the differentiating factors in comparison to other networks, there are a few options:
-
Bus Topology - This is the same topology as CAN, where the wire pair connects all the ECUs together. The problem on FlexRay is the higher frequency of up to 10 Mbps. Extra care needs to be taken laying out of the network
-
Star Network - Where each individual ECU in the network connects to a central node, acting much like a hub. The main advantages in comparison to a bus topology are that if one node fails, it will not affect the remaining ones, making the network more reliable, and being able increase the distance that the network can communicate over, as the smaller star cables improve signal quality
-
Hybrid Network - A mix between bus and star topologies, to get the best out of both worlds
FlexRay network topologies, side by side
Now, let's look at the internals of a FlexRay network. It's a time-triggered protocol, with predictable data timings, like in LIN, and data coming in dynamically such as in CAN. This is achieved by defining static and dynamic frames, where a predefined communication cycle allocates space for all the static frames and a zone for dynamic frames. All the nodes in the network must know how the communication cycle is defined before communicating.
The network one-up's the CAN mechanism to check if the bus is free by using TDMA (Time Division Multiple Access), allowing for faster data-rates than CAN. But that's another set of parameters to be configured exactly the same way within all the ECUs in the network.
As you can see, with the importance of keeping the configuration exactly the same across all ECUs, the FlexRay committee defined a standard format just to share these parameters, called FIBEX (Field Bus EXchange Format), for easy parameter-sharing.
Now, let's look at the FlexRay communication cycle up close. Its duration is fixed, from 1 to 5 ms, usually. It contains 4 parts:
- Static Segment - Where the deterministic data comes in
- Dynamic Segment - Works similarly to CAN. Event-driven data comes in at this stage
- Symbol Window - Used to maintain the network
- Idle Time - An idle time, used to synchronize the network nodes. The nodes in a FlexRay network are synchronize to a macrotick, which is the smallest time base in FlexRay, and is usually around 1us
FlexRay communication cycle
Lastly, let's see what a FlexRay frame contains. It contains the expected 3 parts of a regular communication protocol frame: header, payload and trailer. From the header:
-
Status - Comprised of 5 bits: reserved, a preamble indicator, null frame indicator, sync frame indicator and start frame indicator bit
-
Frame ID - ID of the FlexRay frame, used for specifying the priority of the event-driven frames and the slot in which the frame will be transmitted, in the case of static frames
-
Payload Length - Specifies the size of the payload
-
Header CRC - CRC for the header
-
Cycle Count - Counter of communication cycles
Regarding the payload, this can be from 0 to 254 bytes, which is way more than CAN. Two optional parameters are available:
-
Message ID - The first two bytes of the frame, which the receiver can use to filter out the messages
-
NM Vector - Network management vector, from 0 to 12 bytes
Lastly, the trailer contains 3 bytes of CRC.
FlexRay message format
Alright, now that we gave you the theory behind FlexRay, we hope you can understand the uses for each of the 3 most popular automotive communication protocols. Make sure to subscribe to our newsletter, so you don't miss a thing!
Author: Micael Coutinho (opens in a new tab)
References:
© AutosarToday —@LinkedIn