Real-Time Embedded Systems in Automotive
Real-Time Embedded Systems in Automotive
ASSIGNMENT
Real-time Embedded systems
Name
of
Student
the
Salman Mohideen
Reg. No
CDB0913002
Batch
Full-Time 2013.
Module Leader
GE
NA
MA
AN
NG
ERI
NE
GI
EN
TE
UA
AD
GR
PO
Department
AEL2516
ST
Module Code
Module
Name
Course
<Assignment Title>
ii
Student
Name
Reg. No
Course
Batch
Salman Mohideen
CDB0913002
MSc
Module Code
AEL2516
Module Title
Module Date
Module Leader
18-012014
Declaration
The assignment submitted herewith is a result of my own investigations and that I have
conformed to the guidelines against plagiarism as laid out in the PEMP Student
Handbook. All sections of the text and results, which have been obtained from other
sources, are fully referenced. I understand that cheating and plagiarism constitute a
breach of University regulations and will be dealt with accordingly.
Date
<Assignment Title>
iii
Abstract
____________________________________________________________________________
Navigation technology is a promising technology that has applications in many aspects
of life, such as in agriculture, law, sports, the automobile industry, etc. In the automobile
industry, navigation is used with GPS in many forms.
In this paper, it is explained how GPS technology and accelerometer based navigation
system could be used for optimal routing and location and the application status of RTES in
present automotive scenario. In this way, we can reduce traffic congestion, eventually reduce
travel times and air pollution, and even save money on fuel consumption. This task is
accomplished by using the data collected by the car GPS navigation system, analyzing this data,
and then using the data to model how optimal navigation can be achieved. A robust architecture
for the integration of add-on software in ECUs can be used to effectively make use of the
RTES. This reduces the complexity of the embedded system in vehicles and eases the ECU
integration.
<Assignment Title>
iv
Contents
____________________________________________________________________________
Declaration Sheet...................................................................................................................ii
Abstract..................................................................................................................................iii
Contents..................................................................................................................................iv
List of Tables...........................................................................................................................v
List of Figures........................................................................................................................vi
List of Symbols.....................................................................................................................vii
1.Real time embedded systems.............................................................................................1
1.1 Introduction...........................................................................................................1
1.2 Growth of RTES
2
1.3 Development issues
2
1.3.1 Complex safety requirements
3
1.3.2 Reuse of software
3
1.3.3 Increasing ECUs in vehicle
4
1.3.4 Complicated vehicle network architecture
2 Title of the Chapter
4
2.1 Subtitle 1
5
2.2 Subtitle 2
6
2.3 Subtitle 3
9
1. Title of the Chapter
14
3.1 Subtitle 1
16
3.2 Subtitle 2
17
3.3 Subtitle 3
28
References
29
Bibliography
31
Appendix-1(Title of the Appendix)
33
38
<Assignment Title>
List of Tables
____________________________________________________________________________
Table No.
Table 1.1
Table 1.2
Table 2.1
Pg.No.
12
14
18
<Assignment Title>
vi
List of Figures
____________________________________________________________________________
Figure No.
Figure 1.1
Figure 1.2
Figure 2.1
Pg.No.
13
15
19
<Assignment Title>
vii
List of Symbols
____________________________________________________________________________
Symbol
A
g
V
w
Description
Current
Acceleration due to gravity - 9.81
Voltage
Width
Units
Amp
m/s2
Volts
mm
<Assignment Title>
viii
PART-A
CHAPTER 1
1. Real-Time Embedded systems
1.1 Introduction:
The Embedded systems create a sophisticated structure for modern automobiles which
enhances the performance and quality of the vehicles on a real-time basis. Software development
for automotive applications is gaining more and more importance. Today, software controls a large
number of functions, which make use of linked networks. Interactions of functions in a linked
network contribute to an increasing complexity, which require a strong controllability of the
complexity. This scenario made the role of RTES in automobiles vital. Now each and every systems
in a vehicle deals with complex tasks and efficient function flows which recalls the need of RTES
and its importance in modern style.
manufacturers began to develop specific software with competitive relevance. Now they have to
deal with the problem of reuse, too. But the re-use of the software has not become effective since
then the RTES has launched. Effective tools and unawareness of the technology and variation of
ECU fro from ECU make the process complex.
1.3.3 Increasing ECUs in vehicle
Modern vehicles have a large number of Electronic Control Units (ECUs) inside that realize
a huge number of functions. Those functions may be distributed among several ECUs. Premium
cars for example have up to 70 ECUs, connected to 5 system busses, realizing over 800 functions.
Standardization of the ECU architecture is needed in order to handle increasing functional
complexity in a cost efficient way. BMW is working on a complex body domain ECU consisting of
3 microcontrollers, including a dual core 32Bit C and a dedicated C for safety-related
applications. AUTOSAR will be used to integrate numerous functions into one ECU.
1.3.4 Complicated vehicle network architecture
Early vehicles used dedicated point-to-point connections for inter-module communications.
As the number of modules and features increased in vehicles, the wiring system became bulky,
complex, expensive and difficult to install and maintain. A serial bus can replace all the dedicated
point-to-point wiring between modules. Nowadays many vehicles are considering using a lowspeed LIN bus for body electronics and a high-speed CAN bus for power-train. Future vehicles
will access internet and exchange information with other vehicles and road-side units for various
reasons such as collision avoidance, message dissemination etc. These many network protocols
including FLEXRAY are used in vehicles were communication algorithms becomes more and
complex including the hardware. This is one of the main design issues in modern vehicles.
Sensing this parameter and the current vehicle speed, a warning (mostly a sound beep or jerk in
steering wheel) signal should be generated in order save the driver from accidents. The sensors can
be placed on the windshield as a micro structure. Video graphics and retinal scan hardware are
readily available throughout. Integrating these in a single car will be challenge. The warning range
should be depended upon the relative vehicle speed to enhance the safety. These requirements are
already being claimed in some of the countries.
1.4.2 Phone call detection
This can be explained as excel concept system because of the complexity in
implementation. There are accidents happening all over the globe because of the cell phone usage
of driver while driving. If the driver is using cell phone or making a call, there should be a system
to detect this activity and save the driver life by controlling the vehicle speed automatically. This
can be achieved using a full-fledged telematics system. The telematics system should be capable of
communicating with the drivers phone which is already configured, and in turn the system should
communicate with the vehicle ECU. Whenever driver makes a call, the telematics system detects
the function using the frequency used, saves in memory, compares with the phone frequency
configuration and sends signals to ECU. The ECU in turn reduces the vehicle speed to a threshold
of a less speed which is already saved. Or there can be a system where this system connects with
the ACC (Adaptive Cruise Control) and reduces the speed when any obstacle comes in front. Any
warning signals can be given before reducing the speed. Or it can be incorporated with Automatic
Brake Assist.
1.5 Conclusion
RTES in automotive systems has gone through so many innovations and steps, since it holds
the important part of vehicle performance. The consistent user requirements have paved the way of
development of software throughout the period. Complexity of different systems which follows
these requirements raises the issues in implementing integrating RTES in automobiles. Increasing
complexity doesnt affect the growth much, but in turn enhanced the growth of embedded software.
It can be concluded that wherever requirement is there, growth of technology starts.
PART-B
CHAPTER 2
________________________________________________________________________________
A GPS receiver calculates its position by precisely timing the signals sent by 3 or more
GPS satellites high above the Earth. The receiver uses the messages it receives to determine the
transit time of each message and computes the distance to each satellite using the speed of light. Each
of these distances and satellites' locations defines a sphere. The receiver is on the surface of each of
these spheres when the distances and the satellites' locations are correct. These distances and
satellites' locations are used to compute the location of the receiver using the navigation equations.
This location is then displayed, perhaps with a moving map display or latitude and longitude;
elevation or altitude information may be included. The Micro controller unit in the car acquires these
signals via UART (Universal Asynchronous Receiver Transmitter), processes and displays through
LCD or any other media, may include any other actuators depending upon the application (Fig.2.1).
2.2.2 Inertial Navigation system (INS)
Mathematically integrating these values allows us to determine the rotation of the platform and
therefore the change in its altitude. These calculations enable us to calculate the position of the
vehicle with distance travelled, location, direction.
GPS Satellites
used by forming a triangle and locates the unknown position with its known location of the satellite.
Fig.2.4 is the diagram of navigation using satellites forming triangles. The data is sent 24 hours
irrespective of the location of the user.
GPS Receiver
Fig.2.4 shows the GPS receiver used in the system. It can receive the data at the rate of
9600bps. GPS satellites send the data in a format called NMEA (National Marine Electronics
Association) format which is unique for all satellites and locations. The receiver captures these
signals through antenna which is attached with module and the module converts these signals to
RS232 format using MAX232 IC.
2-axis accelerometer
Accelerometer used in the system is ADXL202. The proper acceleration measured by an
accelerometer is not necessarily the coordinate acceleration (rate of change of velocity). Instead, the
accelerometer sees the acceleration associated with the phenomenon of weight experienced by any
test mass at rest in the frame of reference of the accelerometer device. The ADXL202 is a low cost,
low power, complete dual axis accelerometer with a measurement range of 2 g. The ADXL202
outputs analog and digital signals proportional to acceleration in each of the sensitive axes.
PIC microcontroller
CPU is the other main component of the system. The analog accelerometer data should be
converted to digital in order to process by the processor, at the same time there should be a system
which contains a UART system to communicate GPS signals with the controller. So the best option is
to use a PIC microcontroller. Here in this system PIC18f458 is the MCU used. The PIC18F458
Microcontroller includes 32kb of internal flash Program Memory, together with a large RAM area
and an internal EEPROM. An 8-channel 10-bit A/D converter is also included within the
microcontroller, making it ideal for real-time systems and monitoring applications. It contains inbuilt
SPI (Serial Peripheral Interface) system for communication. PIC based systems are relatively fast and
easy to debug.
LCD display
The Liquid Crystal Display is used in this navigation system to display the position information
in fast and reliable way. LCDs are low cost displays which can be programmed according to the
application and basic information can be displayed without the usage of graphics.
GPS only positioning is difficult. Dead Reckoning solution is widely utilized in automotive
navigation systems.
2.4.2 ADXL202, 2-axis accelerometer
The ADXL202 is a true accelerometer, easily capable of shock/vibration sensing with virtually
no external signal conditioning circuitry. Since the ADXL202 is also sensitive to static (gravitational)
acceleration, tilt sensing is also possible. Tilt sensing requires a very low noise floor which usually
necessitates restricting the bandwidth of the accelerometer, while shock/vibration sensing requires
wide bandwidth. The ADXL202 is a low cost, low power, complete dual axis accelerometer with a
measurement range of 2 g. The features can be listed as,
5 mg Resolution at 60 Hz Bandwidth
Figure 2.6 shows the response of the ADXL202 to the Earths gravitational field. The output
values shown are nominal. They are presented to show the user what type of response to expect from
each of the output pins due to changes in orientation with respect to the Earth. The ADXL210 reacts
similarly with output changes appropriate to its scale. For each axis, an output circuit converts the
analog signal to a Duty Cycle Modulated (DCM) digital signal that can be decoded with a counter/
timer port on a microprocessor. A 0 g acceleration produces a nominally 50% duty cycle. The
acceleration signal can be determined by measuring the length of the T1 and T2 pulses with a
counter/timer.
The ADXL202 has provisions for band limiting the XFILT and YFILT pins. Capacitors must
be added at these pins to implement low-pass filtering for anti-aliasing and noise reduction. The
equation for the 3 dB bandwidth is:
F3 dB
= 5 F
C(X, Y)
Here F is the bandwidth and C(x, y) are the individual capacitors. The tolerance of the internal
resistor (RFILT) can vary as much as 25% of its nominal value of 32k; so the bandwidth will vary
accordingly. A minimum capacitance of 1000 pF for C (X, Y) is required in all cases. In this design,
capacitor of 0.10 F is used to achieve 50 Hz of bandwidth.
Same way DCM (Duty Cycle Modulator) is set using the resistor RSET. The period of the
DCM output is set for both channels by a single resistor from RSET to ground. The equation for the
period is:
T2 = RSET ()
125 M
A 125M resistor will set the duty cycle repetition rate to approximately 1 kHz, or 1 ms.
The device is designed to operate at duty cycle periods between 0.5 ms and 10 ms. analog output is
desired. Use an RSET value between 500 k and 2 M when taking the output from XFILT or
YFILT. The RSET resistor should be place close to the T2 Pin to minimize parasitic capacitance at
this node. The ADXL202 are specifically designed to work with low cost microcontrollers. Specific
code sets, reference designs, and application notes are available from the factory. This section will
outline a general design procedure and discuss the various trade-offs that need to be considered.
For most applications a single 0.1 F capacitor, CDC, will adequately decouple the
accelerometer from signal and noise on the power supply. However, in some cases, especially where
digital devices such as microcontrollers share the same power supply, digital noise on the supply may
cause interference on the ADXL202 output. The 0.1 F value is default designed for avoiding the
unwanted noise signals.
Acceleration obtained from ADXL202 completely depends upon the supply voltage, VDD. The
equation is as follows,
At 0g,
The data of last located position and calculates the distance from that using some equations.
Uses the distance travelled by the car after the GPS data is lost, through accelerometer.
Adds both distances and locate the new location by reverse equating the same equation.
These methods are followed to calculate the new distance in Dead-reckoning. The
Haversine formula is used to calculate the great-circle distance between two points that is, the
shortest distance over the earths surface giving an as-the-crow-flies distance between the points.
The formula is as below,
a = sin(/2) + cos(1).cos(2).sin(/2)
c = 2.atan2(a, (1a))
d = R.c
y =
d = R.x + y
Preprocessor directives
ADCON0bi
ts.DONE
=1
Yes
No
No
If
<Accl_dat
a 512
Yes
Accl_data = 8.39- Accl_data
Accl_data = Accl_data
8.39
Return
2.6 Conclusion
This system concludes with the possibilities of navigation system in locating a vehicle on
real-time basis. Various technologies are invented and the growth is very drastic in enhancing the
implementation of newer systems with high reliability. Hence the system which incorporates GPS and
INS makes the ease in navigating the vehicle, which performs high at any atmosphere and at the same
time reduces the complexity. This paves the path of navigation systems even more clearly.
PART-C
CHAPTER 3
________________________________________________________________________________
Standard Code for Information Interchange) text. The data may vary in the amount of precision
contained in the message. For example time might be indicated to decimal parts of a second or
location may be show with 3 or even 4 digits after the decimal point. Programs that read the data
should only use the commas to determine the field boundaries and not depend on column positions.
There is a provision for a checksum at the end of each sentence which may or may not be checked
by the unit that reads the data. The checksum field consists of a '*' and two hex digits representing
an 8 bit exclusive OR of all characters between, but not including, the '$' and '*'.
For ex.:
$GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75
There are so many NMEA sentences transmitted by the GPS like GPGGA, GPRMC,
GPGSA, GPRMA, GPGRS, GPRTE, GPRMB etc. Among all, GPGGA is been used in this
navigation system. GGA essential fix data which provides3D location and accuracy data. GPGGA
can be explained with an example,
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
GGA
123519
08
0.9
545.4,M
46.9,M
*47
Declaration of
functions
While
loop
Do;
Enables continous reception;
While;
Acquires first data by
checking recepetion flag is
set
No
Yes
While loop;
Checks for the $
symbol
No
Yes
No
Yes
Checks data for
letter P
No
Yes
Checks data for
letter G
No
Yes
Checks data for
letter G
No
Yes
Checks data for
letter A
No
Yes
Acquires the data and stores
till , for Time data
B
D
Acquires the data and stores
till N for longitude
Return
3 inbuilt timers
Enhanced CCP module, analog comparators and the Parallel Slave Port.
communication with external peripherals. RISC architecture enhances performance of the controller
for real time applications. Addressable USART module for reliable communication process.
3.3.3 LCD display
The Liquid Crystal Display is used in this navigation system to display the position
information in fast and reliable way. LCDs are low cost displays which can be programmed
according to the application and basic information can be displayed without the usage of graphics.
PORTD for commands. The PORTC pins RC6, RC7 acts as transmission, reception pins of UART
respectively.
Interfacing hardware is even easier. The GPS data received by the receiver is fed to RC7
pin which is the Rx pin of UART in PIC18f458. The fed data is stored in a register called RCREG
or Reception Register, which is an 8-bit register. The flag bit of PIR1 (Peripheral Interrupt Register)
is set when the RCREG is filled. The baud rate for the reception, 9600bps is set by a register called
SPBRG.
3.5 Conclusion
GPS based navigation system is the most reliable and simple system for locating object.
Design challenges and limitations are less compared to other systems like INS. Forgetting the cost
of the systems, GPS stands for a radical option in navigation field. Hardware used is reliable and
easy to implement which enhances the growth of these kinds of systems.
3.6 Demonstration
Fig.3.7 Demonstration-1
Fig.3.8 Demonstration-2
3.7 References
1. Rajeshwari Hegde, Geetishree Mishra, K S Gurumurthy, International Journal of VLSI design
&