Vehicle Networks - STI Innsbruck

Transcription

Vehicle NetworksCAN-based Higher Layer ProtocolsUniv.-Prof. Dr. Thomas Strang, Dipl.-Inform. Matthias Röckl

OutlineLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionGeneral-purpose HLPsISO TPTP2.0Special-purpose HLPsVehicle-Operational Purposes:CANopenSAE J1939Diagnostics Purposes:ISO 15765-3 (KWP2000/CAN)Unified Diagnostic ServicesOn-Board Diagnostics

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Introduction“Pure CAN” provides fast, prioritized, reliable, broadcast message transmissionwith sophisticated error detection and error handlingPure CAN can fulfill all requirements of small closed systemsPure CAN cannot satisfy the requirements that have to be fulfilled withinlarge, extendable, interconnected networks from different manufacturersÎ Higher Layer Protocols (HLP) required that enable the interconnection ofthese networksInter-manufacturer connection is of major importance for all kinds of nowcatsCranesExtension:Fixed attached components: blue lights, information systems, taximeterDynamic attached components: trailers, seeders, dozer bladesHighly dynamic attaches components: Fleet management system

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionFunctions that have to be fulfilled by HLPs:Definition of common message identifiers, their meaning, format andrespective data types to enable interoperabilityFlow controlTransportation of messages 8 bytesNode addressing to address a specific deviceNetworking via gatewaysNetwork management:Startup, maintenance and shutdown behaviorStatus reporting, ionInterconnecting Higher Layer ProtocolCANLow SpeedCANLow SpeedCANHigh SpeedCANHigh SpeedOtherProtocols

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionCAN in ISO/OSI Reference ModelNo. oflayerISO/OSI ref modelCAN protocol specification7ApplicationApplication gher Layer Protocols (HLP)3Network2Data Link1PhysicalCAN protocol(with free choice of medium)

Protocol Data Unit (PDU) of layer N becomes Service Data Unit (SDU)of layer N-1(N-1)-SDU extended with Protocol Control Information (PCI) and Footerbecomes (N-1)-PDUTerminologyLayer 1 PDU: bitsLayer 2 PDU: frameLayer 3 PDU: packetLayer 4 PDU: segment(N)-PDUPCILayer NLayer N-1PCIPayloadSDU(N-1)-PDUFooterFooterRECAPLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionProtocol messaging

Service Access Points (SAP) provide services to upper and lower layersSAP to layer (N-1)RequestConfirmationSAP to layer (N)ResponseIndicationEnd system ANetwork(N)-Service UserLayerN(1) Request(N)-Service User(4) Confirmation(3) ResponseSAPLayerN-1End system B(2) IndicationSAP(N-1)-Service Provider(N-1)-Service ProviderProtocol(PDU)RECAPLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionProtocol service primitives

Transmission of packets over multiple intermediate hopsProtocols: IPv4, IPv6, ICMP, IGMPMain functions:Global addressingRouting, e.g.:FloodingLink State RoutingDistance Vector RoutingHierarchical RoutingFragmentationQuality of ServiceRECAPLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionNetwork Layer

Data exchange over a logical connection between end-to-end systemsProtocols: TCP, UDP, DCCP, SCTPMain functions:Reliability management:Reliable communication (e.g. TCP by acknowledgements)Unreliable communication (e.g. UDP)Segmentation with (un)ordered deliveryFlow control: Overload at receiversCongestion control: Overload of the networkConnection management:Connection-oriented (e.g. TCP)Connectionless (e.g. UDP)Error ControlMultiplexing of concurrent servicesRECAPLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009IntroductionTransport Layer

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009General-purpose HLPsISO-TP

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009ISO-TPOverviewISO-TP ISO Transport ProtocolDesigned to run existing diagnostics protocols (ISO 14230) on CANUnreliable connection-oriented transport protocol enabling:Segmentation (transmission of up to 4095 bytes)Flow ControlBroadcast and unicast addressingUses CAN on Data Link layerStandardized under ISO 15765-2E.g. used with diagnostics protocols KWP2000 and UDS

Frame Types:Single Frame:4 bit4 bit0x0Data Length8 bit8 bit 0.7 Data BytesStandard frame for unsegmented dataFirst Frame:0x1Data LengthData Length0.6 Data BytesInitial frame in a sequence of framesConsecutive Frame:0x2Seq NumberSubsequent frame in the sequence (SN modulo0.7 Data Bytes2 4)0x3Flow StatusBlock SizeSeparation TimeFlow Control Frame:Response of the receiver specifying min. timing and max. buffer size ( block size) forconsecutive framesIn case of error (timeout or wrongsequence number) application layer0-127msis informed but not sender of the0-127msmessage0-127msÆ no inherent reliability,application layer has to handle errors Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009ISO-TPFrames

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009ISO-TPAddressingFlow control requires unicast communicationAddresses have to be predefined and statically assignedAddressing schemes:Normal Addressing:Source and destination address are encoded in CAN identifierExtended Addressing (for gateways):Additional Transport-PCI Byte ( first byte of CAN payload) withgateway addressÆ CAN payload reduced to 0.6 bytes

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009General-purpose HLPsTP2.0

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009TP2.0OverviewDesigned to allow existing diagnostics protocols on CAN2.0AMainly used by Volkswagen GroupConnection-oriented transport protocol enabling:Segmentation of arbitrary sizeFlow control with handshakeDynamic assignment of CAN identifier per channel (vs. staticassignment of CAN identifiers in ISO-TP)Automatic recovery after timeoutAddressing:UnicastMulticast, e.g. all ECUs on the powertrainBroadcast

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009TP2.0Broadcast communicationAllows usage of gateways (specified by Logical Address)Broadcast messages with and without required responseCANIdentifierCANPayloadLogical OpcodeOpening ID AddressSIDParameterService IDRequest 0x23Response 0x24Parameter

TP2.0Connection-oriented unicast communicationLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Connection setup request/response message:CAN IdentifierCAN PayloadOpening ID Address OpcodeData message:RX IDTX IDDestination IDSender IDRequest0xCOPositive Response 0xD0Negative Response 0xD6-0xD8Opening ID OpcodeAPPTypeID of applicatione.g. 0x01 Diagnostics1.7 DataIncludes Sequence Number, Receive Ready (for Flow Control), etc.Opening ID OpcodeACKConnection shutdown message:Opening ID OpcodeConnection Test0xA3Positive Response 0xA4Negative Response 0xA8

TP2.0Message sequenceChannel Setup2. Data ExchangeBlock-wise data transmissionCumulative acknowledgements3. Channel Shutdown Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/20091.

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Special-purpose HLPsCANopen

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenOverviewDeveloped by CAN in Automation (CiA) since 1995Originally developed for motion-oriented machine control networks,by now it is also used to network:medical electronics, automotive-, industrial- and rail-vehicles, laboratoryautomation systems,building automation systems,embedded networks such as passenger information systems, gamblingmachines and professional coffee machines,vehicle add-ons (blue lights, taximeter, etc.)Standardized in 2002 under EN 50325-4Features:CAN 2.0A on Data Link layer (optional CAN 2.0B)Network auto-configurationAccess to all device parametersDevice synchronizationCyclic and event-driven data transferSynchronous reading or setting of inputs, outputs or parameters

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenOverviewThree parts:Application LayerObject DictionaryCommunication ProfileApplicationObject DictionaryCommunicationProfile AreaIndex10001FFFManufacturerSpecific Profile AreaStandardized DeviceProfile AreaNetwork ation ProfileSDOBased on: Zeltwanger 2007, CANopenPDO

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenObject Dictionary and ProfilesEvery CANopen device has a standardized device specification, the ObjectDictionary (OD)It includes general objects (ID, manufacturer, etc.) and status objects(temperature, speed, etc.)Semantics of the OD-objects are defined in the Electronic Data Sheet(EDS)Objects are addressed by 16-bit index 8-bit subindex1000-1FFF: Communication profile area (CiA DS-301)2000-5FFF: Manufacturer-specific profile area6000-9FFF: Standardized device profile area (e.g. CiA DS-401)A000-AFFF: Network variables (NWV)CANopen defines:Communication profiles: definition of fundamental communicationmechanismsDevice profiles: unambiguous definition of manufacturer-independent ODparameters describing the device and its network behavior (i.e. input/outputmodules, drives, encoders, etc.)Î Devices become interoperable and interchangeable betweenmanufacturers

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenCommunication ProfileProcess Data Objects (PDO): Transport of real-time data ( operational data)Service Data Objects (SDO): Read and write OD entries ( system parameters)Special Object Messages:Synchronization (SYNC)Cyclic time synchronizationTime Stamp (TIME)Adjustment of global network timeCommunicationEmergency Object (EMCY)ProfileIndicate device internal errorsAdministrative Messages:PDOSDONetwork Management (NMT)Process Data ObjectService Data ObjectNode state monitoring Real-time data System parametersError Control: High priority Low priorityCyclic heartbeat, Max. 8 Bytes Data aggregation ( 8 Bytes) Broadcast communication Unicast communicationNode/Life guarding “Pure” CAN No confirmation Data addressing by index Confirmed services

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenDevice and Application Profiles (extract)CiA 301: CANopen application layer and communication profileCiA 401: Device profile for generic I/O modulesCiA 402: Device profile for drives and motion control (servo controller, steppermotor controller, frequency inverter)CiA 404: Device profile for measuring devices and closed-loop controllersCiA 406: Device profile for encoders (rotating and linear)CiA 413: Set of device profiles for truck gatewaysCiA 415: Application profile for road construction machine sensorsCiA 418: Device profile for battery moduleCiA 419: Device profile for battery chargerCiA 422: Application profile for municipal vehicles (e.g. garbage trucks)CiA 423: Application profile for power drive systems (e.g. diesel engine)CiA 424: Application profile for rail vehicle door control systemsCiA 447: Application profile for special-purpose car add-on devices

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenCiA DS-447 Car add-on devicesAttachment of add-on devices, such as blue light, siren, taximeter, etc.Standardization finished in 2008

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenCiA DS-413 Device profiles for truck gateways

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009CANopenSource: Zeltwanger 2005: J1939-based application profilesISO 11783 (ISOBUS) for agricultural and municipal vehicles, based on J1939 and NMEA-2000

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Special-purpose HLPsSAE J1939

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939Specified by Society of Automotive Engineers (SAE) heavy trucks and busdivisionThe SAE J1939 set of profiles is based on the CAN data link layer (ISO 11898-1)using the extended frame format (CAN2.0B) with 29-bit identifierFeaturesUnicast and broadcast communicationNetwork managementTransport protocol functions: data segmentation, flow controlDefinition of parameter groupsSupport of real-time close loop controlApplicationsLight to heavy trucksAgriculture equipmente.g. tractors, harvester, etc.Engines for public work

SAE J1939-73 Applicationlayer diagnosticsDefines all parameters as well asassembled messages calledparameter groupsDefines diagnostic messagesSAE J1939-31 Network layerDefines repeaters, routers, gateways and bridgesSAE J1939-21 Data link layerDefines commonly used messages such as Request, Acknowledgement andTransport ProtocolSAE J1939-11 Physical layerPhysical layer based on ISO 11898-2 at 250 kbit/s with up to 30 devices and amaximum of 40 m bus length (twisted shielded pair)SAE J1939-81 Network managementSAE J1939-71 Truck and buspower-train networkDefines message sequences for initializationand constraints on the use of addresses (e.g.address claiming)Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939Standards

SAE J1939Message FormatCAN 29-bit-Identifier StructureLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009PriorityParameter Group Number (PGN)3818Reser Dataved Page11Source AddressPDU FormatPDU Specific88Priority: Priority during the arbitration phase (lower value higher priority)Reserved: Reserved for future usage (always 0)Data Page selector: Expands parameter groups (for future usage)PDU Format:Global PGNs for broadcast parameter groupsPDU Format 0xF0 24010PDU Specific: Group Extension (further PDU type specification)Specific PGNs for unicast parameter groupsPDU Format 0xEF 23910PDU Specific: Destination Address

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939ExampleEngine Temperature message: Broadcast transmission with 1 HzCAN 2.0B FrameSOFArbitrationFieldPriority Res60DP0ControlFieldData FieldPDU Format254 0xFECRCPDU Specific238 0xEEACKEnd ofFrameSource Address?CoolantFuelEngine OilTurbo OilEngine InterTemperature Temperature Temperature Temperature cooler Temp.8816168Not definedTorque/Speed Control message: Unicast transmissionto Engine ( 00) with 100 Hzto Engine-Retarder( 15) with 20 HzPriority Res30DP0PDU Format0Control Bits8PDU Specific15 ( Engine-Retarder)Requested Speed /Speed Limit16Source Address11 ( ABS/TC)Requested Torque /Torque Limit8Not defined328

The Transport Protocol specifies the breaking up of large amounts of data intomultiple CAN-sized frames, along with adequate communication and timing tosupport effective frame transmission between nodesTwo types:Broadcast Announcement Message (BAM)Broadcast communicationConnection-less (e.g. no handshake)UnreliableNo flow controlConnection Mode Data Transfer (CMDT)Unicast communicationConnection-oriented (2-way handshake)Reliability by cumulative ACKsFlow control by windowing Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939Transport Layer

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939AddressingAddress:Unique identity within a sessionEvery device requires a unique address (0-253)254: zero address255: broadcast addressIncluded in every messageCan change during re-configurationName:Probably unique identifier within the networkProvides functional identification of ECUsUsed to arbitrate in the case of an address selection conflictName

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939Network managementDynamic address allocation(address claiming)Address conflict detectionAddress conflict resolution

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939ApplicationSource: Vector 2006, CAN und J1939Unter extremen EinsatzbedingungenSource: CLAAS 2005, Diagnose bei CLAAS

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009SAE J1939Fleet Management System (FMS)Supervise a whole fleet - consisting of vehicles from different manufacturers - overthe InternetDeveloped by the 6 major European truck manufacturers Daimler, MAN, Scania,DAF, IVECO, Volvo/RenaultBased on J1939Vehicle data shall be available for third parties but internal vehicle busses shall beuntouchedSecure and legal solution for the remote download of data e.g. from the digitaltachographGPS PositioningFollowingtrafficIndividual re-routingbecause ofcongestionCongestioncontrol„Floating“ cars reportposition velocity x

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Special-purpose HLPsDiagnostics

DiagnosticsLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Interchange of digital information between an on-board ECU and a off-boarddiagnostic tester to facilitate inspection, test, diagnostics and configurationManufacturer enhanced diagnosticsUnified Diagnostic ServicesISO 14229Layer7-5Layer4-3Layer2-0ISO 14230-3ISO 14230-2K-LineISO 15765-3Diagnostics on CANISO 15765-2Legislated diagnosticsOn-Board Diagnostics (OBD)ISO 15031ISO 15031-5TP2.0ISO 11898CANK-LineCANJ1850Mandatoryafter 2008in USBased on: Zimmermann, Schmidgall 2007: Bussysteme in der Fahrzeugtechnik

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009DiagnosticsISO 15765-3 Diagnostics on CANDiagnostics on CAN standardized in ISO 15765-3 in 2004Enables interoperability between off-board diagnostic tester and onboard ECUISO 15765-3 is based on the Keyword Protocol 2000 (KWP2000)protocolClient-Server with simple request-response VehicleGateway

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009DiagnosticsISO 15765-3 Diagnostics on CANClient-Server communication:Client ( diagnostic tester) initiates request and waits forconfirmationServer ( ECU) receives indication and sends responseServicesDiagnostic Management: Control of diagnostic sessionsNetwork Layer Protocol ControlData Transmission: Read from and write to ECUsStored Data Transmission: Read Diagnostic Trouble Codes (DTC)Input/Output Control: Control of ECU I/ORemote Activation of Routines: ECU program startupUpload/Download: ECU Flashing

DiagnosticsISO 15765-3 Diagnostics on CANLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Message formats:Service RequestService IDSIDRequest ParametersPositive ResponseSID 0x40Response ParametersNegative ResponseError IDSIDError Code

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009DiagnosticsUnified Diagnostic ServicesUnified Diagnostics Services (UDS) standardized by ISO 14229Advancement of Diagnostics on CAN for general usageWhereas ISO 15765-3 relies on CAN, UDS is independent of lower layerprotocolsTechnically UDS is almost identical to Diagnostics on CAN,advancements are mainly the restructuring of SIDs and unificationUDS also defines, as one of the first protocols, a security layer in orderto encrypt dataAPPSecurityLayerAPPSecurityLayerUDSUDSCANCAN

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009DiagnosticsOn-Board DiagnosticsSelf-diagnostic and reporting capability of modern vehiclesGuarantees standardized access to vehicle information for:fault diagnostics by repair shop andemission inspection by technical inspection agencies (“TÜV”)Mandatory in Europe for:gasoline vehicles manufactured since 2001diesel vehicles manufactured since 2003OBD provides diagnostic data on:Emission-related components(e.g. lambda sensor, catalytic converter)EngineVehicle electronics

DiagnosticsOn-Board DiagnosticsLecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009Service RequestService IDSIDParameter IDPID0.6 Byte Request ParametersService Identifiers (SID):Fault memory0x03 Request emission-related diagnostic trouble codes0x02 Request powertrain freeze frame data0x04 Clear emission-related diagnostic informationTest of emission-related components0x05 Request oxygen sensor monitoring test results0x06 Request control of on-board system, test or componentRead ECUs0x01 Request current powertrain diagnostic data0x09 Request vehicle informationParameter Identifier (PID):0x04 Calculated Load Value0x05 Engine Coolant Temp0x0A Fuel Pressure (gage)0x0C Engine RPM0x0D Vehicle Speed0x11 Absolute Throttle Position

Lecture Vehicle Networks, Thomas Strang and Matthias Röckl, WS 2008/2009QuestionsWhy are Higher Layer Protocols (HLP) required?What are the main functions of HLP in automotive environments?Why almost all HLPs introduce unicast communication?

The SAE J1939 set of profiles is based on the CAN data link layer (ISO 11898-1) using the extended frame format (CAN2.0B) with 29-bit identifier Features Unicast and broadcast communication Network management Transport protocol functions: data segmentation, flow control Definition of parameter groups Support of real-time close loop control .