Top Banner
CAN Controller Area Network Vikas Kumar M
34

Controller Area Network (Basic Level Presentation)

Sep 12, 2014

Download

Automotive

A presentation on basic and easy understanding of Controller Area Network
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Introduction

CANController Area NetworkVikas Kumar MSlide No #7/10/2014Vehicle ComponentsComponents for functioning of a Vehicle?EngineBodyChassisMusic SystemBrakesLighting SystemBatterySensorsDoorsWindowsGaugesClimate ControlMetersTemplate Version 1.0Slide No #7/10/2014Components CommunicationIf all the mentioned components communicate in this fashion, would be a mess, more no of cables would require, etc.

Also if a new node is to be introduced, it will be very difficult and complexcomponentsECM/BCMTemplate Version 1.0Slide No #The automotive industry quickly realized the complexity of wiring each module to every other module. Such a wiring design would not only be complex, it would have to be altered depending on which modules were included in the specific vehicle. For example, a car without the anti-lock brake module would have to be wired differently than one that included anti-lock brakes.7/10/2014Topology for communicationWhat is a TopologyIn general, it is a study of Shapes and Spaces, such as ConnectednessContinuityBoundaryBranchesTemplate Version 1.0Slide No #7/10/2014CAN Bus TopologyWhat is a Network TopologyIt is the arrangement of various elements [Links, Nodes, Etc.] for a Network [a telecommunication n/w] to exchange Data

So CAN is a BUS Topology

Template Version 1.0Slide No #What is a BusIn General, Bus is an electrical pathwayIn other words, the bus is the channel, that connects components and transfers information

7/10/2014Vehicle Bus Topology

What is a Vehicle BusAn internal communications network that interconnects components inside a vehicle [e.g. automobile, bus, train, industrial or agricultural vehicle, etc.]componentsInternal CommunicationNetworkTemplate Version 1.0Slide No #7/10/2014ProtocolNow we have the Vehicle Bus for communication,

What if there isNO Format on how it should be routed / communicated or passed to othersNO Syntax on how to understand the communicationNO Identification to track the communicationTemplate Version 1.0Slide No #7/10/2014ProtocolWhat is a ProtocolProtocol is a set of rules for exchanging messages within or between components/system

Basic requirements of protocolsData formats for data exchangeAddress formats for data exchangeAddress mappingRoutingAcknowledgmentTemplate Version 1.0Slide No #7/10/2014Types of ProtocolWhat are the types of Protocol?In general, protocols differ in so many ways that it's not possible to give an answer

Why you need different varieties of Protocols:Because it depends on who, where, how, whom

Template Version 1.0Slide No #For example, a general scenario, its your birthdayYou bring sweets and send mail to everybodyYou want to go out for dinner, to mail to selected people

7/10/2014CANCAN (Controller Area Network)

Development of Controller Area Network bus started originally in 1983 at Robert Bosch GmbH.Template Version 1.0Slide No #7/10/2014Before CAN

Before CANTemplate Version 1.0Slide No #7/10/2014Development of CANThe development of CAN began:when more and more electronic devices were implemented into modern motor vehiclesIt was designed specifically for automotive applications but now also used in other areas

To improve the behavior of the vehicle even further, it was necessary for the different control systems (and their sensors) to exchange information

Template Version 1.0Slide No #7/10/2014After CAN

After CANOne of the advantages of this topology is:that nodes can easily be added or removed with minimal software impactTemplate Version 1.0Slide No #7/10/2014CANWhat are the Characteristics of a CANIt is a Vehicle BUS with:Serial communication ProtocolMulti-Master Message ModelSystem flexibilityCommunication speedTemplate Version 1.0Slide No #7/10/2014CANCAN bus is a Serial Communication Protocol

What is Serial Communication?Serial communication is the process of sending data one bit at a time, sequentially, over a communication channel

Serial Communication is used for all long-haul communicationTemplate Version 1.0Slide No #7/10/2014CANWhy Serial Communication?Basic differences:Serial CommunicationParallel CommunicationOne data bit is transceived at a timeMultiple data bits are transceived at a timeLess number of cables required to transmit dataHigher number of cables requiredLong DistanceShort DistanceTemplate Version 1.0Slide No #http://maxembedded.com/2013/09/03/serial-communication-introduction/#what

7/10/2014CANWhy Serial Communication

A few advantagesA serial connection requires fewer interconnecting cables (e.g., wires/ fibers) and hence occupies less space.The extra space allows for better isolation of the channel from its surroundings.Serial is a better option because it is cheaper to implement

In general, Common Serial Communication Protocol are:SPI, I2C, FireWire, Ethernet, USB, RS232, etc.

Template Version 1.0Slide No #7/10/2014Vehicle Bus ProtocolProtocolAbbreviationNatureCANControlled Area Networkan inexpensive low-speed serial bus for interconnecting automotive componentsD2BDomestic Digital Busa high-speed multimedia interfaceFlexRay-a general purpose high-speed protocol with safety-critical featuresICInter-Integrated Circuitfor attaching low-speed peripherals KWP 2000Keyword Protocol 2000 a protocol for automotive diagnostic devices (runs either on a serial line or over CAN)

LINLocal Interconnect Network

a very low cost in-vehicle sub-networkMOSTMedia Oriented Systems Transporta high-speed multimedia interfaceSPISerial Peripheral Interfacefor communication with slow peripheral devices, which are accessed infrequentlyCommon Vehicle Bus Protocols include:Template Version 1.0Slide No #7/10/2014CANCAN bus is a Multi Master Message Model

What is Multi Master Any Node* can Transmit or Receive any message

What is Message ModelData transmitted from any node on a CAN bus, does not contain ADDRESSES of either the transmitting node, or of any intended receiving node.Instead it contains MESSAGE which will be labelled by an identifier

Template Version 1.0Slide No #Multicast is the delivery of data to a group simultaneously in a single transmission from the source.7/10/2014CAN, Multi Master Message ModelBasic working PrincipleData that are transmitted from any Node, contains MESSAGE labelled with IDENTIFIER, which is unique throughout the networkAll other nodes receive the message and each performs an acceptance test on the identifier to determine if the message, and thus its content, is relevant to that particular node. If the message is relevant, it will be processed; otherwise it is ignored.

TxRxRxRxRxRxTxRxTemplate Version 1.0Slide No #If two or more units start sending a message at the same time, the unit whose message has highest priority is granted the rights to send, and all other units perform a receive operation.

In situations where two or more nodes attempt to transmit at the same time, a non-destructive arbitration technique guarantees that messages are sent in order of priority and that no messages are lost. 7/10/2014CAN, Multi Master Message ModelWhat if two or more nodes start sending a message at same time?

Answer:A node with message having a highest priority will be granted to send first

Advantage:It guarantees that messages are sent in order of priorityIn addition it also ensures that No message are lostTemplate Version 1.0Slide No #If two or more units start sending a message at the same time, the unit whose message has highest priority is granted the rights to send, and all other units perform a receive operation.

In situations where two or more nodes attempt to transmit at the same time, a non-destructive arbitration technique guarantees that messages are sent in order of priority and that no messages are lost. 7/10/2014CAN Node RequirementEach node requires aHost ProcessorThe host processor decides: what received messages mean and which messages it wants to transmit itselfSensors, actuators and control devices can be connected to the host processor.CAN ControllerReceiving: the CAN controller stores received bits serially from the bus until an entire message is available, which can then be fetched by the host processor (usually after the CAN controller has triggered an interrupt)Sending: the host processor stores its transmit messages to a CAN controller, which transmits the bits serially onto the bus.CAN TransceiverReceiving: it adapts signal levels from the bus to levels that the CAN controller expects and has protective circuitry that protects the CAN controllerTransmitting: it converts the transmit-bit signal received from the CAN controller into a signal that is sent onto the bus.

Template Version 1.0Slide No #7/10/2014CANCAN Message are Transmitted/Received:PeriodicallyOn RequestOn a State changeAt a uniform and fixed bit rate within a CAN Bus or NetworkTemplate Version 1.0Slide No #http://www.playerwindow.com/video/sw3ADKPo1Uo7/10/2014CANError Free Communication

Low Wiring CostLow Hardware CostEasy expandabilityLow Node-Connection CostSafety critical equipment Real-time SystemTwisted Pair Wire, wiring cost is lowConnectivity with MCU doesnt occupy much Chip area, which keeps the MCUs cost LowSimple to add Nodes to the network; Just lap in two wires at any point on the busOnly two pins are needed on MCU and in Bus connectorsMore Chips with CAN HardwareMore and more MCUs with CAN functionality are becoming availableTemplate Version 1.0Slide No #http://dkc1.digikey.com/us/en/tod/Renesas/CANBasicsPart-1_NoAudio/CANBasicsPart-1_NoAudio.html7/10/2014CANQuantity of CAN Nodes:Theoretically it is unlimitedBut practically it is limited to certain number, because higher the nodes will impact on the Delay of the response, will increase the electrical loadTemplate Version 1.0Slide No #http://rockerjin.blogspot.com/2012/06/4848-blog-4-controller-area-network-bus.html7/10/2014CANCAN Bus implementationA Common way to implement using Two-Twisted wires with two termination Resistors of 120 ohms

Twisted Pair Connection for bi-directional dataTerminatorsTemplate Version 1.0Slide No #For short cables, you can often get by without any termination unless the baud rate is very high.7/10/2014CAN Twisted Pair WireReason for Twisted Pair WiresTo Cancel out Noise generated by external fields across WiresCurrent flowing in each wire in Opposite direction, their magnetic field cancels, so the cable radiates less

What is a TerminatorA device connected to one end of a bus or cable that absorbs signals Terminators can be passive (simple resistors) or active (more complex electronics) depending on the type of bus being terminated

Template Version 1.0Slide No #http://rockerjin.blogspot.com/2012/06/4848-blog-4-controller-area-network-bus.htmlhttps://learn.sparkfun.com/tutorials/what-is-a-circuit/circuit-basics

7/10/2014CAN TerminationCAN Bus is terminated with 120 ohms?

The terminator is placed at the end of a transmission line to Eliminate reflections at the ends of bus wireThus to Match Impedance*

Template Version 1.0Slide No #http://dkc1.digikey.com/us/en/tod/Renesas/CANBasicsPart-1_NoAudio/CANBasicsPart-1_NoAudio.html7/10/2014CANCAN Bus is terminated with 120 ohms?

SourceDestinationSourceDestinationTermination

Template Version 1.0Slide No #7/10/2014CANWhy only 120 been used?120 is going to be close most of the time for the relatively large wires commonly used for CAN.

Template Version 1.0Slide No #http://rockerjin.blogspot.com/2012/06/4848-blog-4-controller-area-network-bus.html7/10/2014CANNon-Automotive CAN Applications:ShipsLocomotives, Railway SystemsHVAC SystemsElevatorsIndustrial Freezers, High Speed Printing MachinesMany OthersTemplate Version 1.0Slide No #7/10/2014Thank YouTemplate Version 1.0Slide No #7/10/2014CANCAN Standard SpecificationCAN Protocol is Standardized by ISOISO11898 and ISO11519-2, with no much difference except at the Physical LayerISO11898 is a standard for high-speed CAN communicationISO11519 is a standard for low-speed CAN communication

Template Version 1.0Slide No #The CAN protocol has been standardized by ISO, so that there are several ISO standards for CAN such asISO11898 and ISO11519-2. In the ISO11898 and ISO11519-2 standards, there are no differences in thedefinition of the data link layer, but differences exist for the physical layer.7/10/2014CANWhat is Matching Impedance?When sending power down a transmission line, it is usually desirable that as much power as possible will be absorbed by the load and as little as possible will be reflected back to the source.

Template Version 1.0Slide No #In electronics, impedance matching is the practice of designing the input impedance of an electrical load (or the output impedance of its corresponding signal source) to maximize the power transfer or minimize reflections from the load.

>> http://en.wikipedia.org/wiki/Impedance_matching>> http://en.wikipedia.org/wiki/Transmission_line>> http://en.wikipedia.org/wiki/Electrical_termination7/10/2014