can

Views:
 
     
 

Presentation Description

control are network

Comments

Presentation Transcript

CANController Area Network29BIT ID : 

CANController Area Network29BIT ID Timothy E. Jackson Overview and Application

CAN Frame : 

CAN Frame

CAN Frame : 

CAN Frame Identifier = 29 bits + MAC DLC = Data Length Code 4 bits Indicates number of data bytes Data Field = 0 to 7 bytes Depends on the DLC value

CAN Frame : 

CAN Frame SOF = Start Of Frame RTR = Remote Transmission Request IDE = Identifier Extension Bit DLC = Data Length Code CRC = Cyclic Redundancy Check ACK = Acknowledgement EOF = End Of Frame Standard Format, 2.0A Max frame length with bit stuffing = 127 bits CRC delimiter 1 bit

CAN Frame : 

CAN Frame SOF = Start Of Frame SRR = Substitute Remote Request IDE = Identifier Extension Bit RTR = Remote Transmission Request DLC = Data Length Code CRC = Cyclic Redundancy Check ACK = Acknowledgement EOF = End Of Frame Extended Format, 2.0B Max frame length with bit stuffing = 150 bits CRC delimiter 1 bit

CAN Frame : 

CAN Frame CRC delimiter 1 bit

CAN Frame : 

CAN Frame PRI= Priority 3 bits PGN = Parameter Group Number, 18 bits SA = Source Address, 8 bits Message Structure

How do I start using CAN right now? : 

How do I start using CAN right now? SAE J1939 Defined by the automotive industry Standards defined for the Layers 1,2,3,4, and 7

ISO Layers according to SAE J1939 : 

ISO Layers according to SAE J1939 Application Layer Data Link Layer Physical Layer Layer 7 Layer 2 Layer 1 Presentation Layer Session Layer Transport Layer Layer 6 Layer 5 Layer 4 Layer 3 Network Layer SAE J1939/11 SAE J1939/12 SAE J1939/21 SAE J1939/31 SAE J1939/21 SAE J1939/71 SAE J1939/73

ISO Layers Used In EAMCS : 

ISO Layers Used In EAMCS Application Layer Data Link Layer Physical Layer Layer 7 Layer 2 Layer 1

Physical Layer : 

SAE J1939/11 – High Speed Bus Connection Differential signal transmission Shielded twisted pair bus lines and ground 250k bits/sec 30 nodes max. Bus length = 40m max. or 131 ft. max. Physical Layer SAE J1939/12 – Variant Bus Connection Bus constructed using active termination For bus load = 1 (Using 29bit ID and 8 data bytes per frame, approx. 135bits/message) At a bitrate of 250kbps 1850 messages per second

Slide 12: 

Node B (UQM Inverter) Node A (EAMCS)

Example MSCAN Timing : 

Example MSCAN Timing

Cont. Example MSCAN Timing : 

Cont. Example MSCAN Timing 16Tq = SYNC_SEG + PropagationDelaySeg + TimeSeg1 + TimeSeg2 SYNC_SEG = 1Tq PropagationDelaySeg = 2Tq (Determined by bus characteristics) Pick, TimeSeg2 = 5Tq TimeSeg1 = 8Tq This gives a SJW range 0…3 so, I picked 2 Once values are determined, then apply to MSCAN registers

Data Link Layer SAE J1939/21 : 

PRI= Priority 3 bits PGN = Parameter Group Number, 18 bits r = Reserved Bit, always 0 or dominant DP = Data Page PF = PDU format, (Protocol Data Unit) DA = Destination Address GE = Group Extension SA = Source Address, 8 bits Data Link Layer SAE J1939/21

Slide 17: 

Example: EAMCS Message sent to UQM Inverter Priority Defined by SAE Reserved for future use Defined by SAE PDU Defined by SAE DA Defined by User SA Defined by User

Application LayerSAE J1939/71 : 

Application LayerSAE J1939/71 Defines the bytes in the data field

SAE HANDBOOK DATA : 

SAE HANDBOOK DATA

Example: Parameter Group Definition : 

Example: Parameter Group Definition Electric Drive State Transmission Repetition Rate: 100ms Data Length: 8 bytes Data Page: 0 PDU format: 239 PDU specific: DA Default Priority: 4

Cont. Example: Parameter Group Definition : 

Cont. Example: Parameter Group Definition Definitions Data Field

Cont. Example: Parameter Group Decoding Using MSCAN (The Easy Way) : 

Cont. Example: Parameter Group Decoding Using MSCAN (The Easy Way) CANRXFG[4] Define a struct typedef struct{ INT8U command; INT16U actual_speed; INT8U torque; INT8U voltage; INT8U current; INT16U system_error; }ELEC_DRIVE_STATE; ELEC_DRIVE_STATE elec_drive_data; Create an Instance Take advantage of Struct copying routines elec_drive_data = *(ELEC_DRIVE_STATE*)(CANRXFG + 4); Now access the data fields using the corresponding struct member outhexw(&elec_drive_data.actual_speed); /* Print the 16bit hex value */ D a t a F i e l d

References : 

References Motorola Documentation MSCAN Block Guide V02.14, S12MSCANV2.pdf Bosch Documentation CAN Specification Version 2.0, can2spec.pdf Reference Texts Konrad Etschberger,Controller Area Network. Weingarten, Germany: IXXAT Automation GmbH, 2001 1997 SAE Handbook, Volume 2 Parts and Components. Warrendale, PA: Society of Automotive Engineers, 1997