0% found this document useful (0 votes)
156 views36 pages

Real-Time Embedded Systems in Automotive

Design and development of an Inertial Navigation System (INS) in vehicles with GPS system and its testing/ validation.

Uploaded by

SalmanSallu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views36 pages

Real-Time Embedded Systems in Automotive

Design and development of an Inertial Navigation System (INS) in vehicles with GPS system and its testing/ validation.

Uploaded by

SalmanSallu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

MSRSAS - Postgraduate Engineering and Management Programme - PEMP

ASSIGNMENT
Real-time Embedded systems

Name
of
Student

the

Salman Mohideen

Reg. No

CDB0913002

Batch

Full-Time 2013.

Module Leader

Prof. Tracy Austina Z.

M.S.Ramaiah School of Advanced Studies


<Assignment Title>

Postgraduate Engineering and Management Programmes(PEMP)


th

#470-P, Peenya Industrial Area, 4 Phase, Peenya, Bengaluru-560 058


Tel; 080 4906 5555, website: www.msrsas.org

GE

NA

MA

AN

NG

ERI

NE

GI

EN

TE

UA

AD

GR

M.Sc. in Automotive Electronics


Computer Engg.

PO

Department

AEL2516

ST

Module Code
Module
Name
Course

<Assignment Title>

ii

MSRSAS - Postgraduate Engineering and Management Programme - PEMP

Student
Name
Reg. No
Course
Batch

Salman Mohideen
CDB0913002
MSc

Module Code

AEL2516

Module Title
Module Date
Module Leader

Real-time Embedded systems


to

Batch Full-Time 2013.

18-012014

Prof. Tracy Austina Z.

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.

Signature of the student

Date

Submission date stamp


(by ARO)

Signature of the Module Leader and date

Signature of Head of the Department and date

<Assignment Title>

iii

MSRSAS - Postgraduate Engineering and Management Programme - PEMP

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

MSRSAS - Postgraduate Engineering and Management Programme - PEMP

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

Appendix-2 (Title of the Appendix)

38

<Assignment Title>

List of Tables
____________________________________________________________________________
Table No.
Table 1.1
Table 1.2
Table 2.1

Title of the table


Title of the table
Title of the table
Title of the table

Pg.No.
12
14
18

< The table numbers have to be based on the chapter number>

<Assignment Title>

vi

List of Figures
____________________________________________________________________________
Figure No.
Figure 1.1
Figure 1.2
Figure 2.1

Title of the figure


Title of the figure
Title of the figure
Title of the figure

Pg.No.
13
15
19

< The Figure numbers have to be based on the chapter number>

<Assignment Title>

vii

MSRSAS - Postgraduate Engineering and Management Programme - PEMP

List of Symbols
____________________________________________________________________________
Symbol
A
g
V
w

Description
Current
Acceleration due to gravity - 9.81
Voltage
Width

Units
Amp
m/s2
Volts
mm

< Arrange in alphabetical order>

<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.

1.2 Growth of RTES


The role of software in the automobile concept has got its own evolution with tears of
background. In the 70ties, mechanical systems dominated car development. In the 80ties,
electronics supports mainly in the area of chassis and engine control. Infotainment functions gave
software dedicated meaning in the automotive domain of the 90tiesAt the beginning of the third
millennium; the automotive industry is facing a new challenge. Electronics make 90% of the
innovations, 80% out of that in the area of software. This fact means a big change for the
development of electronics. The evolution of OS in embedded system paved the way of systematic
growth of RTES in a glory.

1.3 Development issues


1.3.1 Complex safety requirements
As the year time passes, people become more vigilant about the performance of car, mainly
on two parameters- safety and reliability. Requirements of the common people have followed the
technology evolved from period to period, reliable but safer too. Substantial growth of technology
is a bold point to be discussed when the new requirements of people are discussed. But the fact is,
technology which is invented, is not that capable to satisfy the complete requirements on priority
basis. This becomes a main issue in developing new technologies and the evolution line never ends.
1.3.2 Reuse of software
Until recently, in the automotive industry, reuse of software has entirely been a typical
activity of suppliers. They try to reduce the increasing software development costs that stem from
rising complexity and size of software in the modern automobile. Lately, also the automotive

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.

1.4 Two future embedded systems


There are numerous embedded systems which can be incorporated in future vehicles as the
part of safety and performance. Two of them are discussed below,
1.4.1 Driver Fatigue Detection system
This is a system which detects the drowsiness of driver, during driving. Most of the
accidents happen due to distraction or driver in sleepy mood. If the driver is in drowsy mood, driver
looses the control on the vehicle and it may lead to a major accident. So there should be a system to
avoid this type of accidents by warning the driver in this situation. When vehicle is moving, a
sensor which may be mostly a camera should take the picture continuously and using image
processing or video graphics, the condition of drivers eye should be identified. Or a better way is
to use Retina scanner to scan the condition of eye, whether it is half opened, fully opened or closed.

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
________________________________________________________________________________

2. Vehicle navigation systems


2.1 Introduction:
An automotive navigation system is a satellite navigation system designed for use
in automobiles to locate the vehicle location, direction to the vehicle is moved, angle, orientation etc.
It typically uses a GPS navigation device to acquire position data to locate the user on a road in the
unit's map database. Using the road database, the unit can give directions to other locations along
roads also in its database. Dead reckoning using distance data from sensors attached to the drive train,
a gyroscope and an accelerometer can be used for greater reliability, as GPS (Global Positioning
System) signal loss and/or multipath can occur due to urban canyons or tunnels. Any system that can
provide intelligent vehicle location and navigation information will let us avoid congested freeways
and find more efficient routes to our destinations, maintaining economy.

2.2 Survey on existing navigation systems


Recently In-car navigation systems have integrated various functions allowed the connection of
different devices, and it is likely that in-car navigation system will incorporate elements of other
functions. Present in-car navigation systems are integrated systems that mainly consist of navigation
function, audio and video function and communication function. The technology used in navigation
includes evolution of various systems which explains about GPS navigation, inertial navigation
system or inertial measurement unit. Two systems are explained which has wide application on
existing automotive systems.
2.2.1 GPS based navigation system

Fig.2.1 GPS navigation system

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)

Fig.2.2 Inertial Navigation System


Inertial navigation is based on the principle that an object will resist in its current state
(stationary or in uniform motion), unless it is disturbed by a force which causes an acceleration.
Measuring this acceleration allows us to determine its motion. A mathematical integration with
respect to time leads us to the velocity, and through a second integration, we obtain the relative
position. To determine the direction it is crucial to consider the actual attitude. Fig.2.2 shows the
block diagram of a basic INS. It consists of a measurement unit called IMU or Inertial Measurement
Unit, CPU and actuator. IMU consists of the various types of sensors like accelerometers (mostly 3axis accelerometers), gyroscopes to measure the angles and optionally some other sensors like
pressure and temperature sensors for relevant information
The acceleration is measured with an accelerometer. These sensors not only measure the
acceleration due to external force, but also the acceleration due to the local gravity. Given that we
know the altitude of the accelerometers, we can mathematically remove the local gravity component.

In order to determine the altitude, an angular velocity sensor, ie

gyroscope can be employed.

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.

2.3 Design of simplified navigation system

Fig.2.3 A simplified navigation system


The navigation system should be capable to provide location data at real time with relevant
information and very less amount of errors. Fig.2.4 shows the block diagram of a simplified
navigation system which provides basic information of the position and location of the car on real the
time basis. The system includes basic components for the navigation which is communicated through
serial communication. The basic components are,

GPS Satellites

Fig. 2.4 GPS satellites tracking


The readymade data of the location is provided by the GPS satellites. There are around 24
satellites revolving around the earth on its orbit, which is used only for sending GPS data, basically
the satellite name, time when it sent and position of the satellite. Minimum of 3 GPS satellites are

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.

Fig. 2.5 Liquid Crystal Display


Fig.2.5 shows a basic LCD display and its pin diagrams. It needs a 5v supply and 4 pins to
control the display. This navigation system uses a 5*7 matrix LCD.

2.4 Accelerometer based position calculation


Before going in details of the position calculation, it is helpful know about the use of
accelerometers in this system. In this particular system accelerometers replaces GPS through a
method called Dead reckoning. To get inertial frame velocities and positions, it is first necessary to
obtain the physical acceleration of the sensor in the inertial frame. To convert the accelerometer
measurement into actual physical acceleration of the sensor, it is important to first understand exactly
what the accelerometer is measuring.
2.4.1 Dead reckoning
As said, GPS system is already used as primary navigation system for the overall system. But
even though GPS data can be used to locate the position without any additional calculation, GPS has
got its own drawbacks. If the vehicle is passing through a tunnel or at extreme weather conditions like
fog etc. there is a chance of GPS data getting lost. So there is an additional method called dead
reckoning. It is the process of calculating one's current position by using a previously determined
position, or fix, and advancing that position based upon known or estimated speeds over elapsed time
and course. Dead reckoning is subject to cumulative errors. Advances in navigational aids which give
accurate information on position, in particular satellite navigation using the Global Positioning
System, have made simple dead reckoning by humans obsolete for most purposes. However, inertial
navigation systems, which provide very accurate directional information, use dead reckoning and are
very widely applied. It enables to keep high accuracy positioning by using information from various
sensors (gyro sensor, accelerometer, wheel ticks, etc.) to calculate the current position, even when

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,

Measurement range of 2 g/10 g.

It can measure both dynamic and static acceleration.

2-Axis Acceleration Sensor on a Single IC Chip

+3 V to +5.25 V Single Supply Operation

1000 g Shock Survival

Low Power <0.6 mA

5 mg Resolution at 60 Hz Bandwidth

The bandwidth of the sensor may be set from 0.01Hz to 5khz

0C to +70C commercial or 40C to +85C industrial temperature range.

Fig.2.6 ADXL202 nominal response

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.

Fig.2.7 Typical output duty cycle


As per Fig.2.7, every 1g tilt, there will be a change of 12.5% in duty cycle output. For most tilt
sensing applications the ADXL202 is the most appropriate accelerometer. Its higher sensitivity
(12.5%/g) allows the user to use a lower speed counter for PWM decoding while maintaining high
resolution.
2.4.3 Functional block diagram

Fig. 2.8 Functional block diagram of ADXL202


The basic block diagram of ADXl202 is given as Fig.2.8. Two axes are measured by 2
individual sensors X sensor and Y sensor. The supply +3 to +5.25v is given at 13th ,14th pin VDD,
analog outputs are taken through pins 11,12 XFILT, YFILT respectively. Xout and Yout pins stands for
digital outputs at pins 9, 10 respectively. The counter block comes after the digital outputs denotes
any timer/counter circuits of microcontroller.

2.4.4 Basic design of components


The hardware design consists of selection of required resistor, RSET and capacitors Cx, Cy.

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

(2 (32 k) *C(x, y))


F3 dB

or, more simply,

= 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.

2.4.5 Acceleration, Velocity, Distance calculation


In this navigation system, the analog output of the accelerometer is used for the INS
implementation. So the acceleration, velocity and distance is calculated depending upon the analog
output voltage. So, need to have variables for each of the following, for each axis:

Current Acceleration (ax, ay)

Previous Acceleration (ax0, ay0)

Current Velocity (vx, vy)

Previous Velocity (vx0, vy0)

Current Distance (dx, dy)

Acceleration obtained from ADXL202 completely depends upon the supply voltage, VDD. The
equation is as follows,
At 0g,

Offset or analog output =VDD/2,

means for +5v, the output of the

sensor is +2.5v at 0g.


Sensitivity= (60mVVDD)/g,

means 300mV/g at +5v.

The velocity can be calculated with the following relation,


Current Velocity = Previous Velocity + Current Acceleration
vx += (ax + ax0) / 2
vy += (ay + ay0) / 2

The distance is calculated with the following relation,


Current Distance = Previous Distance + Current Velocity
dx += (vx + vx0) / 2
dy += (vy + vy0) / 2

2.4.6 Haversine formula


As said earlier dead-reckoning uses the previous position of the object to calculate the
present distance. When GPS data is lost, the INS uses,

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

Where is latitude, is longitude, R is earths radius (mean radius = 6,371km), c is the


Angular distance in radians, and a is the square of half the chord length between the points,
The haversine formula remains particularly well-conditioned for numerical computation even at
small distances.
- If performance is an issue and accuracy less important, for small distances Pythagoras
theorem can be used on an equi-rectangular projection:
x = .cos()
,

y =
d = R.x + y

where is latitude and is longitude. Using


this, distance is calculated and added with
distance found by accelerometer.

2.5 Schematics for the Block diagram

Fig.2.8 Proteus simulation for ADXL202


Simulation of ADXL202 interface is done in Proteus Professional V7.6 SP4. The analog
output of sensor is selected instead of digital out due to the reason of availability of only one CCP
(Capture compare PWM) module in PIC18f458. So the analog voltage is given to RA1 pin of
PORTA, which is the analog input port of the IC. The in-built 10-bit ADC converts the analog signals
to digital. And the conversion is controlled by the 8-bit register ADCON. The conversion status is
found by setting the flag bits of ADCON0. The data registers are ADRESH, ADRESL.
2.5.1 Design Algorithm

Preprocessor directives

Initialize PortB and PortD as


output and PortA as input port

Analog channel setup ADCON0


and ADCON1

Enable ADCON0bits.GO to start


acquisition

ADCON0bi
ts.DONE
=1

Yes

No

Move data from ADRESH and


ADRESL

Conversion of two register data to 10


bit data

Calculate the acceleration value from


10bit data

Accl_data = Accl_data X 0.0163

No
If
<Accl_dat
a 512
Yes
Accl_data = 8.39- Accl_data

Accl_data = Accl_data

8.39

Current Velocity = acceleration _data


X time (1s)

Current Velocity = acceleration_data


X time (1s)

Total velocity = prev velocity


current velocity

Total velocity = prev velocity +


current velocity

Position = prev position + total


velocity

Display acceleration, velocity and


position

Prev velocity = total velocity


Prev position = current position

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
________________________________________________________________________________

3. GPS based navigation system


3.1 Introduction
The Global Positioning System (GPS) is a constellation of satellites that orbit the earth
twice a day, transmitting precise time and position (latitude, longitude and altitude) information.
With a GPS Receiver, users can determine their location anywhere on the Earth. The complete
System consists of 24 satellites orbiting about 12,000 miles above the Earth, and five ground
stations to monitor and manage the satellite constellation. A GPS working principle is that, it
measures the time interval between the transmission and the reception of a satellite signal, and then
it calculates the distance between the user and each satellite. Through the distance measurements of
at least three satellites in an algorithm computation, the GPS receiver arrives at an accurate position
fix. To obtain a 2-D fix (latitude and longitude), information must be received from three satellites
and for a 3-D fix (latitude, longitude and altitude), four satellites are required.

3.2 GPS data acquisition


The data from the GPS is received through GPS receivers, modules which acquires the
data in a specific speed. Data from GPS is of a specific format called NMEA or National Marine
Electronics Association format.
3.2.1 NMEA format
This data includes the complete PVT (position, velocity, time) solution computed by the
GPS receiver. The idea of NMEA is to send a line of data called a sentence that is totally self
contained and independent from other sentences. There are standard sentences for each device
category and there is also the ability to define proprietary sentences for use by the individual
company. All of the standard sentences have a two letter prefix that defines the device that uses that
sentence type. (For GPS receivers the prefix is GP.) which is followed by a three letter sequence
that defines the sentence contents. In addition NMEA permits hardware manufactures to define
their own proprietary sentences for whatever purpose they see fit. All proprietary sentences begin
with the letter P and are followed with 3 letters that identifies the manufacturer controlling that
sentence. For example a Garmin sentence would start with PGRM and Magellan would begin with
PMGN.
Each sentence begins with a '$' and ends with a carriage return/line feed sequence and can
be no longer than 80 characters of visible text (plus the line terminators). The data is contained
within this single line with data items separated by commas. The data itself is just ASCII (American

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

Global Positioning System Fix Data

123519

Fix taken at 12:35:19 UTC

4807.038,N Latitude 48 deg 07.038' N


01131.000,E Longitude 11 deg 31.000' E
1

Fix quality: 0 = invalid


1 = GPS fix (SPS)
2 = DGPS fix
3 = PPS fix
4 = Real Time Kinematic
5 = Float RTK
6 = estimated (dead reckoning) (2.3 feature)
7 = Manual input mode
8 = Simulation mode

08

Number of satellites being tracked

0.9

Horizontal dilution of position

545.4,M

Altitude, Meters, above mean sea level

46.9,M

Height of geoid (mean sea level) above WGS84


ellipsoid

*47

the checksum data, always begins with *

Fig. 3.1 GPS data acquisition system


A basic data acquisition contains the hardwares which can acquire the GPS data without fail.
As per Fig.3.1, the system contains a GPS receiver to sense and acquire the data, a module to
convert these datas to RS-232 format, a communication network (mostly UART system) to
communicate to external devices and mainly a microcontroller to append these datas, process it and
use it in an effective using any necessary actuators. The primary function but mainly the heart
portion is performed by the GPS receiver which is incorporated with a module who converts the
GPS data to RS-232 level format. There should be a good microcontroller board to process the
datas as per the applications. Serial port communication can be used for relevant communication
process.

3.2.2 Design algorithm


Start

Declaration of

functions

Configure the UART with


baud rate of 9600bps

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

Acquires the data 100 times in an


array by checking reception flag

While loop checks


reception flag is set
and acquires data for
100 times
No
Yes

Checks data for


letter G

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

Acquires the data and stores


till N for latitude
B

B
D
Acquires the data and stores
till N for longitude

Displays time, latitude,


longitude in LCD

Return

3.3 Realization of hardware


Hardware selection is done based upon the performance range of the system and economy.
Basically there are 3 components,
3.3.1 GPS receiver

Fig.3.2 GPS Receiver


The receiver used is CIROCOMM which is a high gain GPS Receiver (5V Serial). Receiver
makes use of third generation POT (Patch Antenna On Top) for the GPS module. The built in 3V3
to 5V level converter enable it to interface with normal 5V Microcontrollers. Its low pin count (4
Pin) berg strip makes the interfacing easier. The 4 Pins are 5V,TX,RX,GND. The features are,

Single 5V DC supply @ 60 mA (typical).

TTL asynchronous serial interface.

Data output Baud rate: 9600 bps (Default).

Standard NMEA0183 output format.

Patch Antenna Size: 25mm x 25mm x 4mm.

Low Power Consumption: 50mA @ acquisition, 45mA @ tracking.

High Sensitivity: Up to -158 dBm tracking, superior urban performances.

Position Accuracy: < 3m CEP (50%) without SA (horizontal).

Cold Start is Under 36 seconds (Typical).

Warm Start is Under 34 seconds (Typical).

Hot Start is Under 1 second (Typical).

Max. Update Rate : 5 Hz (Default: 1 Hz).


This receiver can acquire the basic NMEA datas of GGA, GSA, GSV, RMC, VTC.

3.3.2 PIC Microcontroller


The controller used is PIC(Peripheral Interface Controller), PIC18f458, which is a40 pin
high- performance, enhanced flash microcontrollers with CAN module.

16-bit RISC (Reduced Instruction Set Computing) architecture

DC-40MHz clock input

High current sink/source 25 mA/25 mA

Three external interrupt pins

3 inbuilt timers

Enhanced CCP module, analog comparators and the Parallel Slave Port.

Master Synchronous Serial Port (MSSP) with two modes of operation

10-bit, up to 8-channel Analog-to-Digital Converter module (A/D)

Programmable Brown-out Reset (BOR)

Watchdog Timer (WDT) with its own on-chip RC oscillator

Low-power, high-speed Enhanced Flash technology

Secondary Oscillator (32 kHz) clock input


PIC contains 5 port with 8-pin analog channels. Inbuilt MSSP module enables serial

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.

Fig. 3.3 Liquid Crystal Display


Fig.3.3 shows a basic LCD display and its pin diagrams. 3 pins are used to command the LCD,
8 pins for data lines. It needs a 5v supply and 4 pins to control the display. This navigation system
uses a 5*7 matrix LCD.

Fig.3.4 Proteus circuit simulation


The GPS circuit simulation is done in Proteus Professional V7.6 SP4. A demonstration is
shown in Fig.3.4. Instead of interfacing the GPS receiver, a virtual serial communication block
which acts as UART system. And the data reception is tested by displaying the information on LCD
which is typed from the keyboard. LCD is interfaced with PIC through PORTB for data and

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.4 Test cases


Took 2 points A, B. A has the position using GPS, the latitude and longitude data. From A to
B point, distance is calculated using accelerometer which is around 400m. And added both value to
get the latitude and longitude value.

Fig.3.5 Test case-point-A

Fig.3.6 Test case-point-B

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

Circuit is demonstrated with displayed data on LCD as per Fig.3.5, 3.6

3.7 References
1. Rajeshwari Hegde, Geetishree Mishra, K S Gurumurthy, International Journal of VLSI design
&

Communication Systems (VLSICS), Vol.2, No.3, September 2011.

2. Alberto Sangiovanni-Vincentelli, University of California, Berkeley, October 2007.


3. Syed Masud Mahmud, In vehicle Network Architecture, Wayne State University, USA,2006.
4. ADRIAN SCHUMACHER, Master of Science Thesis, Stockholm, Sweden March 2006.
5. Dakai Zhu and Chunjiang Qian, University of Texas at San Antonio,2010.
6. ADXL202/ADXL210 data sheet, Analog devices.
7. PIC18FXX8 datasheet, Microchip.
8. Andrew Aubry, GPS and Inertial Navigation, October 16, 2012.

3.8 Benefits of Assignment


This assignment is efficient to enhance the knowledge of individual in every aspects of
automotive software development. The resultant outcome from this assignment is the module
learning outcome to understand the topic.

You might also like