Estratto del documento

From standard to automotive communication

Martedì 13 ottobre 2020 19:30

ISO/OSI - Bottom-up approach

1. Physical layer

  • Specifies mechanical, electrical properties of the bits we want to transmit.
  • Time synchronization, coding, modulation.

2. Data link layer

  • Check the transmission of frames.
  • Frame synchronization, error checking, flow control.

3. Network layer

  • Transmission of packets.
  • Connection setup, routing, resource management.

4. Transport layer

  • Reliable end-to-end transport of segments.

5. Session layer

  • Establish and tear down sessions.

6. Presentation layer

  • Define syntax and semantics of information.

7. Application layer

  • Communication between applications.

ISO/OSI in automotive

ISO/OSI in automotive - Bus

Automotive connectivity Pagina 1

Bus automotive - Many standards:

CAN (Controller Area Network) Bus

CAN Bus Layers

Data link layer

  • Logical Link Control (LLC): where we use the brain and where we give meaning to the groups of bits; acceptance filtering, overload notification, recovery management.
  • Medium Access Control (MAC): coding frames, detecting errors, data encapsulation/decapsulation, bit stuffing, channel access control.

Physical layer

  • Here we only want to transmit bits, 1 means 5V and 0 means 0V.
  • Physical Signaling (PLS): bit encoding/decoding, bit time synchronization.
  • Physical Medium Attachment (PMA): driver/receiver characteristics.
  • Media Dependant Interface (MDI): connectors.

Why bus systems?

  • Low cost: material, weight, volume.
  • Higher modularity: customization of vehicles, cooperation with Original Equipment Manufacturers (OEMs).
  • Shorter development cycles: re-usability of components, standard protocols and testing plans (less errors).

OBD: Automotive connectivity Pagina 2

OBD:

CAN (Controller Area Network) is part of On Board Diagnosis (OBD) connector (mandatory pin).

CAN Bus Use Cases

  • Driveline: engine and transmission control.
  • Active safety: Electronic Stability Programme (ESP).
  • Passive safety: air bags, belt tensioners.
  • Comfort: interior lighting, A/C automation.
  • Multimedia and Telematics: navigation system, CD changer.

On and Off Board Communication

CAN Bus On Board Communication

  • Complex control and monitoring tasks: data transmission between ECUs.
  • Simplification of wiring: replaces dedicated copper wiring.
  • Multimedia bus systems: transmission of large volumes of data.

CAN Bus Off Board Communication

Off board means when we are not driving.

  • Diagnosis: read out of approximately 3000 kinds of errors, exhaust emission testing.
  • Flashing: initial installation of firmware on ECUs or update.
  • Debugging: detailed diagnosis of internal status during development.

Important characteristics of the main applications

Automotive Connectivity Pagina 3

Network

Network topologies to connect ECUs

Network medium and Data transmission:

  • CAN bus is electrical and broadcast.
  • Ethernet is electrical and unicast.
  • 802.11p OCB is wireless and broadcast.

CAN Bus Details

CAN Bus uses a line topology, in which the nodes are the ECUs, and the lines are a twisted pair of lines.

Automotive Connectivity Pagina 4

CAN Bus uses a line topology, in which the nodes are the ECUs, and the lines are a twisted pair of lines.

It uses an electrical medium over wires.

CAN Bus uses a broadcast data transmission, in which one node is sending data, and all the others will be able to listen.

The benefit of having CAN Bus on lines is quantity:

Bus Access Classification

  • Deterministic: we know everything a-priori.
  • Distributed: everyone knows what to do.
  • Centralized: there is a super-node that allows sending/receiving data.
  • Random: we wake up and try to transmit.
  • Collision free.
  • Non-collision free.
  • Combinations: Dense networks where nodes have always something to transmit. Otherwise, a lot of time is wasted accessing the channel and colliding.

Automotive Connectivity Pagina 6

Networks with few nodes and sporadic data exchange. Otherwise, a lot of time is wasted for the slot/token.

CAN Bus Recap

The Controller Area Network (CAN bus) is the nervous system, enabling communication between all parts of the car.

  • Electronic Control Units (ECUs) are connected via the CAN bus, which acts as a central networking system.
  • In an automotive CAN bus system, ECUs can, for example, be the engine control unit, airbags, or the audio system. A modern (standard) car can have up to 70 ECUs.
  • The CAN bus protocol allows ECUs to communicate with each other without complex dedicated wiring in between. In turn, this allows for several features to be added via software alone.
  • CAN Goal: to allow any ECU to communicate with the entire system without causing an overload to the controller computer.

Automotive Connectivity Pagina 7

Automotive Connectivity Pagina 8

CAN Bus

Venerdì 16 ottobre 2020 15:43

CAN wires:

CAN ECUs Structure Blocks

CAN is a line topology Bus, so each node is plugged directly inside the line. Each node/ECU attached to the CAN must follow the CAN interface, and it must deploy the 3 layers of ISO/OSI stack:

  • Layer 1 - Physical.
  • Layer 2 - Data Link.
  • Layer 7 - Application.

The CAN interface implements layer 1 and layer 2 of ISO/OSI (7 is not CAN standard communication, but for OBD):

  • CAN controller for data link layer: the brain, creates and maintains the CAN frame/message.
  • CAN transceiver for physical layer: it simply converts logical bits into physical values (in Volt).

CAN Message

Automotive Connectivity Pagina 9

  • Start of Frame (SOF): it is a "dominant 0" bit that tells the other ECUs that we want to start the transmission and a message is coming.
  • CAN-ID: it contains the message identifier of the sender. Low values have higher priority.
  • RTR: allows ECUs to request messages from other ECUs.
  • Control (6 bits): it informs us of the lengths of the Data in bytes (0 to 8 bytes).
  • Data (0-64 bits): it contains the actual data values (payload).
  • CRC: it is used to ensure data integrity.
  • ACK: it indicates if the CRC process is OK.
  • End of Frame (EOF): it marks the end of the CAN message and tells if there is a general error.

Without the Control block:

  • No information about the data size, so no information about the threshold between data and CRC, so no check possibilities.
  • No way to know the final frame size, no way to know the end of the frame, sync lost for every ECU.
  • No info about the typology of CAN protocol used (the first two bits tell us if we are in CAN or CAN FD).

Message passing:

A node can only transmit or receive.

  • If we are transmitting data, we need to be sure that we are the only one to transmit data.
  • Once a node is transmitting, all the others are listening/receiving.

CAN Bus Wired AND

The CAN Bus wire is a logical AND because if only one ECU is writing a 0 on the bus, all the bus will be a 0. If we want a 1, everyone must write a 1.

CAN Message Transmission (Tx)

  • CAN is an event-driven bus system, it means that an ECU wakes up when it wants to transmit.
  • Possible collisions.
  • If bus is idle, we can transmit.
  • If bus is busy, so if another ECU is already transmitting data, then we have to wait.

Message time sending:

  • Maximum size, average bus speed.

Avoid Collisions

ECU X and Y are waiting for ECU Z to end the transmission. They probably start to transmit together once the bus is free, causing a collision.

Solution: CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) as a wired connection because we want to avoid collisions.

CSMA/CA - Bitwise Arbitration

  1. All ECUs, with a transmission request, simultaneously send the ID of their respective CAN message to be transmitted, bitwise from the most significant to least significant bit.
  2. A bit significance 0 is dominant on the CAN bus (AND wired).
  3. If two ECUs X and Y simultaneously transmit different bit values, the 0 value prevails over the 1 value on the bus.
  4. Each ECU compares the value on the bus with the value it has sent.
  5. The rules of the arbitration logic determine whether an ECU may continue sending or must stop.

Error on the CAN Bus

Switch to receiving (Rx)

  1. S=0; B=0: we want to transmit, but another ECU is already transmitting. If we and the other ECU want to transmit simultaneously (both pushing a 0 on the bus), bitwise arbitration.
  2. S=0; B=1: electrical error on the CAN Bus.
  3. S=1; B=0: we switch to receiving because a node with higher ID is transmitting (bitwise arbitration).
  4. S=1; B=1: we are all listening on the bus.

Priorities instead of collisions - Bitwise arbitration Pros:

  • The bus logic and arbitration logic not only prevent collisions but also ensure that the highest priority ID node will always win the bitwise arbitration (priority-controlled bus access).
  • Smaller ECU's ID means higher priority.
  • The access is random, nondestructive (not causing failures), and priority-controlled.

Cons:

We don't know a-priori when we will be able to transmit.

CAN Message Error Detection

How do the sender and receiver agree on message integrity?

We need to focus on the Data and on the CRC.

Polynomial Division

We need to divide the data message by the generator, with the condition:

Polynomial Remainder Theorem: Given two polynomials (the dividend) and (the divisor), it asserts the existence (and the uniqueness) of a quotient and a remainder (the rest) such that:

, with

We need to do the polynomial arithmetic in modulo 2, in which the addition/subtraction is a XOR:

CRC Encoding - Sender

  • We have a message of bits: .
  • We have a generator of bits: .
  • The rest of bits: .
  • Add zeroes at the end of: .
  • Then divide the new message by to obtain the rest of bits, called CRC.
  • Form the novel final message: this means adding the CRC at the end of the message replacing the zeroes padded before.

Automotive Connectivity Pagina 12

CRC Decoding - Receiver

CRC Error Resistance

If an error occurs in the transmission channel, the receiver receives instead of simply . If this error is a multiple of , then divided by does no rest, so the receiver marks the message as correct, but it is not.

The solution is to have a good , which is defined by standard protocol in the CRC-encoding.

Examples:

Automotive Connectivity Pagina 13

is very important, and it is selected so that the error cannot easily be a multiple of

Automotive Connectivity Pagina 14

CAN Bit Codings

Sabato 24 ottobre 2020 16:20

Two Main Bit Coding Techniques

Non Return to Zero (NRZ):

  • Assign a voltage value to a logical value.

CAN Bus uses NRZ.

In CAN Bus, physical 0 means 0V and physical 1 means 5V (in general is the maximum value in V).

Each time we have a value to transmit, we have a constant long voltage level of the same value.

Manchester:

  • When we have to transmit a logical value of 0, we place a rising edge of the signal, so we need to push a change on the wire.
  • When we have to transmit a logical 1, we go from physical high level (5V) to physical low level (0V).

Ex. in bold we have the bits positions:

NRZ Coding:

Manchester Coding:

Automotive Connectivity Pagina 15

Reducing Electromagnetic Interference (EMI)

We need to absorb the electromagnetic noise:

  • Add shielding to wires.
  • Use twisted pair wiring.
  • Use coding with few rising/falling signal edges.

Dealing with the clock:

NRZ is less noisy because we jump from 1 to 0 a few times.

  • The most interference situation is when EMI is equal to half of the clock frequency (ex. 1010).
  • The best situation is when we have EMI equal to 0 (ex. 1111).

Manchester carries the clock with it on every single bit.

  • The most demanding situation is when we have a long sequence of the same bit. EMI is .
  • The best situation is when we have long patterns of 0101. The best EMI is .

How the Clock Works

Clock drift is caused by natural variations of a piece of quartz. Mechanical properties are translated into electrical properties.

The vibrations of quartz give me the clock, so we can decide when to send bits and for how much time, etc...

But clock drift leads to de-synchronization and bad interpretation of bit sequences.

We need to avoid the clock drift, continuously monitoring the bus to understand if we are going too fast or too slow. So we need a continuous bit re-adjusting not to make the receiver lose bits.

NRZ Bit Stuffing

We need to solve the problem of NRZ, in which we are losing the concept of bit because the long sequences have no edges that could compensate the clock drift.

The solution is Bit Stuffing: insert extra bits, which are not part of the message, after consecutive identical bits (in CAN).

Ex. stuffing width of 3 bits:

  • Every 3 consecutive same bits we put a 0. The receiver destroys these bits to compose the message again.

Automotive Connectivity Pagina 16

What is Inside a Single Bit

The clock period is not the one of the microcontroller because the clock period corresponds to a multiplier of the clock of the microcontroller.

The smallest portion of time is called Time Quanta (TQ).

  • A single bit is composed of 4 segments, each one has a role.
  • From 8 to 25 Time Quantas (single slot in figure).
  • TQs are generated by a programmable device of the oscillator.
  • TQ is the smallest discrete timing resolution used by a CAN node.

Constraints:

  • Each segment is composed of an integer number of TQs.
  • Segments are non-overlapping.
  • The bit time, and the bit rate, are selected by programming the width of the Time Quantum and the number of Time Quanta in various segments.
  • The higher the amount of TQs of each segment, the longer the segment or bit time, and the lower the bit rate (bit/s).

Synchronization Segment

We need synchronization in the CAN Bus. In bitwise arbitration, many nodes are writing simultaneously on the bus, so we need to be synchronized.

The Synchronization Segment is used to synchronize the various bus nodes.

  • On transmission, at the start of this segment, we will push the new bit value on the wire.
  • On receiving, a bus state change is expected to occur.
  • The length of this segment is always 1 Time Quantum.

Propagation Time Segment

Allows signal propagation.

  • Programmable length (1-8 Time Quantas).
  • This enables us to reach faraway portions of the bus, still maintaining synchronization.
  • A long bus prefers 8 TQs.

Phase Buffer Segment One

Buffer segments one and two deal with logical problems.

  • Allows lengthening of bits during re-synchronization.
  • It is the only segment that can be lengthened during re-synchronization.
  • Bus state is sampled at the end of this segment. The sample point is the point of time at which the bus level collects the data and interprets it as the value of the respective bit.
  • Programmable length (1-8 Time Quantas).

Phase Buffer Segment Two

Buffer segments one and two deal with logical problems.

  • Allows shortening of bits during re-synchronization.
  • The information processing time begins with the sample point and is reserved for calculation of the subsequent bit level.
  • The length of this segment must be at least as long as the information processing time.
  • Programmable length (1-8 Time Quantas).

Bit Lengthening

Lengthening Stage (the receiver is faster than the transmitter)

  • The transmitter doesn't have to check anything. The others have to adapt their own clock to the transmitter.
  • Therefore, all the receivers have to be synchronized with the transmitter.
  • At the beginning of the synchronization segment, we are pushing the change on the bus. But in the receiver, it can happen at the end of the synch segment, so we are going too fast because we are anticipating the synch segment with respect to the real edge of the bit.
  • Resynchronization: we need to compensate the oscillator tolerances within the different CAN nodes.

In the example, the transmitter oscillator is slower than the receiver oscillator, so the next falling edge used for resynchronization may be delayed. Thus, phase buffer segment One needs to be lengthened to obtain resynchronization, pushing 1 TQ in the orange segment:

Shortening Stage (the receiver is slower than the transmitter)

Automotive Connectivity Pagina 19

In this second example, the transmitter oscillator is faster than the receiver oscillator, so the next falling edge used for resynchronization may be too early. Thus, phase buffer segment Two needs to be shortened to obtain resynchronization (we can do it in bit or bit ), erasing 1 TQ from the blue segment:

Jump Width

  • It is the number of Time Quanta we can add in phase buffer one or erase in phase buffer two, in order to maintain synchronization (from 1 to 4 TQ). Jump width is the ability to jump in time and adjust during re-sync.
  • Jump width needs to be decided a-priori to know which CAN Bus technology we belong to.
  • The lower it is, the more sensible we have to be.

Dynamic Sample Position

Early sampling:

Automotive Connectivity Pagina 20

  • Flexibility: programming the sample point allows tuning the characteristics to suit the bus.
  • The sample position depends on the Jump Width.
  • Early sampling means more TQs in buffer segment two.
  • Early sampling decreases the sensitivity to oscillator tolerances.

Late sampling:

  • Reachability: late sampling allows maximum signal propagation time.
  • We are decreasing the Jump Width, so we need a good clock.
  • Maximum bus length and poor bus technologies can be handled.
  • Late sampling means more TQs in buffer segment one.
Anteprima
Vedrai una selezione di 20 pagine su 91
Automotive Connectivity Pag. 1 Automotive Connectivity Pag. 2
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 6
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 11
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 16
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 21
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 26
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 31
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 36
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 41
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 46
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 51
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 56
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 61
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 66
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 71
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 76
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 81
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 86
Anteprima di 20 pagg. su 91.
Scarica il documento per vederlo tutto.
Automotive Connectivity Pag. 91
1 su 91
D/illustrazione/soddisfatti o rimborsati
Acquista con carta o PayPal
Scarica i documenti tutte le volte che vuoi
Dettagli
SSD
Ingegneria industriale e dell'informazione ING-INF/04 Automatica

I contenuti di questa pagina costituiscono rielaborazioni personali del Publisher Dino_A di informazioni apprese con la frequenza delle lezioni di Automotive Connectivity e studio autonomo di eventuali libri di riferimento in preparazione dell'esame finale o della tesi. Non devono intendersi come materiale ufficiale dell'università Università degli Studi di Modena e Reggio Emilia o del prof Grazia Carlo.
Appunti correlati Invia appunti e guadagna

Domande e risposte

Hai bisogno di aiuto?
Chiedi alla community