Presentation overview Background automotive electronics as an application area for realtime communication Real time protocols LIN Local Interconnection Network A premium passenger car is controlled and managed by 80+ Embedded Systems Comfort Electronics: Thermal Management Chassis Control Parking Assistant Infotainment: Telematics Solutions Car PC Wireless Connectivity Cartocar communication Floating Car Data CAN Controller Area Network TTCAN, Time Triggered CAN (based on Controller Area Network (CAN) CAN FD CAN with Flexible Datarate FlexRay, based on BMW s ByteFlight Hybrid scheduling combining static scheduling with fixed priority scheduling analysis Safety: Predictive Safety Systems Driver Assistance Systems Adaptive Cruise Control Electric Power Steering Powertrain: Engine Management Transmission Control Power Management 2 Courtesy of Daimler, Bosch 2 Virtual differentiation between variants Example of the electrical system complexity 927997 Variant Entertainment configuration A All variants of a specific model are physically identical and differ only in their individual software configuration The various included physical components can be activated or deactivated by the software Motor configuration A Motor configuration B Variant 2 Entertainment configuration F No. of fuses 27 54 200 575 Wiring diagram, Volvo ÖV4 ( Jacob ) 927 6 9 283 4 5 7 83 83 50 30 927 944 956 966 975 982 997 No. of meters of electric wires 3 4
The evolution of functional requirements on the electrical system Automotive electronics roadmap Power production and distribution Simple components More complex functions standalone systems ABS, Airbag Architecture Optimisation on many levels Standardised interfaces Integration of systems 00 Optimisation of information 50 Common data busses 0 450 400 350 300 250 200 50 Features 930 940 950 960 970 980 990 995 2000 2005 # of functions # of integrated functions 970 980 990 2000 200 5 6 Multiplex Networks Evolution of protocols Conventional system Network Identifier Data Command Control MOST Byteflight FlexRay CAN FD Engine Control CAN VAN J850 CAN 2.0 TTP/C LIN TTCAN Control units Module Automatic Transmission Driver Information 985 990 995 2000 2005 200 Central Module 7 8
Example of the electrical system The LIN protocol, started in 998 Lock Mirror Lock Window lift LIN Local Interconnection network predecessor: VOLCANO Lite Power Train Infotainment systems Instruments Central body control Climate Seat Roof Heating Heating Heating Trunk Cooperation between partners: Freescale, VOLVO CAR, BMW, AUDI, Volkswagen, DaimlerChrysler Mentor Graphics (former: Volcano Communication Technology) Steering wheel panel Very high performance High performance Medium performance Low end performance Seat Lock Mirror Heating Lock Seat Universal motor Universal panel Interior lights Objectives: Low cost, modest performance and safety requirements, flexible system architecture 9 0 LIN target applications Roof: (high amount of wiring) Rain Sensor, Light Sensor, Light Control, Sun Roof (Rain Sensor needs to be interrogated every 020ms) Door/window/seat: Mirror,Central ECU, Mirror, Switch, Window Lift, Seat Control Switch, Door Lock, etc. Steering Wheel: (very many controls are going to be positioned on the steering wheel) Climate: many Small Motors Control Panel Cruise Control, Wiper, Turning Light, Optional: Climate Control, Radio, Telephone, etc. Seat: many Seat Position Motors, Occupancy Sensor, Control Panel LIN protocol features Bus topology Masterslave protocol, no arbitration required UART protocol, 0 bits (uses sync break facility) 8 bits of data in a block 28 blocks of data per frame Single wire Maximum 20 kbits/s 2
LIN bus communication CAN Controller Area Network master control unit polling master task slave task interframe spacing synch Identifier field slave control unit slave task slave control unit slave task next synch field Bus topology CSMA/CR (Carrier sense, Multiple Access/ Collision Resolution) Error detection capabilities Supports atomic broadcast 064 bytes of data per frame Twisted pair Maximum Mbit/s ARB CTRL DATA CRC ACK EOF Arbitration (identifier) Control information 08 bytes Checksum Acknowledge End of frame Master Task Slave Task Response spacing 2 byte byte data block parity time time SOF ARB MESSAGE FRAME CTRL DATA CRC ACK EOF 3 4 Bus collission detection Idle bus (recessive level) NodeA Bus level +5V R Bus transceivers Open collector Bus level: Recessive (bit) Dominant (bit) 0 Node B Bus arbitration Two nodes transmitting same level () transmit +5V receive Bus level I R = 0 I A = 0 Node A Node B transmit receive I B = 0 5 6
Collission Resolution transmit 0 receive 0 +5V R Bus level: 0V Node A 0 0 I R =I A Node B 0 0 I A I B =0 transmit receive 0 Three messages collide... Arbitration field (identifier with priority) Nodes own specific message identifiers. EXAMPLE: Three nodes start simultaneously Node A transmits: $257 (000 00 0) Node B transmits: $360 (00 00 0000) Node C transmits: $25F (000 00 ) Bit number SOF 2 3 4 5 6 7 8 9 0 2 3 Bus level D D D R D D R D R D R R R R Node A 0 0 0 0 0 0 0 Node B 0 0 0 Aborts Node C 0 0 0 0 0 0 Aborts Node B aborts transmission since the received bit differs from the transmitted bit 7 8 Standard/Extended CAN drawback... Protocol bus arbitration, acknowledge and error handling slow down bitrate ( maximum Mbits/s) Solution: New CAN FD specification CAN Flexible Datarate Bywire control Hydraulic information carrier Electronic information carrier The F8 Digital FlyByWire (DFBW) flight research project validated the principal concepts of allelectric flight control systems now used on nearly all modern highperformance aircraft and on military and civilian transports. The first flight of the 3year project was on May 25, 972. 20 Courtesy of Dryden Flight Research Center 9 20
Control system implementation strategies Nonfunctional requirements Local control Local information processing Independent control objects Centralized global control Local and central information processing Interconnected control objects Distributed global control Local and distributed information processing Interconnected control objects Performance/ Efficiency Security Safety Costeffectiveness Interoperability Produceability Timeliness System life time System Architecture Conceptual integrity Changeability Testability Usability Availability Reliability Understandability Maintainability Extendability Portability Restructuring Robustness Fault tolerance Variability (variants, configurations) 2 22 Tradeoffs from Safety/Reliability requirements Time Triggered CAN The extremes from reliability requirements leads to safety requirements. Safety requirements implies redundancy, (FailOperational, FailSafe, etc). Safety requirements also demands predictability, we has to show, a priori, that the system will fulfill it s mission in every surrounding at every time. Based on the CAN protocol Bus topology Media: twisted pair Mbit/s In a distributed environment, only time triggered protocols with redundant buses can provide this safety. Contemporary TTP s are: TTCAN, based on Controller Area Network (CAN) which is widely used in today's vehicular electronic systems. FlexRay, based on BMW s ByteFlight. Operational in contemporary automotive electronic systems. TimeTriggered Ethernet. TTEthernet expands classical Ethernet with services to meet timecritical, deterministic or safetyrelevant conditions. Basic cycle 0 Basic cycle Basic cycle 2 Basic cycle 3 Transmission Columns t Exclusive guaranteed service Arbitration guaranteed service (high ID), best effort (low ID) Reserved for future expansion... Time is global and measured in network time units (NTU s) 23 24
Flexray Double channels, bus or star (even mixed). Media: twisted pair, fibre 0 Mbit/s for each channel Time Triggered Ethernet Classic Ethernet bus topology Gbit for each channel Redundant channel can be used for an alternative schedule Static segment (TTCAN Exclusive ) guaranteed service Dynamic segment (TTCAN Arbitration ) guaranteed service (high ID), best effort (low ID) Every base period Every second base period Max 64 nodes on a Flexray network. Compare with TTCAN basic cycles Every fourth base 26 period 25 26 Comparisons All protocols targets real time applications. Provides for time AND event triggered paradigms. What to choose? All protocols are suitable for scheduling tools. Commercial production tools are available. CAN, many years experiences, a lot of existing applications. Implies migration of existing CAN applications into TTCAN and CAN FD. Flexray is the automotive industries initiative. New hardware, promoted in for example AUTOSAR. TTEthernet. Proven technology with lots of existing hardware, 28 27 28
Combining time triggering with events: Example of Hybrid scheduling for TTCAN TTCAN detailed study Response time analysis Q T Messages are sorted into three different categories: Hard realtime, for minimal jitter with guaranteed response time. Firm realtime, for guaranteed response time, but can tolerate jitter. Soft realtime, for best effort messages. B R i B i T i Q i 29 30 Time triggered messages M h Basic cycle 0 Basic cycle Transmission Columns time windows Multiple solutions satisfies the equation... Basic cycle 2 Basic cycle 3 After structuring: M : {M h, M f, M s }, assume that at least M h is defined. We now construct a matrix cycle. Due to protocol constraints, the schedule has to fulfil: LCM( M h p ) = x 2 n where: LCM is least common multiple period for the M h message set; x is the preferred length of a basic cycle within LCM; n is the number of basic cycles. Choose a strategy: Strategy : Minimize number of basic cycles, requires a longer basic cycle, and more triggers. Strategy 2: Hardware constraints: Hwc: x 2 y, has to be consistent with a hardware register, y bits Hwc2: 0 n k, always a power of 2, constraint in hardware. Hwc3: # of triggers Tr, columns in the matrix cycle. Limited by the number of available trigger registers. Minimize length of basic cycles, increase probability of finding a feasible schedule for large message 3 32
Persuing the strategies... Strategy Construct a schedule for the following set: M h = ( M, M2, M3) with the following attributes (NTU): M p = 000, M e = 68 M2 p = 2000, M2 e = 84 M3 p = 3000, M3 e = 26 It s obvious that: LCM( M, M2, M3 ) = 6000. and: Minimizing number of basic cycles yields: 2 n =, so n = 0 and x = 6000. Hwc and Hwc2 are fulfilled. Total numbers of triggers for N messages in one basic cycle is: N LCM( M ) i in this case: i M # of triggers = 6000 000 6000 2000 6000 3000 So, strategy, leads to a solution with: basic cycle and triggers. MAtrix cycle length is 6000 NTU. 6000 = x 2 n Basic Cycle Triggers 0 68 352 000 2000 268 3000 3352 4000468 5000 M M 2 M 3 M M M 2 M M 3 M M 2 M 34 33 34 Strategy 2 n = 0: 6000 = x 2 0 x = 6000 (same as strategy ) n = : 6000 = x 2 x = 3000 n = 2: 6000 = x 2 2 x = 500 n = 3: 6000 = x 2 3 x = 750 n = 4: 6000 = x 2 4 x = 375 n = 5: 6000 = x 2 5 x = 87.5 Basic (at 0) 0 cycle 2 (at 375) 3 (at 750) 4 (at 25) 5 (at 500) 6 (at 875) 7 (at 2250) 8 (at 2625) 9 (at 3000) 3000 0 (at 3375) (at 3750) 2 (at 425) 425 3 (at 4500) 4 (at 4875) 5 (at 5250) 6 (at 5625) 68 468 352 2000 268 000 3352 4000 5000 M M 2 M 3 3 2 0 3 M 4 0 5 0 6 M M 2 2 7 0 8 0 9 M M 3 2 0 0 M? 2?M M 2 2 3 0 4 M 5 0 6 0 Trigger Information 35 Minimum Triggers Strategy 2 Avoid this conflict with the requirement that: a basic cycle shall be at least as long as the shortest period in the message set. Applying this restriction we get: n = 2, (x = 500) which yields a feasible schedule: Basic cycle 2 3 4 0 3000 68 352 3352 2000 5000 268 4000 000 468 M M 2 M 3 M 4 2 M M 2 2 3 M M 3 M M 2 4 4 M Trigger Information Minimum Triggers 35 36
Verifying the events... (M f ) Basic Grey slots are supposed to be allocated for M h Cycle NTUslots (Columns) q 0 2 q q 2 3 q 3 q 4 q 5.. 2 n q N3 q N2 q N for each message m in M f : for message m = up to last_m for virtual message VM i = up to last_vm if( Q m + T m ) falls within ( VM i,start, VM i,completion ) Q m = VM i,completion else Q m endif end end end j: Pm Pj Q t j m Tj 38 Thank you for your attention. 37 38