嵌入式系统代写代做代考 Embedded Systems Reconfigurable computing

Reconfigurable computing

Small Embedded Systems

Unit 5.6 Automotive Networks

In-Vehicle Networking
Automobiles are a major user of embedded systems
Some automotive sub-systems do not require high performance or safety, but do have very tight cost constraints
Boot release
Electric wing mirrors
Other systems can be safety critical and require high performance
Powertrain
Traction control
Advanced braking system
Future trends in automotive electronics (e.g. advanced driver assist, self-driving cars) will increase the need for safety critical high performance systems

In-Vehicle Networking
Most modern vehicles mix a variety of standards:
They differ by cost, data rate, flexibility and safety guarantees

Cost per node
10k
Data rate (bps)

LIN
20k
125k
1M

FT-CAN

HS-CAN

FlexRay

MOST
10M
150M

Ethernet
100M

In-Vehicle Networking
Most modern vehicles mix a variety of standards:

https://www.nxp.com/docs/en/brochure/BRINVEHICLENET.pdf

Low data rate
Non safety critical Use LIN
High data rate
Safety critical
Use FlexRay

LIN: Local Interconnect Network
Very low data rate, low cost systems (e.g. central locking)
Simple Master-Slave bus
Can be implemented with using standard UART

Cost per node
10k
Data rate (bps)

LIN
20k
125k
1M

FT-CAN

HS-CAN

FlexRay

MOST
10M
150M

Ethernet
100M

CAN: Controller Area Network
Main standard for automotive systems
In many country its use is a legal requirement
CSMA/CR (event triggered) protocol over a twisted-wire pair
Two types: High-Speed and Fault-Tolerant

Cost per node
10k
Data rate (bps)

LIN
20k
125k
1M

FT-CAN

HS-CAN

FlexRay

MOST
10M
150M

Ethernet
100M

FlexRay
Used for time-critical safety-critical systems
Mixed Time-Domain-Multiple-Access (time triggered) and CSMA/CR (event triggered) protocol over a twisted-wire pair
For TDMA message, time between transmission and reception is deterministic and can be precisely known
Cost per node
10k
Data rate (bps)

LIN
20k
125k
1M

FT-CAN

HS-CAN

FlexRay

MOST
10M
150M

Ethernet
100M

MOST: Media Oriented System Transport
Multimedia (audio, video, navigation display) require very high data rates, but no real safety implication.
Usually based on plastic optical fibre
Ethernet is a possible competitor technology
Cost per node
10k
Data rate (bps)

LIN
20k
125k
1M

FT-CAN

HS-CAN

FlexRay

MOST
10M
150M

Ethernet
100M

Controller Area Network (CAN)
Developed by Robert Bosch in 1986 (and ISO 11898 in 1993)
Electronic Control Units (ECUs) act as nodes connected via CAN bus
Any ECU can communicate with any (or all) other ECUs without overloading the central controller
Robust towards failure
Efficient message prioritization
Flexible operation for ECUs

High speed CAN: 1Mbs (suspension, engine control)
Low speed CAN: 125 kbps (wipers, window power)

Goals of CAN bus
Low cost: a single digital bus eliminates much analog wiring: reduced errors, weight, costs
Centralized monitoring: allows for central error diagnosis and configuration across all ECUs
No centralized network controller: which could become overwhelmed in heavy network traffic
Robust: against electrical disturbances and electromagnetic interference
Efficient: CAN frames are prioritized by ID – the top priority gets bus access, yet arbitration does not interrupt frame
Flexible: Each CAN-connected ECU can receive all transmitted messages. Each can respond according to relevance of messages: allows easy modification and extension

CAN operation
Runs at up to 1Mb/s at distances of up to 40m
More slowly it can operate over several hundred metres
Data is sent onto the network in frames
Nodes detect collisions or corrupted messages and re-transmit
Frame format :

SOF (start of frame)
DLC (data length code) number of bytes transmitted
CRC (cyclic redundancy check) error detection code

https://www.ccontrols.com/pdf/CANtutorial.pdf

Physical Layer
CAN bus uses two wires (CANH, CANL), driven differentially
The termination resistors (120 W ) damp out reflected energy on the wire, but also serve to enforce that the voltage between CANH and CANL is zero when no node is actively driving

Node 1

Node 2

Node 3

120 W
120 W
CANH
CANL

Physical Layer
A logic 0 is represented by a voltage difference of ~2V:
CANH ~3.5V
CANL ~1.5V
Sending device actively drives the lines
A logic 1 is represented by a voltage difference of ~0V
Sending device disconnects from the line (Hi-Z outputs)
3.3V
0V
TTL signal levels
time
CAN signal levels
CANL
CANH
3.5V
1.5V

Arbitration
Logic 0 is normally called the “dominant” logic level
Logic 1 is normally called the “recessive” logic level
This way of driving the wires gives us easy arbitration if devices start to transmit simultaneously
Messages start with an 11-bit arbitration field

http://sygi.vizz.pl/index.php?id=4&lang=en
So another device must be transmitting and that device has higher priority
Node 1 stops transmitting
Node 1 sees CAN bus is at 0 when it tried to transmit 1

Arbitration
Logic 0 is normally called the “dominant” logic level
Logic 1 is normally called the “recessive” logic level
This way of driving the wires gives us easy arbitration if devices start to transmit simultaneously
Messages start with an 11-bit arbitration field
The first device to transmit a 1 loses arbitration
Devices arbitration field represents its importance and priority
Maximum priority device has arbitration field of 00000000000

CAN synchronization
All nodes on CAN are synchronized to sample data at same time
However no clock, so essentially asynchronous
Receivers synchronise on recessive to dominant edges
If data contains long string of 0s or 1s, an additional 1 or 0 is inserted to help synchronization: “bit stuffing”
Carrier Sense Multiple Access (CSMA)
Nodes monitor bus for ‘inter-frame’ space
Node transmits when there is an inter-frame space
All nodes have equal right to transmit
If a node needs more time to process a message, it can transmit Overload frames to request other nodes to wait before sending it a new message
Collision Detection with Collision Resolution (CD-CR)
If 2 nodes transmit at the same time, a collision occurs
This is resolved by arbitration

Higher Level Protocols for CAN
CAN provides the low level protocol for sending the bits and detecting that they arrived safely. It does not specify the ‘language’ that gives meanings to those bits.
Various overlays to CAN exist which provide a standardized messages and conversion rules:
SAE J1939 (Society of Automotive Engineers)
Diagnostic and telematic data for heavy duty vehicles
trucks, buses, ambulances, fire engines
On-board diagnostics (OBD2)
Used by mechanics to diagnose faults in cars
CANopen
Used in embedded control and industrial automation

FlexRay
With CAN bus, any node can transmit at any time it find the bus free
Nodes can have to wait for the bus to become free
Thus no timing guarantees can be given as to when a message will actually get through
Unsuitable for high data-rate safety critical systems
FlexRay is a high data rate bus that can give completely deterministic timing:
a node knows when it will be able to send and
knows when the message will be received

FlexRay
Flexray communication cycles consist of
Static segment
Consists of a series of time-triggered frames (slots)
Each slot is reserved for a particular ECU
Safety critical ECUs transmit in these slots
They know when they will able to transmit
They know when their data will be received

https://www.ni.com/en-gb/innovations/white-papers/06/flexray-automotive-communication-bus-overview.html
Static segment

FlexRay
Flexray communication cycles consist of
Dynamic segment
Available for flexible use by event-triggered frames
ECUs with sporadic, non-safety critical data transmit here
Function in a similar manner to CAN
Symbol window – used for network maintenance
Idle time – used to adjust any drift in ECU clocks

Static segment
Dynamic segment
Idle time
Symbol window
https://www.ni.com/en-gb/innovations/white-papers/06/flexray-automotive-communication-bus-overview.html

Summary
Types of network
Event triggered (Random access)
Time triggered (TDMA)
Main standards
CAN
FlexRay

/docProps/thumbnail.jpeg