+ All Categories
Home > Documents > 1 Lecture Controller Area Networks Dr. Tony Grift [email protected].

1 Lecture Controller Area Networks Dr. Tony Grift [email protected].

Date post: 18-Jan-2016
Category:
Upload: julianna-strickland
View: 217 times
Download: 3 times
Share this document with a friend
38
1 Lecture Controller Area Networks Dr. Tony Grift [email protected]
Transcript
Page 1: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

1

Lecture Controller Area NetworksDr. Tony Grift

[email protected]

Page 2: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

2

What will you learn today?

• Recap binary numbers• What purpose serve vehicle networks?• Understand Controller Area Network physical layer

(hardware)• Identify and interpret components of CAN Frames• Understand the meaning and importance of

standardized communication protocols

Page 3: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

3

Bits & Bytes

• Data communication is digital. You only have 1’s and 0’s• Bit = binary digit• How do you translate these into decimal numbers?• Decimal number

• 4532• 2*10^0+3*10^1+5*10^2+4*10^3=4532dec

• Binary numbers• 1011bin

• 1*2^0+1*2^1+0*2^2+1*2^3 = 11dec

• 1 byte = 8 bits• Base (either 10 or 2) is called the radix

Page 4: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

4

Why do we need in-vehicle networks?

Page 5: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

5

Modern Car components

Page 6: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

6

Star topology

Page 7: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

7

Bus topology

Page 8: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

8

Let’s simulate a Vehicle Network…

Rule: Only transmit your message when nobody else is transmitting

You are an OIL TEMPERATURE SENSOR/TRANSMITTER Your identifier ID = 100 Your task If you hear REQUEST ID 100

Say ID 100, 82.0 (you may choose other temperatures, make sure to write them down)

Page 9: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

9

Here is our communication protocol

ID Function Messages Meaning 0 Heart rate monitor X, Int X = heart rate in bpm 1 Collision detector X, binary 0 = ok, 1 = Collision detected 2 Seatbelt tensioner X, binary 0 = ok, 1 = Tension seatbelt 3 Airbag controller X, binary 0 = ok, 1 = Activate airbag 100 Oil temp sensor X, Float X = Engine oil temperature in deg Celsius 101 Humidity sensor X, Int X = Relative Air humidity % 102 GPS Receiver X,Y, float Latitude, 8 chars Longitude, 8 chars 1000 Satellite transmitter X, float 1001 Satellite Relay unit X, float Relays x from 1000 (car) to 1002 (hospital) 1002 Ambulance A, X,Y 0=Stationary, 1 = Drive to X,Y (GPS coord).

Page 10: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

10

Controller Area Network

• A broadcast, differential serial bus standard, originally developed in the 1980s by Robert Bosch GmbH, for connecting electronic control units (ECUs) in vehicles.

• Very robust• Two wire bus• Messages are short (8 data bytes max) • Priority based arbitration used for Collision Avoidance• Bit stuffing for synchronization: if 5 equal bits, the following

one is opposite polarity• Error detection mechanism through Cyclic Redundancy Check

(CRC)• Bit rates up to 1 Mbit/s• The CAN data link layer protocol is standardized in ISO 11898-

1 (2003). All the other protocol layers are left to the network designer's choice.

• ISO 11783 (ISOBUS) is the agricultural network protocol

Page 11: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

11

OSI model

Page 12: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

12

Complete 7 layer OSI model

All People Seem To Need Data Processing

Page 13: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

CAN only implements the two layers of the OSI model that are closest to the hardware

13

Page 14: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

14

Controller Area Network cont.• 4 ms per bit = 250 kilo bit/s (Required for ISOBUS standard)• Data Length Code (DLC) contains nr of data bytes• If RTR bit is high,

• no data bytes, DLC = # bytes requested• 11-bit (CAN 2.0a) and 29 bit (CAN 2.0b) ID messages on

same bus• IDE (Identifier Extension bit) distinguishes between 11 and

29 bit frames

1

0

Page 15: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

15

CAN Frames Standard (a) & Extended (b)

Page 16: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

16

Demo time

Page 17: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

17

Transmitter

Receiver

Analog Inputs

CAN bus

Page 18: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

19

CAN 2.0b Request Transmission Frame

Mark the bits in your handout (3 min)

Page 19: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

20

Answer

01010101 01011110 10101010 00001001 11000100 00010101 00001000 10111111 1

Page 20: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

21

Step 1 Get rid of the stuffing bits

• Stuffing bits are put in to ensure synchronization• If you see 5 consecutive zeros or ones, the next one is a

stuffing bit • Throw it out!

Page 21: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

22

De-stuffing the CAN Frame

0101010101011110101010100000 1 00111000100000 1 0101000010001011111111

0101010101011110101010100000001110001000000101000010001011111111

Page 22: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

23

Chop the Frame up into pieces

0 Start of Frame

XXXXXXXXXXX 11- bit Standard Identifier

X Substitute Remote Request BitX Identifier Extension Bit (1 = Extended Frame)

XXXXXXXXXXXXXXXXXX 18 Bit Extended Identifier

X RTR Bit (1 = Request Transmission)XX ReservedXXXX Data Length Code (Nr of bytes that follows)

XXXXXXXX Data Byte 1XXXXXXXX Data Byte 2XXXXXXXX Data Byte 3XXXXXXXX Data Byte 4

XXXXXXXXXXXXXXX Cyclic Redundancy Check (CRC) (15 bits)1 CRC delimiter

X Acknowledge slot bit 1 Acknowledge delimiter

1111111 End of frame (7 ones)

0101010101011110101010100000001110001000000101000010001011111111

Page 23: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

24

Interpret the CAN Frame

0 Start of Frame

10101010 101 11- bit Standard Identifier1 Substitute Remote Request Bit1 Identifier Extension Bit (1 = Extended Frame)

10 10101010 00000011 18 Bit Extended Identifier

1 RTR Bit (1 = Remote Transmission Request)00 Reserved0100 Data Length Code (Nr of bytes requested)

XXXXXXXX Data Byte 1XXXXXXXX Data Byte 2XXXXXXXX Data Byte 3XXXXXXXX Data Byte 4

000010100001000 Cyclic Redundancy Check (CRC) (15 bits)1 CRC delimiter

0 Acknowledge slot bit 1 Acknowledge delimiter

1111111 End of frame (7 ones)

Page 24: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

25

A word on error detection

• Cyclic Redundancy Check• Transmitter computes Transmitter checksum based on data• Receiver receives both data and Transmitter check sum• Receiver computes Receiver checksum based on data• If Transmitter checksum == Receiver checksum

• Data is valid with very high probability

• P(Error unnoticed) = 4.7 *10-11

Transmitter Receiver

Message

Algorithm

Checksum Transmitter

Message

Algorithm

Checksum Receiver

Checksum Transmitter

Compare

Page 25: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

26

Message arbitration is used to resolve conflicts due to collisions: most important message must go through

• If more than one message is being transmitted simultaneously a collision occurs

• Bit-by-bit arbitration process: If a node has a lower (dominant) bit it wins arbitration, the others lose and shut down

• At (2) Node 2 loses arbitration and shuts down. At (3) Node 1 loses arbitration and shuts down. Node 3 (lowest number, highest priority) goes through

Page 26: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

CAN-USB interface (Lab being developed)

27

1556AA034FFFF0102 (From CAN232 Monitor) 0001 0101 0101 0110 1010 1010 0000 0011 0100 1111 1111 1111 1111 0000 0001 0000 0002 0 SOF 001 0101 0101 11 bit ID (341) 0 STR 1 IDE 10 1010 1010 0000 0011 18 bit ID (174595) 0100 DLC 11111111 Data bytes (4) 11111111 00000001 00000010 SOF:11-bitID:STR:IDE:18-bitID:DLC:DataBytes

Page 27: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

28

What is a protocol ?

• Give some examples of protocols among humans•

• Communication pilot-tower• Meetings (Roberts Rules of Order)• Rules of games• Etiquette rules• Unwritten rules (job interview)

• Some Network protocols• TCP (Transmission Control Protocol) • IP (Internet Protocol) • DHCP (Dynamic Host Configuration Protocol) • HTTP (Hypertext Transfer Protocol) • FTP (File Transfer Protocol) • POP3 (Post Office Protocol 3) • SMTP (Simple Mail Transfer Protocol) • IMAP (Internet Message Access Protocol) • ISO 11783 (ISOBUS)

Page 28: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

29

You are sending a mining truck overseas• Sender

• Split up the truck in smaller parts• Add routing information• Add additional packing information• Add reassemble information• Send “packages sent” message to receiver• Deliver packages to UPS

• Receiver• Receive messages from UPS• Wait until all packages have come in• Check if you have everything• Reassemble the truck• Send acknowledge message to sender

• This transmission process requires a protocol• UPS = ISO 11898 CAN physical layer

• We don’t care how it does it• We want it reliable• We want it fast

• ISO 11783 (ISOBUS) is the protocol

Page 29: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

30

CAN in Agriculture

Page 30: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

31

Page 31: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

The lightbar displays graphics to assist the operator when navigating along curved swaths.

32

Page 32: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

The FieldPilot Module performs assisted steering on straight and contour paths.

33

Page 33: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

34

Page 34: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

Spray application

35

Page 35: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

36

Page 36: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

37

Virtual terminal in John Deere tractor

Page 37: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

38

Summary

• Why do we need a Vehicle network?Improved control of engine performance and emissionsImproved comfortAutomated diagnostics (OnStar)Improved safety

• Controller Area Network• Communication network for vehicles and other noisy environments• Error handling

• Bit stuffing• CRC

• Frames• 11bit (2.0a) and 29 bit • Prioritization using arbitration mechanism

• Protocols, rules of communication• ISO 11898 (CAN Physical layer)• ISO 11783 (ISOBUS communication)

• Link: http://www.can-cia.org/

Page 38: 1 Lecture Controller Area Networks Dr. Tony Grift grift@uiuc.edu.

39

The End


Recommended