automotive bus technologies

74
Prepared by: Radwa Tarek. Automotive Bus Technologies

Upload: radwa-tarek

Post on 21-Apr-2017

265 views

Category:

Automotive


1 download

TRANSCRIPT

Page 1: Automotive bus technologies

Prepared by: Radwa Tarek.

Automotive Bus Technologies

Page 2: Automotive bus technologies

Agenda:

Introduction to automotive embedded systems.

Automotive Network.

Network fundamentals.

Review for Serial communication.

Automotive bus protocols:

Local interconnect technology.

Controlled area network.

Page 3: Automotive bus technologies

Introduction to automotive embedded systems.

• Automotive is embedding systems consist of separated ECUs and

each ECU has its own functionality.

Page 4: Automotive bus technologies

What is an ECU?In the Automobile industry an electronic control unit (ECU) is an embeddedelectronic device, basically a digital computer, that reads signals comingfrom sensors placed at various parts and in different components ofthe car and depending on this information controls various important unitse.g. engine and other automated operations within the car among many.

Electronic Control Unit(ECU)consists of:

Microcontroller(s).

Sensors.

Power switches.

Drivers.

Voltage regulator(s).

Page 5: Automotive bus technologies

Automotive ECUs:

Page 6: Automotive bus technologies

Automotive ECUs:

Dynamic stability control

https://www.youtube.com/watch?v=VvNP2d6MDQM

Air Bags and Seat Belts

https://www.youtube.com/watch?v=R4ekbB5EzZM&spfreload=10

Roll Stability Control

https://www.youtube.com/watch?v=6WjfRxtIMzo

Page 7: Automotive bus technologies

Automotive ECUs:The automotive ECU market can be segmented on the basis of as application

into safety and security systems, chassis electronics, powertrain

electronics, communication & navigation systems and entertainment

systems.

Page 8: Automotive bus technologies

Automotive network

Whenever increase applications/technologies in cars will increase in

ECUs.

Each car now contains at least 30 computer system (ECU).

Each ECU in car need to interface with more than one ECU to perform its

own functionality.

Page 9: Automotive bus technologies

Network Fundamentals

The main network properties are:

Transmission medium

Transmission speed

Network topology

Data packets

Page 10: Automotive bus technologies

Network Fundamentals: Transmission medium

1. Twisted pair cables

2. Fiber optics cables

3. Wireless networks

Page 11: Automotive bus technologies

Network Fundamentals: Transmission speed

Transmission speed can be measured by Bit rate

Bit rate is number of bit that can be transmit in a fixed amount of time usually

Kbit/sec

depend on time constrains and can be measured by bit rate.

Engine control tasks: Critical

Break system tasks: Critical

Dashboard tasks: High

Doors control tasks: Normal

Air condition tasks: Low

Page 12: Automotive bus technologies

Network Fundamentals: Network topology

A network topology is the arrangement of a network, including its nodes and

connecting lines.

there are several common physical topologies:

1. bus network topology

2. Star network topology

3. Ring network topology

Page 13: Automotive bus technologies

Network Fundamentals: Data packets

packet is a unit of data is called a segment or a block or a cell or a frame

depending on the type of network.

Page 14: Automotive bus technologies

Network protocol

Page 15: Automotive bus technologies

Network Protocol

Network protocol determine network fundamentals.

In network protocol define:

topology, Speed, transmission medium and data packet/frame.

In embedded Systems there are three basics serial communications

protocols:

UART, SPI and I2C.

Page 16: Automotive bus technologies

Network Protocol

Topology in serial communication protocols define Terminologies

Simplex Communication

Half Duplex Communication

Full Duplex Communication

Page 17: Automotive bus technologies

Network Protocol

Speed in serial communication protocols define Modes

data can be transferred in two modes:

Synchronous mode: data sampling with clock pulses.

Asynchronous mode: transmitter and receiver used the same data

rate.

Page 18: Automotive bus technologies

Network Protocol

Data packet format depend on network protocol for example :

Data size

Address

Start and End communication methods

Error detection method

Page 19: Automotive bus technologies

Automotive bus protocols

• Network protocol classification:

Depend on message ID.

Depend on distention ID.

• Network protocols depend on message ID:

Controlled area network “CAN”.

Local interconnect network “LIN”.

• Network protocols depend on distention ID: I2C.

Page 20: Automotive bus technologies

Local interconnect network

Page 21: Automotive bus technologies

Local interconnect network

LIN protocol is single master multi slaves.

LIN bus single wire connection->> half duplex> terminology.

LIN bus speed 20 kbps and max length 40m>>speed.

LIN is serial communication protocol used in low speed

applications.

in automotive applications, LIN bus is connected

between(smart sensors, actuators and ECUs such as door

control ECU and air condition ECU).

Page 22: Automotive bus technologies

Local interconnect network

LIN protocol depend on message ID:

from message ID each slave connected to lin bus

determine whether it needs to publish or subscribe.

publish-subscribe: in a publish-subscribe system, senders

label each message with the name of a topic ("publish"), rather

than addressing it to specific recipients. The messaging system

then sends the message to all eligible systems that have asked

to receive messages on that topic ("subscribe").

Page 23: Automotive bus technologies

Local interconnect network

Concept of operation:

LIN is single master –multi slaves:

master node consists of slave task and master task.

slave node consists of slave task.

Page 24: Automotive bus technologies

Local interconnect network

Master task:

Control over the whole Bus.

Controls which message at what time is to be transferred over the bus.

Error handling.

monitors Data Bytes and Check Byte, and evaluates them on consistence.

Receives Wakeup Break from slave nodes when the bus is inactive.

Defines the transmission speed.

Switching slave nodes to sleep/wake up mode.

Page 25: Automotive bus technologies

Local interconnect network

Slave task:

One of 2-16 Members on the Bus.

Receives or transmits Data when appropriate ID is sent .

According to ID, slave determines:

receive data (subscribe), transmit data ( publish) ,do nothing.

When transmitting : sends 1, 2, 4, or 8 Data Bytes + Check-Byte

Page 26: Automotive bus technologies

LIN message frame

The LIN is a SCI/UART-based serial, the LIN protocol is byte

oriented.

data is sent one byte at a time.

One byte field contains a start bit (dominant), 8 data bits and a

stop bit (recessive).

The data bits are sent LSB first.

Page 27: Automotive bus technologies

LIN message frame

LIN frame consist of:

Header which is provided by the master task

Response which is provided by the slave task

Page 28: Automotive bus technologies

LIN message frame

Header consists of: break field, synch field and identifier field.

Response consists of: from 0 to 8 data fields and checksum.

Page 29: Automotive bus technologies

LIN frame structure:

Break field:

The break symbol is used to signal the beginning of a new frame.

A break is always generated by the master task and it shall be at

least 13 bits of dominant value, including the start bit, followed by

a break delimiter

Synch break ends with a “break delimiter” which should be at least

one recessive bit.

Page 30: Automotive bus technologies

LIN frame structure:

Synch field: is the second field transmitted by the master task in

the header.

LIN is self synchronization; has the synchronization mechanism

that allows the clock recovery by slave nodes.

Sync is defined as the character x55.

The sync field allows slave devices that perform automatic baud

rate detection to measure the period of the baud rate and adjust

their internal baud rates to synchronize with the bus.

Page 31: Automotive bus technologies

LIN frame structure:

Protected Identifier

The ID field is the final field transmitted by the master task in the

header.

This field provides identification for each message on the

network and ultimately determines which nodes in the network

receive or respond to each transmission.

All slave tasks continually listen for ID fields, verify their parities,

and determine if they are publishers or subscribers for this

particular identifier.

Page 32: Automotive bus technologies

LIN frame structure:

Protected Identifier

1.Identifier:

Six bits are reserved for the identifier (ID).

Values in the range 0 to 63 can be used.

The identifiers are split in four categories:

Values 0 to 59 (0x3b) are used for signal• carrying frames.

60 (0x3c) and 61 (0x3d) are used to carry diagnostic data.

62 (0x3e) is reserved for user• defined extensions.

63 (0x3f) is reserved for future protocol enhancements.

Page 33: Automotive bus technologies

LIN frame structure:

• Protected Identifier: the Identifier Field does not indicate

the destination of the message but describes the contents of the message

frame.

Page 34: Automotive bus technologies

LIN frame structure:

Protected Identifier:

ID5:4

used to determine data length in bytes which transfer in response.

Page 35: Automotive bus technologies

LIN frame structure:

Protected Identifier

2. Parity:

The parity is calculated on the identifier bits.

Page 36: Automotive bus technologies

LIN frame structure:

Data:

A frame carries between one and eight bytes of data

A data byte is transmitted in a byte field

The data bytes field is transmitted by the slave task in the

response.

Page 37: Automotive bus technologies

LIN frame structure:

Check sum:

The checksum field is transmitted by the slave task in the

response.

The LIN bus defines the use of one of two checksum algorithms to

calculate the value in the eight-bit checksum field:

Classic checksum is calculated by summing the data bytes alone (V 1.3)

enhanced checksum is calculated by summing the data bytes and the

protected ID. (V2.0)

Page 38: Automotive bus technologies

LIN Error Handling:

Each LIN Slave monitors its operating state and creates a status

report.

The status report is sent periodically to the LIN Master (LIN 2.0).

Monitoring by error detection mechanisms

Parity check

Checksum

LIN messages detected as corrupt are rejected

Error handling is not part of the LIN specification and must be

defined separately

Page 39: Automotive bus technologies

LIN Frame types:

There are three different ways of transmitting frames on the bus:

unconditional, event triggered, and sporadic frames.

Unconditional Frame:

This is the “normal” type of LIN communication.

The master sends a frame header in a scheduled frame slot and

the designated slave node fills the frame with data.

Page 40: Automotive bus technologies

LIN Frame types:

Event-triggered frame: collect statues of slaves

The purpose of this method is to receive as much information from

slave nodes without overloading the bus with frames.

An event triggered frame can be filled with data from more

than one slave node.

A slave only updates the data in an event triggered frame when

the value has changed.

If more than one slave wants to update data in the frame a

collision occurs. The master should then send unconditional

frames to each of the slaves starting with the one with the highest

priority.

Page 41: Automotive bus technologies

LIN Frame types:

Sporadic Frame:

This method provides some dynamic behavior to the otherwise

static LIN protocol.

The header of a sporadic frame is only sent from the master when

it knows that a signal has been updated in a slave node.

Usually the master fills the data bytes of the frame itself and the

slave nodes will be the receivers of the information.

Page 42: Automotive bus technologies

LIN Frame types:

User-defined frames:

have an ID of 62.

carry any type of information.

Diagnostic frame:

Eight data bytes in length

Carry diagnostic or configuration data.

Their IDs are : 60 for a master request frame.

61 for a slave response frame.

Page 43: Automotive bus technologies

LIN Bus Timing

Theader = (NSync_Field + NSync_Byte + NPID_Byte) • TBit = 34 • Tbit

Tresponse = 10 • (NData + 1) • Tbit

Tframe = Theader + Tresponse

Page 44: Automotive bus technologies

LIN Bus Timing

A time reserve of up to 40% is given for transmission of a LIN

message TFrame_Max = THeader_Max + TResponse_Max = 1.4 • TFrame

Page 45: Automotive bus technologies

Controlled Area Network

Page 46: Automotive bus technologies

Controlled Area Network: Features

CAN protocol is Multi-Master Multi-Slave communication.

CAN bus is two wires connections but still half

duplex>>terminology.

CAN bus speed 1 Mbps and 40m max length>>speed.

The Controller Area Network (CAN) is a serial communications

protocol widely used in automotive electronics for critical tasks

such as engine control tasks and break systems tasks.

Page 47: Automotive bus technologies

Controlled Area Network: CAN bus Connection

Page 48: Automotive bus technologies

Controlled area network: CAN properties

Prioritization of message:

No node addressing, Message identifier specifies contents & priority.

Depending on the importance of messages the priorities will be given to the different messages.

the highest priority message with the lowest ID in your network

Page 49: Automotive bus technologies

Controlled area network: CAN properties

Multicast reception with time synchronization:

CAN is based on the “broadcast communication mechanism”

,simultaneously multiple nodes can receive the frame.

Page 50: Automotive bus technologies

Controlled area network: CAN properties

Multi master: When the bus is free any unit may start to transmit

a message.

If two nodes need to transmit in the same time, the unit with the

message of higher priority to be transmitted gains bus access.

Message Routing: An identifier names the content of a message.

The identifier does not indicate the destination of the message,

but describes the meaning of the data, so that all nodes in the

network are able to decide by message filtering whether the data

is to be acted upon by them or not [publish /subscribe].

Page 51: Automotive bus technologies

Controlled Area Network: CAN properties

Bus values: The bus can have one of two complementary logical

values: ‘dominant’ (‘0’) or ‘recessive’ (‘1’). During simultaneous

transmission of ’dominant’ and ’recessive’ bits, the resulting bus

value will be ’dominant’.

Automatic retransmission of corrupted messages as soon as

the bus is idle again.

Page 52: Automotive bus technologies

Controlled area network: CAN properties

Synchronization:

Hard Synchronization:

CAN synchronize the message transfer for each node with the

leading edge of SOF bit.

Re-synchronize

With each recessive to dominant edge.

Page 53: Automotive bus technologies

Controlled area network: Different Types of CAN

There are two types of CAN implementations depending in the

size of the identifier field.

1) STANDARD: 11-bit wide identifier field.

2) EXTENDED: 29-bit wide identifier field.

Page 54: Automotive bus technologies

Controlled area network: CAN message

1. Data frame:

Description: - Carries data from a transmitter to the receivers.

Fields: - Start of Frame, Arbitration Field, Control Field, Data

Field, CRC Field, ACK Field, End of Frame.

Page 55: Automotive bus technologies

Controlled area network: CAN message

1. Data frame:

SOF: Start of frame bit. It is the indication of start of frame

when a dominant bit is detected after the bus idle condition.

Page 56: Automotive bus technologies

Controlled area network: CAN message

1. Data frame:

The arbitration field is depending on the type of frame

Page 57: Automotive bus technologies

Controlled area network: CAN message

The arbitration field contains:

Identifier field: contains information’s about message.

In case of standard frame the length of this field is 11 bits.

In case of extended 18 more bits are added to it. So in case of

extended frame total size of identifier field it is 29 bits.

RTR: It is the remote transmission request BIT

RTR = Dominant in the data frames

RTR = Recessive in the remote frames

Page 58: Automotive bus technologies

Controlled area network: CAN message

The arbitration field contains:

SRR: Substitute remote request (SRR)

one bit wide. Used in case of extended frame. SRR bit will be

recessive and in case standard frame this bit replaces the RTR bit. .

IDE: Identifier extension bit (IDE)

IDE = Dominant in the standard frame

IDE = Recessive in the extended frame

Page 59: Automotive bus technologies

Controlled area network: CAN message

The control field:

six bit wide. Two bits r0 and r1 are reserved. In standard frame r1 is

replaced by IDE bit. And remaining 4 bits called as data length

control (DLC) describes total length of data field.

Page 60: Automotive bus technologies

Controlled area network: CAN message

Data field: contains the actual information within the limit of

{0…8} bytes.

CRC field: (cyclic redundancy code )

16 bit wide. Divided into two parts:

CRC sequence: 15 bit length. Calculated over SOF to data field.

CRC delimiter: 1 bit recessive bit.

Page 61: Automotive bus technologies

Controlled area network: CAN message

ACK field: 2 bit wide and contain two fields ACK flag and

ACK delimiter.

ACK flag: being successful reception of frame the receiver

will indicate the transmitter by putting a dominant bit in this place,

otherwise recessive.

ACK delimiter: A recessive bit.

END OF FRAME: 7 bit wide. Consists of 7 recessive bits.

Page 62: Automotive bus technologies

Controlled area network: CAN message

2- Remote Frame

Description: -

Transmitted by a bus unit to request the transmission of the data

frame with the same identifier.

Fields: - Start of Frame, Arbitration Field, Control Field,

CRC Field, ACK Field, End of Frame

Page 63: Automotive bus technologies

Controlled area network: CAN message

3- Error Frame:

Description: - Any unit on detecting a error transmits an

error frame.

Fields: - Error flag and Error delimiter.

Page 64: Automotive bus technologies

Controlled area network: CAN message

3- Error Frame:

There are two types of error frames are there in CAN:

Active Error Flag: six dominant bits, Transmitted by a node detecting an error on the network that is in error state "error active“.

Passive Error Flag: six recessive bits, Transmitted by a node detecting an active error frame on the network that is in error state "error passive".

And in both the cases all the bits of error delimiter will be all recessive. Depending on the node internal error count register condition the respective type of error frame will be transmitted.

Page 65: Automotive bus technologies

Controlled area network: CAN message

4- Overload Frame:

Description: Generated due to internal conditions of a receiver,

which requires a delay of the next DATA or REMOTE frame.

Fields: - Overload flag and Overload delimiter.

Page 66: Automotive bus technologies

Controlled area network: CAN Error Detection:

There are 5 error detection mechanisms:

Bit error: During transmission the node transmits the bit at

transmit time region and receives the bit at receive time and

two bits are compared if they are not equal then that is

considered as bit error.

Page 67: Automotive bus technologies

Controlled area network: CAN Error Detection

CRC error:

While receiving data or remote frame the CRC value will be

calculated and is compared with the received CRC values.

In case of proper frame transmission both will be equal. Else

that will be considered as CRC error and error frame will be

transmitted.

Page 68: Automotive bus technologies

Controlled area network: CAN Error Detection

Acknowledgement error:

During the transmission of data or remote frame, in the ACK flag

field the transmitter will put recessive bit and expect dominant bit

from receive pin.

If dominant bit is observed then that is considered as proper

transmission. In other case it is acknowledgement error. The error

frame is transmitted if acknowledgment error is observed.

Page 69: Automotive bus technologies

Controlled area network: CAN Error Detection

Form error: Form error will be related to the error in forming the

frame. For e.g. delimiter (CRC, ACK) missing or improper end of

frame, these conditions are taken as form error and immediately

error frame is transmitted.

Page 70: Automotive bus technologies

Controlled area network: CAN Error Detection

Stuff error:

In a frame if continuous 5 recessive or dominant bits are

transmitted, the sixth bit should be of opposite to that.

While receiving if continuous 5 recessive or dominant bits are

received then the next incoming bit is of same value that of

previous then it will be considered as stuff error.

Page 71: Automotive bus technologies

Controlled area network: Bus Arbitration

Page 72: Automotive bus technologies

Controlled area network

CAN Application:

Motor vehicles

Utility vehicles

Industrial automation.

Other applications for CAN are: trains, medical equipment,

building automation, household appliances, and office

automation.

Page 73: Automotive bus technologies

CAN and LIN in AUTOSAR

Page 74: Automotive bus technologies

• References:

http://www.ni.com/white-paper/9733/en/

https://www.kvaser.com/about-can/can-

standards/linbus/

http://electrosofts.com/can/