Documente Academic
Documente Profesional
Documente Cultură
架構及其應用
南台科大 電子系 唐經洲
中山資工 2017/02/24
大綱
Why In-Vehicle Networking (車內網路)?
CAN Bus 發展歷史
CAN Bus 基本概念
Topology/Node
Repeater/Bridge/Gateway
CAN Bus 相關標準介紹/討論
Physical Layer
Data Link Layer
中山資工 2017/02/24 2
Why In-Vehicle Networking (IVN) ?
(車內網路) ?
中山資工 2017/02/24
Vehicle Design Evolution
那些沒有變化 ?
引擎, 輪胎, 大燈, 尾燈, 玻璃窗, 喇叭, 方向盤…
中山資工 2017/02/24 4
http://www.justanswer.com/classic-cars/285m1-need-downlooad-wiring-diagram-1950-ford-car.html
中山資工 2017/02/24 5
Electronics in the Car
偏航 加速度 溫度
Throttle Ignition and Yaw and acceleration Occupant Door sensors Temperature/
position sensor engine control sensors and air bag position for internal humidity
and control electronics deployment sensors and lights sensors and
雨滴 controls (smart comfort control
Charge sensor Rain sensor air bags)
(battery) and wiper 倒車
control Parking
Oil/fuel (proximity)
pressure and sensors
flow sensors
and controls
夜視
氧氣
Wireless phone Emissions
O2 sensor Seat belt
and GPS sensor (NOX)
Collision (air/fuel) sensor
avoidance
Steering angle Angular
and night Combustion Passenger Tire Zero vehicle
pressure sensor and weight sensor pressure speed (ABS) acceleration
vision
sensor and stability control (smart air bags) sensor sensor and sensors
sensor
中山資工 2017/02/24 control 轉向角度 胎壓 control (suspension)6
一部車要用到多少Flash Memory/ ECU?
-40 ~ 85oC
Q1: 那一個 ECU 可以指揮這些 ECUs + Memory ? AEC-Q100
Q2: 感測完後的 資料(訊) 要傳到拿裡去 ?
Source: Audi
中山資工 2017/02/24 7
Car Runs on Code (1/3)
今日一部車子的 ECUs 數目
Low end: 30 ~ 50 (doors, roof… etc)
High end: 70~100
Lines of code: ~100 million (1 億)
Future: 200~300 million
Benz S Class 的 Radio 與 Navigation 系統的軟
體行數: > 20M 行
比 A389 還多
電子/與軟體在一部車的 Cost 比重: 35% ~ 40%
Hybrid 車子的比重會更高
How can we ensure timely and reliable
communication via the “wires”?
[http://www.spectrum.ieee.org/feb09/7649]
中山資工 2017/02/24 8
Car Runs on Code (2/3)
IVDC: Interactive Vehicle Dynamic Control (互動式車身動態穩定控制系統 )
ISG: Integrated Starter Generator (起動機—發電機一體化技術 )
EPAS: Electric Power Assistant Steering (電動輔助轉向系統 )
ESP: Electronic Stability Program (電子車身穩定系統 )
Function
Growth
Lane-
Remote
keeping
Processor Diagnostics
787 Dreamliner
F-22 Raptor
中山資工 2017/02/24 10
An increased regulatory pressure to
reduce CO2 emissions
g CO2 /km
Tesla model S 的碳排放量約 163 g/mile
200
2015
180
154 g CO2 /km
160
2016
140
140g CO2/km
2020
120 2015
CO2: g/Km 95g CO2/km
US: 195(2010) 140 (2016)
130g CO2/km
100
CN: 190(2010) 154 (2015)
EU: 150(2010) 95 (2020)
80
2010
中山資工 2017/02/24 2012 2014 2016 2018 2020
11
為何需要 IVN ?
Too complex, too much energy
consumption
Too many ECUs
Too many cables/harness
Too many connectors
Too much weight
Too many different networks
中山資工 2017/02/24 15
http://canbuskit.com/what.php
採用CAN Bus系統的接線示意圖
簡化佈線
提高可靠度與維護性
Engine Control Body Control
中山資工 2017/02/24 16
Dr. Wolfhard Lawrenz
University of Applied Science in Braunschweig-Wolfenbüttel, Germany
中山資工 2017/02/24 17
CAN Bus發展歷史 (5/5)
1994: DeviceNet(Allen-Bradely)
維護: Open DeviceNet Vendors Association (ODVA)
美日
1995: CANopen(CiA)
標準: CENELEC EN 50325-4
歐洲
2000: Time-Triggered CAN (TTCAN)
2004: 超過 15 家Foundry/50 種 CAN Controller
2008: OBDII 確認 CAN 是其中一種訊號
2011: Bosch提出CAN with Flexible Data-Rate (CAN FD)
2012: Taiwan CS8959 Luxgen SUV
2014: Taiwan CAN Transceiver CS8972
中山資工 2017/02/24 18
CAN Bus 的發明者
Dr. Wolfhard Lawrenz
University of Applied Science in Braunschweig-
Wolfenbüttel, Germany
中山資工 2017/02/24 19
Harness before CAN
中山資工 2017/02/24 20
Harness with CAN
儀表板
中山資工 2017/02/24 21
VW 的 CAN Bus 發展歷史
1997: PASSAT
Comfort: 62.5K
1998: PASSAT & GOLF
Powertrain: 500K
2000: PASSAT & GOLF
Gateway (第二代 CAN Bus)
2001:
Comfort: 100K
Powertrain: 500K
2002: PQ24 (A4) 平台 (第三代 CAN Bus)
2003: PQ35 (A5) 平台 •P 表示乘用車(passenger car)平台
•Q 表示橫置引擎(quer)
5 個 CAN segment •2 表示平台的大小或級別
LIN •5 表示第幾代
中山資工 2017/02/24 22
VW Phaeton2002
Electrical parts: 11,136
Communication: 61 ECUs in total
External diagnosis: 31 ECUs via serial
communication
Optical bus for high bandwidth Infotainment-data
Sub-networks based on proprietary serial bus
35 ECUs connected by 3 CAN-busses
Sharing approximately 2500 signals
in 250 CAN messages
中山資工 2017/02/24 23
http://www.sequentialtaillights.com/dodge/Tip89_DodgeCANBUS.htm
中山資工 2017/02/24 24
ECM 與 TCM 的訊號關係
Engine Control Unit
Transmission
Control Unit
ECM
TCM
中山資工 2017/02/24 25
BMW 第一個CAN Bus
1993 740i/iL
DME: Digital Motor Electronics
AGS: Automatic Electronic Gearbox Control
(EGS) /變速齒輪機箱
Transmission - 自動變速箱
Engine Temperature
Engine RPM (TD)
Engine Load (tL)
Injector on Time (ti)
Throttle Position (DKV)
Transmission Range
Torque Reduction (ME)
TCC Lockup Status
中山資工 2017/02/24 http://www.bmwsections.com/info/abbreviations.php
http://prodcds.bmwuniversity.com/library/bmw/Technician/Archived%20Courses/ST051%20Body%20Electronics%20I_archive%2010-10/10%20Introduction%20to%20Bus%20Systems.pdf 26
BMW E38 750iL CAN Bus1995-1997
不是雙絞線
是 Shield cable
中山資工 2017/02/24 28
JAGUAR X-TYPE XK8 XKR X2 –LED 2W
Price: £ 4.99
中山資工 2017/02/24 29
In-Vehicle CAN Networking (1/2)
Brake
(ABS / VSC / TRC / EBD) Throttle
Speed Sensor Shift Steering
Body(TRC / ACC)
CAN Bus
CAN_H
CAN_L
Brake
Pedal Accelerate Wheel actuator(4WS)
AT
AFS Pedal
中山資工 2017/02/24 30
In-Vehicle CAN Networking (2/2)
中山資工 2017/02/24
http://documentation.renesas.com/doc/products/mpumcu/apn/rej05b0804_m16cap.pdf
Source: Renesas 31
CAN Bus Topology
中山資工 2017/02/24
BMW 5xx 的 CAN Bus 電纜
Blue BL
Brown BR
Yellow GE
Green GN
Grey GR
Orange OR
Red RT
Black SW
Transparent TR
Violet VI
White WS
BMW 3 Series 的 CAN High (黃色/紅色 Yellow/Red) 與 CAN Low (黃色/棕色 Yellow/Brown) 34
中山資工 2017/02/24
BMW 的 Motorcycles OBD
http://www.hexcode.co.za/products/gs-911/images-1/connector/gs-911_s1000rrm.jpg
中山資工 http://developer.mbed.org/users/fossum_13/notebook/obd-on-bmw-motorcycles/
2017/02/24 35
BMW 的 OBDII Connector
Bus
Star
(Star Link)
中山資工 2017/02/24 37
CAN Bus 的 Topology (2/3)
Source: Automotive Fuel and Emissions Control Systems
Chapter 12, Pearson
By James D. Halderman and James Linder
Router
Tree
Message rate control
Message multicasting Ring Link
Message scheduling
Identifier validation and translation
Message checks
Message content translation
中山資工 2017/02/24 Diagnosis and management 38
CAN Bus 的 Topology (3/3)
A star link network connects all of the modules together using splice packs.
中山資工 2017/02/24 40
Basic Configuration
中山資工 2017/02/24 41
Typical ECU Components
Power
Conditioning
CAN CAN
Micro-Controller Protocol Bus
Controller Driver
Memory Interface
I/O
中山資工 2017/02/24 42
ECU Connection to the bus
Power
ECU 1 Power
ECU 2
Conditioning Conditioning
CAN_H
Terminator CAN_L Terminator
$19.95
中山資工 2017/02/24 http://www.oemdevices.com/index.php?route=product/product&product_id=64 43
CAN Bus上的CAN Nodes
http://www.ti.com/
中山資工 2017/02/24 44
CAN Bus 相關標準介紹/討論
中山資工 2017/02/24
ISO 11898 Standards
ISO 11898-1: 2003 Road vehicles — Part 1: Data link layer and
physical signaling
ISO 11898-2: 2003 Road vehicles — Part 2: High-speed medium
access unit
ISO 11898-3: 2006 Road vehicles — Part 3: Low-speed, fault-
tolerant, medium dependent interface
LSFT CAN/FTCAN
ISO 16845:2004 Road vehicles -- Controller area network (CAN) -- Conformance test plan
ISO/CD 16845-1: Road vehicles -- Controller area network (CAN) conformance test plan -- Part
1: Data link layer and physical signaling
ISO 16845-2: 2014 Road vehicles -- Controller area network (CAN) conformance test plan --
Part 2: High-speed medium access unit with selective wake-up functionality
中山資工 2017/02/24 47
1 bit error each 0,7s, 500 kbit/s, working 8 h/day at 365 days/year.
Statistical average: 1 undetected error in 1000 years!
中山資工 2017/02/24 49
Typical CAN Node (1/2)
Data Link Layer Physical Layer
CAN Bus
CAN CAN
Controller Transceiver
ADC Interface
RXD CAN_L
Controller (控制器) x1
Transceiver (收發器) x1
一般會將控制器與收發
Bus Terminator 器整合在一個ECU上
(終端電阻) x 2
中山資工 2017/02/24 51
CAN匯流排組成元件 (2/3)
CAN Controller
可接收來自車輛控制模組所傳送來的數位資料,控制器處理
之後可將其轉給收發器
當然,控制器也可接收來自收發器的數位資料,將其處理後
轉給車輛控制模組
CAN Transceiver
包含了發送器 (Transmitter) 與接收器(Receiver)
它可將控制器送來的數位資料轉成電子訊號,接著送到匯流
排導線進行傳輸
收發器也可將匯流排導線上收到的電子訊號轉成控制器可解
讀的數位資料,並傳送給控制器
Terminator
匯流排終端電阻的功能是避免電子信號在匯流排導線末端發
生反射現象,提高匯流排導線上信號的穩定性
中山資工 2017/02/24 52
CAN匯流排組成元件 (3/3)
CAN High x 1, CAN Low x1
CAN匯流排上所傳遞的資料,所有的控制器都可以收到
中山資工 2017/02/24 53
CAN Bus Transceiver (1/2)
一般Transceiver 內部的電路圖
Source: TI
中山資工 2017/02/24 54
CAN Bus Transceiver (2/2)
幾乎與 RS 485 2-wire Multi-Drop 系統結構
一樣,只是 終端電阻為100 Ohm
RS 485 Multi-Drop
中山資工 2017/02/24 55
NXP FTCAN Transceiver
FTCAN: Fault Tolerant CAN
TJA 1055T
SJA1000
中山資工 2017/02/24 56
Bus 電壓定義: ISO-IS 11898 (1/2)
弱勢 強勢 弱勢
一般示波器上所應該看到的正常CAN_H 與CAN_L 訊號
中山資工 2017/02/24 Source: TI 58
Arbitration (仲裁)
中山資工 2017/02/24
CAN Bus Arbitration (1/4)
CAN匯流排上的訊息交換方式
中山資工 2017/02/24 60
CAN Bus Arbitration (2/4)
Identifier (29 bits) Data (8 bytes)
ECU 1 1 0 1 1 0 0 0 1 1 1 ... 1 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 ...
ECU 2 1 0 1 1 1 ECU 2 ceases transmission
and prepares to resend later
Bus
Result 1 0 1 1 0 0 0 1 1 1 ... 1 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 ...
Arbitration Field NO Arbitration
Lower numbered identifiers assume higher priority
CAN_H
CAN_L
VCAN_H
Voltage
1 Bit
Logic value
中山資工 2017/02/24 63
http://www.go-gddq.com/down/2012-07/12072204023817.pdf
福斯汽車之煞車、引擎、自動變速箱控制模組
之狀態欄位範例
中山資工 2017/02/24 64
http://www.go-gddq.com/down/2012-07/12072204023817.pdf
煞車、
引擎、
自動變速箱控制模組之
訊息優先順序示意圖
中山資工 2017/02/24 65
CAN匯流排資料傳輸步驟 (1/2)
資料傳輸步驟包含五項,分別為:
1. 提供資料(Provide Data)
2. 傳送資料(Send Data)
3. 接收資料(Receive Data)
4. 檢查資料(Check Data)
5. 接收資料(Accept Data)
中山資工 2017/02/24 66
http://www.go-gddq.com/down/2012-07/12072204023817.pdf
CAN匯流排資料傳輸步驟 (2/2)
CAN匯流排資料傳送與接收步驟示意圖
5 5
1
4 4
3 2 3 3
中山資工 2017/02/24 67
CAN 的 Broadcast/Filter 特性
CAN CAN CAN CAN
Station 1 Station 2 Station 3 Station 4
(consumer) (Producer) (consumer) (consumer)
bus lines
中山資工 2017/02/24 68
Message Frames (訊框)
Data Frame (資料訊框)
最為普遍的類型
資料被從一個節點傳送到所有的節點
Remote Frame (遠端訊框)
與 Data Frame 極為相似
只有 RTR bit 被設為 1
被用來向其它的 CAN node 主動要求資料之用
Error Frame (錯誤訊框)
用來表示在 CAN bus 上有錯誤狀況被偵測到
Overload Frame (超載訊框)
用來告知其他的 CAN nodes, 必須有更多的時間來處
理收到的資料. 主要的功能是延遲下一個封包被傳送的
時間
中山資工 2017/02/24 69
Key Reasons for Using CAN
可靠 (Reliability)
Error-free communication
費用低 (Economy )
Low wiring cost
Low hardware cost
彈性 (Scalability)
Easy expandability
Low node-connection costs
資源豐富 (Availability)
More chips with CAN hardware
More off-the-shelf tools
通用 (Popularity)
Knowledge base expanding
中山資工 2017/02/24 70
Limitations of CAN
速度太低 (<1Mbps)
當有太多資料同時要傳輸,匯流排的使用
(Utilization) 就會降低
很多Nodes 要經常重新傳(retransmitted)
某些CAN Nodes 可能會阻塞匯流排
Babbling idiot
常常因為要 Arbitration,所以Message 的
傳遞時間經常無法預估
對於安全性可能有隱憂
中山資工 2017/02/24 72