Guaranteeing Message Latencies on Controller Area Network (CAN) Garrett Chandler 27 March 2006 EE 699
Garrett Chandler Guaranteeing Message Latencies on CAN Outline Introduction System Model System Analysis SAE Benchmark Case Discussion and Conclusions 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Garrett Chandler Guaranteeing Message Latencies on CAN Introduction Common Automotive Industry View CAN good for most urgent data CAN unable to provide guarantees for less urgent data View Incorrect CAN scheduling virtually identical to real-time process scheduling Analysis can be applied almost without change to CAN latency problem 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Garrett Chandler Guaranteeing Message Latencies on CAN System Model: CAN Typical CAN Stuff… Assumptions Fixed Set of Messages Each w/ Unique Priority Rate Max Size No RTR Messages Soft Real-Time as Background Messages (low-priority IDs) Hardware Intel 82527 15 slots 1 in only, 14 in or out 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Model: Messaging Messages queued by software task Bounded time between event and queue entrance Queuing Jitter: variability between subsequent queuings of message Period: minimum time between same task invocations 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Model : Queuing Jitter Jitter is the difference between the earliest and latest possible times a given message can be queued Jitter important for analysis Options exist to reduce queuing jitter Tm = Period Jm = Jitter 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Garrett Chandler Guaranteeing Message Latencies on CAN System Analysis Analysis will bound worst-case latency of given message Almost direct application of processor scheduling theory Assumptions Deadline of a message must not be more than the period of a message Controller always sends highest priority message 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Notation Deadline, Dm – Maximum time between event and response Period, Tm – Minimum time between events Worst-Case Response Time, Rm – Longest time between message entering queue and the latest said message arrives at receiving nodes Queuing Jitter, Jm - Variability between subsequent queuings of message Queuing Delay, wm – Longest time a message may sit in a queue before being sent Transmission Time, Cm – Time it takes to send given message on the bus 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Response Rm – Worst-case response time of message Jm – Queuing Jitter wm – Queuing Delay Cm – Transmission Time 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Transmission Cm – Transmission Time Accounts For Frame Overhead Data Contents Stuff Bits sm – size of message in bytes tbit – bit time of the bus (1us at 1MHz) 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Queuing wm – Queuing Delay Set hp(m) contains all messages in system of higher priority than m. Bm is the longest time that m can be delayed by lower priority messages. 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Delay Bm – Arbitration Delay Set lp(m) contains all messages in system of lower priority than m. In case of unbounded number of lower-priority messages of indeterminate size, Bm is 130 bit-times. 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
System Analysis: Scheduling Given equations assume nothing about system choice of message priorities Work on processor scheduling shows that optimal ordering of priorities is deadline monotonic Tasks with smallest difference in deadline and jitter should have highest priority 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Garrett Chandler Guaranteeing Message Latencies on CAN SAE Benchmark Case SAE Example System Battery, Vehicle Controller, Motor Controller, Instrument Panel, Driver Inputs, Brakes, Transmission 53 Messages according to Kopetz [6] 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
SAE Benchmark: Latencies Messages Ordered by D – J 1 to 1 ID to Data Assignment Bold = Sporadic Signal X = failed to meet latency requirements 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
SAE Benchmark: Utilization System can not be scheduled at 125 kbps Message Utilization Data bits / Bus bits Bus Utilization Total bits / Bus bits available 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Garrett Chandler Guaranteeing Message Latencies on CAN 82527 Limitation Limitation Vehicle controller transmits more than 14 message IDs Solution Concatenate more data into single packet Results 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN
Discussion and Conclusions Scheduling analysis developed for fixed priority scheduling can be adapted for use with CAN. Analysis applied to benchmark system. Paper omits discussion and analysis of re-transmission of messages after a detected error. 27 March 2006 Garrett Chandler Guaranteeing Message Latencies on CAN