3e 2011 0800652 1
3e 2011 0800652 1
September 2011
ii
DECLARATION
I hereby declare that this project report is based on my original work except for
citations and quotations which have been duly acknowledged. I also declare that it
has not been previously and concurrently submitted for any other degree or award at
UTAR or other institutions.
Signature : _________________________
ID No. : 08UEB00652
Approved by,
Signature : ______________________
Date : _ ___
iv
The copyright of this report belongs to the author under the terms of the
copyright Act 1987 as qualified by Intellectual Property Policy of University Tunku
Abdul Rahman. Due acknowledgement shall always be made of the use of any
material contained in, or derived from, this report.
Specially dedicated to
my beloved parents and friends.
vi
ACKNOWLEDGEMENTS
First, I am grateful and appreciating for those who had assisted and guided me in
completing this project, especially my project supervisor, Dr. Chew Kuew Wai.
From him, I learnt to research in the project title and transforming knowledge of
electric vehicle technology into more detailed experiments and physical hardware. I
am grateful for the close guidance and knowledge gained from him.
Last but not the least; I am thankful for UTAR management for preparing the
suitable environment and all the equipment and lab for carrying out the research.
Equipment, devices and materials have been prepared well.
vii
ABSTRACT
The weakness of GPS navigation system coordinating with electric vehicle (EV)
battery management system to estimate battery capacity always leads to inaccurate
estimated range. A new system known as Contour Positioning System (CPS) had
been introduced to improve the existing EV technology; it considers the contour
condition along a selected route line. Total forces acting on a car during uphill
condition are calculated and further related to current calculation to estimate battery
capacity. An inclined plane experiment had been carried out to support the
calculation method. Motor speed monitoring system had been done with a sensorless
configuration, with a 16-bits microcontroller used as core controller. PIC24 with 10-
bits ADC feature is used to convert analogue voltage to digital signal for further
display on LCD display and transmitted to computer through serial ports. RS-232
communication protocol is used for serial communication between microcontroller
and computer serial ports. Graphical User Interface of an EV intelligent monitoring
system with data logging feature has been designed using Adobe Flash and the data
reading from a text file is done using LoadVars method.
viii
TABLE OF CONTENTS
DECLARATION ii
APPROVAL FOR SUBMISSION iii
ACKNOWLEDGEMENTS vi
ABSTRACT vii
TABLE OF CONTENTS viii
LIST OF TABLES xi
LIST OF FIGURES xii
LIST OF SYMBOLS / ABBREVIATIONS xv
LIST OF APPENDICES xvii
CHAPTER
1 INTRODUCTION 1
1.1 Background 1
1.2 Advantages of Electric Vehicle 3
1.3 Disadvantages of Electric Vehicle 5
1.4 Aims and Objectives 5
1.5 Scope of Project 6
2 LITERATURE REVIEW 8
2.1 About Electric Motor 8
2.2 Brushless DC Motor 12
2.3 GPS modules on Electric Vehicles 14
2.4 Great Circle Distance 16
2.5 Google Earth for Elevation level 16
ix
REFERENCES 60
APPENDICES 62
xi
LIST OF TABLES
2 Experimental value 29
LIST OF FIGURES
4.1 PIC24FJ64GA002 35
EV Electric Vehicle
ICE Internal Combustion Engine
PM Permanent Magnet
GPS Global Positioning System
BMS Battery Management System
CPS Contour Positioning System
SOC State of Charge
F|| Hill climbing force
Frr Rolling resistance force
FD Aerodynamic drag
Cd Drag coefficient
A Frontal area
v Travelling velocity
ρ Air density
T Temperature
p Pressure
h Altitude above sea level
L Temperature lapse rate
p0 Sea level standard atmospheric pressure
M Molar mass of dry air
R Universal gas constant
g Gravity constant
τ Torque
G Gear ratio
Rwheel Wheel size
kt Torque constant
I Current
xvi
RC Radio-controlled
Vsupply Supply Voltage
RPMno-load(max) Motor‟s maximum no-load RPM
Rm Terminal resistance
Ino-load No-load current
kb Voltage constant
EMF Electromotive force
MCU Microcontroller
ADC Analog-to-Digital Converter
RPM Rounds-per-minute
GUI Graphical user interface
EEPROM Electrically Erasable Programmable Read-Only Memory
xvii
LIST OF APPENDICES
A Graph 62
1 INTRODUCTION
1.1 Background
An electric vehicle (EV) is a car powered by an electric motor rather than a gasoline
engine. From the definition, an electric car is converted from a gasoline-powered
vehicle. The major difference between both vehicles is the way a car is powered; an
electric vehicle is powered by electric motor and the conventional one is powered by
gasoline engine. Another important component for an electric car is the rechargeable
battery. There is a controller between the electric motor and the battery.
The early development of electric motive power was started since 1828 by Ányos
Jedlik, the invention of a small scale model car powered by an electric motor. It was
then followed by the invention of the first crude electric carriage powered by non-
rechargeable primary cells by Robert Anderson from Scotland.
There was a significant weakness of electric motor powered vehicles at the early
development stage, which is the lack of power. For example, the electric locomotive
built by Robert Davidson in 1838 could only achieve a speed of 6km/hour. Electric
vehicles were dominating the early automobiles field until the replacement by more
powerful ICE (Internal Combustion Engine). Gasoline-powered vehicles were taking
over the main role of transportation, globally.
It is the trend of modern world automobile industry where they are trying to bring
back an old technology, make it new by further development, and that‟s the
introduction of an electric vehicle. The commercially available pure electric cars in
the market nowadays include the Nissan‟s LEAF, the Chevrolet‟s VOLT, and the
Tesla Roaster.
Great Performance
The electric car is silent, as compared to a conventional gasoline-powered car which
is using an internal combustion engine (ICE).
There are many people pointing that the charging of EV battery will also
create emission at the power station; but it actually depends on the power source
generating technology. Other than coal power plant that is utilizing fossil-fuel, there
are some alternative power sources such as hydroelectricity, solar panel and wind
farms.
As comparison, a conventional gasoline-powered car will produce much
higher ratio of greenhouse gases. An EV produces only 5% to 10% of the emissions
of an ICE per mile travelled.
Also, a lot of skilful technician will be needed for the battery replacement
process. Services and maintenance of an EV is definitely different from a
conventional gasoline-powered car, hence more efforts should be carried out by
related industries to produce more work force on this field.
1.3 Disadvantages of Electric Vehicle
Limited mileage
It is due to the current battery technology limitation. Common electric cars are using
lead-acid battery array where it can support a driving range from 70-100km per
single charge. An EV that is using Lithium-ion battery array (great example: Tesla
Roadster) can travel up to 350km per single charge. Of course, the Li batteries are
much more expensive as comparable.
Example: Lead-acid battery packs with 14700Watts capacity (196 Volts DC, 75AH)
will take 4 hours on Malaysia 240 Volts system (240Volt supply with 15A circuit
breaker).
ii. Study about motor behaviors and develop a motor speed monitoring system
iii. Develop a data logging system and Graphical User Interface of electric
vehicle smart control system
The scope of this project includes the battery power management, converters and
controller, motor characteristics and selection studies, regenerative braking and real
time monitoring system. This research project can be divided into three main
portions:
Part 1: Gather all required information about the electric car such as:
• Battery type: Lead Acid battery
• Battery voltage: 192V
• Maximum speed: 130km/h
• Maximum Torque: 210Nm
• Range: 300km
• Motor type: DC brushless motor
Part 2: Studies and enhance the currently available battery power management and
distribution system which includes the ultrafast charging and discharging system,
charging methods, comparison for rechargeable batteries based on the use of Lead
Acid battery. The whole system will be monitor through real time operation platform.
The study also includes the controller which includes converters (DC-DC), inverters
(DC-AC), four quadrant high frequency power electronics switching circuit for
maximum power transfer factor from the battery to motor and base drive circuit,
phase converter driver circuits and regenerative braking system. The motor controller
and base driver circuits is to control speed, direction, torque and regenerative braking
system.
Part 3: To assemble and convert a normal IC engine car into an electric car as a
primary platform for further testing on the battery energy usage, real time controller,
feedback system and on road performance profile. These studies will provide a
fundamental platform for further studies on commercially available electric cars in
market.
CHAPTER 2
2 LITERATURE REVIEW
Other than the battery pack, another main feature of an electric vehicle is the electric
motor. The electric motor gives the name of “Electric Vehicle”; while battery pack is
used to power up the electric motor. Electric motors replace the role of internal
combustion engine in conventional gasoline-powered car.
When an electric motor is required to operate over wide speed range, the
efficiency issue becomes an important issue. A loss caused by inefficiency can
contribute to the calculation failure or calculation inaccuracy. An efficient electric
motor means that it could be smaller due to smaller heat disposal would be needed. A
lighter weight electric motor is definitely a better choice in an electric vehicle.
Downsizing and weight reduction can be achieved by choosing a higher efficiency
electric motor; various electric motor requirements are actually inter-related.
As with the case of motor efficiency, the electric motor type chosen is much
less important than other factors when it comes to the specific power and power
density of an electric motor. The one exception to this is the brushed DC motor
because a high proportion of the losses are generated in the rotor.
An electric motor with higher speed leads to a higher power density. The size
of electric motor is strongly depending on the motor torque; the motor power does
not influence the motor size much as compared with the motor torque. An electric
motor with higher torque and lower speed will be larger, for instance those electric
motors used in electric forklift.
For electric vehicles, lighter and smaller motors are desired; hence high speed
electric motors with gearbox are used. Gearbox is used with a high speed motor
whenever a low speed rotation is needed. Gearbox is not necessary used with an
electric motor; hence it is possible to use a high speed motor directly coupled to the
axle.
Figure 2.2: Difference between geared motors (transmission involved) and gearless
motors (direct coupled)
Selection of electric motors shall consider the system voltage of the particular
electric vehicle because different electric vehicles types will adopt different system
voltage levels. System voltage level is governed by the battery pack used; while a
battery pack weight is nearly 30% of the total curb weight. Hence, choose a higher
power motor means that higher voltage levels are needed.
Figure 2.3: A regenerative-braking system configuration
A fast torque response is needed for electric motors in electric vehicle; high
torque is generated when an electric vehicle is climbing uphill, hence a fast response
is required. While the reliability and robustness of electric motors under various
driving conditions should be kept as high as possible to make the electric vehicle
lasts longer.
2.2 Brushless DC Motor
By considering waveform feeding into the motor terminal, permanent magnet (PM)
brushless motor drives can be classified as:
i. PM DC motor drives
ii. PM AC (synchronous) motor drives
They are called brushless motor drives because they have no brushes,
commutator and slip rings. The reasons for not considering brushed DC motors are
shown in the table below:
PM brushless DC motor drive is one of the good choices for electric vehicle
because it is most capable to compete with induction motors for electric propulsion
among modern motor drives. Advantages of PM brushless DC motor drives include:
A DC motor can run in a range from 96V to 192V. It can consist of 8-16
batteries in series (each 12V). DC installation is simpler and less expensive as
compared to the AC motor.
Since the early 1970s, the Global Positioning System (GPS) was developed by the
U.S. Department of Defence (DoD). GPS is a satellite-based navigation system
developed as a military system initially. Since Bill Clinton announced to release the
restriction on accuracy of Global Positioning System (GPS) on May 2000, the GPS
has become widely used in the positioning system of vehicular technology.
GPS navigation system on electric vehicle consists of the GPS receiver, GPS
antenna, navigation computer, display screen (touch screen panels are common) and
audio speaker. Once a destination is selected by EV driver, the navigation will start
computation for both range and time estimation to provide visual display and audio
prompts to assist the driver heading to the desired destination.
The great circle distance refers to the shortest distance between two points on a
sphere surface. There is a unique great circle between two points on a sphere that are
not directly opposite to each other. Hence these two points will separate the great
circle into two arcs; the length of the shorter arc is the great circle distance between
these two points.
Calculations to find out the surface distance between two horizontal positions
are performed by assuming spherical Earth; several steps are required by
manipulating the latitudes and longitudes.
A calculation method having good accuracy for both long distance and short
distance is used to determine the great circle distance, known as the Haversine
formula. R refers to the Earth‟s radius (mean radius = 6,371km).
Users are allowed to find cities, places and local businesses by installing
Google Earth on their personal computers. Google Earth maps the Earth by the
superimposition of images gathered from satellite images, aerial photography and
Geographical Information System (GIS) 3D globe.
17
The Google Earth programs has an extra credit as compared to other websites
providing satellite images which is the ability to show sea elevation level for a
selected point on Earth surface.
Electric vehicles need BMS, just like they need battery pack and electric motor.
Monitoring the battery pack under various conditions is a crucial task to be done in
real-time. Some batteries can be damaged or destroyed if they are over-charged;
hence BMS is necessary as a basic requirement in electric vehicles.
CHAPTER 3
3.1 Background
The heart of an electric car is the battery technology which is causing the invisible
wars among giant car makers. While enjoying the zero-emission technology from
electric cars, the awareness of having sufficient battery capacity for completing a
certain journey is important. Electric cars using different battery technology will
have different drive distance; different battery charging profiles will also lead to
varied charging time needed.
is to cut down the estimation percentage and increase the accuracy of so-called
“calculation”.
GPS receiver used in a car can give the approximated distance difference between
current location and selected location; a range estimator can calculate the time
duration to reach the selected destination.
CPS calculations will enhance the range estimator and battery capacity
calculation because it involves the contour condition during an electric vehicle
climbing uphill. By getting information of latitude and longitude of a selected route
line, slope angle between two points (with sample distance 9m-12m) is calculated by
relating it to the sea elevation level between two points. The slope angle is used to
calculate force acting on a car during climbing hill condition. Others forces like
rolling resistance force (between tires and road surface) and aerodynamic force are
included to increase the precision of calculation.
The net force acting on a car is converted to the torque by knowing the car‟s
tire radius; current drawn from the battery pack can be calculated by knowing the
torque needed by the EV during uphill condition.
21
A series of calculation steps has been performed to calculate the current drawn from
battery pack of an electric vehicle during uphill condition. An inclined plane
experiment has been carried out to collect experimental result. Both results from
calculation method and inclined plane experiment are compared to prove the CPS
calculation method.
A route line with significant change of slope angle along the route is needed as the
target of data collection; Genting Highland has been selected as the target destination
for this purpose. A total distance of 6.424km along the route line heading to Genting
Highland has been selected.
sample distance of 9m to 12m between two points selected. There are total of 607
points with total distance of 6.426km for the route line selected.
Figure 3.1: The overall view of route line along Genting Highland as shown on the
reference website [www.flashearth.com]
Figure 3.2: Red circle sticker on laptop screen used to ensure constant distance
between two points on the map
23
The selected route line which have different angle of uphill slopes is the
uphill route to Genting Highland. Using the sets of data collected as shown in Figure
3.3, Haversine Formula is used to calculate the distance between two coordinates
with Rearth = earth‟s radius (mean radius = 6,371km).
Hence, for a set of latitudes and longitudes selected, the distance calculator
can be used to show the exact distance between them.
The next step is to make use Google Earth which provides a platform to view
the location and the elevation level of that particular coordination. The elevation
difference between two points is calculated and it is repeated for the whole route map
selected.
With a set of distance differences and elevation differences, the angle (θ)
between two coordinates can be calculated by using the following formula:
θ = Tan-1 (Rise / Run) (4)
First, by ignoring the friction force, the hill climbing force (F ||) pulling down
a car along the inclined plane can be figured out.
F|| = mg· sin (θ) (5)
By using gravity constant g= 9.81 m/s2 and assuming the selected car has a
curb weight 1000kg, eq.(5) can be written as:
F|| = 9810·sin (θ) (6)
The next scenario is to look into the rolling resistance force calculation.
Frr = µrr.mg (7)
By assuming good tires are used with rolling resistance coefficient µrr =
0.005, the rolling resistance force can be calculated by using the selected curb weight
of 1000kg.
Frr = 0.005(9810) (8)
25
The aerodynamic drag (FD) is the force due to the friction of vehicle body
moving through the air.
FD = 0.5 ρ·v2·Cd·A (9)
The air density (ρ) can be calculated by first figuring out the temperature (T)
and pressure (p) at certain altitude above sea level (h).
Some constants value used in the calculation for aerodynamic drag (FD):
i) The sea level standard temperature T0 is 288.15
ii) The temperature lapse rate L = 0.0065 K/m.
iii) The sea level standard atmospheric pressure p0 = 101325 Pa.
iv) Molar mass of dry air M is 0.0289644 kg/mol.
v) Universal gas constant R is 8.31447 J/(mol·K).
vi) Gravity constant (g) is 9.81 m/s2.
The following formulas are used to calculate the air density (ρ):
T = T0 – (L·h) (10)
p = p 0 · (1- (11)
ρ= (12)
The particular aerodynamic drag (FD) acting on the electric vehicle along the
uphill journey (Genting Highland) can be calculated using air density at a certain
latitude above sea level using (12).
26
The force can be related with torque (τ) by the following formula:
τ = Fnet · (Rwheel/G) (14)
Gear ratio (G) of the car shall be determined for the calculation of torque. The
selected wheel size (Rwheel) determines the finally available torque. By knowing the
wheel radius, torque can be calculated as by applying (14).
The data for a distance over 6.4km along the route line towards Genting
Highland has been collected and the current needed by the extra torque can be
calculated by knowing torque constant (kt) for the particular electric motor.
τ = kt · I (15)
The calculation can be used on any electric vehicle in order those needed
parameters for force calculation are known. The torque calculated through this
method is the extra torque needed to climb up this particular route line. Hence
current consumption can be linked for enhancement in the battery capacity
estimation module in electric vehicle. The table showing steps for calculating extra
current drawn from the latitude and longitude data are attached as Appendix.
As shown in Figure 3.5, an incline plane with variable angle is built as the
track of a RC model car to simulate the scenario of an electric vehicle driving uphill
with certain slope angle.
27
The inclined plane was built from scrap items like table surface, wood sticks,
and iron sticks. Recycled items are used for environmental saving purpose and cost
saving purpose.
The inclined plane was built to have variable angle selections. It was done by
drilling holes at pre-calculated heights to have angle with steps of 5°. Two iron sticks
are used to select the desired slope angle.
Figure 3.6: Inclined plane experiment with a RC car running on 20° slope angle
28
A radio controlled (RC) car with 9.6V supply voltage is used to climb up
slope with angle from 5° to 40° as shown in Figure 3.6.
The RC car weight is 0.825167kg. Motor in the RC car is the small scale DC
motor with 9.6V supply voltage requirement. The battery pack used is the Ni-CD cell
with 2800mAh capacity. The inclined plane is built from normal wooden table and
the table surface does not provide good friction (plywood). The inclined plane
surface is then further tested by adding sand paper to increase the friction coefficient.
The sand papers tend to function like asphalt road‟s friction force onto the car wheels.
There are several methods to express slope or grading systems around the
world, mainly is by degree, which is the angle of the slope; and percentage, which is
“grade” of the slope degree. The percentage of the grade is calculated by the formula
100 , where rise is the elevation difference or the vertical difference of the two
points of interest and run is the horizontal length difference of the points.
The torque constant is not given by the motor manufacturer, hence the supply
voltage (Vsupply) motor‟s maximum no-load RPM (RPMno-load(max)), terminal
resistance (Rm) and no-load current (Ino-load) are measured to calculate the torque
constant. The following are the measurements taken:
i) Ino-load = 0.79A
ii) RPMno-load(max) = 16.652k
iii) Rm = 8.48/0.79 = 10.73Ω
iv) Vsupply = 10V
The above readings were taken to calculate torque constant (k t) for the
particular RC car used in the inclined plane simulation experiment.
kt=kb · 1.345 (13)
Imotor = [Vsupply-(kb · kRPM)]/Rm (14)
By applying (15),
kb = 0.09.
Then by applying (13), torque constant for the particular DC motor is found.
kt = 0.12 Nm/A.
The torque constant is calculated and it can be used to calculate the current
needed to climb up a hill with certain slope angle. The calculated value will then
compared with the measured value in the inclined plane experiment.
Based on the RC model car with inclined plane experiment, measured values
indicating the relationship between current and slope angle are shown in Table 2.
The graph plotted based on these results is shown in Figure 3.7 (a full size graph will
30
be attached in Appendix section). Graph plotted gives an equation for the particular
RC model car:
This equation gives the relationship between current and slope angle for the
particular RC car; each electric vehicle is expected to have a unique equation for this
relationship.
Current
12
11
I vs A
f(x)=0.15711905*x+1.0610714; R2=0.9988
10
7 (40,7.240)
(35,6.590)
6
(30,5.820)
5
(25,5.010)
4 (20,4.240)
(15,3.480)
3
(10,2.650)
2
(5,1.740)
Angle
5 10 15 20 25 30 35 40 45 50
Figure 3.7: Current versus Slope Angle graph based on experimental results
31
Calculation on the net force applied on the car climbing uphill should consider the
frictional force more precisely by applying exact friction coefficient on the particular
route line selected.
The air density will change along the journey and hence a way to choose air
density value shall be pre-determined during the system design stage.
To further calculate other forces acting on the electric vehicle during uphill condition,
the acceleration force is another element to be analyzed. Yet, it shall be considered
under the condition where the car is not travelling at constant speed. Due to the CPS
calculation assumes that the car is travelling at constant speed, this acceleration force
is not considered.
The comparison between measured value and calculated value shows that
there is an error percentage of 9.77%. Since there are actually more forces acting on
a car during uphill condition; hence the current calculated is slightly lesser than
measured current value. The necessity to involve acceleration force in the calculation
shall be considered to improve the accuracy.
Efficiency loss shall be considered because the gear system will never be
100% efficient. A small efficiency loss can cause another variation factor in the real-
car calculation and implementation.
When it comes to real world implementation, a lab test is needed to obtain the
angle-current profile. A particular electric vehicle should have its own relationship
33
between slope angle and current needed during uphill condition due to different
parameters. Average data by repeating the tests shall be obtained to compensate for
the efficiency loss that is unpredictable in the calculation method.
CHAPTER 4
4.1 Introduction
i) Shunt resistors
ii) Current-sensing transformer
iii) Hall effect current sensors
iv) Hall effect tachometer
Other than these feedback systems, the back electromotive force (EMF)
control method can be used to eliminate the requirement for relatively expensive
sensors, such as Hall Effect devices. Back-EMF control method has its advantage
over other motor speed monitoring method due to the sensorless configurations. This
control method obtains the speed and position of the motor directly from the voltage
at the motor windings.
The back-EMF motor speed monitoring system needs a DC motor and a core
microcontroller to read the feedback voltage from the motor terminal as well as
doing analogue-to-digital conversion.
The 10-bits ADC feature of the PIC24 makes it possible to take the back-
EMF voltage generated by motor terminals of DC motor as input voltage for
conversion process. The drawback of this PIC24 is that it can only accept an input
voltage for not greater than 3.6V for an analogue pin; while the maximum back-EMF
generated during the maximum motor speed is higher than 9V.
The compiler used to program the PIC24 using self-built programmer is the
MPLAB Integrated Development Environment (IDE) by Microchip. Easy-to-learn
interface is provided with powerful debugging tools and simulators. The MPLAB
IDE supports programming with C languange and it can be used to program various
types of microcontroller.
Programming stage:
i) Set one pin as analogue input pin (RB0) to read back-EMF voltage
ii) Set one pin as input pin (RB1) to be connected with a switch
iii) Set 6 pins for output pins (RA0-RA5) to be connected with a LCD display
iv) Initialize ADC conversion
v) Initialize LCD
vi) Read from ADC conversion and send string to LCD
A LCD display with 16x2 characters dot matrix display has been selected; the
model is JHD162A as shown in Figure 4.6.
One of the motor terminals is connected to RB0 pin of PIC24 as the back-
EMF voltage and another terminal is connected to the common Ground of PIC24.
Long jumper wires are used to connect both the motor terminals to ensure continuous
data reading during the RC car running condition.
The 16x2 characters dot matrix LCD display and the internal ADC of PIC24
need to be initialized before they are used; hence initialization coding have been
written and imported as library in the main program.
4.3 Results and Discussion
Figure 4.7: LCD display showing updated back-EMF voltage reading and calculated
rounds-per-minute (RPM)
After the ADC conversion interrupt occurs, the PIC24 will calculate the
corresponding Rounds-Per-Minute (RPM) with ratio to the back-EMF voltage level.
The conversion was done according to the 10-bits internal ADC of PIC24,
with accuracy up to 0.1% and resolution of 3.2mV. Due to 16 buffer calculations are
selected instead of 1 buffer, the average value converted is more accurate.
The problem encountered in this method was the voltage drop after the back EMF
voltage being feed to the PIC24 as input voltage. For instance, a reading of 2.8V
back-EMF voltage will be detected as 2.0V after it is connected to the input pin of
PIC24.
The reason was found and it was due to the impedance mismatch. To
compensate for this error, several readings were taken and the average value was
found to be 0.82V voltage drop.
This method can give feedback of motor speed monitoring without sensor
configurations; yet it is not 100% accurate due to the voltage generated is not stable
under low speed condition.
The impedance mismatch case in the methodology also shows that the use of
voltage divider configuration circuit is not suitable. Voltage regulator circuit shall be
built with desired regulator IC. The selected regulator IC can be chosen with desired
electrical characteristics.
Also, the RPM calculated in this method can only give the motor shaft‟s
speed. In order to have the speedometer feature, sensors are still needed to show the
vehicle speed in unit of km/hour. For instance, sensors shall be installed at vehicle
wheels to measure time between each wheel revolution. Accurate wheel radius shall
be known to give precise calculations of vehicle speed.
5.1 Introduction
Typical EV intelligent control systems have data logging features to save data to the
on-board computers. These saved data can be manipulated by technician or engineers
during servicing process; some advanced systems could even access to the database
by the control centrals.
The data logging features are done using two ways; one is using Electrically Erasable
Programmable Read-Only Memory (EEPROM) and another is done using computer
solid state hard disk storage. The GUI is designed using Adobe Flash CS3.
43
EEPROM storage
The first option was to store date read from sensors to EEPROM through I2C 2-wire
protocol. An EEPROM with model NM24C04 is connected to the PIC24. The
EEPROM uses two I/O pins of PIC24; hence it can store 4K bits with minimized pin
counts. It is used to serve as backup memory storage if the serial connection to the
computer fails.
In order to save feedback data from sensors installed on electric vehicles, data must
be passed to computer through the microcontroller. Serial connections are needed
between the computer serial ports and the microcontroller. An Intel Desktop Board
D510MO has been used as the on-board computer; two serial ports are available for
serial communications.
By having this serial level converter circuit, data processed by internal ADC
of PIC24 can be transmitted serially to the computer. Data received through the
computer serial ports can be accessed through some terminal program such as
HyperTerminal, SerialTerm and PuTTY.
Data received through serial ports can be stored in text file format and it can
be saved to specific folders according to the user setting. The text file is set to be
saved in a format such that there is no space between incoming data. This text file
can be manipulated later as input for graph plotting or input for Flash design.
GUI design was done using Adobe Flash CS3. The output file format is a Shock
Wave Flash (SWF) file. A SWF file is a window for capturing and displaying
information. Adobe Flash does not have communication ports; hence it cannot
communicate with serial ports directly.
LoadVars method is used to access data from a text file; the source code is
written as below:
function onLoaded(e:Event):void {
var speed:Array = e.target.data.split("&");
if (speed[i]==undefined){
var display_message:URLLoader = new URLLoader();
display_message.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
var error:Array = e.target.data.split("&");
textbox.text= error[0];
};
display_message.load(new URLRequest("error.txt"));
gotoAndPlay (1,"Scene 1");}//end if
else
textbox.text= speed[i];
};
myTextLoader.load(new URLRequest("database.txt"));
48
The SWF file is designed in such a way that whenever a button is pressed to
monitor the motor speed, a looping back from scene to scene is prompted. This is
done to ensure that the action script is being executed continuously so that it will
continuously read from the particular text file to get the updated data. Action script
3.0 was used in the Flash design.
Using Adobe Flash CS4, Graphical User Interface (GUI) of an electric vehicle on-
board intelligent monitoring system has been designed with some desired functions.
Temperature monitoring, CPS, BMS, phone calling features and advanced settings
can be controlled through this GUI.
As shown in Figure 5.9 to Figure 5.13, the main GUI page with be directed to
the CPS page where the user can choose to view current battery status or to choose a
point of interest. Once a location is selected, the user will see the calculated
remaining battery status under CPS method which considered about the contour
condition along the route line selected.
CPS calculation has been used in this GUI design to show how it can be
implemented on an EV or even a conventional gasoline-powered car.
As shown in Figure 5.14, the monitoring system page has been done with
both battery monitoring and motor speed monitoring. The input to the motor speed
monitoring is obtained from a specified text file saved using terminal program
(SerialTerm or PuTTY).
Smart phone revolution has brought significant impact to global users. Smart phones
with surprising features are equipped with powerful mobile operating system. Two of
the famous mobile operating systems are known as iOS and Android.
Smart phone features could be embedded onto the on-board computers in EV,
such as the phone calling feature and infotainment feature. For instance, an Android
smart phone can be connected to computer using VNC remote control software.
54
CHAPTER 6
CHAPTER 7
7.1 Conclusion
In this project, several modules are added as extra features to an EV control system.
The CPS introduced can be a new revolution in the range and battery estimation
technology; contour conditions should be considered in order to estimate available
battery capacity accurately. A series of CPS calculation is proven to match measured
values from inclined plane experiment; some improvements could be made to make
the system more reliable.
Motor speed monitoring was done using back-EMF control method; hence it
does not use sensors. Using PIC24 as core microcontroller, ADC conversion was
done and the RPM calculated from back-EMF could be shown on a LCD display.
Using RS-232 serial communication, the motor speed could be monitored through
GUI designed using Adoble Flash. Real time monitoring can be achieved by using
LoadVars method in Adobe Flash so that the SWF file can continuously read data
from a text file.
7.2 Recommendation
Real time kernel and real time operating system shall be created in order to have real
time response within microcontroller and computer serial ports. For an EV, data
59
communication for displaying at the on-board display screen shall be kept as real
time as possible. The importance of real time condition will only be realized during
crucial condition; hence it should be implemented for the EV drivers‟ safety purpose.
REFERENCES
James Larminie, John Lowry. Electric vehicle technology explained. West Sussex:
John Wiley and Sons Ltd, 2003, pp. 1-277.
André Lewis, Michael Purvis, Jeffrey Sambells, Cameron Turner. Beginning Google
maps applications with Rails and Ajax: from novice to professional. New York:
Springer-Verlag, 2007, pp. 276-269.
Mircea Popa, Veronica Argesanu, Anca Sorana Popa. “Car finding with a pedestrian
navigation system”, Human System Interactions (HSI) 2010 3rd Conference, pp.
406-411.
Thomas Bräunl. (2008, August). Embedded Robotics: Mobile Robot Design and
Application with Embedded System. (3rd edition). [On-line]. Available:
http://books.google.com/books?id=1_rMmj9OxYC&printsec=frontcover#v=onepage
&q&f=false [Jun. 30, 2011].
61
APPENDICES
APPENDIX A: Graphs
#include <P24FJ64GA002.H>
#include <stdio.h>
#include <string.h>
#include "LCD.c"
#include "adc.c"
#include "function.h"
#include "UART_KC.c"
void main(void)
{char speed[7];
char volt[3];
char counter[20];
float value,value1,temperature;
int loop;
int ct=0;
lcd_init();
initU1();
64
if(_RB1=1)
{
for (ct=0;ct<1000000;ct++){
ADCInit(); // Initialize the A/D converter
ADCStart(); // Turn ADC on
while(!_AD1IF);
_AD1IF = 0;
if (value1<2990){
putsU1 ("0");
putsU1 ("&");
msdelay(10);
lcd_clear();
lcd_gotoxy(0,1); //display RPM value at first line of LCD
lcd_puts("RPM: ");
lcd_gotoxy(5,1);
lcd_puts("0");
msdelay(550);
}//end if
else{
sprintf(speed, "%.1f", value1); //convert float (value1) to string
putsU1 (speed); //transmit speed value to serial port
putsU1 ("&"); //transmit characeter "&" to serial port
65
msdelay(10);
lcd_clear();
lcd_gotoxy(0,1); //display RPM value at first line of LCD
lcd_puts("RPM: ");
lcd_gotoxy(5,1);
lcd_puts(speed);
msdelay(550);
}//end else
}//end if loop
else
lcd_clear();
#include <p24fj64ga002.h>
/**************************************************
*********Initialization for UART settings**********
**************************************************/
//call the function initU1() to set up UART port for data transmission to PC
//Using MAX232 connect T1IN to RP6 and R1OUT to RP5
void initU1(void)
{
66
/**************************************************
*******Transmission of data in string************
**************************************************/
int putsU1 (char *s)
{
while (*s)
{
delay();
transmitU1(*s++);
}
}
/**************************************************
*****Tansmission of data from U1TX(integer)********
**************************************************/
int transmitU1(int c)
{
U1TXREG=c; //move the integer to TX1 register
IFS0bits.U1TXIF=0; //ensure TX1 interrupt flag is 0
while (!IFS0bits.U1TXIF);
return c;
}
67
/**************************************************
*******************Timing delay********************
**************************************************/
//provide delay for the clock to stable after power up
//provide delay for the transmission to complete
void delay()
{
unsigned char i,j;
for(i=0;i<255;i++)
for(j=0;j<100;j++);
}
/**************************************************
******Function provide newline for UART************
**************************************************/
void newline()
{
delay();
transmitU1(10); //go to new line and return
delay();
transmitU1(13);
}
/**************************************************
**************Data receive to U1RX****************
**************************************************/
char getU1()
{
while(!U1STAbits.URXDA);
delay();
return U1RXREG;
}
68
#include <P24FJ64GA002.H>
#include "lcd.h"
/**************************************************/
/* msdelay(x) */
/* Delay for x milliseconds. */
/* Note delay is only approximate . */
/* Max value for x is 65536 i.e. 65.536 seconds */
/**************************************************/
void msdelay(unsigned int x)
{
unsigned int delval;
while(x--)
{
delval =794; //msdelay(1)= delay of 1.000250mSecs
while(delval--)
;
}
}
/**************************************************/
/* lcd_init() */
/* Initialise the LCD */
/**************************************************/
void lcd_init()
{
/* 0x28 - 4 bit mode
0x06 -
0x0c -
*/
static BYTE lcd_init_data[] = { 0x28,0x06,0x0c };
69
BYTE i;
AD1PCFG |= 0xffff;//0x003C;
TRISB &= 0x10F0;//0xFFC0;
TRISA &= 0x0000;
E = 0;
RS = 0;
msdelay(20);
/* Ensure LCD is in known state */
for( i = 0; i < 3; i++)
{
lcd_write_nibble(0x03);
msdelay(5);
}
/* Configure LCD */
for( i = 0; i < 3; i++)
{
lcd_write_byte(lcd_init_data[i]);
}
lcd_clear();
}
/**************************************************/
/* lcd_clear() */
/* Clear LCD to all spaces */
/**************************************************/
void lcd_clear()
{
lcd_write_control_byte(CLEAR_LCD);
70
msdelay(5);
}
/**************************************************/
/* lcd_gotoxy(x,y) */
/* Position cursor at column x, line y. */
/* For a 2 line 16 character display */
/* x = 0 to 15, y = 0 or 1 */
/**************************************************/
void lcd_gotoxy(BYTE x, BYTE y)
{
BYTE pos = 0x80;
/**************************************************/
/* lcd_putchar(x) */
/* display character x on LCD at cursor location. */
/**************************************************/
void lcd_putchar(char x)
{
lcd_write_data_byte(x);
}
71
/**************************************************/
/* lcd_puts(s) */
/* Display string s on LCD at cursor location. */
/**************************************************/
void lcd_puts(const char *s)
{
while(*s)
lcd_write_data_byte(*s++);
}
/*================================================*/
/* END OF PUBLIC FUNCTIONS */
/*================================================*/
/************************************************
The following functions should not need
to be called by a user program
*************************************************/
static void lcd_write_nibble(BYTE x)
{
msdelay(1);
}
void lcd_write_control_byte(BYTE x)
{
RS = 0;
lcd_write_byte(x);
}
void lcd_write_data_byte(BYTE x)
{
RS = 1;
lcd_write_byte(x);
}
ADCInit()
{
AD1CON1 = 0x00E4;
AD1CON2 = 0x003C;
AD1CON3 = 0x0D09;
AD1CHS=0x0102;
AD1PCFG=0xFFFB;
AD1CSSL=0x0000;
}
ADCStart()
{
_ADON = 1; // Turn on the A/D converter
}
73
ADCAvg()
{
unsigned long int temp;
return (temp);
}