Automotive Time Triggered Network Design

Document Sample
Automotive Time Triggered Network Design Powered By Docstoc
					CAN To FlexRay Migration
      Framework

           Richard Murphy
     Automotive Control Group,
   Waterford Institute of Technology
   E-mail: richmillions@gmail.com
             Agenda
•   Introduction
•   Background
•   Proposed Solution
•   Test Case
•   Conclusion
INTRODUCTION
                  Aims
• To present a method of migrating from CAN
  to FlexRay

• To explain why this would be necessary

• To present issues encountered carrying out a
  practical implementation
BACKGROUND
                    Why Migrate?
• Increase in traffic on CAN bus due to increased (critical and non-
  critical) functionality of automotive applications



• To avail of features available on the FlexRay protocol not available
  on the CAN protocol
    – Bandwidth
    – Time-Triggered & Event-Triggered
    – Redundancy
    – Determinism
    – Topology
    FlexRay Characteristics
• High Data Rate (10Mbit/s apiece on dual channels)

• Static (ST) and Dynamic (DYN) segments

• Multiple Topologies

• FlexRay Payload - up to 254 Bytes

• Support of wake-up and sleep functionality via the bus
                         FlexRay Cycles
          0
          1
          2
          3




Cycle
Counter
          62
          63

                         Static Segment   Dynamic Segment
                                                            NIT

               Used Static Slot
               Used Dynamic minislot
             FlexRay Frame
       Header             Payload             Trailer


       5 Bytes            0-254 Bytes         3 Bytes

• Header
   – Frame ID, Payload length, Header CRC, Cycle count,
     Reserve bit, Payload preamble, Null Start up & sync
     frame indicators
• Payload – Data
• Trailer – CRC (Cyclic Redundancy Check)
PROPOSED SOLUTION
          Migration Issues
• Cost
   – CAN Mature Protocol, FlexRay Relatively New


• FlexRay Complexity-
   – 74 Parameters (Eric Armengaud, 2006 )


• CAN purely Event-Triggered, FlexRay both Time-
  Triggered & Event-Triggered
     Migration Procedure
                                                       ri  0ms

• Task Graph Analysis                  Ti

  – Deadline Analysis (ST)
  – Response Time Analysis   Ti 1

    (DYN)                                     Ti  2

                             Ti 3




                                     Ti  n
                                                       Di  60 ms
              Static Segment
• Initial Parameters required
   – Task graph ri and Di, WCET and task periods


• Redistribute any slack in the system and recalculate ri
  and di values

• Message deadline
   – td(mi)= di - ri – wi


• ST Slot size
   – gdstaticSlot=size(payloadi)+size(overheadi)/Busspeed
         Payload Definition

Header          Trailer

     1 Byte Payload




Header                    254 Byte Payload   Trailer
 Payload Definition cont’d
                                   Quantity of ST Data Transmitted per
• Heuristically choose                          Frame Size

  payload                                n   Region
                                             1
                                                         Region
                                                         2
                                                                   Region
                                                                   3
                                  400
• Overhead 14 Bytes
  –   5 Bytes Header               300


  –   3 Bytes CRC                  200
                              Bytes/
  –   2 Bytes TSS             Payload
                                   100
  –   4 Bytes for clock and
      Security                           0
                                                  5       10      15        x
                                                      Frame
                                                      Size
      Periodicity & Distance
           Constraints
• Period Constraint: Message cycles occur at
  multiple harmonic periods

• Distance Constraint: The distance between
  two successive messages must be <= period

• Allows decoupling of application task
  schedules from FlexRay communication
  schedules
      Dynamic Segment
• Worst Case Response Time Analysis
  (WCRTA)

• Rm(t)=Cm+δm+wm(t)
  – Communication Time per message Cm
  – Delay if message is transmitted just after its slot
    has passed δm
  – Delay by St bus and higher priority messages wm
   Parameter Calculation

• Cm =Fmessagei / Busspeed

• δm= FR(t)-(STbus+(messageIDi.gdMinislot)+NIT)

• wm(t)= STbus+hp(m)+(pLatestTx.gdMinislot)+NIT
ACC (ADAPTIVE CRUISE
      CONTROL)
      TEST CASE
                    Test Case
                         Adaptive Cruise Control
T1   m1        m2   T2
                         configuration
                           Task Number        Operation
          T3
                               T1          Vehicle Velocity
           m3

                               T2        Distance to Vehicle
          T4                                   in Front
                               T3        Calc Relative speed
           m4
                                          of Vehicle in Front
                               T4            Calc Desired
          T5                                   Velocity
                               T5            Calc Absolute
               m5
                                            Throttle Value
          T6                   T6        Actuate Throttle and
                                                Breaks
       Parameter Comparison
Task   WCET   Deadline   Period   App        Node   Deadline   Period    App
                                  Deadline                               Deadline
                           CAN                                 FlexRay
T1     2ms    20ms       20ms                N1     14ms       14ms
T2     2ms    20ms       20ms                N1     14ms       14ms
T3     6ms    20ms       20ms     120ms      N2     14ms       14ms      84ms

T4     2ms    20ms       20ms                N2     14ms       14ms
T5     6ms    20ms       20ms                N2     14ms       14ms
T6     2ms    20ms       20ms                N1     14ms       14ms
              FlexRay System
                Parameters
Parameter                Value               Units
 FlexRay Cycle Size   1.750 (Ideal 0.875)       ms

 Number of ST Slots           6                Slots

Number of DYN Slots          247             Minislots

    ST Slot Size              40                µs

 DYN Minislot Size            6                 µs

    Payload Size              5             2 Byte-words

        NIT                   25                µs
       Period and Distance Constraint
                 Validated
       Static Segment                Dynamic Segment          Network Idle Time
         FlexRay Frame                                                            Task
         Cycle                                                                    Cycle



0ms           1.750ms         3.5ms                    7ms                                14ms




14ms        15.75ms         17.5ms                     21ms                               28ms




                            84ms        1.750ms
                      Application
                      Cycle
             Conclusion
• Using this migration procedure it is possible
  to complete a successful migration from an
  application implemented on a CAN system to
  successful implementation on a FlexRay
  system
Thank you for your attention


        Questions?

				
DOCUMENT INFO