MARMARA ÜNİVERSİTESİ TEKNOLOJİ FAKÜLTESİ
Abdullah DEMİR, Yrd. Doç. Dr.
• Automotive Software Systems
• Software Architectures for Advanced Driver Assistance Systems (ADAS)
• The Intelligent Automated Vehicle: the Last IoT Node
• Araçlardaki Mobil Uygulamalar
https://en.wikipedia.org/wiki/Data_rate_units
HATIRLATMA The ISQ symbols for the bit and byte are bit and B, respectively. In the context of
data rate units, one byte consists of 8 bits, and is synonymous with the unit octet.
The abbreviation bps is often used to mean bit/s, so that when a 1 Mbps connection
is advertised, it usually means that the maximum achievable bandwidth is 1 Mbit/s
(one million bits per second), which is 0.125 MB/s (megabyte per second), or about
0.1192 MiB/s (mebibyte per second). The Institute of Electrical and Electronics
Engineers (IEEE) uses the symbol b for bit.
Kilobit per second
kilobit per second (symbol kbit/s or kb/s, often abbreviated "Kbps") is a unit of
data transfer rate equal to:
1,000 bits per second
125 bytes per second
Megabit per second
megabit per second (symbol Mbit/s or Mb/s, often abbreviated "Mbps") is a unit of
data transfer rate equal to:
1,000,000 bits per second
1,000 kilobit per second
125,000 bytes per second
125 kilobytes per second
The International System of Quantities (ISQ)
SAE.ORG, Next-gen electronic controls: Open source, scalable and integrated; 19-Apr-2016 04
Tony Cooprider, Senior Technical Leader
for Ford Motor Co. “Twenty-five years
ago, 75% of the vehicle value was
mechanical, 22% was electronics and
there was a sliver of software. Software
has grown to 18%, electronics is now
about a third and about half is
mechanical parts.”
“We need to consolidate what we’ve
distributed, we want to reduce the
number of controllers in a car,” said
Michael Groene, Director of Global
Software Engineering at Delphi
Automotive.
• How many lines of code in a:
– F-22 Raptor:
– Average new Ford:
1.7 million
10 million
Noah Goodall, VDOT’s Connected Vehicle Program, Virginia Center for Transportation Innovation and Research, ASHE Old Dominion Section Meeting, June 13, 2013
Modern Vehicles – Very Sophisticated
Lines Of Code: Kod Satırı
Açıklama
F-22 Raptor (Yırtıcı Kuş), Lockheed
Martin firması tarafından, hava
üstünlüğü odaklı,düşük radar izi ile
yüksek görünmezlik sağlamaya yönelik
üretilen avcı uçağıdır. Amerika Birleşik
Devletleri Hava Kuvvetleri (USAF)'ne
göre, F-22 uçakları Birleşik Devletler
Küresel Saldırı Görev Gücü (US-
GSTF)'nün önemli bileşenlerindendir.
Computerized Measurement
• Speed
• Heading (rota, yön)
• Acceleration (lateral, longitudinal, vertical)
• Position (from GPS)
• Other diagnostics Wipers on/off
Braking status
Tire pressure
Steering wheel angle
Headlights on/off
Turn signals on/off
Rain sensors
Stability control
Noah Goodall, VDOT’s Connected Vehicle Program, Virginia Center for Transportation Innovation and Research, ASHE Old Dominion Section Meeting, June 13, 2013
Introduction to Automotive
Software Systems 2IN60: Real-time Architectures (for automotive systems)
More and more car functions are
being implemented in software
Developing software is
expensive
$$$
Car functions
powertrain, e.g.
engine control, transmission and gear control;
chassis, e.g.
ABS (Antilock Braking System), ESP (Electronic Stability Program),
ASC (Automatic Stability Control), ACC (Adaptive Cruise Control);
body (comfort), e.g.
air conditioning and climate control, dash board, wipers, lights,
doors, seats, windows, mirrors, cruise control, park distance
control;
telematics/wireless, e.g.
multimedia, infotainment, GPS and in-vehicle navigation systems,
CD/DVD players, rear-seat entertainment;
passive safety (emerging), e.g.
rollover sensors, airbags, belt pretensioners.
11
Powertrain Chassis Body Telematics Passive
safety
Program size 2 MB 4.5 MB 2.5 MB 100 MB 1.5 MB
Number of ECUs 3-6 6-10 14-30 4-12 11-12
Number of
messages
36 180 300 660 20
Bus topology Bus Bus Bus Ring Star
Bandwidth 500 Kb/s 500 Kb/s 100 Kb/s 22 Mb/s 10 Mb/s
Cycle time 10 ms – 10 s 10 ms – 10 s 50 ms 2 s 20 ms 0 5 s 50 ms
Safety
requirements
High High Low Low Very high
Task of engine control:
calculate amount of fuel and
exact moment of injection
Dependencies:
pedal (driver)
load of the engine
temperature
etc.
Sensors and actuators:
position of crankshaft
valves
Relevance:
avoid mechanical damage
provide quality of control (e.g. fuel efficiency)
Crankshaft (red), pistons (grey) in their
cylinders (blue), and flywheel (black)
Real-time requirements for fuel injection:
Keep the fuel intake valve open for f(x) μs at x rpm
Crankshaft position accuracy: 0.1 degree
1. At 100 rps 3s temporal accuracy
Challenges:
latency between sending “close” command to valve and the actual time when the valve closes
1. Communication latency
2. Environmental conditions (e.g. temperature)
Approach:
compensate for latency:
1. sensor signal indicates when valve closes
2. latency is measured during every engine cycle
3. determine when “close” command must be sent
Anti-lock Braking System
Controller
1. Brake
pedal
pushed
2. Pressure
passed to the
brake fluid
3. Wheel disc
brakes
squeezed
4. If the brake pedal is
pushed too hard, the
wheel will lock a
sensor detects this and
notifies the controller
5. Controller
releases the
pressure on
the discs by
releasing
some brake
fluid in a
container
6. The fluid is
pumped back to
repeat the
pressure on the
discs
7. Entire process is repeated about 15 times/sec
(by courtesy of Damir Isovic)
Electronic system:
Sensor: detects that the wheel will lock
Actuator: release and repeat the pressure on the discs
Controller: requires an ECU
Distributed:
Controller, sensors, and actuators at different locations
Requires wires or a network
Embedded and invisible to the driver
Reduce severity of head-to-tail crash
Stage 1 (~2.6 s to impact):
Provide visual and audible collision warning
1. shine lights and sound
Stage 2 (~1.6 s to impact):
Automatically initiate partial braking at 4 m/s2
Move the front passenger seat to safe position
1. Height, fore/aft adjustment, backrest angle
2. Inflate air-chambers inside seat for better support
If skidding: close front windows and sunroof
Stage 3 (~0.6s to impact):
Tighten the seatbelts (e.g. fire pyrotechnics or pulleys)
Prepare airbags for deployment
Relies on several subsystems
Radar for detecting potential collision
Anti-lock Braking System to apply partial
braking
Traction Control to identify if skidding
Window Control System to close windows
…
Complexity is due to the many dependencies
E.g. communication
Communication is expensive
Surface area, power consumption, latency, ability to
understand system behavior, …
Modular design:
Divide an integrated system into independent modules
Define interfaces between the modules
Keep the interfaces thin!
Advantages
Separation of concerns
Flexibility
Maintainability
Security
• When investigating the root causes for traffic jams in a city, it is infeasible to consider the interactions between molecules comprising the car or the driver’s brain.
• A model is an abstraction of the key elements which are relevant for achieving a given goal
Example: traffic in a city can be modeled by means of a queue network representing the streets, and Markov chains describing the arrival of cars
• A system is a set of interacting components
forming an integrated whole
• Architecture is a description of the individual
components and their interactions
Collection of models describing the system
from different views
Describes the architecture of software-intensive systems
Logical view: functionality that the system provides to end-users
Development view: implementation from programmers perspective
Process view: runtime behavior (tasks and how they communicate)
Physical view: mapping of the software onto physical layer
Scenarios: illustrates the architecture description based on several use cases
Electronic Control Unit (ECU)
Sensors and actuators
Microcontroller
Software
Bus
Connects individual ECUs
Interconnect between buses CA
N I
nfo
tain
ment
CAN Komfort
CAN Komfort
CAN Antrieb
CAN
Kombi
LIN
LINLIN
AFS-CANSensor-CAN
CA
N D
iagnose
Gateway
Controls one or more car functions
Types of electronic control units
Airbag (ACU), Engine (ECU),
Transmission (TCU), …
70 – 100 ECUs inside a car (nearly as
many as inside Airbus A380)
Microprocessor-based
An ECU and its interfaces
Power
CAN port FlexRay port Digital and Analog
I/O ports
Debug port
Example ECU (Freescale board EVB9512XF)
Power
CAN port
LEDs
Reset button
Microcontroller
(CPU + memory)
FlexRay port
Digital and
Analog
I/O ports
CAN controller
Debug port
Connects individual ECUs
Examples: CAN, FlexRay, I2C, IEEE 802.11p
K-CAN
System
MOST K-CAN
Periphery
SI-BUS
(Byteflight)
PT-CAN
Diagnose
Gateway
A particular bus defines the communication protocol (including message format
and possible message exchanges), bandwidth, physical interfaces.
Also referred to as “non-functional requirements” or “extra-functional requirements”
Timeliness/Predictability
1. Hard timing requirements: functional
2. Firm/soft timing requirements: non-functional (can be traded for others, e.g. a bit later but much cheaper to realize)
Dependability
Maintainability: ability for software to undergo modifications and repairs
Scalability: ability to scale a metric with changing architecture
1. Example: maintainability will decrease when increasing number of ECUs in a car
Security
Dependability is an umbrella term for Availability, Reliability and Safety
A real-time system is one with very strict timing constraints. For
example, during a crash you would like the airbag to inflate just at
the right time: not too early and not too late. So, the airbag controller
must guarantee that the strict timing constraints are met.
Example: inflation of an air bag
real-time fast
real time: fulfill specific timing requirements
best-casedeadline
time
response
worst-casedeadline
event
• Example: Software controlling the deployment of
airbags has 15 to 40 milliseconds to determine which
and in what order to activate
Specification:
Lower and upper bounds on the response time
Metrics:
Worst-case response time
Tardiness (yavaşlık, geç kalma)
32
Specification in 3 dimensions:
Availability: readiness for correct service
1. Metric: probability of the system being ready to use
1. Mean Time To Failure (MTTF), Mean Time To Repair (MTTR)
2. Availability: MTTF/(MTTF+MTTR)
Reliability: continuity of correct service
1. Metric: expected time until not being available
Safety: absence of catastrophic consequences on the user and the environment
1. Metric: catastrophic states are not reachable
• In 2005, Toyota recalled 160 000 Prius
hybrids, because of software causing car to
stall and shutdown.
Fix required 90 min per car = 240000 man
hours
• In 2008, VW recalled 6500 cars, because of
software causing unexpected increase in
RPM when air-conditioning is turned on.
The controlled system must remain safe
hazardous states unreachable (e.g., extremely
high temperatures)
even in erroneous conditions, safety must be
maintained (no “error exit”)
Certification: approval by independent agency
• Security: when the system is open to external
observation and control (e.g., via Internet)
confidentiality, integrity and non-repudiation
1. validation of privileges (authentication,
authorization)
2. secure protocols to make intrusion impossible
Non-repudiation: Red Olmayan
Repudiation: Tanımama, inkar etme
Recommended reading: [Burns] Ch. 1.1-1.3, 2.1-2.2, 2.10
Optional reading:
N. Navet, F. Simonot-Lion, “Automotive Embedded Systems
Handbook”, CRC Press, 2009
G. Leen, D. Hefferenan, “Expanding automotive electronics
systems”, Computer, 35(1), 2002
U. Keskin, “In-Vehicle Communication Networks: A Literature
Survey”, TU/e CS-Report 09-10, 2009
P. Kruchten, “Architectural Blueprints—The 4+1 View Model of
Software Architecture”, Software 12 (6), 1995
Kia
Kia
• Seri iletişim
• Paralel iletişim
Not: Paralel devrede 2 farklı sinyal için 2 kablo kullanılırken seri
devrede bir kablo üzerinden 2 ayrı sinyal gönderilir.
Kia
Ağ Tasarımları
ECU’lar aralarında bilgi alışverişi yapabilmek için
birbirlerine bağlanırlar.
ECU’lar arasında 3 tip bağlantı vardır.
• Çember/Halka
• Yıldız
• Otobüs/Bus
Kia
Bu tip bağlantıda ECU’lar
sinyal gönderir ve gönderdiği
sinyal tekrar kendisine gelir.
Kia
Bu tip bağlantıda merkezde bir ana
ECU vardır. Diğer ECU’lar ana ECU
üzerinden birbirine bağlanırlar.
Kia
Bu tip bağlantıda ECU’lar ortak iletişim
kablosuyla birbirine bağlıdır. Ortak
iletişim kablosu üzerinden data/veri
transferi oluşur.
Kia
Kia
İletişim Hızına Göre Sınıflandırma
Kia
İletişim Hızına Göre Sınıflandırma
Kia
CAN düşük hız düzenlemesi / LIN (GH)
Kia
LIN
Kia
CARNIVAL/SEDONA iletişim sistemi
Software Architectures
for
Advanced Driver Assistance Systems (ADAS)
Robert Leibinger, Software Architectures for Advanced Driver Assistance Systems (ADAS), Elektrobit Automotive GmbH, July 7th, 2015
Robert Leibinger, Software Architectures for Advanced Driver Assistance Systems (ADAS), Elektrobit Automotive GmbH, July 7th, 2015
Robert Leibinger, Software Architectures for Advanced Driver Assistance Systems (ADAS), Elektrobit Automotive GmbH, July 7th, 2015
Power Consumption within BMW cars
Max. power consumption limits the number of ECUs
Robert Leibinger, Software Architectures for Advanced Driver Assistance Systems (ADAS), Elektrobit Automotive GmbH, July 7th, 2015
Rising Quota of Multicore deliveries at Volkswagen
Ramp up: Desteklemek yada güçlendirmek
Multicore usage ramps up (e.g. Powertrain).
ADAS will speed this up.
ARAÇLARDAKİ MOBİL UYGULAMALARIN ALTYAPISI
• CAN,
• LIN,
• FlexRay
bus sistemleri
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
1986 - Robert Bosch / 1993 - ISO
Tek bir hat üzerinden kablolu veri transferi
Kontrol Alan Ağ modülü bulunan ilk entegre 1989 yılında Intel
Corp. tarafından piyasaya çıkarılmıştır.
• Siemens,
• Motorola,
• Philips,
• Microchip
Endüstriyel otomasyon, otomotiv ve mühendisliğin çeşitli
alanlarında kullanılır. Çift yönlü veri haberleşme için
kullanılır.
• Yüksek performanslı,
• Güvenilir,
Kablolu ağ teknolojisidir.
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
İletişim ortamına erişim yöntemi olarak, bit öncelikli
yapı kullanır.
CSMA/CD
Bu yöntem, mesajların çarpışmamasını garanti etmekle
beraber, iletişim hattının uzunluğunu sınırlandırır.
1 Mbit/s veri iletim hızı ile 40 m
40 Kbit/s veri iletim hızı ile 1000 m
CSMA/CD (Carrier Sense, Multiple Access/Collosion Detection)
CSMA\CD (İngilizce: Carrier Sense Multiple Access With Collision
Detection, Çarpışma Algılayıcıyla Taşıyıcı Dinleyen Çoklu Erişim)
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
• Ağa bağlı bir düğümden tüm sistem kontrol edilebilir.
• Fonksiyonları kontrol eden komutlar seri olarak gönderildiği
için kablo ve konnektör karışıklığı azalır.
• Sistemin çözülmesi veya toplanması daha kolay ve daha
hızlıdır.
• Verimli hata bulma sağlar.
• Kullanıcıya uyarı ve durum bilgisi göndermek için daha
yüksek kapasite sağlar.
• Ağa yeni kontrol birimlerinin kolayca eklenebilmesini sağlar.
• Ağa erişimde farklı erişim öncelikleri sağlar.
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
• ITS- Intelligent Transportation Systems
• TMS – Traffic Management Systems
• TIS – Traffic Information Systems
• DSRC-Dedicated Short Range
Communication (802.11.p / 5.9 GHz)
• AVCS – Advanced Vehicle Control Systems
• V2V V2I V2X
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
1. Ad Hoc ağlar
2. Wireless LAN
3. Cell broadcast
4. DSRC
5. UWB (Ultra Wide Band)
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
• Araçsal Ağlar 5.9 GHz bandında, 75 MHz’lik band genişliğine sahip,
yüksek veri transfer hızı (6-27 Mbps) sunan DSRC (Dedicated Short
Range Communications) standardını kullanır.
• Bu standarda göre yol üzerinde hareket halindeki araçlar;
mevki,
zaman,
yön,
hız,
trafik durumu bilgilerini içeren rutin trafik mesajını yaymak zorundadır.
Dedicated Short-range Communications (DSRC):
Tahsis Edilmiş Kısa Mesafe İletişim
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
On-Board Diagnostic bir aracın kendi kendine tanı ve raporlama
yeteneğini yapabilmesini sağlayan bir otomotiv standardıdır.
OBD sistemleri aracın alt sistemlerine, sensor bilgilerine, motor
hakkında çeşitli verilere erişimi sağlar.
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
SAE J1962
16-pin (2x8) J1962 connector
• Motor devir
• Hesaplanmış yük değeri
• Antifiriz sıcaklığı
• Yakıt sistemi durumu
• Araç hızı
• Kısa mesafe yakıt sarfiyatı
• Uzun mesafe yakıt sarfiyatı
• Emme manifold basıncı
• Ateşleme Avansı
• Hava emiş sıcaklığı
• Hava akış oranı
• Oksijen sensör voltajı
• Yakıt basıncı
Elektronik kontrol
ünitesi (ECU)
herhangi bir arıza
oluştuğunda bir kod
numarası bildirir.
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
SAE J1850 PWM (pulse-width modulation — 41.6 kB/sec,
standard of the Ford Motor Company)
SAE J1850 VPW (variable pulse width — 10.4/41.6 kB/sec,
standard of General Motors)
ISO 9141-2. This protocol has an asynchronous serial data rate of
10.4 kBaud. It is somewhat similar to RS-232; however, the signal
levels are different, and communications happens on a single,
bidirectional line without additional handshake signals. ISO 9141-2 is
primarily used in Chrysler, European, and Asian vehicles.
ISO 14230 KWP2000 (Keyword Protocol 2000)
ISO 15765 CAN (250 kBit/s or 500 kBit/s). The CAN protocol was
developed by Bosch for automotive and industrial control. Unlike other
OBD protocols, variants are widely use outside of the automotive
industry. While it did not meet the OBD-II requirements for U.S.
vehicles prior to 2003, as of 2008 all vehicles sold in the US are
required to implement CAN as one of their signaling protocols.
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
Android, symbian ve windows işletim sistemli tablet, telefon ve
bilgisayarlarla veriler kablo olmadan, bluetooth ile görülebilir ve
düzenlenebilir. Ancak iOs işletim sisteminde kablosuz Wi-Fi özelliği
kullanılır.
• Android
• IOs
Önemli Not: Kablosuz haberleşme imkanı sağlayan mobil cihazlar ile aracın
OBD soketine uyumlu Bluetooth ve Wifi teknolojilerini destekleyen OBD II
tarama olarak farklı kitler bulunmaktadır. OBD II scanner kitleri için geliştirilmiş
çeşitli yazılımlar bulunmaktadır.
Smartphones
Noah Goodall, VDOT’s Connected Vehicle Program, Virginia Center for Transportation Innovation and Research, ASHE Old Dominion Section Meeting, June 13, 2013
• Very sophisticated computer
• Sensors
GPS
3-axis accelerometer
Camera
Magnetometer
• Carried with you all day
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
• DashCommand
• iOBD2
• Mobilescan OBD
• MD4MyCar
• LogWorks
• Rev
• Roaders
Gül Türker, Araçlarda On Board Diagnostic Sistem ve Mobil Cihaz Uygulamaları, ab.org.tr/ab14/sunum/9.ppt
Kaynak: “BMW.com.tr” web sitesi, BMW Teknoloji Rehberi (Erişim Tarihi: 03/04/2014).
Flex Ray Flex Ray, araç bileşenleri arasında veri aktarımını hızlandıran yeni geliştirilmiş bir seri
veri yolu sistemidir. Flex Ray, farklı sistemlerin güvenli ve hassas bir şekilde birbirine
bağlanmasına olanak verir. Yeni ve hızlı sürücü destek sistemleri ile yürüyen aksam
kontrol sistemleri daha güvenli ve daha konforlu sürüş anlamına gelir.
Elektronik sürücü destek sistemlerinin karmaşıklığı gün geçtikçe artmaktadır. Yeni şasi
ve hareketli aksam kontrol sistemleri, etkin bir şekilde işlev görebilmek için son derece
yüksek veri aktarım hızlarına ihtiyaç duymaktadır. Bu artan gereksinimleri karşılamak
için BMW, otomotiv uygulamalarında gerekli olan güvenlik, hız ve yüksek kaliteyi
sağlayabilecek yeni bir veri yolu sistemi geliştirmek için konusunda uzman firmalar ile
işbirliğine girdi. 2007 yapımı BMW X5, dünyada bu yeni teknolojiyi kullanan ilk standart
üretim otomobil oldu. Flex Ray, Adaptif Sürüş yürüyen aksam kontrol sisteminin optik
veri yolunu kontrol eder ve amortisörlerin elektromanyetik valfleri ile dengeleyicileri
kontrol etmekte kullanılır, bu sayede Adaptif Sürüş, araç gövdesinin yana yatma etkisini
ortadan kaldırır.
Flex Ray’in en önemli avantajlarından biri yüksek veri aktarım hızlarıdır: Saniyede
10 MBit’e varan bu hız, geleneksel CAN veri yolu sistemine göre yirmi kat daha
fazladır. İkinci bir Flex Ray iletişim kanalı, güvenliği her zaman mükemmellik düzeyinde
tutabilmek için yedek görevi görür. Eğer kanallardan biri işlevini yerine getiremez
duruma gelirse, diğeri kullanılabilir durumda kalır. Güvenlik tehlikesi taşımayan
sistemlerde, tek bir kanalın kullanımı ile daha yüksek bir veri aktarım hızı elde edilebilir.
Bu avantajlar, araç üzerindeki sistemlerin birbirleri ile daha hızlı ve daha güvenli iletişim
kurmasına olanak vererek, sürüş konforunu ve güvenliğini önemli ölçüde artırır.